Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amsanghi committed Sep 21, 2023
1 parent 31fd346 commit 5b46084
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion contracts
42 changes: 27 additions & 15 deletions system_tests/assertion_on_large_number_of_blocks_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -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()

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

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

Expand Down
2 changes: 1 addition & 1 deletion util/headerreader/header_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit 5b46084

Please sign in to comment.