Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
amsanghi committed Oct 3, 2023
1 parent 18a8fc3 commit 4505cd3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions system_tests/assertion_on_large_number_of_blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/offchainlabs/nitro/arbnode"
"github.com/offchainlabs/nitro/arbstate"
"github.com/offchainlabs/nitro/cmd/chaininfo"
"github.com/offchainlabs/nitro/solgen/go/bridgegen"
"github.com/offchainlabs/nitro/staker"
"github.com/offchainlabs/nitro/validator/server_common"
"github.com/offchainlabs/nitro/validator/valnode"
Expand Down Expand Up @@ -91,10 +92,13 @@ func TestAssertionOnLargeNumberOfBlocks(t *testing.T) {
"test",
time.Second,
)
assertion, err := poster.PostAssertion(ctx)
Require(t, err)
setupEndTime := time.Now().Unix()
print("Time taken for setup:")
print(setupEndTime - setupStartTime)
assertion, err := poster.PostAssertion(ctx)

assertion, err = poster.PostAssertion(ctx)
Require(t, err)
assertionPostingEndTime := time.Now().Unix()
print("Time taken to post assertion:")
Expand Down Expand Up @@ -226,11 +230,7 @@ func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, prot
l1Info.SetContract("Inbox", rollupAddresses.Inbox)
initMessage := getInitMessage(ctx, t, l1Backend, rollupAddresses)

bridgeAddr, seqInbox, seqInboxAddr := setupSequencerInboxStub(ctx, t, l1Info, l1Backend, chainConfig)

l2Info, l2Stack, l2ChainDb, l2ArbDb, l2Blockchain := createL2BlockChainWithStackConfig(t, nil, "", chainConfig, initMessage, nil, nil)
rollupAddresses.Bridge = bridgeAddr
rollupAddresses.SequencerInbox = seqInboxAddr

fatalErrChan := make(chan error, 10)
l2Node, err := arbnode.CreateNode(ctx, l2Stack, l2ChainDb, l2ArbDb, NewFetcherFromConfig(conf), l2Blockchain, l1Backend, rollupAddresses, nil, nil, nil, fatalErrChan)
Expand All @@ -243,7 +243,7 @@ func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, prot
rollup, err := rollupgen.NewRollupAdminLogic(l2Node.DeployInfo.Rollup, l1Backend)
Require(t, err)
deployAuth := l1Info.GetDefaultTransactOpts("RollupOwner", ctx)
_, err = rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(1))
_, err = rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(0))
Require(t, err)

emptyArray, err := rlp.EncodeToBytes([]uint8{0})
Expand All @@ -259,17 +259,19 @@ 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.SetIsBatchPosterWithoutOwner(&deployAuth, simpleAddress, true)
seqInbox, err := bridgegen.NewSequencerInbox(rollupAddresses.SequencerInbox, l1Backend)
Require(t, err)
tx, err = seqInbox.SetIsBatchPoster(&deployAuth, simpleAddress, true)
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))
tx, err = simple.PostManyBatches(&txOpts, rollupAddresses.SequencerInbox, batch, big.NewInt(300))
Require(t, err)
receipt, err = EnsureTxSucceeded(ctx, l1Backend, tx)
Require(t, err)

nodeSeqInbox, err := arbnode.NewSequencerInbox(l1Backend, seqInboxAddr, 0)
nodeSeqInbox, err := arbnode.NewSequencerInbox(l1Backend, rollupAddresses.SequencerInbox, 0)
Require(t, err)
batches, err := nodeSeqInbox.LookupBatchesInRange(ctx, receipt.BlockNumber, receipt.BlockNumber)
Require(t, err)
Expand Down

0 comments on commit 4505cd3

Please sign in to comment.