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.
This commit is contained in:
Mac L 2022-06-03 03:22:55 +00:00
parent 55ac423872
commit 20071975c7
3 changed files with 7 additions and 90 deletions

View File

@ -40,77 +40,3 @@ pub fn geth_genesis_json() -> Value {
"baseFeePerGas":"0x7" "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"
}
}
})
}

View File

@ -1,13 +1,12 @@
use crate::build_utils; use crate::build_utils;
use crate::execution_engine::GenericExecutionEngine; use crate::execution_engine::GenericExecutionEngine;
use crate::genesis_json::nethermind_genesis_json; use std::env;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Child, Command, Output}; use std::process::{Child, Command, Output};
use std::{env, fs::File};
use tempfile::TempDir; use tempfile::TempDir;
use unused_port::unused_tcp_port; 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"; const NETHERMIND_REPO_URL: &str = "https://github.com/NethermindEth/nethermind";
fn build_result(repo_dir: &Path) -> Output { fn build_result(repo_dir: &Path) -> Output {
@ -71,14 +70,7 @@ impl NethermindEngine {
impl GenericExecutionEngine for NethermindEngine { impl GenericExecutionEngine for NethermindEngine {
fn init_datadir() -> TempDir { fn init_datadir() -> TempDir {
let datadir = TempDir::new().unwrap(); 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
} }
fn start_client( fn start_client(
@ -88,15 +80,14 @@ impl GenericExecutionEngine for NethermindEngine {
jwt_secret_path: PathBuf, jwt_secret_path: PathBuf,
) -> Child { ) -> Child {
let network_port = unused_tcp_port().unwrap(); let network_port = unused_tcp_port().unwrap();
let genesis_json_path = datadir.path().join("genesis.json");
Command::new(Self::binary_path()) Command::new(Self::binary_path())
.arg("--datadir") .arg("--datadir")
.arg(datadir.path().to_str().unwrap()) .arg(datadir.path().to_str().unwrap())
.arg("--config") .arg("--config")
.arg("themerge_kiln_testvectors") .arg("kiln")
.arg("--Init.ChainSpecPath") .arg("--Merge.TerminalTotalDifficulty")
.arg(genesis_json_path.to_str().unwrap()) .arg("0")
.arg("--JsonRpc.AdditionalRpcUrls") .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(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") .arg("--JsonRpc.EnabledModules")

View File

@ -9,7 +9,7 @@ use types::{
MainnetEthSpec, Slot, Uint256, 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<E> { struct ExecutionPair<E> {
/// The Lighthouse `ExecutionLayer` struct, connected to the `execution_engine` via HTTP. /// The Lighthouse `ExecutionLayer` struct, connected to the `execution_engine` via HTTP.