Skip to content

Commit

Permalink
Merge pull request #212 from ethereum-optimism/harry/supersim_genesis…
Browse files Browse the repository at this point in the history
…_latest

feat: update genesis to contain latest L2toL2CDM
  • Loading branch information
tremarkley authored Oct 21, 2024
2 parents a06edef + 2868f0f commit 93a802b
Show file tree
Hide file tree
Showing 17 changed files with 205 additions and 341 deletions.
209 changes: 46 additions & 163 deletions bindings/l2tol2crossdomainmessenger.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/lib/optimism
Submodule optimism updated 167 files
188 changes: 94 additions & 94 deletions genesis/generated/900-l1-genesis.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions genesis/generated/901-l2-addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"OptimismPortalProxy": "0x37a418800d0c812a9de83bc80e993a6b76511b57",
"DisputeGameFactoryProxy": "0x124efba5858a36f53726e107481e71d9060d84e0",
"AnchorStateRegistryProxy": "0xd4589582d87eb7de8f473656068bb149ae215389",
"AnchorStateRegistryImpl": "0x50ab95ded64106f980cd72c38f9b4990abb52481",
"AnchorStateRegistryImpl": "0xaf742bff47b634e4fe00d733e9f04a1486c796c5",
"FaultDisputeGame": "0x0000000000000000000000000000000000000000",
"PermissionedDisputeGame": "0x872b7e0986f54bb839436c134bf47cb95ddb40ba",
"PermissionedDisputeGame": "0x2fb6599748703ed7de1e4d978c4c2024b92aa634",
"DelayedWETHPermissionedGameProxy": "0x65b4322cde0ac9d47196bd2e0ecf31c2e462722a",
"DelayedWETHPermissionlessGameProxy": "0x0000000000000000000000000000000000000000"
}
Expand Down
14 changes: 7 additions & 7 deletions genesis/generated/901-l2-genesis.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions genesis/generated/902-l2-addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"OptimismPortalProxy": "0x35e67bc631c327b60c6a39cff6b03a8adbb19c2d",
"DisputeGameFactoryProxy": "0x94e2e1fcbfd1099b450b2d5ac1f1701327361163",
"AnchorStateRegistryProxy": "0x9883f4e327051da515a177b11d8b9b6f6a5a9cfb",
"AnchorStateRegistryImpl": "0x995fb165763e30bd8d19dba2f7446a5a7c321b1c",
"AnchorStateRegistryImpl": "0x973da266292b2bb1f7f6de73da2e6e084b8d24c7",
"FaultDisputeGame": "0x0000000000000000000000000000000000000000",
"PermissionedDisputeGame": "0x6bb6328f20179860be5ea852aeac9e6ff0f37270",
"PermissionedDisputeGame": "0x50fd7ef7a82605a2f8199a7f700e5277fbefa1d8",
"DelayedWETHPermissionedGameProxy": "0xf6892a113c9dd542e6d9a652a560a1f1dac33c8e",
"DelayedWETHPermissionlessGameProxy": "0x0000000000000000000000000000000000000000"
}
Expand Down
14 changes: 7 additions & 7 deletions genesis/generated/902-l2-genesis.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions genesis/generated/903-l2-addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"OptimismPortalProxy": "0x5658eab2feceacbea892675f0b09d01e63efe265",
"DisputeGameFactoryProxy": "0xed76b1d812dad3a322fdc3d766f251d51a78c3a9",
"AnchorStateRegistryProxy": "0x44ac0dd1056ff363f4545093727b90447cd8ec6c",
"AnchorStateRegistryImpl": "0xf44570942a42fa59e00d2e4b492c0fbb328639de",
"AnchorStateRegistryImpl": "0x0c5576a2f8469d9ced3fd0a119176dca31e6d4bd",
"FaultDisputeGame": "0x0000000000000000000000000000000000000000",
"PermissionedDisputeGame": "0x78679f9e42e65f9d492f356f34fc3ba60b805631",
"PermissionedDisputeGame": "0xe2db5ae08716615f15f5e457d5e39f8054cd1cfc",
"DelayedWETHPermissionedGameProxy": "0xfb58b1bcdcf96279d8f66dcd36f806d82ea508a7",
"DelayedWETHPermissionlessGameProxy": "0x0000000000000000000000000000000000000000"
}
Expand Down
14 changes: 7 additions & 7 deletions genesis/generated/903-l2-genesis.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions genesis/generated/904-l2-addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"OptimismPortalProxy": "0xa15bc4939efd3a0819f815e0fd277f0174c66cdc",
"DisputeGameFactoryProxy": "0x0a4bf4bfdbd1155df635021f4558eef0754e3706",
"AnchorStateRegistryProxy": "0xb7601acc6ec5231d7709120c08d3b07f38ffcbf7",
"AnchorStateRegistryImpl": "0x684dada74a03594d8de822a3a752748a01b1957e",
"AnchorStateRegistryImpl": "0x641b2d589f9c814260b7d96f331d529fa76b269c",
"FaultDisputeGame": "0x0000000000000000000000000000000000000000",
"PermissionedDisputeGame": "0x3076a04ffe654b85608c63e2c72eba6e42fc3c0e",
"PermissionedDisputeGame": "0x884411fd6b3b590dc29c705b21c2e3fdf0e681a6",
"DelayedWETHPermissionedGameProxy": "0x742fb2473c25f8b9cf64963673aebcc7cb501338",
"DelayedWETHPermissionlessGameProxy": "0x0000000000000000000000000000000000000000"
}
Expand Down
14 changes: 7 additions & 7 deletions genesis/generated/904-l2-genesis.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions genesis/generated/905-l2-addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"OptimismPortalProxy": "0xca7fe8338d83cdb72b8c7d62c6beb383059dfcc1",
"DisputeGameFactoryProxy": "0xed5f8f44f210716c76111f7973acbddb39784d73",
"AnchorStateRegistryProxy": "0x3e4b933c07fc42a84299fd6c2e676f44daf92a0f",
"AnchorStateRegistryImpl": "0x4e13e2aa43559e2dfd3a1becdea786822f682656",
"AnchorStateRegistryImpl": "0xbb8c49e6d8fd355afea7595102b3ed7254c74583",
"FaultDisputeGame": "0x0000000000000000000000000000000000000000",
"PermissionedDisputeGame": "0xfa8e02986b531a0c142fdbf4cc17468d388f7f3d",
"PermissionedDisputeGame": "0x7fd963cfa1cafff78ab045708f9722eab4b0a6db",
"DelayedWETHPermissionedGameProxy": "0xc3fcab14911dedd32173c6e3ab3242d0940b9ad1",
"DelayedWETHPermissionlessGameProxy": "0x0000000000000000000000000000000000000000"
}
Expand Down
14 changes: 7 additions & 7 deletions genesis/generated/905-l2-genesis.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.3

require (
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef
github.com/ethereum-optimism/optimism v1.9.4-0.20241017231226-27c12a132d32
github.com/ethereum-optimism/optimism v1.9.5-0.20241021150032-1e59d08322f8
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20241002103526-9083af857790
github.com/ethereum/go-ethereum v1.14.11
github.com/joho/godotenv v1.5.1
Expand Down Expand Up @@ -71,7 +71,7 @@ require (
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.4 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101411.0-rc.1 h1:xRheNbOM+Js9a+dqVt5LmBqQK8L5IyHKU8FfI4Cy9qw=
github.com/ethereum-optimism/op-geth v1.101411.0-rc.1/go.mod h1:7S4pp8KHBmEmKkRjL1BPOc6jY9hW+64YeMUjR3RVLw4=
github.com/ethereum-optimism/optimism v1.9.4-0.20241017231226-27c12a132d32 h1:0aL9mA2eP6HTUtGkATxJ+I4cELWp2uG1hALwRPAWvqg=
github.com/ethereum-optimism/optimism v1.9.4-0.20241017231226-27c12a132d32/go.mod h1:Xghe72cmK8ehQipbTp2TZSaiaKNIFKz2LWxKccAu5bg=
github.com/ethereum-optimism/optimism v1.9.5-0.20241021150032-1e59d08322f8 h1:bhG/9dttuyOPZZUhMb3e5zApDunSAE5a8sy42P/V7sw=
github.com/ethereum-optimism/optimism v1.9.5-0.20241021150032-1e59d08322f8/go.mod h1:5vH0W+a+76TjhxA//o8jr5d/zouHQaFtspVu0N2jumk=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20241002103526-9083af857790 h1:yZlEBCdD0izqzTvmhET1roNSzMfXL50DhL+dALYlnXk=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20241002103526-9083af857790/go.mod h1:XaVXL9jg8BcyOeugECgIUGa9Y3DjYJj71RHmb5qon6M=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
Expand Down Expand Up @@ -275,8 +275,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
Expand Down
43 changes: 12 additions & 31 deletions interop/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/ethereum-optimism/optimism/op-service/tasks"
"github.com/ethereum-optimism/supersim/bindings"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
Expand Down Expand Up @@ -73,43 +72,25 @@ func (r *L2ToL2MessageRelayer) Start(indexer *L2ToL2MessageIndexer, clients map[
return fmt.Errorf("failed to subscribe to sent message events: %w", err)
}

transactor, err := bind.NewKeyedTransactorWithChainID(privateKey, big.NewInt(int64(destinationChainID)))
if err != nil {
r.logger.Debug("failed to create transactor", "err", err)
return fmt.Errorf("failed to create transactor: %w", err)
}

l2tol2CDM, err := bindings.NewL2ToL2CrossDomainMessengerTransactor(predeploys.L2toL2CrossDomainMessengerAddr, client)
if err != nil {
r.logger.Debug("failed to create transactor", "err", err)
return fmt.Errorf("failed to create transactor: %w", err)
}

for {
select {
case <-r.tasksCtx.Done():
unsubscribe()
close(sentMessageCh)
return nil
case sentMessage := <-sentMessageCh:
transactor, err := bind.NewKeyedTransactorWithChainID(privateKey, big.NewInt(int64(destinationChainID)))
if err != nil {
r.logger.Debug("failed to create transactor", "err", err)
return fmt.Errorf("failed to create transactor: %w", err)
}

l2tol2CDM, err := bindings.NewL2ToL2CrossDomainMessengerTransactor(predeploys.L2toL2CrossDomainMessengerAddr, client)
if err != nil {
r.logger.Debug("failed to create transactor", "err", err)
return fmt.Errorf("failed to create transactor: %w", err)
}

// For some reason gas estimation does not work properly for some messages so estimating and padding gas (https://github.com/ethereum-optimism/supersim/issues/143)
txData, err := bindings.L2ToL2CrossDomainMessengerParsedABI.Pack("relayMessage", *sentMessage.Identifier(), sentMessage.MessagePayload())
if err != nil {
r.logger.Debug("failed to create relay message calldata", "err", err)
return fmt.Errorf("failed to create relay message calldata: %w", err)
}
gasEstimate, err := client.EstimateGas(r.tasksCtx, ethereum.CallMsg{
From: transactor.From,
To: &predeploys.L2toL2CrossDomainMessengerAddr,
Data: txData,
})
if err != nil {
r.logger.Debug("failed to estimate gas for relay message tx", "err", err)
return fmt.Errorf("failed to estimate gas for relay message tx: %w", err)
}
// Pad gas by 33%.
paddedGas := (gasEstimate / 3) + gasEstimate
transactor.GasLimit = paddedGas
if _, err := l2tol2CDM.RelayMessage(transactor, *sentMessage.Identifier(), sentMessage.MessagePayload()); err != nil {
r.logger.Debug("failed to relay message", "err", err)
return fmt.Errorf("failed to relay message: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion monorepo-commit-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3f65402acca0e9ae1b39facf58d5fce886b9412e
1e59d08322f8f0074d1493108c21d6627454f36b

0 comments on commit 93a802b

Please sign in to comment.