Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJeremyHe committed Mar 13, 2024
1 parent f07ba1e commit c2fad81
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
8 changes: 0 additions & 8 deletions arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 2 additions & 0 deletions system_tests/espresso-e2e/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
19 changes: 16 additions & 3 deletions system_tests/espresso_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand 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)
Expand Down

0 comments on commit c2fad81

Please sign in to comment.