Skip to content

Commit

Permalink
Fixes snap sync test procedure when creating arb node
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoximenes committed Jan 3, 2025
1 parent f5034ab commit da6022a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,8 @@ func getDAS(
}

func getInboxTrackerAndReader(
ctx context.Context,
exec execution.ExecutionSequencer,
arbDb ethdb.Database,
txStreamer *TransactionStreamer,
dapReaders []daprovider.Reader,
Expand All @@ -613,10 +615,14 @@ func getInboxTrackerAndReader(
}
firstMessageBlock := new(big.Int).SetUint64(deployInfo.DeployedAt)
if config.SnapSyncTest.Enabled {
if exec == nil {
return nil, nil, errors.New("snap sync test requires an execution sequencer")
}

batchCount := config.SnapSyncTest.BatchCount
delayedMessageNumber, err := exec.NextDelayedMessageNumber()
if err != nil {
return nil, err
return nil, nil, err
}
if batchCount > delayedMessageNumber {
batchCount = delayedMessageNumber
Expand All @@ -629,7 +635,7 @@ func getInboxTrackerAndReader(
}
block, err := FindBlockContainingBatchCount(ctx, deployInfo.Bridge, l1client, config.SnapSyncTest.ParentChainAssertionBlock, batchCount)
if err != nil {
return nil, err
return nil, nil, err
}
firstMessageBlock.SetUint64(block)
}
Expand Down Expand Up @@ -1036,7 +1042,7 @@ func createNodeImpl(
return nil, err
}

inboxTracker, inboxReader, err := getInboxTrackerAndReader(arbDb, txStreamer, dapReaders, config, configFetcher, l1client, l1Reader, deployInfo, delayedBridge, sequencerInbox)
inboxTracker, inboxReader, err := getInboxTrackerAndReader(ctx, executionSequencer, arbDb, txStreamer, dapReaders, config, configFetcher, l1client, l1Reader, deployInfo, delayedBridge, sequencerInbox)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit da6022a

Please sign in to comment.