From 5b46084bb019101c79aadbf9111d279cc194256f Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 21 Sep 2023 23:03:46 +0530 Subject: [PATCH] fix --- contracts | 2 +- ...ssertion_on_large_number_of_blocks_test.go | 42 ++++++++++++------- util/headerreader/header_reader.go | 2 +- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/contracts b/contracts index 8e3d419d71..a5c1e0b77d 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit 8e3d419d71d3bd82e3cdcbe4fb50409958eec35a +Subproject commit a5c1e0b77d6892b23b896fe078a391fc63c45241 diff --git a/system_tests/assertion_on_large_number_of_blocks_test.go b/system_tests/assertion_on_large_number_of_blocks_test.go index 781426f488..434778bae7 100644 --- a/system_tests/assertion_on_large_number_of_blocks_test.go +++ b/system_tests/assertion_on_large_number_of_blocks_test.go @@ -1,6 +1,9 @@ // Copyright 2023, Offchain Labs, Inc. // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE +//go:build assertion_on_large_number_of_batch_test +// +build assertion_on_large_number_of_batch_test + package arbtest import ( @@ -43,6 +46,7 @@ var ( // Helps in testing the feasibility of assertion after the protocol upgrade. func TestAssertionOnLargeNumberOfBlocks(t *testing.T) { + setupStartTime := time.Now().Unix() ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -84,7 +88,13 @@ func TestAssertionOnLargeNumberOfBlocks(t *testing.T) { "test", time.Second, ) + setupEndTime := time.Now().Unix() + print("Time taken for setup:") + print(setupEndTime - setupStartTime) _, err = poster.PostAssertion(ctx) + assertionPostingEndTime := time.Now().Unix() + print("Time taken to post assertion:") + print(assertionPostingEndTime - setupEndTime) Require(t, err) } @@ -170,26 +180,28 @@ func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, prot txOpts := l1Info.GetDefaultTransactOpts("deployer", ctx) simpleAddress, simple := deploySimple(t, ctx, txOpts, l1Backend) - tx, err = seqInbox.SetIsBatchPoster(&deployAuth, simpleAddress, true) + tx, err = seqInbox.SetIsBatchPosterWithoutOwner(&deployAuth, simpleAddress, true) Require(t, err) receipt, err := EnsureTxSucceeded(ctx, l1Backend, tx) Require(t, err) - tx, err = simple.PostManyBatches(&txOpts, seqInboxAddr, batch, big.NewInt(1024)) - Require(t, err) - receipt, err = EnsureTxSucceeded(ctx, l1Backend, tx) - Require(t, err) + for i := 0; i < 3; i++ { + tx, err = simple.PostManyBatches(&txOpts, seqInboxAddr, batch, big.NewInt(300)) + Require(t, err) + receipt, err = EnsureTxSucceeded(ctx, l1Backend, tx) + Require(t, err) - nodeSeqInbox, err := arbnode.NewSequencerInbox(l1Backend, seqInboxAddr, 0) - Require(t, err) - batches, err := nodeSeqInbox.LookupBatchesInRange(ctx, receipt.BlockNumber, receipt.BlockNumber) - Require(t, err) - if len(batches) == 0 { - Fatal(t, "batch not found after AddSequencerL2BatchFromOrigin") + nodeSeqInbox, err := arbnode.NewSequencerInbox(l1Backend, seqInboxAddr, 0) + Require(t, err) + batches, err := nodeSeqInbox.LookupBatchesInRange(ctx, receipt.BlockNumber, receipt.BlockNumber) + Require(t, err) + if len(batches) != 300 { + Fatal(t, "300 batch not found after PostManyBatches") + } + err = l2Node.InboxTracker.AddSequencerBatches(ctx, l1Backend, batches) + Require(t, err) + _, err = l2Node.InboxTracker.GetBatchMetadata(0) + Require(t, err, "failed to get batch metadata after adding batch:") } - err = l2Node.InboxTracker.AddSequencerBatches(ctx, l1Backend, batches) - Require(t, err) - _, err = l2Node.InboxTracker.GetBatchMetadata(0) - Require(t, err, "failed to get batch metadata after adding batch:") return l2Node, assertionChain } diff --git a/util/headerreader/header_reader.go b/util/headerreader/header_reader.go index befd54ace3..78d95a5a50 100644 --- a/util/headerreader/header_reader.go +++ b/util/headerreader/header_reader.go @@ -90,7 +90,7 @@ var TestConfig = Config{ PollOnly: false, PollInterval: time.Millisecond * 10, TxTimeout: time.Second * 5, - OldHeaderTimeout: 5 * time.Minute, + OldHeaderTimeout: 30 * time.Minute, UseFinalityData: false, }