Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isthmus: Updates for L2 withdrawals root in header #12848

Draft
wants to merge 14 commits into
base: vd/isthmus-config
Choose a base branch
from
Draft
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum v1.14.11 => github.com/ethereum-optimism/op-geth v1.101411.1-rc.6
replace github.com/ethereum/go-ethereum v1.14.11 => ../op-geth
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO - will be changed to use a commit tag, once the op-geth PR is approved/merged


//replace github.com/ethereum/go-ethereum => ../go-ethereum

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/u
github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101411.1-rc.6 h1:VvUBIVFbnU9486CWHa9Js5XYY3o6OsdQcI8gE3XjCDE=
github.com/ethereum-optimism/op-geth v1.101411.1-rc.6/go.mod h1:7S4pp8KHBmEmKkRjL1BPOc6jY9hW+64YeMUjR3RVLw4=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240910145426-b3905c89e8ac h1:hCIrLuOPV3FJfMDvXeOhCC3uQNvFoMIIlkT2mN2cfeg=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240910145426-b3905c89e8ac/go.mod h1:XaVXL9jg8BcyOeugECgIUGa9Y3DjYJj71RHmb5qon6M=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
Expand Down
3 changes: 2 additions & 1 deletion op-chain-ops/cmd/check-derivation/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ func newClientsFromContext(cliCtx *cli.Context) (*ethclient.Client, *sources.Eth
MethodResetDuration: time.Minute,
}
cl := ethclient.NewClient(clients.L2RpcClient)
ethCl, err := sources.NewEthClient(client.NewBaseRPCClient(clients.L2RpcClient), log.Root(), nil, &ethClCfg)
l2RpcChecker := sources.NewL2RPCChecker()
ethCl, err := sources.NewEthClient(client.NewBaseRPCClient(clients.L2RpcClient), log.Root(), nil, &ethClCfg, l2RpcChecker)
if err != nil {
return nil, nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion op-conductor/conductor/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ func (c *OpConductor) initSequencerControl(ctx context.Context) error {
return errors.Wrap(err, "failed to create geth rpc client")
}
execCfg := sources.L2ClientDefaultConfig(&c.cfg.RollupCfg, true)
l2RpcChecker := sources.NewL2RPCChecker()
// TODO: Add metrics tracer here. tracked by https://github.com/ethereum-optimism/protocol-quest/issues/45
exec, err := sources.NewEthClient(ec, c.log, nil, &execCfg.EthClientConfig)
exec, err := sources.NewEthClient(ec, c.log, nil, &execCfg.EthClientConfig, l2RpcChecker)
if err != nil {
return errors.Wrap(err, "failed to create geth client")
}
Expand Down
2 changes: 1 addition & 1 deletion op-e2e/actions/helpers/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func WithActiveGenesisFork(fork rollup.ForkName) EnvOpt {
// DefaultFork specifies the default fork to use when setting up the action test environment.
// Currently manually set to Holocene.
// Replace with `var DefaultFork = func() rollup.ForkName { return rollup.AllForks[len(rollup.AllForks)-1] }()` after Interop launch.
const DefaultFork = rollup.Holocene
const DefaultFork = rollup.Isthmus

// SetupEnv sets up a default action test environment. If no fork is specified, the default fork as
// specified by the package variable [defaultFork] is used.
Expand Down
2 changes: 1 addition & 1 deletion op-e2e/actions/helpers/l1_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (s *L1Miner) ActL1EndBlock(t Testing) *types.Block {
withdrawals = make([]*types.Withdrawal, 0)
}

block := types.NewBlock(s.l1BuildingHeader, &types.Body{Transactions: s.L1Transactions, Withdrawals: withdrawals}, s.l1Receipts, trie.NewStackTrie(nil))
block := types.NewBlock(s.l1BuildingHeader, &types.Body{Transactions: s.L1Transactions, Withdrawals: withdrawals}, s.l1Receipts, trie.NewStackTrie(nil), s.l1Cfg.Config)
if s.l1Cfg.Config.IsCancun(s.l1BuildingHeader.Number, s.l1BuildingHeader.Time) {
parent := s.l1Chain.GetHeaderByHash(s.l1BuildingHeader.ParentHash)
var (
Expand Down
14 changes: 14 additions & 0 deletions op-e2e/actions/helpers/l2_sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ func (s *L2Sequencer) ActBuildL2ToTime(t Testing, target uint64) {
}
}

func (s *L2Sequencer) ActBuildL2ToCanyon(t Testing) {
require.NotNil(t, s.RollupCfg.CanyonTime, "cannot activate CanyonTime when it is not scheduled")
for s.L2Unsafe().Time < *s.RollupCfg.CanyonTime {
s.ActL2EmptyBlock(t)
}
}

func (s *L2Sequencer) ActBuildL2ToEcotone(t Testing) {
require.NotNil(t, s.RollupCfg.EcotoneTime, "cannot activate Ecotone when it is not scheduled")
for s.L2Unsafe().Time < *s.RollupCfg.EcotoneTime {
Expand Down Expand Up @@ -233,3 +240,10 @@ func (s *L2Sequencer) ActBuildL2ToHolocene(t Testing) {
s.ActL2EmptyBlock(t)
}
}

func (s *L2Sequencer) ActBuildL2ToIsthmus(t Testing) {
require.NotNil(t, s.RollupCfg.IsthmusTime, "cannot activate IsthmusTime when it is not scheduled")
for s.L2Unsafe().Time < *s.RollupCfg.IsthmusTime {
s.ActL2EmptyBlock(t)
}
}
5 changes: 5 additions & 0 deletions op-e2e/actions/helpers/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type hardforkScheduledTest struct {
fjordTime *hexutil.Uint64
graniteTime *hexutil.Uint64
holoceneTime *hexutil.Uint64
isthmusTime *hexutil.Uint64
runToFork string
allocType config.AllocType
}
Expand All @@ -41,6 +42,8 @@ func (tc *hardforkScheduledTest) GetFork(fork string) *uint64 {

func (tc *hardforkScheduledTest) fork(fork string) **hexutil.Uint64 {
switch fork {
case "isthmus":
return &tc.isthmusTime
case "holocene":
return &tc.holoceneTime
case "granite":
Expand Down Expand Up @@ -88,6 +91,7 @@ func testCrossLayerUser(t *testing.T, allocType config.AllocType) {
"fjord",
"granite",
"holocene",
"isthmus",
}
for i, fork := range forks {
i := i
Expand Down Expand Up @@ -146,6 +150,7 @@ func runCrossLayerUserTest(gt *testing.T, test hardforkScheduledTest) {
dp.DeployConfig.L2GenesisFjordTimeOffset = test.fjordTime
dp.DeployConfig.L2GenesisGraniteTimeOffset = test.graniteTime
dp.DeployConfig.L2GenesisHoloceneTimeOffset = test.holoceneTime
dp.DeployConfig.L2GenesisIsthmusTimeOffset = test.isthmusTime

if test.canyonTime != nil {
require.Zero(t, uint64(*test.canyonTime)%uint64(dp.DeployConfig.L2BlockTime), "canyon fork must be aligned")
Expand Down
9 changes: 9 additions & 0 deletions op-e2e/actions/upgrades/helpers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,13 @@ func ApplyDeltaTimeOffset(dp *e2eutils.DeployParams, deltaTimeOffset *hexutil.Ui
dp.DeployConfig.L2GenesisHoloceneTimeOffset = deltaTimeOffset
}
}

// configure Isthmus to not be before Delta accidentally
if dp.DeployConfig.L2GenesisIsthmusTimeOffset != nil {
if deltaTimeOffset == nil {
dp.DeployConfig.L2GenesisIsthmusTimeOffset = nil
} else if *dp.DeployConfig.L2GenesisIsthmusTimeOffset < *deltaTimeOffset {
dp.DeployConfig.L2GenesisIsthmusTimeOffset = deltaTimeOffset
}
}
}
Loading