Skip to content

Commit

Permalink
Fixes challengetests
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoximenes committed Jan 3, 2025
1 parent 2543158 commit 7f61e06
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
6 changes: 5 additions & 1 deletion arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ type Node struct {
Stack *node.Node
ExecutionClient execution.ExecutionClient
ExecutionSequencer execution.ExecutionSequencer
ExecutionRecorder execution.ExecutionRecorder
L1Reader *headerreader.HeaderReader
TxStreamer *TransactionStreamer
DeployInfo *chaininfo.RollupAddresses
Expand Down Expand Up @@ -895,6 +896,7 @@ func getNodeParentChainReaderDisabled(
stack *node.Node,
executionClient execution.ExecutionClient,
executionSequencer execution.ExecutionSequencer,
executionRecorder execution.ExecutionRecorder,
txStreamer *TransactionStreamer,
blobReader daprovider.BlobReader,
broadcastServer *broadcaster.Broadcaster,
Expand All @@ -909,6 +911,7 @@ func getNodeParentChainReaderDisabled(
Stack: stack,
ExecutionClient: executionClient,
ExecutionSequencer: executionSequencer,
ExecutionRecorder: executionRecorder,
L1Reader: nil,
TxStreamer: txStreamer,
DeployInfo: nil,
Expand Down Expand Up @@ -996,7 +999,7 @@ func createNodeImpl(
}

if !config.ParentChainReader.Enable {
return getNodeParentChainReaderDisabled(ctx, arbDb, stack, executionClient, executionSequencer, txStreamer, blobReader, broadcastServer, broadcastClients, coordinator, maintenanceRunner, syncMonitor, configFetcher), nil
return getNodeParentChainReaderDisabled(ctx, arbDb, stack, executionClient, executionSequencer, executionRecorder, txStreamer, blobReader, broadcastServer, broadcastClients, coordinator, maintenanceRunner, syncMonitor, configFetcher), nil
}

delayedBridge, sequencerInbox, err := getDelayedBridgeAndSequencerInbox(deployInfo, l1client)
Expand Down Expand Up @@ -1044,6 +1047,7 @@ func createNodeImpl(
Stack: stack,
ExecutionClient: executionClient,
ExecutionSequencer: executionSequencer,
ExecutionRecorder: executionRecorder,
L1Reader: l1Reader,
TxStreamer: txStreamer,
DeployInfo: deployInfo,
Expand Down
20 changes: 10 additions & 10 deletions system_tests/bold_challenge_protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ func testChallengeProtocolBOLD(t *testing.T, spawnerOpts ...server_arb.SpawnerOp
)
defer l2nodeB.StopAndWait()

genesisA, err := l2nodeA.Execution.ResultAtPos(0).Await(ctx)
genesisA, err := l2nodeA.ExecutionClient.ResultAtPos(0).Await(ctx)
Require(t, err)
genesisB, err := l2nodeB.Execution.ResultAtPos(0).Await(ctx)
genesisB, err := l2nodeB.ExecutionClient.ResultAtPos(0).Await(ctx)
Require(t, err)
if genesisA.BlockHash != genesisB.BlockHash {
Fatal(t, "genesis blocks mismatch between nodes")
Expand All @@ -160,7 +160,7 @@ func testChallengeProtocolBOLD(t *testing.T, spawnerOpts ...server_arb.SpawnerOp
l2nodeA.InboxReader,
l2nodeA.InboxTracker,
l2nodeA.TxStreamer,
l2nodeA.Execution,
l2nodeA.ExecutionRecorder,
l2nodeA.ArbDB,
nil,
StaticFetcherFrom(t, &blockValidatorConfig),
Expand All @@ -175,7 +175,7 @@ func testChallengeProtocolBOLD(t *testing.T, spawnerOpts ...server_arb.SpawnerOp
l2nodeB.InboxReader,
l2nodeB.InboxTracker,
l2nodeB.TxStreamer,
l2nodeB.Execution,
l2nodeB.ExecutionRecorder,
l2nodeB.ArbDB,
nil,
StaticFetcherFrom(t, &blockValidatorConfig),
Expand Down Expand Up @@ -331,11 +331,11 @@ func testChallengeProtocolBOLD(t *testing.T, spawnerOpts ...server_arb.SpawnerOp
t.Logf("Node B batch count %d, msgs %d", bcB, msgB)

// Wait for both nodes' chains to catch up.
nodeAExec, ok := l2nodeA.Execution.(*gethexec.ExecutionNode)
nodeAExec, ok := l2nodeA.ExecutionClient.(*gethexec.ExecutionNode)
if !ok {
Fatal(t, "not geth execution node")
}
nodeBExec, ok := l2nodeB.Execution.(*gethexec.ExecutionNode)
nodeBExec, ok := l2nodeB.ExecutionClient.(*gethexec.ExecutionNode)
if !ok {
Fatal(t, "not geth execution node")
}
Expand Down Expand Up @@ -616,8 +616,8 @@ func createTestNodeOnL1ForBoldProtocol(

parentChainId, err := l1client.ChainID(ctx)
Require(t, err)
currentNode, err = arbnode.CreateNode(
ctx, l2stack, execNode, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain.Config(), l1client,
currentNode, err = arbnode.CreateNodeFullExecutionClient(
ctx, l2stack, execNode, execNode, execNode, execNode, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain.Config(), l1client,
addresses, sequencerTxOptsPtr, sequencerTxOptsPtr, dataSigner, fatalErrChan, parentChainId,
nil, // Blob reader.
)
Expand Down Expand Up @@ -777,7 +777,7 @@ func create2ndNodeWithConfigForBoldProtocol(
fatalErrChan := make(chan error, 10)
l1rpcClient := l1stack.Attach()
l1client := ethclient.NewClient(l1rpcClient)
firstExec, ok := first.Execution.(*gethexec.ExecutionNode)
firstExec, ok := first.ExecutionClient.(*gethexec.ExecutionNode)
if !ok {
Fatal(t, "not geth execution node")
}
Expand Down Expand Up @@ -826,7 +826,7 @@ func create2ndNodeWithConfigForBoldProtocol(
Require(t, err)
l1ChainId, err := l1client.ChainID(ctx)
Require(t, err)
l2node, err := arbnode.CreateNode(ctx, l2stack, execNode, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain.Config(), l1client, addresses, &txOpts, &txOpts, dataSigner, fatalErrChan, l1ChainId, nil /* blob reader */)
l2node, err := arbnode.CreateNodeFullExecutionClient(ctx, l2stack, execNode, execNode, execNode, execNode, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain.Config(), l1client, addresses, &txOpts, &txOpts, dataSigner, fatalErrChan, l1ChainId, nil /* blob reader */)
Require(t, err)

l2client := ClientForStack(t, l2stack)
Expand Down
2 changes: 1 addition & 1 deletion system_tests/bold_state_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func setupBoldStateProvider(t *testing.T, ctx context.Context, blockChallengeHei
l2node.InboxReader,
l2node.InboxTracker,
l2node.TxStreamer,
l2node.Execution,
l2node.ExecutionRecorder,
l2node.ArbDB,
nil,
StaticFetcherFrom(t, &blockValidatorConfig),
Expand Down
4 changes: 2 additions & 2 deletions system_tests/overflow_assertions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestOverflowAssertions(t *testing.T) {
l2node.InboxReader,
l2node.InboxTracker,
l2node.TxStreamer,
l2node.Execution,
l2node.ExecutionRecorder,
l2node.ArbDB,
nil,
StaticFetcherFrom(t, &blockValidatorConfig),
Expand Down Expand Up @@ -173,7 +173,7 @@ func TestOverflowAssertions(t *testing.T) {
t.Logf("Node batch count %d, msgs %d", bc, msgs)

// Wait for the node to catch up.
nodeExec, ok := l2node.Execution.(*gethexec.ExecutionNode)
nodeExec, ok := l2node.ExecutionClient.(*gethexec.ExecutionNode)
if !ok {
Fatal(t, "not geth execution node")
}
Expand Down

0 comments on commit 7f61e06

Please sign in to comment.