Implement production geth using kurtosis

This commit is contained in:
Omar Abdulla
2025-09-26 18:15:11 +03:00
parent 5c30e8a5bf
commit 566dd06d9a
7 changed files with 544 additions and 579 deletions
Generated
+154
View File
@@ -87,6 +87,7 @@ dependencies = [
"alloy-transport",
"alloy-transport-http",
"alloy-transport-ipc",
"alloy-transport-ws",
]
[[package]]
@@ -378,6 +379,7 @@ dependencies = [
"alloy-transport",
"alloy-transport-http",
"alloy-transport-ipc",
"alloy-transport-ws",
"async-stream",
"async-trait",
"auto_impl",
@@ -454,6 +456,7 @@ dependencies = [
"alloy-transport",
"alloy-transport-http",
"alloy-transport-ipc",
"alloy-transport-ws",
"futures",
"pin-project",
"reqwest",
@@ -709,6 +712,24 @@ dependencies = [
"tracing",
]
[[package]]
name = "alloy-transport-ws"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e915e1250dc129ad48d264573ccd08e4716fdda564a772fd217875b8459aff9"
dependencies = [
"alloy-pubsub",
"alloy-transport",
"futures",
"http",
"rustls",
"serde_json",
"tokio",
"tokio-tungstenite",
"tracing",
"ws_stream_wasm",
]
[[package]]
name = "alloy-trie"
version = "0.9.0"
@@ -1373,6 +1394,17 @@ dependencies = [
"syn 2.0.101",
]
[[package]]
name = "async_io_stream"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c"
dependencies = [
"futures",
"pharos",
"rustc_version 0.4.1",
]
[[package]]
name = "atomic-waker"
version = "1.1.2"
@@ -2021,6 +2053,12 @@ dependencies = [
"parking_lot_core",
]
[[package]]
name = "data-encoding"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476"
[[package]]
name = "der"
version = "0.7.10"
@@ -3956,6 +3994,16 @@ dependencies = [
"ucd-trie",
]
[[package]]
name = "pharos"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414"
dependencies = [
"futures",
"rustc_version 0.4.1",
]
[[package]]
name = "pin-project"
version = "1.1.10"
@@ -4577,6 +4625,8 @@ dependencies = [
"revive-dt-node-interaction",
"serde",
"serde_json",
"serde_with",
"serde_yaml_ng",
"sp-core",
"sp-runtime",
"temp-dir",
@@ -4768,6 +4818,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321"
dependencies = [
"once_cell",
"ring",
"rustls-pki-types",
"rustls-webpki",
"subtle",
@@ -5055,6 +5106,12 @@ dependencies = [
"pest",
]
[[package]]
name = "send_wrapper"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73"
[[package]]
name = "serde"
version = "1.0.219"
@@ -5171,6 +5228,19 @@ dependencies = [
"syn 2.0.101",
]
[[package]]
name = "serde_yaml_ng"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b4db627b98b36d4203a7b458cf3573730f2bb591b28871d916dfa9efabfd41f"
dependencies = [
"indexmap 2.10.0",
"itoa",
"ryu",
"serde",
"unsafe-libyaml",
]
[[package]]
name = "serdect"
version = "0.2.0"
@@ -6067,6 +6137,22 @@ dependencies = [
"tokio-util",
]
[[package]]
name = "tokio-tungstenite"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084"
dependencies = [
"futures-util",
"log",
"rustls",
"rustls-pki-types",
"tokio",
"tokio-rustls",
"tungstenite",
"webpki-roots 0.26.11",
]
[[package]]
name = "tokio-util"
version = "0.7.15"
@@ -6281,6 +6367,25 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "tungstenite"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13"
dependencies = [
"bytes",
"data-encoding",
"http",
"httparse",
"log",
"rand 0.9.2",
"rustls",
"rustls-pki-types",
"sha1",
"thiserror 2.0.12",
"utf-8",
]
[[package]]
name = "tuplex"
version = "0.1.2"
@@ -6368,6 +6473,12 @@ version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "unsafe-libyaml"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
[[package]]
name = "untrusted"
version = "0.9.0"
@@ -6385,6 +6496,12 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "utf-8"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
[[package]]
name = "utf8_iter"
version = "1.0.4"
@@ -6639,6 +6756,24 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "webpki-roots"
version = "0.26.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
dependencies = [
"webpki-roots 1.0.2",
]
[[package]]
name = "webpki-roots"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2"
dependencies = [
"rustls-pki-types",
]
[[package]]
name = "widestring"
version = "1.2.0"
@@ -6977,6 +7112,25 @@ version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
[[package]]
name = "ws_stream_wasm"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c173014acad22e83f16403ee360115b38846fe754e735c5d9d3803fe70c6abc"
dependencies = [
"async_io_stream",
"futures",
"js-sys",
"log",
"pharos",
"rustc_version 0.4.1",
"send_wrapper",
"thiserror 2.0.12",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
]
[[package]]
name = "wyz"
version = "0.5.1"
+3 -1
View File
@@ -45,7 +45,8 @@ serde_json = { version = "1.0", default-features = false, features = [
"std",
"unbounded_depth",
] }
serde_with = { version = "3.14.0" }
serde_with = { version = "3.14.0", features = ["hex"] }
serde_yaml_ng = { version = "0.10.0" }
sha2 = { version = "0.10.9" }
sp-core = "36.1.0"
sp-runtime = "41.1.0"
@@ -80,6 +81,7 @@ features = [
"json-abi",
"providers",
"provider-ipc",
"provider-ws",
"provider-debug-api",
"reqwest",
"rpc-types",
+1
View File
@@ -44,6 +44,7 @@ This section describes the required dependencies that this framework requires to
- ETH-RPC - All communication with Kitchensink is done through the ETH RPC.
- Solc - This is actually a transitive dependency, while this tool doesn't require solc as it downloads the versions that it requires, resolc requires that Solc is installed and available in the path.
- Resolc - This is required to compile the contracts to PolkaVM bytecode.
- Kurtosis - The Kurtosis CLI tool is required for the production Ethereum mainnet-like node configuration with Geth as the execution layer and lighthouse as the consensus layer. Kurtosis also requires docker to be installed since it runs everything inside of docker containers.
All of the above need to be installed and available in the path in order for the tool to work.
+13 -23
View File
@@ -79,8 +79,8 @@ impl AsRef<GethConfiguration> for Context {
}
}
impl AsRef<LighthouseConfiguration> for Context {
fn as_ref(&self) -> &LighthouseConfiguration {
impl AsRef<KurtosisConfiguration> for Context {
fn as_ref(&self) -> &KurtosisConfiguration {
match self {
Self::ExecuteTests(context) => context.as_ref().as_ref(),
Self::ExportJsonSchema => unreachable!(),
@@ -201,7 +201,7 @@ pub struct TestExecutionContext {
/// Configuration parameters for the lighthouse node.
#[clap(flatten, next_help_heading = "Lighthouse Configuration")]
pub lighthouse_configuration: LighthouseConfiguration,
pub lighthouse_configuration: KurtosisConfiguration,
/// Configuration parameters for the Kitchensink.
#[clap(flatten, next_help_heading = "Kitchensink Configuration")]
@@ -266,8 +266,8 @@ impl AsRef<GethConfiguration> for TestExecutionContext {
}
}
impl AsRef<LighthouseConfiguration> for TestExecutionContext {
fn as_ref(&self) -> &LighthouseConfiguration {
impl AsRef<KurtosisConfiguration> for TestExecutionContext {
fn as_ref(&self) -> &KurtosisConfiguration {
&self.lighthouse_configuration
}
}
@@ -360,28 +360,19 @@ pub struct GethConfiguration {
pub start_timeout_ms: Duration,
}
/// A set of configuration parameters for lighthouse.
/// A set of configuration parameters for kurtosis.
#[derive(Clone, Debug, Parser, Serialize)]
pub struct LighthouseConfiguration {
/// Specifies the path of the lighthouse node to be used by the tool.
pub struct KurtosisConfiguration {
/// Specifies the path of the kurtosis node to be used by the tool.
///
/// If this is not specified, then the tool assumes that it should use the lighthouse binary that's
/// If this is not specified, then the tool assumes that it should use the kurtosis binary that's
/// provided in the user's $PATH.
#[clap(
id = "lighthouse.path",
long = "lighthouse.path",
default_value = "lighthouse"
id = "kurtosis.path",
long = "kurtosis.path",
default_value = "kurtosis"
)]
pub path: PathBuf,
/// The amount of time to wait upon startup before considering that the node timed out.
#[clap(
id = "lighthouse.start-timeout-ms",
long = "lighthouse.start-timeout-ms",
default_value = "30000",
value_parser = parse_duration
)]
pub start_timeout_ms: Duration,
}
/// A set of configuration parameters for Kitchensink.
@@ -508,7 +499,7 @@ pub struct WalletConfiguration {
/// This argument controls which private keys the nodes should have access to and be added to
/// its wallet signers. With a value of N, private keys (0, N] will be added to the signer set
/// of the node.
#[clap(long = "wallet.additional-keys", default_value_t = 100_000)]
#[clap(long = "wallet.additional-keys", default_value_t = 200)]
additional_keys: usize,
/// The wallet object that will be used.
@@ -638,7 +629,6 @@ impl AsRef<Path> for WorkingDirectoryConfiguration {
impl Default for WorkingDirectoryConfiguration {
fn default() -> Self {
TempDir::new()
.map(|tempdir| dbg!(tempdir.dont_delete_on_drop()))
.map(Arc::new)
.map(Self::TemporaryDirectory)
.expect("Failed to create the temporary directory")
+2
View File
@@ -22,6 +22,8 @@ revive-dt-node-interaction = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_with = { workspace = true }
serde_yaml_ng = { workspace = true }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
File diff suppressed because it is too large Load Diff
+14 -2
View File
@@ -68,7 +68,7 @@ impl Process {
command_building_callback(&mut command, stdout_logs_file, stderr_logs_file);
command
};
let child = command
let mut child = command
.spawn()
.context("Failed to spawn the built command")?;
@@ -106,7 +106,7 @@ impl Process {
}
if let Some(stderr_line) = stderr_line.as_ref() {
stderr.push_str(stderr_line);
stdout.push('\n');
stderr.push('\n');
}
let check_result =
@@ -124,6 +124,15 @@ impl Process {
}
}
}
ProcessReadinessWaitBehavior::WaitForCommandToExit => {
if !child
.wait()
.context("Failed waiting for kurtosis run process to finish")?
.success()
{
anyhow::bail!("Failed to initialize kurtosis network",);
}
}
}
Ok(Self {
@@ -151,6 +160,9 @@ pub enum ProcessReadinessWaitBehavior {
/// straight away.
NoStartupWait,
/// Waits for the command to exit.
WaitForCommandToExit,
/// The process does require some amount of wait duration after it's been started.
WaitDuration(Duration),