From 7f61e06aad78254a49a4444a119ec1eff0fccd1e Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Fri, 3 Jan 2025 10:34:55 -0300 Subject: [PATCH] Fixes challengetests --- arbnode/node.go | 6 +++++- system_tests/bold_challenge_protocol_test.go | 20 ++++++++++---------- system_tests/bold_state_provider_test.go | 2 +- system_tests/overflow_assertions_test.go | 4 ++-- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/arbnode/node.go b/arbnode/node.go index 36fc7eb595..1128f6bad2 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -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 @@ -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, @@ -909,6 +911,7 @@ func getNodeParentChainReaderDisabled( Stack: stack, ExecutionClient: executionClient, ExecutionSequencer: executionSequencer, + ExecutionRecorder: executionRecorder, L1Reader: nil, TxStreamer: txStreamer, DeployInfo: nil, @@ -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) @@ -1044,6 +1047,7 @@ func createNodeImpl( Stack: stack, ExecutionClient: executionClient, ExecutionSequencer: executionSequencer, + ExecutionRecorder: executionRecorder, L1Reader: l1Reader, TxStreamer: txStreamer, DeployInfo: deployInfo, diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index fe49999bdd..9a8bdec4a4 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -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") @@ -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), @@ -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), @@ -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") } @@ -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. ) @@ -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") } @@ -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) diff --git a/system_tests/bold_state_provider_test.go b/system_tests/bold_state_provider_test.go index 0ecce5ba64..cd137ea5b2 100644 --- a/system_tests/bold_state_provider_test.go +++ b/system_tests/bold_state_provider_test.go @@ -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), diff --git a/system_tests/overflow_assertions_test.go b/system_tests/overflow_assertions_test.go index c024a43070..6bc7faa9ca 100644 --- a/system_tests/overflow_assertions_test.go +++ b/system_tests/overflow_assertions_test.go @@ -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), @@ -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") }