Skip to content

Commit

Permalink
feat: apply SuperchainWETH contracts to forked networks
Browse files Browse the repository at this point in the history
  • Loading branch information
tremarkley committed Sep 16, 2024
1 parent 073392f commit 33ef828
Show file tree
Hide file tree
Showing 13 changed files with 217 additions and 118 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ jobs:

- name: Run tests
run: just test-go
env:
SUPERSIM_RPC_URL_OP: ${{ secrets.SUPERSIM_RPC_URL_OP }}
SUPERSIM_RPC_URL_BASE: ${{ secrets.SUPERSIM_RPC_URL_BASE }}
5 changes: 5 additions & 0 deletions anvil/anvil.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"math/big"
"os"
"os/exec"
"strconv"
Expand Down Expand Up @@ -248,6 +249,10 @@ func (a *Anvil) SetStorageAt(ctx context.Context, result interface{}, address co
return a.rpcClient.CallContext(ctx, result, "anvil_setStorageAt", address.Hex(), storageSlot, storageValue)
}

func (a *Anvil) SetBalance(ctx context.Context, result interface{}, address common.Address, value *big.Int) error {
return a.rpcClient.CallContext(ctx, result, "anvil_setBalance", address.Hex(), hexutil.EncodeBig(value))
}

func (a *Anvil) SetIntervalMining(ctx context.Context, result interface{}, interval int64) error {
return a.rpcClient.CallContext(ctx, result, "evm_setIntervalMining", interval)
}
Expand Down
11 changes: 9 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import (
"github.com/ethereum-optimism/supersim/config"

"github.com/ethereum-optimism/optimism/op-service/cliapp"
"github.com/ethereum-optimism/optimism/op-service/ctxinterrupt"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum-optimism/optimism/op-service/opio"

"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"

"github.com/joho/godotenv"
"github.com/urfave/cli/v2"
)

Expand All @@ -34,6 +35,12 @@ const (
)

func main() {
// Load the .env file
err := godotenv.Load()
if err != nil {
log.Crit("Error loading .env file", "err", err)
}

oplog.SetupDefaults()
logFlags := oplog.CLIFlags(envVarPrefix)

Expand All @@ -59,7 +66,7 @@ func main() {
},
}

ctx := opio.WithInterruptBlocker(context.Background())
ctx := ctxinterrupt.WithSignalWaiterMain(context.Background())
if err := app.RunContext(ctx, os.Args); err != nil {
log.Crit("Application Failed", "err", err)
}
Expand Down
2 changes: 2 additions & 0 deletions config/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package config
import (
"context"
"fmt"
"math/big"
"strings"

registry "github.com/ethereum-optimism/superchain-registry/superchain"
Expand Down Expand Up @@ -81,6 +82,7 @@ type Chain interface {
SimulatedLogs(ctx context.Context, tx *types.Transaction) ([]types.Log, error)
SetCode(ctx context.Context, result interface{}, address common.Address, code string) error
SetStorageAt(ctx context.Context, result interface{}, address common.Address, storageSlot string, storageValue string) error
SetBalance(ctx context.Context, result interface{}, address common.Address, value *big.Int) error
SetIntervalMining(ctx context.Context, result interface{}, interval int64) error

// Lifecycle
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/optimism
Submodule optimism updated 37 files
+0 −1 op-chain-ops/interopgen/deploy.go
+0 −1 op-chain-ops/interopgen/deployers/implementations.go
+0 −9 op-chain-ops/script/deterministic.go
+0 −7 op-chain-ops/script/prank.go
+0 −14 op-chain-ops/script/script.go
+4 −6 op-chain-ops/script/script_test.go
+38 −39 op-e2e/actions/proofs/channel_timeout_test.go
+17 −17 op-e2e/actions/proofs/env.go
+1 −1 op-e2e/actions/proofs/fixture.go
+29 −30 op-e2e/actions/proofs/garbage_channel_test.go
+1 −1 op-e2e/actions/proofs/matrix.go
+21 −22 op-e2e/actions/proofs/sequence_window_expiry_test.go
+20 −21 op-e2e/actions/proofs/simple_program_test.go
+0 −31 op-e2e/e2eutils/setuputils/utils.go
+0 −85 op-e2e/interop/interop_test.go
+0 −616 op-e2e/interop/supersystem.go
+1 −2 op-e2e/sequencer_failover_setup.go
+23 −4 op-e2e/setup.go
+3 −7 op-e2e/tx_helper.go
+1 −20 op-service/sources/supervisor_client.go
+3 −7 op-supervisor/supervisor/backend/backend.go
+0 −3 op-supervisor/supervisor/backend/source/chain_processor.go
+1 −9 op-supervisor/supervisor/service.go
+24 −51 packages/contracts-bedrock/scripts/DeployImplementations.s.sol
+0 −1 packages/contracts-bedrock/scripts/DeployOPChain.s.sol
+0 −12 packages/contracts-bedrock/scripts/libraries/DeployUtils.sol
+2 −2 packages/contracts-bedrock/semver-lock.json
+79 −104 packages/contracts-bedrock/snapshots/abi/OPStackManager.json
+79 −104 packages/contracts-bedrock/snapshots/abi/OPStackManagerInterop.json
+4 −18 packages/contracts-bedrock/snapshots/storageLayout/OPStackManager.json
+4 −18 packages/contracts-bedrock/snapshots/storageLayout/OPStackManagerInterop.json
+29 −32 packages/contracts-bedrock/src/L1/OPStackManager.sol
+4 −3 packages/contracts-bedrock/src/L1/OPStackManagerInterop.sol
+3 −47 packages/contracts-bedrock/test/DeployImplementations.t.sol
+12 −9 packages/contracts-bedrock/test/L1/OPStackManager.t.sol
+2 −2 packages/contracts-bedrock/test/Specs.t.sol
+1 −4 packages/contracts-bedrock/test/vendor/Initializable.t.sol
66 changes: 32 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,52 @@ require (
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/ethereum-optimism/optimism v1.9.1-0.20240808190618-0c8d7c8c5186
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240803025447-c92ef420eec2
github.com/ethereum/go-ethereum v1.13.15
github.com/ethereum-optimism/optimism v1.9.2-0.20240916204539-7d92c98c75a2
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240910145426-b3905c89e8ac
github.com/ethereum/go-ethereum v1.14.8
github.com/joho/godotenv v1.5.1
github.com/stretchr/testify v1.9.0
github.com/tyler-smith/go-bip39 v1.1.0
github.com/urfave/cli/v2 v2.27.3
github.com/urfave/cli/v2 v2.27.4
)

require (
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/DataDog/zstd v1.5.6-0.20230824185856-869dae002e5e // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20231018212520-f6cde3fc2fa4 // indirect
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set/v2 v2.3.0 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/fjl/memsize v0.0.2 // indirect
github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect
github.com/getsentry/sentry-go v0.20.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-bexpr v0.1.11 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
Expand All @@ -67,15 +68,16 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/pointerstructure v1.2.1 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
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.19.1 // indirect
github.com/prometheus/client_golang v1.20.3 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.11.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
Expand All @@ -86,22 +88,18 @@ require (
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101315.3-rc.2

replace github.com/crate-crypto/go-kzg-4844 v1.0.0 => github.com/crate-crypto/go-kzg-4844 v0.7.0
replace github.com/ethereum/go-ethereum v1.14.8 => github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240827042333-110c433a2469
Loading

0 comments on commit 33ef828

Please sign in to comment.