diff --git a/arbnode/node.go b/arbnode/node.go index 3caca38900..ff14583d10 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -553,14 +553,6 @@ func createNodeImpl( var statelessBlockValidator *staker.StatelessBlockValidator if config.BlockValidator.ValidationServerConfigs[0].URL != "" { - var hotShotReader *HotShotReader - if config.BlockValidator.Espresso { - addr := common.HexToAddress(config.BlockValidator.HotShotAddress) - hotShotReader, err = NewHotShotReader(addr, l1client) - if err != nil { - return nil, err - } - } var hotShotReader *HotShotReader if config.BlockValidator.Espresso { addr := common.HexToAddress(config.BlockValidator.HotShotAddress) diff --git a/deploy/deploy.go b/deploy/deploy.go index cfe7fbcf8d..6752ae493e 100644 --- a/deploy/deploy.go +++ b/deploy/deploy.go @@ -161,7 +161,7 @@ func deployChallengeFactory(ctx context.Context, l1Reader *headerreader.HeaderRe return ospEntryAddr, challengeManagerAddr, nil } -func deployRollupCreator(ctx context.Context, l1Reader *headerreader.HeaderReader, auth *bind.TransactOpts, maxDataSize *big.Int, hotshot common.Address isUsingFeeToken bool) (*rollupgen.RollupCreator, common.Address, common.Address, common.Address, error) { +func deployRollupCreator(ctx context.Context, l1Reader *headerreader.HeaderReader, auth *bind.TransactOpts, maxDataSize *big.Int, hotshot common.Address, isUsingFeeToken bool) (*rollupgen.RollupCreator, common.Address, common.Address, common.Address, error) { bridgeCreator, err := deployBridgeCreator(ctx, l1Reader, auth, maxDataSize, isUsingFeeToken) if err != nil { return nil, common.Address{}, common.Address{}, common.Address{}, fmt.Errorf("bridge creator deploy error: %w", err) @@ -239,7 +239,7 @@ func DeployOnL1(ctx context.Context, parentChainReader *headerreader.HeaderReade return nil, errors.New("no machine specified") } - rollupCreator, _, validatorUtils, validatorWalletCreator, err := deployRollupCreator(ctx, parentChainReader, deployAuth, maxDataSize, hotshot,isUsingFeeToken) + rollupCreator, _, validatorUtils, validatorWalletCreator, err := deployRollupCreator(ctx, parentChainReader, deployAuth, maxDataSize, hotshot, isUsingFeeToken) if err != nil { return nil, fmt.Errorf("error deploying rollup creator: %w", err) } diff --git a/system_tests/espresso-e2e/docker-compose.yaml b/system_tests/espresso-e2e/docker-compose.yaml index b933df76fe..bc4948ba26 100644 --- a/system_tests/espresso-e2e/docker-compose.yaml +++ b/system_tests/espresso-e2e/docker-compose.yaml @@ -59,6 +59,7 @@ services: - ESPRESSO_SEQUENCER_ETH_MNEMONIC - ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX - ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS + - ESPRESSO_SEQUENCER_STATE_PEERS=http://espresso-sequencer1:$ESPRESSO_SEQUENCER_API_PORT - RUST_LOG - RUST_LOG_FORMAT depends_on: @@ -95,6 +96,7 @@ services: - ESPRESSO_STATE_RELAY_SERVER_URL - RUST_LOG - RUST_LOG_FORMAT + - ESPRESSO_SEQUENCER_STATE_PEERS=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_API_PORT depends_on: orchestrator: condition: service_healthy diff --git a/system_tests/espresso_e2e_test.go b/system_tests/espresso_e2e_test.go index 07eb53382c..eae295921c 100644 --- a/system_tests/espresso_e2e_test.go +++ b/system_tests/espresso_e2e_test.go @@ -77,16 +77,20 @@ func runEspresso(t *testing.T, ctx context.Context) func() { func createL2Node(ctx context.Context, t *testing.T, hotshot_url string, builder *NodeBuilder) (*TestClient, info, func()) { nodeConfig := arbnode.ConfigDefaultL1Test() builder.takeOwnership = false + nodeConfig.BatchPoster.Enable = false + nodeConfig.BlockValidator.Enable = false nodeConfig.DelayedSequencer.Enable = true nodeConfig.Sequencer = true nodeConfig.Espresso = true builder.execConfig.Sequencer.Enable = true builder.execConfig.Sequencer.Espresso = true - builder.execConfig.Sequencer.EspressoNamespace = 412346 + builder.execConfig.Sequencer.EspressoNamespace = builder.chainConfig.ChainID.Uint64() builder.execConfig.Sequencer.HotShotUrl = hotshot_url builder.chainConfig.ArbitrumChainParams.EnableEspresso = true + nodeConfig.Feed.Output.Enable = true + nodeConfig.Feed.Output.Addr = "0.0.0.0" builder.nodeConfig.Feed.Output.Enable = true builder.nodeConfig.Feed.Output.Port = fmt.Sprintf("%d", broadcastPort) @@ -156,6 +160,7 @@ func createL1ValidatorPosterNode(ctx context.Context, t *testing.T) (*NodeBuilde builder.nodeConfig.BatchPoster.PollInterval = 10 * time.Second builder.nodeConfig.BatchPoster.MaxDelay = -1000 * time.Hour builder.nodeConfig.BlockValidator.Enable = true + builder.nodeConfig.BlockValidator.ValidationPoll = 2 * time.Second builder.nodeConfig.BlockValidator.ValidationServer.URL = fmt.Sprintf("ws://127.0.0.1:%d", arbValidationPort) builder.nodeConfig.BlockValidator.HotShotAddress = hotShotAddress builder.nodeConfig.BlockValidator.Espresso = true @@ -209,6 +214,7 @@ func createStaker(ctx context.Context, t *testing.T, builder *NodeBuilder, incor config.BatchPoster.Enable = false config.Staker.Enable = false config.BlockValidator.Enable = true + config.BlockValidator.ValidationPoll = 2 * time.Second config.BlockValidator.HotShotAddress = hotShotAddress config.BlockValidator.Espresso = true config.BlockValidator.ValidationServer.URL = fmt.Sprintf("ws://127.0.0.1:%d", arbValidationPort) @@ -392,7 +398,14 @@ func TestEspressoE2E(t *testing.T) { Require(t, err) // Remember the number of messages - msgCnt, err := node.ConsensusNode.TxStreamer.GetMessageCount() + var msgCnt arbutil.MessageIndex + err = waitFor(t, ctx, func() bool { + cnt, err := node.ConsensusNode.TxStreamer.GetMessageCount() + Require(t, err) + msgCnt = cnt + log.Info("waiting for message count", "cnt", msgCnt) + return msgCnt > 1 + }) Require(t, err) // Wait for the number of validated messages to catch up @@ -445,7 +458,7 @@ func TestEspressoE2E(t *testing.T) { badStaker, blockValidatorB, cleanB := createStaker(ctx, t, builder, incorrectHeight) defer cleanB() - err = waitFor(t, ctx, func() bool { + err = waitForWith(t, ctx, 60*time.Second, 1*time.Second, func() bool { validatedA := blockValidatorA.Validated(t) validatedB := blockValidatorB.Validated(t) shouldValidated := arbutil.MessageIndex(incorrectHeight - 1)