Skip to content

Commit

Permalink
fix blockhash mismatch issue in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Dec 30, 2024
1 parent 9cb8dbb commit d624150
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 1 addition & 3 deletions arbnode/transaction_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,6 @@ func (s *TransactionStreamer) ExecuteNextMsg(ctx context.Context) bool {
return false
}

// we just log the error but not update the value in db itself with msgResult.BlockHash? and instead forward the new block hash
s.checkResult(pos, msgResult, msgAndBlockInfo)

batch := s.db.NewBatch()
Expand All @@ -1294,8 +1293,7 @@ func (s *TransactionStreamer) ExecuteNextMsg(ctx context.Context) bool {
msgWithBlockInfo := arbostypes.MessageWithMetadataAndBlockInfo{
MessageWithMeta: msgAndBlockInfo.MessageWithMeta,
BlockHash: &msgResult.BlockHash,
// maybe if blockhash is differing we clear out previous timeboosted and not send timeboosted info to broadcasting?
BlockMetadata: msgAndBlockInfo.BlockMetadata,
BlockMetadata: msgAndBlockInfo.BlockMetadata,
}
s.broadcastMessages([]arbostypes.MessageWithMetadataAndBlockInfo{msgWithBlockInfo}, pos)

Expand Down
5 changes: 2 additions & 3 deletions execution/gethexec/express_lane_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ func (es *expressLaneService) Start(ctxIn context.Context) {
log.Warn("Could not find round info for ExpressLaneConroller transfer event", "round", round)
continue
}
prevController := setExpressLaneIterator.Event.PreviousExpressLaneController
if roundInfo.controller != prevController {
if roundInfo.controller != setExpressLaneIterator.Event.PreviousExpressLaneController {
log.Warn("Previous ExpressLaneController in SetExpressLaneController event does not match Sequencer previous controller, continuing with transfer to new controller anyway",
"round", round,
"sequencerRoundController", roundInfo.controller,
Expand All @@ -297,7 +296,7 @@ func (es *expressLaneService) Start(ctxIn context.Context) {
if roundInfo.controller == setExpressLaneIterator.Event.NewExpressLaneController {
log.Warn("SetExpressLaneController: Previous and New ExpressLaneControllers are the same, not transferring control.",
"round", round,
"previous", setExpressLaneIterator.Event.PreviousExpressLaneController,
"previous", roundInfo.controller,
"new", setExpressLaneIterator.Event.NewExpressLaneController)
continue
}
Expand Down
13 changes: 6 additions & 7 deletions system_tests/timeboost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestExpressLaneTransactionHandlingComplex(t *testing.T) {
verifyControllerAdvantage(t, ctx, seqClient, aliceExpressLaneClient, seqInfo, "Alice", "Bob")

// Binary search and find how many of bob's futureSeqTxs were able to go through
s, f := 0, len(bobExpressLaneTxs)
s, f := 0, len(bobExpressLaneTxs)-1
for s < f {
m := (s + f + 1) / 2
_, err := seqClient.TransactionReceipt(ctx, bobExpressLaneTxs[m].Hash())
Expand Down Expand Up @@ -1099,11 +1099,10 @@ func setupExpressLaneAuction(
t.Fatalf("failed to cast listener address to *net.TCPAddr")
}
port := tcpAddr.Port
builderFeedListener := NewNodeBuilder(ctx).DefaultConfig(t, true)
builderFeedListener.isSequencer = false
builderFeedListener.nodeConfig.Feed.Input = *newBroadcastClientConfigTest(port)
builderFeedListener.nodeConfig.Feed.Input.Timeout = broadcastclient.DefaultConfig.Timeout
cleanupFeedListener := builderFeedListener.Build(t)
nodeConfig := arbnode.ConfigDefaultL1NonSequencerTest()
nodeConfig.Feed.Input = *newBroadcastClientConfigTest(port)
nodeConfig.Feed.Input.Timeout = broadcastclient.DefaultConfig.Timeout
feedListener, cleanupFeedListener := builderSeq.Build2ndNode(t, &SecondNodeParams{nodeConfig: nodeConfig, stackConfig: testhelpers.CreateStackConfigForTest(t.TempDir())})

// Send an L2 tx in the background every two seconds to keep the chain moving.
go func() {
Expand Down Expand Up @@ -1376,7 +1375,7 @@ func setupExpressLaneAuction(
time.Sleep(roundTimingInfo.TimeTilNextRound())
t.Logf("Reached the bidding round at %v", time.Now())
time.Sleep(time.Second * 5)
return seqNode, seqClient, seqInfo, proxyAddr, alice, bob, roundDuration, cleanupSeq, builderFeedListener.L2, cleanupFeedListener
return seqNode, seqClient, seqInfo, proxyAddr, alice, bob, roundDuration, cleanupSeq, feedListener, cleanupFeedListener
}

func awaitAuctionResolved(
Expand Down

0 comments on commit d624150

Please sign in to comment.