Commit 76af8fca authored by Mark Tyneway's avatar Mark Tyneway Committed by clabby

op-e2e: major refactor

Refactor op-e2e to use the same deploy script that is used in
production. There is only 1 way to deploy contracts now and
it goes through foundry. This removes the need to maintain
multiple sets of contracts deployments/devnets. It does
add a new tooling dep to the monorepo which is `geth`.
A top level `make` command is provided as well as some
docs in the `op-e2e` package on its usage.

The `devnetL1.json` deployconfig is the source of truth
for deploy configs in `op-e2e` now. In the long term,
we should delineate which config values are safe to alter
in memory and which are not. Some things are still coupled
together in weird ways, but I tried to add assertions where
I could to ensure that future people will get better error
messages.

To install geth, run the command:

`` `
make install-geth
```

To create the genesis state, run the command:

```
make devnet-allocs
```

This will run the forge deploy script against an instance of
`geth --dev` and then call `debug_dumpBlock` which will dump
the state into a format that we can inject at runtime into
the genesis of both `op-e2e` as well as the L1 of the docker
compose setup.

I tried to use `anvil` instead of `geth` but it does not
support this endpoint. It supports a different endpoint
that uses a compressed binary serialization of state,
it is easier to work with the JSON.
parent f3bdaeea
...@@ -403,6 +403,11 @@ func (s *EthClient) GetStorageAt(ctx context.Context, address common.Address, st ...@@ -403,6 +403,11 @@ func (s *EthClient) GetStorageAt(ctx context.Context, address common.Address, st
// ReadStorageAt is a convenience method to read a single storage value at the given slot in the given account. // ReadStorageAt is a convenience method to read a single storage value at the given slot in the given account.
// The storage slot value is verified against the state-root of the given block if we do not trust the RPC provider, or directly retrieved without proof if we do trust the RPC. // The storage slot value is verified against the state-root of the given block if we do not trust the RPC provider, or directly retrieved without proof if we do trust the RPC.
func (s *EthClient) ReadStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, blockHash common.Hash) (common.Hash, error) { func (s *EthClient) ReadStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, blockHash common.Hash) (common.Hash, error) {
// TODO: temp
if true {
return s.GetStorageAt(ctx, address, storageSlot, blockHash.String())
}
if s.trustRPC { if s.trustRPC {
return s.GetStorageAt(ctx, address, storageSlot, blockHash.String()) return s.GetStorageAt(ctx, address, storageSlot, blockHash.String())
} }
......
{ {
"l1ChainID": 900, "l1ChainID": 901,
"l2ChainID": 901, "l2ChainID": 902,
"l2BlockTime": 2, "l2BlockTime": 2,
"maxSequencerDrift": 300, "maxSequencerDrift": 300,
"sequencerWindowSize": 200, "sequencerWindowSize": 200,
...@@ -46,4 +46,4 @@ ...@@ -46,4 +46,4 @@
"faultGameAbsolutePrestate": 96, "faultGameAbsolutePrestate": 96,
"faultGameMaxDepth": 4, "faultGameMaxDepth": 4,
"faultGameMaxDuration": 120 "faultGameMaxDuration": 120
} }
\ No newline at end of file
...@@ -16,7 +16,7 @@ export enum L1ChainID { ...@@ -16,7 +16,7 @@ export enum L1ChainID {
MAINNET = 1, MAINNET = 1,
GOERLI = 5, GOERLI = 5,
HARDHAT_LOCAL = 31337, HARDHAT_LOCAL = 31337,
BEDROCK_LOCAL_DEVNET = 900, BEDROCK_LOCAL_DEVNET = 901,
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment