diff --git a/espresso/environment/5_batch_authentication_test.go b/espresso/environment/5_batch_authentication_test.go new file mode 100644 index 00000000000..3bf9096f053 --- /dev/null +++ b/espresso/environment/5_batch_authentication_test.go @@ -0,0 +1,99 @@ +package environment_test + +import ( + "context" + "math/big" + "strings" + "testing" + "time" + + env "github.com/ethereum-optimism/optimism/espresso/environment" + "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-e2e/system/e2esys" + "github.com/ethereum/go-ethereum/crypto" +) + +// TestE2eDevNetWithInvalidAttestation verifies that the batcher correctly fails to register +// when provided with an invalid attestation. This test ensures that the batch inbox contract +// properly validates attestations +func TestE2eDevNetWithInvalidAttestation(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + launcher := new(env.EspressoDevNodeLauncherDocker) + + privateKey, err := crypto.GenerateKey() + if err != nil { + t.Fatalf("failed to generate private key") + } + + system, _, err := + launcher.StartDevNet(ctx, t, + env.SetBatcherKey(*privateKey), + env.Config(func(cfg *e2esys.SystemConfig) { + cfg.DisableBatcher = true + }), + ) + + if have, want := err, error(nil); have != want { + t.Fatalf("failed to start dev environment with espresso dev node:\nhave:\n\t\"%v\"\nwant:\n\t\"%v\"\n", have, want) + } + + batchDriver := system.BatchSubmitter.TestDriver() + batchDriver.Attestation = []byte{1} + err = batchDriver.StartBatchSubmitting() + + if err == nil { + t.Fatalf("batcher should've failed to register with invalid attestation but got nil error") + } + + // Check for the key part of the error message + expectedMsg := "could not register with batch inbox contract" + errMsg := err.Error() + if !strings.Contains(errMsg, expectedMsg) { + t.Fatalf("error message does not contain expected message %q:\ngot: %q", expectedMsg, errMsg) + } + + cancel() +} + +// TestE2eDevNetWithUnattestedBatcherKey verifies that when a batcher key is not properly +// attested, the L2 chain can still produce unsafe blocks but cannot progress to safe L2 blocks. +func TestE2eDevNetWithUnattestedBatcherKey(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + launcher := new(env.EspressoDevNodeLauncherDocker) + + privateKey, err := crypto.GenerateKey() + if err != nil { + t.Fatalf("failed to generate private key") + } + + system, _, err := + launcher.StartDevNet(ctx, t, + env.SetBatcherKey(*privateKey), + ) + if have, want := err, error(nil); have != want { + t.Fatalf("failed to start dev environment with espresso dev node:\nhave:\n\t\"%v\"\nwant:\n\t\"%v\"\n", have, want) + } + + l2Seq := system.NodeClient("sequencer") + + // Check that unsafe L2 is progressing... + _, err = geth.WaitForBlock(big.NewInt(15), l2Seq) + if have, want := err, error(nil); have != want { + t.Fatalf("failed to wait for block:\nhave:\n\t\"%v\"\nwant:\n\t\"%v\"\n", have, want) + } + + // ...but safe L2 is not + _, err = geth.WaitForBlockToBeSafe(big.NewInt(1), l2Seq, 2*time.Minute) + if err == nil { + t.Fatalf("block shouldn't be safe") + } + + _ = system + + // Signal the testnet to shut down + cancel() +} diff --git a/espresso/environment/espresso_dev_net_launcher.go b/espresso/environment/espresso_dev_net_launcher.go index fbea1b4de1f..660649044f6 100644 --- a/espresso/environment/espresso_dev_net_launcher.go +++ b/espresso/environment/espresso_dev_net_launcher.go @@ -28,6 +28,9 @@ type DevNetLauncherContext struct { // Any Current Error Error error + // The Current System configuration + SystemCfg *e2esys.SystemConfig + // The Current System instance System *e2esys.System @@ -45,6 +48,8 @@ type DevNetLauncherOption func( // e2e system that is being launched. It contains the GethOptions and // any relevant StartOptions that may be needed for the system. type E2eSystemOption struct { + SysConfigOption func(*e2esys.SystemConfig) + // The GethOptions to pass to the Geth Node. GethOptions map[string][]geth.GethOption diff --git a/espresso/environment/optitmism_espresso_test_helpers.go b/espresso/environment/optitmism_espresso_test_helpers.go index a24b0fc3c58..79d24d92159 100644 --- a/espresso/environment/optitmism_espresso_test_helpers.go +++ b/espresso/environment/optitmism_espresso_test_helpers.go @@ -3,9 +3,11 @@ package environment import ( "bytes" "context" + "crypto/ecdsa" "errors" "fmt" "io" + "log/slog" "math/big" "net" "net/http" @@ -20,6 +22,8 @@ import ( "github.com/ethereum-optimism/optimism/op-e2e/system/e2esys" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth/ethconfig" gethNode "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" @@ -37,6 +41,8 @@ const ESPRESSO_MNEMONIC = "giant issue aisle success illegal bike spike question // contracts on the L1 const ESPRESSO_MNEMONIC_INDEX = "0" +const ESPRESSO_TESTING_BATCHER_KEY = "0xfad9c8855b740a0b7ed4c221dbad0f33a83a49cad6b3fe8d5817ac83d38b6a19" + // This is address that corresponds to the menmonic we pass to the espresso-dev-node var ESPRESSO_CONTRACT_ACCOUNT = common.HexToAddress("0x8943545177806ed17b9f23f0a21ee5948ecaa776") @@ -207,7 +213,7 @@ var ErrUnableToDetermineEspressoDevNodeSequencerHost = errors.New("unable to det func (l *EspressoDevNodeLauncherDocker) StartDevNet(ctx context.Context, t *testing.T, options ...DevNetLauncherOption) (*e2esys.System, EspressoDevNode, error) { originalCtx := ctx - sysConfig := e2esys.DefaultSystemConfig(t, e2esys.WithAllocType(config.AllocTypeStandard)) + sysConfig := e2esys.DefaultSystemConfig(t, e2esys.WithAllocType(config.AllocTypeEspresso)) sysConfig.DeployConfig.DeployCeloContracts = true // Ensure that we fund the dev accounts @@ -223,7 +229,8 @@ func (l *EspressoDevNodeLauncherDocker) StartDevNet(ctx context.Context, t *test } launchContext := DevNetLauncherContext{ - Ctx: originalCtx, + Ctx: originalCtx, + SystemCfg: &sysConfig, } allOptions := append(initialOptions, options...) @@ -243,6 +250,10 @@ func (l *EspressoDevNodeLauncherDocker) StartDevNet(ctx context.Context, t *test if startOption := options.StartOptions; startOption != nil { startOptions = append(startOptions, startOption...) } + + if sysConfigOption := options.SysConfigOption; sysConfigOption != nil { + sysConfigOption(&sysConfig) + } } // We want to run the espresso-dev-node. But we need it to be able to @@ -356,6 +367,29 @@ func determineFreePort() (port int, err error) { return addr.Port, nil } +func SetBatcherKey(privateKey ecdsa.PrivateKey) DevNetLauncherOption { + return func(ct *DevNetLauncherContext) E2eSystemOption { + return E2eSystemOption{ + StartOptions: []e2esys.StartOption{ + { + Role: "set-batcher-key", + BatcherMod: func(c *batcher.CLIConfig) { + c.TestingEspressoBatcherPrivateKey = hexutil.Encode(crypto.FromECDSA(&privateKey)) + }, + }, + }, + } + } +} + +func Config(fn func(*e2esys.SystemConfig)) DevNetLauncherOption { + return func(ct *DevNetLauncherContext) E2eSystemOption { + return E2eSystemOption{ + SysConfigOption: fn, + } + } +} + // launchEspressoDevNodeDocker is DevNetLauncherOption that launches th // Espresso Dev Node within a Docker container. It also ensures that the // Espresso Dev Node is actively producing blocks before returning. @@ -515,6 +549,8 @@ func launchEspressoDevNodeDocker() DevNetLauncherOption { } c.EspressoUrl = "http://" + hostPort + c.LogConfig.Level = slog.LevelDebug + c.TestingEspressoBatcherPrivateKey = "0x" + config.ESPRESSO_PRE_APPROVED_BATCHER_PRIVATE_KEY } }, }, diff --git a/op-batcher/batcher/config.go b/op-batcher/batcher/config.go index b6c822ddd7a..4bc09de09e3 100644 --- a/op-batcher/batcher/config.go +++ b/op-batcher/batcher/config.go @@ -122,8 +122,9 @@ type CLIConfig struct { RPC oprpc.CLIConfig AltDA altda.CLIConfig - EspressoUrl string - EspressoLightClientAddr string + EspressoUrl string + EspressoLightClientAddr string + TestingEspressoBatcherPrivateKey string } func (c *CLIConfig) Check() error { @@ -194,32 +195,33 @@ func NewConfig(ctx *cli.Context) *CLIConfig { EspressoPollInterval: ctx.Duration(flags.EspressoPollIntervalFlag.Name), /* Optional Flags */ - MaxPendingTransactions: ctx.Uint64(flags.MaxPendingTransactionsFlag.Name), - MaxChannelDuration: ctx.Uint64(flags.MaxChannelDurationFlag.Name), - MaxL1TxSize: ctx.Uint64(flags.MaxL1TxSizeBytesFlag.Name), - MaxBlocksPerSpanBatch: ctx.Int(flags.MaxBlocksPerSpanBatch.Name), - TargetNumFrames: ctx.Int(flags.TargetNumFramesFlag.Name), - ApproxComprRatio: ctx.Float64(flags.ApproxComprRatioFlag.Name), - Compressor: ctx.String(flags.CompressorFlag.Name), - CompressionAlgo: derive.CompressionAlgo(ctx.String(flags.CompressionAlgoFlag.Name)), - Stopped: ctx.Bool(flags.StoppedFlag.Name), - WaitNodeSync: ctx.Bool(flags.WaitNodeSyncFlag.Name), - CheckRecentTxsDepth: ctx.Int(flags.CheckRecentTxsDepthFlag.Name), - BatchType: ctx.Uint(flags.BatchTypeFlag.Name), - DataAvailabilityType: flags.DataAvailabilityType(ctx.String(flags.DataAvailabilityTypeFlag.Name)), - ActiveSequencerCheckDuration: ctx.Duration(flags.ActiveSequencerCheckDurationFlag.Name), - TxMgrConfig: txmgr.ReadCLIConfig(ctx), - LogConfig: oplog.ReadCLIConfig(ctx), - MetricsConfig: opmetrics.ReadCLIConfig(ctx), - PprofConfig: oppprof.ReadCLIConfig(ctx), - RPC: oprpc.ReadCLIConfig(ctx), - AltDA: altda.ReadCLIConfig(ctx), - ThrottleThreshold: ctx.Uint64(flags.ThrottleThresholdFlag.Name), - ThrottleTxSize: ctx.Uint64(flags.ThrottleTxSizeFlag.Name), - ThrottleBlockSize: ctx.Uint64(flags.ThrottleBlockSizeFlag.Name), - ThrottleAlwaysBlockSize: ctx.Uint64(flags.ThrottleAlwaysBlockSizeFlag.Name), - PreferLocalSafeL2: ctx.Bool(flags.PreferLocalSafeL2Flag.Name), - EspressoUrl: ctx.String(flags.EspressoUrlFlag.Name), - EspressoLightClientAddr: ctx.String(flags.EspressoLCAddrFlag.Name), + MaxPendingTransactions: ctx.Uint64(flags.MaxPendingTransactionsFlag.Name), + MaxChannelDuration: ctx.Uint64(flags.MaxChannelDurationFlag.Name), + MaxL1TxSize: ctx.Uint64(flags.MaxL1TxSizeBytesFlag.Name), + MaxBlocksPerSpanBatch: ctx.Int(flags.MaxBlocksPerSpanBatch.Name), + TargetNumFrames: ctx.Int(flags.TargetNumFramesFlag.Name), + ApproxComprRatio: ctx.Float64(flags.ApproxComprRatioFlag.Name), + Compressor: ctx.String(flags.CompressorFlag.Name), + CompressionAlgo: derive.CompressionAlgo(ctx.String(flags.CompressionAlgoFlag.Name)), + Stopped: ctx.Bool(flags.StoppedFlag.Name), + WaitNodeSync: ctx.Bool(flags.WaitNodeSyncFlag.Name), + CheckRecentTxsDepth: ctx.Int(flags.CheckRecentTxsDepthFlag.Name), + BatchType: ctx.Uint(flags.BatchTypeFlag.Name), + DataAvailabilityType: flags.DataAvailabilityType(ctx.String(flags.DataAvailabilityTypeFlag.Name)), + ActiveSequencerCheckDuration: ctx.Duration(flags.ActiveSequencerCheckDurationFlag.Name), + TxMgrConfig: txmgr.ReadCLIConfig(ctx), + LogConfig: oplog.ReadCLIConfig(ctx), + MetricsConfig: opmetrics.ReadCLIConfig(ctx), + PprofConfig: oppprof.ReadCLIConfig(ctx), + RPC: oprpc.ReadCLIConfig(ctx), + AltDA: altda.ReadCLIConfig(ctx), + ThrottleThreshold: ctx.Uint64(flags.ThrottleThresholdFlag.Name), + ThrottleTxSize: ctx.Uint64(flags.ThrottleTxSizeFlag.Name), + ThrottleBlockSize: ctx.Uint64(flags.ThrottleBlockSizeFlag.Name), + ThrottleAlwaysBlockSize: ctx.Uint64(flags.ThrottleAlwaysBlockSizeFlag.Name), + PreferLocalSafeL2: ctx.Bool(flags.PreferLocalSafeL2Flag.Name), + EspressoUrl: ctx.String(flags.EspressoUrlFlag.Name), + EspressoLightClientAddr: ctx.String(flags.EspressoLCAddrFlag.Name), + TestingEspressoBatcherPrivateKey: ctx.String(flags.TestingEspressoBatcherPrivateKeyFlag.Name), } } diff --git a/op-batcher/batcher/driver.go b/op-batcher/batcher/driver.go index 0b545b2df24..acfdbff0050 100644 --- a/op-batcher/batcher/driver.go +++ b/op-batcher/batcher/driver.go @@ -185,6 +185,11 @@ func (l *BatchSubmitter) StartBatchSubmitting() error { } if l.Config.UseEspresso { + err := l.registerBatcher(l.killCtx) + if err != nil { + return fmt.Errorf("could not register with batch inbox contract: %w", err) + } + l.wg.Add(4) go l.receiptsLoop(l.wg, receiptsCh) // ranges over receiptsCh channel go l.espressoBatchQueueingLoop(l.shutdownCtx, l.wg) diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 3f6eab90d79..5894fe7274b 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -127,12 +127,6 @@ func (l *BatchSubmitter) espressoBatchLoadingLoop(ctx context.Context, wg *sync. defer ticker.Stop() defer close(publishSignal) - err := l.registerBatcher(ctx) - if err != nil { - l.Log.Error("could not register with batch inbox contract", "err", err) - return - } - streamer := espresso.NewEspressoStreamer( l.RollupConfig.L2ChainID.Uint64(), l.L1Client, @@ -341,7 +335,7 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { return nil } - batchAuthenticator, err := bindings.NewBatchAuthenticator(l.RollupConfig.CaffNodeConfig.BatchAuthenticatorAddress, l.L1Client) + batchAuthenticator, err := bindings.NewBatchAuthenticator(l.RollupConfig.BatchAuthenticatorAddress, l.L1Client) if err != nil { return fmt.Errorf("failed to create batch authenticator contract bindings: %w", err) } @@ -436,7 +430,7 @@ func (l *BatchSubmitter) sendEspressoTx(txdata txData, isCancel bool, candidate verifyCandidate := txmgr.TxCandidate{ TxData: authenticateBatchCalldata, - To: &l.RollupConfig.CaffNodeConfig.BatchAuthenticatorAddress, + To: &l.RollupConfig.BatchAuthenticatorAddress, } l.Log.Debug( @@ -444,10 +438,11 @@ func (l *BatchSubmitter) sendEspressoTx(txdata txData, isCancel bool, candidate "txRef", transactionReference, "commitment", hexutil.Encode(commitment[:]), "sig", hexutil.Encode(signature), - "address", l.RollupConfig.CaffNodeConfig.BatchAuthenticatorAddress.String(), + "address", l.RollupConfig.BatchAuthenticatorAddress.String(), ) _, err = l.Txmgr.Send(l.killCtx, verifyCandidate) if err != nil { + l.Log.Error("Failed to send authenticateBatch transaction", "txRef", transactionReference, "err", err) receiptsCh <- txmgr.TxReceipt[txRef]{ ID: transactionReference, Err: fmt.Errorf("failed to send authenticateBatch transaction: %w", err), diff --git a/op-batcher/batcher/service.go b/op-batcher/batcher/service.go index bba1fbf69ab..9c37374524e 100644 --- a/op-batcher/batcher/service.go +++ b/op-batcher/batcher/service.go @@ -156,8 +156,8 @@ func (bs *BatcherService) initFromCLIConfig(ctx context.Context, version string, if err != nil { bs.Log.Info("Not running in enclave, skipping attestation", "info", err) - // Replace ephemeral keys with persistent keys, as in devnet they'll be pre-approved for batching - privateKey, err := crypto.HexToECDSA(strings.TrimPrefix(cfg.TxMgrConfig.PrivateKey, "0x")) + // Replace ephemeral keys with configured keys, as in devnet they'll be pre-approved for batching + privateKey, err := crypto.HexToECDSA(strings.TrimPrefix(cfg.TestingEspressoBatcherPrivateKey, "0x")) if err != nil { return fmt.Errorf("Failed to parse batcher's private key") } diff --git a/op-batcher/flags/flags.go b/op-batcher/flags/flags.go index 232fbfca2cb..947c626df87 100644 --- a/op-batcher/flags/flags.go +++ b/op-batcher/flags/flags.go @@ -207,6 +207,12 @@ var ( Value: "0x703848f4c85f18e3acd8196c8ec91eb0b7bd0797", EnvVars: prefixEnvVars("ESPRESSO_LIGHT_CLIENT_ADDR"), } + TestingEspressoBatcherPrivateKeyFlag = &cli.StringFlag{ + Name: "testing-espresso-batcher-private-key", + Usage: "Private key of batcher in Espresso mode: ONLY FOR TESTING", + Value: "", + EnvVars: prefixEnvVars("TESTING_ESPRESSO_BATCHER_PRIVATE_KEY"), + } // Legacy Flags SequencerHDPathFlag = txmgr.SequencerHDPathFlag ) diff --git a/op-chain-ops/genesis/config.go b/op-chain-ops/genesis/config.go index 806b21d49d3..3ba3bb84d86 100644 --- a/op-chain-ops/genesis/config.go +++ b/op-chain-ops/genesis/config.go @@ -1024,16 +1024,15 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Header, l2GenesisBlockHa L2Time: l2GenesisTimestamp, SystemConfig: d.GenesisSystemConfig(), }, - BlockTime: d.L2BlockTime, - MaxSequencerDrift: d.MaxSequencerDrift, - SeqWindowSize: d.SequencerWindowSize, - ChannelTimeoutBedrock: d.ChannelTimeoutBedrock, - L1ChainID: new(big.Int).SetUint64(d.L1ChainID), - L2ChainID: new(big.Int).SetUint64(d.L2ChainID), - BatchInboxAddress: d.BatchInboxAddress, - CaffNodeConfig: rollup.CaffNodeConfig{ - BatchAuthenticatorAddress: d.BatchAuthenticatorAddress, - }, + BlockTime: d.L2BlockTime, + MaxSequencerDrift: d.MaxSequencerDrift, + SeqWindowSize: d.SequencerWindowSize, + ChannelTimeoutBedrock: d.ChannelTimeoutBedrock, + L1ChainID: new(big.Int).SetUint64(d.L1ChainID), + L2ChainID: new(big.Int).SetUint64(d.L2ChainID), + BatchInboxAddress: d.BatchInboxAddress, + BatchAuthenticatorAddress: d.BatchAuthenticatorAddress, + DepositContractAddress: d.OptimismPortalProxy, L1SystemConfigAddress: d.SystemConfigProxy, RegolithTime: d.RegolithTime(l1StartTime), @@ -1114,6 +1113,8 @@ type L1Deployments struct { ProtocolVersionsProxy common.Address `json:"ProtocolVersionsProxy"` DataAvailabilityChallenge common.Address `json:"DataAvailabilityChallenge"` DataAvailabilityChallengeProxy common.Address `json:"DataAvailabilityChallengeProxy"` + BatchInbox common.Address `json:"BatchInbox"` + BatchAuthenticator common.Address `json:"BatchAuthenticator"` } // GetName will return the name of the contract given an address. @@ -1138,6 +1139,9 @@ func (d *L1Deployments) Check(deployConfig *DeployConfig) error { } for i := 0; i < val.NumField(); i++ { name := val.Type().Field(i).Name + if name == "BatchInbox" || name == "BatchAuthenticator" { + continue + } if !deployConfig.UseFaultProofs && (name == "DisputeGameFactory" || name == "DisputeGameFactoryProxy") { diff --git a/op-deployer/pkg/deployer/inspect/l1.go b/op-deployer/pkg/deployer/inspect/l1.go index 730392fc61e..a8de9dbb4bd 100644 --- a/op-deployer/pkg/deployer/inspect/l1.go +++ b/op-deployer/pkg/deployer/inspect/l1.go @@ -44,6 +44,8 @@ func (l L1Contracts) AsL1Deployments() *genesis.L1Deployments { ProtocolVersionsProxy: l.SuperchainDeployment.ProtocolVersionsProxyAddress, DataAvailabilityChallenge: l.OpChainDeployment.DataAvailabilityChallengeImplAddress, DataAvailabilityChallengeProxy: l.OpChainDeployment.DataAvailabilityChallengeProxyAddress, + BatchInbox: l.OpChainDeployment.BatchInboxAddress, + BatchAuthenticator: l.OpChainDeployment.BatchAuthenticatorAddress, } } diff --git a/op-e2e/config/init.go b/op-e2e/config/init.go index ceef191f921..d2f040d12c0 100644 --- a/op-e2e/config/init.go +++ b/op-e2e/config/init.go @@ -34,6 +34,8 @@ import ( _ "embed" ) +const ESPRESSO_PRE_APPROVED_BATCHER_PRIVATE_KEY = "5fede428b9506dee864b0d85aefb2409f4728313eb41da4121409299c487f816" + // legacy geth log levels - the geth command line --verbosity flag wasn't // migrated to use slog's numerical levels. const ( @@ -52,6 +54,7 @@ const ( AllocTypeAltDA AllocType = "alt-da" AllocTypeL2OO AllocType = "l2oo" AllocTypeMTCannon AllocType = "mt-cannon" + AllocTypeEspresso AllocType = "espresso" DefaultAllocType = AllocTypeStandard ) @@ -65,14 +68,14 @@ func (a AllocType) Check() error { func (a AllocType) UsesProofs() bool { switch a { - case AllocTypeStandard, AllocTypeMTCannon, AllocTypeAltDA: + case AllocTypeStandard, AllocTypeMTCannon, AllocTypeAltDA, AllocTypeEspresso: return true default: return false } } -var allocTypes = []AllocType{AllocTypeStandard, AllocTypeAltDA, AllocTypeL2OO, AllocTypeMTCannon} +var allocTypes = []AllocType{AllocTypeStandard, AllocTypeAltDA, AllocTypeL2OO, AllocTypeMTCannon, AllocTypeEspresso} var ( // All of the following variables are set in the init function @@ -281,6 +284,15 @@ func initAllocType(root string, allocType AllocType) { } } + if allocType == AllocTypeEspresso { + batcherPk, err := crypto.HexToECDSA(ESPRESSO_PRE_APPROVED_BATCHER_PRIVATE_KEY) + if err != nil { + panic(fmt.Errorf("failed to parse batcher private key: %w", err)) + } + intent.Chains[0].EspressoEnabled = true + intent.Chains[0].PreApprovedBatcherKey = crypto.PubkeyToAddress(batcherPk.PublicKey) + } + baseUpgradeSchedule := map[string]any{ "l2GenesisRegolithTimeOffset": nil, "l2GenesisCanyonTimeOffset": nil, diff --git a/op-e2e/system/e2esys/setup.go b/op-e2e/system/e2esys/setup.go index 3ca1c966ae3..33451828ee0 100644 --- a/op-e2e/system/e2esys/setup.go +++ b/op-e2e/system/e2esys/setup.go @@ -637,27 +637,28 @@ func (cfg SystemConfig) Start(t *testing.T, startOpts ...StartOption) (*System, L2Time: uint64(cfg.DeployConfig.L1GenesisBlockTimestamp), SystemConfig: e2eutils.SystemConfigFromDeployConfig(cfg.DeployConfig), }, - BlockTime: cfg.DeployConfig.L2BlockTime, - MaxSequencerDrift: cfg.DeployConfig.MaxSequencerDrift, - SeqWindowSize: cfg.DeployConfig.SequencerWindowSize, - ChannelTimeoutBedrock: cfg.DeployConfig.ChannelTimeoutBedrock, - L1ChainID: cfg.L1ChainIDBig(), - L2ChainID: cfg.L2ChainIDBig(), - BatchInboxAddress: cfg.DeployConfig.BatchInboxAddress, - DepositContractAddress: cfg.DeployConfig.OptimismPortalProxy, - L1SystemConfigAddress: cfg.DeployConfig.SystemConfigProxy, - RegolithTime: cfg.DeployConfig.RegolithTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - CanyonTime: cfg.DeployConfig.CanyonTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - DeltaTime: cfg.DeployConfig.DeltaTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - EcotoneTime: cfg.DeployConfig.EcotoneTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - FjordTime: cfg.DeployConfig.FjordTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - GraniteTime: cfg.DeployConfig.GraniteTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - HoloceneTime: cfg.DeployConfig.HoloceneTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - IsthmusTime: cfg.DeployConfig.IsthmusTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - InteropTime: cfg.DeployConfig.InteropTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - Cel2Time: cfg.DeployConfig.RegolithTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), - ProtocolVersionsAddress: cfg.L1Deployments.ProtocolVersionsProxy, - AltDAConfig: rollupAltDAConfig, + BlockTime: cfg.DeployConfig.L2BlockTime, + MaxSequencerDrift: cfg.DeployConfig.MaxSequencerDrift, + SeqWindowSize: cfg.DeployConfig.SequencerWindowSize, + ChannelTimeoutBedrock: cfg.DeployConfig.ChannelTimeoutBedrock, + L1ChainID: cfg.L1ChainIDBig(), + L2ChainID: cfg.L2ChainIDBig(), + BatchInboxAddress: cfg.DeployConfig.BatchInboxAddress, + BatchAuthenticatorAddress: cfg.DeployConfig.BatchAuthenticatorAddress, + DepositContractAddress: cfg.DeployConfig.OptimismPortalProxy, + L1SystemConfigAddress: cfg.DeployConfig.SystemConfigProxy, + RegolithTime: cfg.DeployConfig.RegolithTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + CanyonTime: cfg.DeployConfig.CanyonTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + DeltaTime: cfg.DeployConfig.DeltaTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + EcotoneTime: cfg.DeployConfig.EcotoneTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + FjordTime: cfg.DeployConfig.FjordTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + GraniteTime: cfg.DeployConfig.GraniteTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + HoloceneTime: cfg.DeployConfig.HoloceneTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + IsthmusTime: cfg.DeployConfig.IsthmusTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + InteropTime: cfg.DeployConfig.InteropTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + Cel2Time: cfg.DeployConfig.RegolithTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), + ProtocolVersionsAddress: cfg.L1Deployments.ProtocolVersionsProxy, + AltDAConfig: rollupAltDAConfig, ChainOpConfig: ¶ms.OptimismConfig{ EIP1559Elasticity: cfg.DeployConfig.EIP1559Elasticity, EIP1559Denominator: cfg.DeployConfig.EIP1559Denominator, diff --git a/op-node/rollup/types.go b/op-node/rollup/types.go index 7edd67e54ae..e3bcca6cc6d 100644 --- a/op-node/rollup/types.go +++ b/op-node/rollup/types.go @@ -153,6 +153,8 @@ type Config struct { // Caff Node config CaffNodeConfig CaffNodeConfig `json:"caff_node_config,omitempty"` + + BatchAuthenticatorAddress common.Address `json:"batch_authenticator_address,omitempty,omitzero"` } // CaffNodeConfig is the config for the Caff Node @@ -161,7 +163,6 @@ type CaffNodeConfig struct { NextHotShotBlockNum uint64 PollingHotShotPollingInterval time.Duration HotShotUrls []string - BatchAuthenticatorAddress common.Address `json:"batch_authenticator_address"` } // ValidateL1Config checks L1 config variables for errors. diff --git a/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.sol b/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol similarity index 100% rename from packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.sol rename to packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol