From c6b5153886287c7a1b6dbd2d2fb80c25464fad89 Mon Sep 17 00:00:00 2001 From: Tristan Wilson Date: Tue, 3 Oct 2023 18:59:23 -0700 Subject: [PATCH] Use SimulatedBeacon for test L1s v1.12.1 geth changes the default ChainConfig returned with DeveloperGenesisBlock from AllCliqueProtocolChanges to AllDevChainProtocolChanges. Since the dev chain config is not set to clique mode and is set as post-TTD with TTD=0, there needs to be a non-ethhash based consensus engine running in order for blocks to be produced. See the upstream geth change here: https://github.com/ethereum/go-ethereum/pull/27327 This commit copies the initailization code for how geth is started up in dev mode with the simulated beacon node to our test L1 setup code. It also enables FullSync mode on the L1, since otherwise SimluatedBeacon.sealBlock would fail when calling the ConsensusAPI.ForkChoiceUpdatedV2 as it would still be syncing if it was in SnapSync mode. UseMergeFinality was also disabled on the TestDelayedSequencerConfig since the SimulatedBeacon seems to have different finalization behavior. --- arbnode/delayed_sequencer.go | 2 +- go-ethereum | 2 +- system_tests/common_test.go | 9 +++++++++ system_tests/retryable_test.go | 2 -- system_tests/wrap_transaction_test.go | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arbnode/delayed_sequencer.go b/arbnode/delayed_sequencer.go index aa6d43785e..39cdebf2a3 100644 --- a/arbnode/delayed_sequencer.go +++ b/arbnode/delayed_sequencer.go @@ -60,7 +60,7 @@ var TestDelayedSequencerConfig = DelayedSequencerConfig{ Enable: true, FinalizeDistance: 20, RequireFullFinality: false, - UseMergeFinality: true, + UseMergeFinality: false, } func NewDelayedSequencer(l1Reader *headerreader.HeaderReader, reader *InboxReader, exec *execution.ExecutionEngine, coordinator *SeqCoordinator, config DelayedSequencerConfigFetcher) (*DelayedSequencer, error) { diff --git a/go-ethereum b/go-ethereum index 89f53b035d..90dbc8edbe 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 89f53b035d7a8b9b1ff8599958bf0c55efcdf718 +Subproject commit 90dbc8edbe96aeb0c5c372cc7289373ee66d3351 diff --git a/system_tests/common_test.go b/system_tests/common_test.go index c4ee904fd8..6cc032c9d9 100644 --- a/system_tests/common_test.go +++ b/system_tests/common_test.go @@ -37,6 +37,8 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/catalyst" + "github.com/ethereum/go-ethereum/eth/downloader" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/ethclient" @@ -412,9 +414,16 @@ func createTestL1BlockChainWithConfig(t *testing.T, l1info info, stackConfig *no l1Genesis.BaseFee = big.NewInt(50 * params.GWei) nodeConf.Genesis = l1Genesis nodeConf.Miner.Etherbase = l1info.GetAddress("Faucet") + nodeConf.SyncMode = downloader.FullSync l1backend, err := eth.New(stack, &nodeConf) Require(t, err) + + simBeacon, err := catalyst.NewSimulatedBeacon(0, l1backend) + Require(t, err) + catalyst.RegisterSimulatedBeaconAPIs(stack, simBeacon) + stack.RegisterLifecycle(simBeacon) + tempKeyStore := keystore.NewPlaintextKeyStore(t.TempDir()) faucetAccount, err := tempKeyStore.ImportECDSA(l1info.Accounts["Faucet"].PrivateKey, "passphrase") Require(t, err) diff --git a/system_tests/retryable_test.go b/system_tests/retryable_test.go index 63876f1f46..b1dd32d1dc 100644 --- a/system_tests/retryable_test.go +++ b/system_tests/retryable_test.go @@ -15,7 +15,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/arbos" @@ -30,7 +29,6 @@ import ( "github.com/offchainlabs/nitro/solgen/go/precompilesgen" "github.com/offchainlabs/nitro/util/arbmath" "github.com/offchainlabs/nitro/util/colors" - "github.com/offchainlabs/nitro/util/testhelpers" ) func retryableSetup(t *testing.T) ( diff --git a/system_tests/wrap_transaction_test.go b/system_tests/wrap_transaction_test.go index 1eae2396b7..e4ce6a4bb8 100644 --- a/system_tests/wrap_transaction_test.go +++ b/system_tests/wrap_transaction_test.go @@ -79,7 +79,7 @@ func EnsureTxSucceeded(ctx context.Context, client arbutil.L1Interface, tx *type func EnsureTxSucceededWithTimeout(ctx context.Context, client arbutil.L1Interface, tx *types.Transaction, timeout time.Duration) (*types.Receipt, error) { txRes, err := WaitForTx(ctx, client, tx.Hash(), timeout) if err != nil { - return nil, fmt.Errorf("waitFoxTx got: %w", err) + return nil, fmt.Errorf("waitFoxTx (tx=%s) got: %w", tx.Hash().Hex(), err) } return txRes, arbutil.DetailTxError(ctx, client, tx, txRes) }