From 20071975c7539a76d4abc509f64334d1604019db Mon Sep 17 00:00:00 2001 From: Mac L Date: Fri, 3 Jun 2022 03:22:55 +0000 Subject: [PATCH] Switch Nethermind integration tests to use `master` branch (#3228) ## Issue Addressed N/A ## Proposed Changes Preemptively switch Nethermind integration tests to use the `master` branch along with the baked in `kiln` config. ## Additional Info There have been some spurious timeouts across CI so this also increases the timeout to 20s. --- .../src/genesis_json.rs | 74 ------------------- .../src/nethermind.rs | 21 ++---- .../src/test_rig.rs | 2 +- 3 files changed, 7 insertions(+), 90 deletions(-) diff --git a/testing/execution_engine_integration/src/genesis_json.rs b/testing/execution_engine_integration/src/genesis_json.rs index c0b94e22e..87fdaec14 100644 --- a/testing/execution_engine_integration/src/genesis_json.rs +++ b/testing/execution_engine_integration/src/genesis_json.rs @@ -40,77 +40,3 @@ pub fn geth_genesis_json() -> Value { "baseFeePerGas":"0x7" }) } - -/// Sourced from: -/// -/// https://github.com/NethermindEth/nethermind/blob/kiln/src/Nethermind/Chains/themerge_kiln_testvectors.json -pub fn nethermind_genesis_json() -> Value { - json!({ - "name": "TheMerge_Devnet", - "engine": { - "clique": { - "params": { - "period": 5, - "epoch": 30000 - } - } - }, - "params": { - "gasLimitBoundDivisor": "0x400", - "accountStartNonce": "0x0", - "maximumExtraDataSize": "0x20", - "minGasLimit": "0x1388", - "networkID": 1, - "eip150Transition": "0x0", - "eip155Transition": "0x0", - "eip158Transition": "0x0", - "eip160Transition": "0x0", - "eip161abcTransition": "0x0", - "eip161dTransition": "0x0", - "eip140Transition": "0x0", - "eip211Transition": "0x0", - "eip214Transition": "0x0", - "eip658Transition": "0x0", - "eip145Transition": "0x0", - "eip1014Transition": "0x0", - "eip1052Transition": "0x0", - "eip1283Transition": "0x0", - "eip1283DisableTransition": "0x0", - "eip152Transition": "0x0", - "eip1108Transition": "0x0", - "eip1344Transition": "0x0", - "eip1884Transition": "0x0", - "eip2028Transition": "0x0", - "eip2200Transition": "0x0", - "eip2565Transition": "0x0", - "eip2929Transition": "0x0", - "eip2930Transition": "0x0", - "eip1559Transition": "0x0", - "eip3198Transition": "0x0", - "eip3529Transition": "0x0", - "eip3541Transition": "0x0" - }, - "genesis": { - "seal": { - "ethereum": { - "nonce": "0x42", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "difficulty": "0x400000000", - "author": "0x0000000000000000000000000000000000000000", - "timestamp": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "extraData":"0x0000000000000000000000000000000000000000000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "gasLimit":"0x1C9C380", - "author": "0x0000000000000000000000000000000000000000", - "parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000", - "baseFeePerGas":"0x7" - }, - "accounts": { - "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": { - "balance":"0x6d6172697573766477000000" - } - } - }) -} diff --git a/testing/execution_engine_integration/src/nethermind.rs b/testing/execution_engine_integration/src/nethermind.rs index 833409c69..7fb07c9e5 100644 --- a/testing/execution_engine_integration/src/nethermind.rs +++ b/testing/execution_engine_integration/src/nethermind.rs @@ -1,13 +1,12 @@ use crate::build_utils; use crate::execution_engine::GenericExecutionEngine; -use crate::genesis_json::nethermind_genesis_json; +use std::env; use std::path::{Path, PathBuf}; use std::process::{Child, Command, Output}; -use std::{env, fs::File}; use tempfile::TempDir; use unused_port::unused_tcp_port; -const NETHERMIND_BRANCH: &str = "kiln"; +const NETHERMIND_BRANCH: &str = "master"; const NETHERMIND_REPO_URL: &str = "https://github.com/NethermindEth/nethermind"; fn build_result(repo_dir: &Path) -> Output { @@ -71,14 +70,7 @@ impl NethermindEngine { impl GenericExecutionEngine for NethermindEngine { fn init_datadir() -> TempDir { - let datadir = TempDir::new().unwrap(); - - let genesis_json_path = datadir.path().join("genesis.json"); - let mut file = File::create(&genesis_json_path).unwrap(); - let json = nethermind_genesis_json(); - serde_json::to_writer(&mut file, &json).unwrap(); - - datadir + TempDir::new().unwrap() } fn start_client( @@ -88,15 +80,14 @@ impl GenericExecutionEngine for NethermindEngine { jwt_secret_path: PathBuf, ) -> Child { let network_port = unused_tcp_port().unwrap(); - let genesis_json_path = datadir.path().join("genesis.json"); Command::new(Self::binary_path()) .arg("--datadir") .arg(datadir.path().to_str().unwrap()) .arg("--config") - .arg("themerge_kiln_testvectors") - .arg("--Init.ChainSpecPath") - .arg(genesis_json_path.to_str().unwrap()) + .arg("kiln") + .arg("--Merge.TerminalTotalDifficulty") + .arg("0") .arg("--JsonRpc.AdditionalRpcUrls") .arg(format!("http://localhost:{}|http;ws|net;eth;subscribe;engine;web3;client|no-auth,http://localhost:{}|http;ws|net;eth;subscribe;engine;web3;client", http_port, http_auth_port)) .arg("--JsonRpc.EnabledModules") diff --git a/testing/execution_engine_integration/src/test_rig.rs b/testing/execution_engine_integration/src/test_rig.rs index 79661354d..77993df2b 100644 --- a/testing/execution_engine_integration/src/test_rig.rs +++ b/testing/execution_engine_integration/src/test_rig.rs @@ -9,7 +9,7 @@ use types::{ MainnetEthSpec, Slot, Uint256, }; -const EXECUTION_ENGINE_START_TIMEOUT: Duration = Duration::from_secs(10); +const EXECUTION_ENGINE_START_TIMEOUT: Duration = Duration::from_secs(20); struct ExecutionPair { /// The Lighthouse `ExecutionLayer` struct, connected to the `execution_engine` via HTTP.