diff --git a/.cargo-deny.toml b/.cargo-deny.toml index 3d760c1..db4dccf 100644 --- a/.cargo-deny.toml +++ b/.cargo-deny.toml @@ -31,7 +31,6 @@ allow = [ "BSD-2-Clause", "BSD-3-Clause", "BSL-1.0", - "BlueOak-1.0.0", "CC0-1.0", "CDLA-Permissive-2.0", "ISC", diff --git a/Cargo.lock b/Cargo.lock index d364e53..1a8ef54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,56 +54,12 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - [[package]] name = "anstyle" version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys 0.61.2", -] - [[package]] name = "anyhow" version = "1.0.100" @@ -877,22 +833,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "broadcast-service" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "derivative", - "futures", - "nomos-core", - "overwatch", - "serde", - "tokio", - "tokio-stream", - "tracing", -] - [[package]] name = "bs58" version = "0.5.1" @@ -918,12 +858,6 @@ version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" -[[package]] -name = "bytecount" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" - [[package]] name = "bytemuck" version = "1.24.0" @@ -1012,22 +946,22 @@ dependencies = [ ] [[package]] -name = "cfgsync" +name = "cfgsync_tf" version = "0.1.0" dependencies = [ "anyhow", "axum", "clap", - "groth16", "hex", - "key-management-system-service", - "nomos-core", - "nomos-da-network-core", - "nomos-executor", - "nomos-libp2p", - "nomos-node", - "nomos-tracing-service", - "nomos-utils", + "logos-blockchain-core", + "logos-blockchain-da-network-core", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-service", + "logos-blockchain-libp2p", + "logos-blockchain-node", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-tracing-service", + "logos-blockchain-utils", "rand 0.8.5", "reqwest", "serde", @@ -1035,7 +969,6 @@ dependencies = [ "serde_path_to_error", "serde_with", "serde_yaml", - "subnetworks-assignations", "testing-framework-config", "testing-framework-core", "thiserror 2.0.17", @@ -1043,100 +976,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "chain-common" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "nomos-core", - "serde", -] - -[[package]] -name = "chain-leader" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "chain-common", - "chain-service", - "cryptarchia-engine", - "futures", - "key-management-system-keys", - "nomos-blend-service", - "nomos-core", - "nomos-da-sampling", - "nomos-ledger", - "nomos-time", - "nomos-wallet", - "overwatch", - "serde", - "services-utils", - "thiserror 1.0.69", - "tokio", - "tracing", - "tracing-futures", - "tx-service", -] - -[[package]] -name = "chain-network" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "chain-common", - "chain-service", - "cryptarchia-engine", - "cryptarchia-sync", - "futures", - "nomos-core", - "nomos-da-sampling", - "nomos-ledger", - "nomos-network", - "nomos-time", - "overwatch", - "rand 0.8.5", - "serde", - "serde_with", - "services-utils", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", - "tracing-futures", - "tx-service", -] - -[[package]] -name = "chain-service" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "broadcast-service", - "bytes", - "cryptarchia-engine", - "cryptarchia-sync", - "futures", - "groth16", - "nomos-core", - "nomos-ledger", - "nomos-network", - "nomos-storage", - "nomos-utils", - "num-bigint", - "overwatch", - "serde", - "serde_with", - "services-utils", - "strum", - "thiserror 1.0.69", - "tokio", - "tracing", - "tracing-futures", -] - [[package]] name = "chrono" version = "0.4.42" @@ -1181,23 +1020,6 @@ dependencies = [ "inout", ] -[[package]] -name = "circuits-prover" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "circuits-utils", - "tempfile", -] - -[[package]] -name = "circuits-utils" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "dirs", -] - [[package]] name = "clang-sys" version = "1.8.1" @@ -1225,11 +1047,8 @@ version = "4.5.53" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" dependencies = [ - "anstream", "anstyle", "clap_lex", - "strsim", - "terminal_size", ] [[package]] @@ -1263,29 +1082,6 @@ dependencies = [ "owo-colors", ] -[[package]] -name = "colorchoice" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" - -[[package]] -name = "common-http-client" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "broadcast-service", - "futures", - "nomos-core", - "nomos-da-messages", - "nomos-http-api-common", - "reqwest", - "serde", - "serde_json", - "thiserror 1.0.69", - "url", -] - [[package]] name = "concurrent-queue" version = "2.5.0" @@ -1295,19 +1091,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "console" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e45a4a8926227e4197636ba97a9fc9b00477e9f4bd711395687c5f0734bec4" -dependencies = [ - "encode_unicode", - "libc", - "once_cell", - "unicode-width", - "windows-sys 0.61.2", -] - [[package]] name = "const-hex" version = "1.17.0" @@ -1341,15 +1124,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "convert_case" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -1442,40 +1216,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" -[[package]] -name = "cryptarchia-engine" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "cfg_eval", - "nomos-utils", - "serde", - "serde_with", - "thiserror 1.0.69", - "time", - "tokio", - "tracing", -] - -[[package]] -name = "cryptarchia-sync" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "bytes", - "cryptarchia-engine", - "futures", - "libp2p", - "libp2p-stream", - "nomos-core", - "rand 0.8.5", - "serde", - "serde_with", - "thiserror 1.0.69", - "tokio", - "tracing", -] - [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1509,76 +1249,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "cucumber" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c09939b8de21501b829a3839fa8a01ef6cc226e6bc1f5f163f7104bd5e847d" -dependencies = [ - "anyhow", - "clap", - "console", - "cucumber-codegen", - "cucumber-expressions", - "derive_more", - "either", - "futures", - "gherkin", - "globwalk", - "humantime", - "inventory", - "itertools 0.14.0", - "junit-report", - "linked-hash-map", - "pin-project", - "ref-cast", - "regex", - "sealed", - "smart-default", -] - -[[package]] -name = "cucumber-codegen" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f5afe541b5147a7b986816153ccfd502622bb37789420cfff412685f27c0a95" -dependencies = [ - "cucumber-expressions", - "inflections", - "itertools 0.14.0", - "proc-macro2", - "quote", - "regex", - "syn 2.0.111", - "synthez", -] - -[[package]] -name = "cucumber-expressions" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6401038de3af44fe74e6fccdb8a5b7db7ba418f480c8e9ad584c6f65c05a27a6" -dependencies = [ - "derive_more", - "either", - "nom 8.0.0", - "nom_locate", - "regex", - "regex-syntax", -] - -[[package]] -name = "cucumber_ext" -version = "0.1.0" -dependencies = [ - "cucumber", - "testing-framework-core", - "testing-framework-runner-compose", - "testing-framework-runner-local", - "testing-framework-workflows", - "thiserror 2.0.17", -] - [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -1743,17 +1413,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive-getters" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2c35ab6e03642397cdda1dd58abbc05d418aef8e36297f336d5aba060fe8df" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive_arbitrary" version = "1.4.2" @@ -1765,29 +1424,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "derive_more" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b768e943bed7bf2cab53df09f4bc34bfd217cdb57d971e769874c9a6710618" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d286bfdaf75e988b4a78e013ecd79c581e06399ab53fbacd2d916c2f904f30b" -dependencies = [ - "convert_case 0.10.0", - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.111", - "unicode-xid", -] - [[package]] name = "deunicode" version = "1.6.2" @@ -1980,12 +1616,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "encode_unicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" - [[package]] name = "enum-as-inner" version = "0.6.1" @@ -2055,21 +1685,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "executor-http-client" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "common-http-client", - "futures", - "nomos-core", - "nomos-http-api-common", - "reqwest", - "serde", - "serde_json", - "tracing", -] - [[package]] name = "eyre" version = "0.6.12" @@ -2369,23 +1984,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "gherkin" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70197ce7751bfe8bc828e3a855502d3a869a1e9416b58b10c4bde5cf8a0a3cb3" -dependencies = [ - "heck", - "peg", - "quote", - "serde", - "serde_json", - "syn 2.0.111", - "textwrap", - "thiserror 2.0.17", - "typed-builder", -] - [[package]] name = "gimli" version = "0.32.3" @@ -2454,24 +2052,6 @@ dependencies = [ "spinning_top", ] -[[package]] -name = "groth16" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "ark-bn254 0.4.0", - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-groth16", - "ark-serialize 0.4.2", - "generic-array 1.3.5", - "hex", - "num-bigint", - "serde", - "serde_json", - "thiserror 2.0.17", -] - [[package]] name = "group" version = "0.13.0" @@ -3156,12 +2736,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "inflections" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" - [[package]] name = "inout" version = "0.1.4" @@ -3180,15 +2754,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "inventory" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc61209c082fbeb19919bee74b176221b27223e27b65d781eb91af24eb1fb46e" -dependencies = [ - "rustversion", -] - [[package]] name = "ipconfig" version = "0.3.2" @@ -3217,12 +2782,6 @@ dependencies = [ "serde", ] -[[package]] -name = "is_terminal_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" - [[package]] name = "itertools" version = "0.10.5" @@ -3334,18 +2893,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "junit-report" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c3a3342e6720a82d7d179f380e9841b73a1dd49344e33959fdfe571ce56b55" -dependencies = [ - "derive-getters", - "quick-xml", - "strip-ansi-escapes", - "time", -] - [[package]] name = "k256" version = "0.13.4" @@ -3383,56 +2930,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "key-management-system-keys" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "bytes", - "ed25519-dalek", - "generic-array 1.3.5", - "groth16", - "key-management-system-macros", - "nomos-blend-proofs", - "nomos-utils", - "num-bigint", - "poseidon2", - "rand_core 0.6.4", - "serde", - "subtle", - "thiserror 2.0.17", - "tokio", - "tracing", - "zeroize", - "zksign", -] - -[[package]] -name = "key-management-system-macros" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.111", -] - -[[package]] -name = "key-management-system-service" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "key-management-system-keys", - "log", - "overwatch", - "serde", - "thiserror 2.0.17", - "tokio", - "tracing", -] - [[package]] name = "kube" version = "0.87.2" @@ -3524,41 +3021,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "kzgrs" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "ark-bls12-381", - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-poly 0.4.2", - "ark-poly-commit", - "ark-serialize 0.4.2", - "blake2", - "blst", - "num-bigint", - "num-traits", - "rand 0.8.5", - "thiserror 1.0.69", -] - -[[package]] -name = "kzgrs-backend" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "ark-ff 0.4.2", - "ark-poly 0.4.2", - "ark-serialize 0.4.2", - "blake2", - "itertools 0.12.1", - "kzgrs", - "nomos-core", - "rand 0.8.5", - "serde", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -4028,12 +3490,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.11.0" @@ -4061,6 +3517,1215 @@ version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +[[package]] +name = "logos-blockchain-api-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "bytes", + "futures", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-chain-service", + "logos-blockchain-core", + "logos-blockchain-da-dispersal-service", + "logos-blockchain-da-network-core", + "logos-blockchain-da-network-service", + "logos-blockchain-da-sampling-service", + "logos-blockchain-da-verifier-service", + "logos-blockchain-kzgrs-backend", + "logos-blockchain-libp2p", + "logos-blockchain-network-service", + "logos-blockchain-sdp-service", + "logos-blockchain-storage-service", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-time-service", + "logos-blockchain-tx-service", + "overwatch", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tracing", + "utoipa", + "utoipa-swagger-ui", +] + +[[package]] +name = "logos-blockchain-blend" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "logos-blockchain-blend-crypto", + "logos-blockchain-blend-message", + "logos-blockchain-blend-network", + "logos-blockchain-blend-proofs", + "logos-blockchain-blend-scheduling", +] + +[[package]] +name = "logos-blockchain-blend-crypto" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "blake2", + "logos-blockchain-groth16", + "logos-blockchain-poq", + "logos-blockchain-poseidon2", + "logos-blockchain-utils", + "rs-merkle-tree", + "thiserror 1.0.69", +] + +[[package]] +name = "logos-blockchain-blend-message" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "blake2", + "derivative", + "itertools 0.14.0", + "logos-blockchain-blend-crypto", + "logos-blockchain-blend-proofs", + "logos-blockchain-core", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-utils", + "serde", + "serde-big-array", + "serde_with", + "thiserror 1.0.69", + "tracing", + "zeroize", +] + +[[package]] +name = "logos-blockchain-blend-network" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "either", + "futures", + "futures-timer", + "libp2p", + "logos-blockchain-blend-message", + "logos-blockchain-blend-proofs", + "logos-blockchain-blend-scheduling", + "logos-blockchain-core", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-libp2p", + "tracing", +] + +[[package]] +name = "logos-blockchain-blend-proofs" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "ed25519-dalek", + "generic-array 1.3.5", + "logos-blockchain-blend-crypto", + "logos-blockchain-groth16", + "logos-blockchain-poq", + "num-bigint", + "serde", + "thiserror 1.0.69", +] + +[[package]] +name = "logos-blockchain-blend-scheduling" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "derivative", + "fork_stream", + "futures", + "logos-blockchain-blend-message", + "logos-blockchain-blend-proofs", + "logos-blockchain-core", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-utils", + "multiaddr", + "rand 0.8.5", + "serde", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-blend-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "fork_stream", + "futures", + "libp2p", + "libp2p-stream", + "logos-blockchain-blend", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-chain-service", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-service", + "logos-blockchain-ledger", + "logos-blockchain-libp2p", + "logos-blockchain-network-service", + "logos-blockchain-poq", + "logos-blockchain-sdp-service", + "logos-blockchain-services-utils", + "logos-blockchain-time-service", + "logos-blockchain-utils", + "overwatch", + "rand 0.8.5", + "serde", + "serde_with", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-chain-broadcast-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "derivative", + "futures", + "logos-blockchain-core", + "overwatch", + "serde", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-chain-leader-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "futures", + "logos-blockchain-blend-service", + "logos-blockchain-chain-service", + "logos-blockchain-chain-service-common", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-da-sampling-service", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-ledger", + "logos-blockchain-services-utils", + "logos-blockchain-time-service", + "logos-blockchain-tx-service", + "logos-blockchain-wallet-service", + "overwatch", + "serde", + "thiserror 1.0.69", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "logos-blockchain-chain-network-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "futures", + "logos-blockchain-chain-service", + "logos-blockchain-chain-service-common", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-cryptarchia-sync", + "logos-blockchain-da-sampling-service", + "logos-blockchain-ledger", + "logos-blockchain-network-service", + "logos-blockchain-services-utils", + "logos-blockchain-time-service", + "logos-blockchain-tx-service", + "overwatch", + "rand 0.8.5", + "serde", + "serde_with", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", + "tracing-futures", +] + +[[package]] +name = "logos-blockchain-chain-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "bytes", + "futures", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-cryptarchia-sync", + "logos-blockchain-groth16", + "logos-blockchain-ledger", + "logos-blockchain-network-service", + "logos-blockchain-services-utils", + "logos-blockchain-storage-service", + "logos-blockchain-time-service", + "logos-blockchain-utils", + "num-bigint", + "overwatch", + "serde", + "serde_with", + "strum", + "thiserror 1.0.69", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "logos-blockchain-chain-service-common" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "logos-blockchain-core", + "serde", +] + +[[package]] +name = "logos-blockchain-circuits-prover" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "logos-blockchain-circuits-utils", + "tempfile", +] + +[[package]] +name = "logos-blockchain-circuits-utils" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "dirs", +] + +[[package]] +name = "logos-blockchain-common-http-client" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "futures", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-chain-service", + "logos-blockchain-core", + "logos-blockchain-da-messages", + "logos-blockchain-http-api-common", + "reqwest", + "serde", + "serde_json", + "thiserror 1.0.69", + "url", +] + +[[package]] +name = "logos-blockchain-core" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "ark-ff 0.4.2", + "async-trait", + "bincode", + "blake2", + "bytes", + "const-hex", + "futures", + "generic-array 1.3.5", + "hex", + "logos-blockchain-blend-proofs", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-pol", + "logos-blockchain-poseidon2", + "logos-blockchain-utils", + "multiaddr", + "nom 8.0.0", + "num-bigint", + "serde", + "strum", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "logos-blockchain-cryptarchia-engine" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "cfg_eval", + "logos-blockchain-utils", + "serde", + "serde_with", + "thiserror 1.0.69", + "time", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-cryptarchia-sync" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "bytes", + "futures", + "libp2p", + "libp2p-stream", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "rand 0.8.5", + "serde", + "serde_with", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-da-dispersal-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "futures", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-core", + "logos-blockchain-da-network-core", + "logos-blockchain-da-network-service", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-kzgrs-backend", + "logos-blockchain-services-utils", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-tracing", + "logos-blockchain-utils", + "overwatch", + "serde", + "serde_with", + "thiserror 2.0.17", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-da-messages" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "blake2", + "futures", + "logos-blockchain-core", + "logos-blockchain-kzgrs-backend", + "serde", + "tokio", +] + +[[package]] +name = "logos-blockchain-da-network-core" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "cached", + "fixed", + "futures", + "indexmap 2.12.1", + "libp2p", + "libp2p-stream", + "log", + "logos-blockchain-core", + "logos-blockchain-da-messages", + "logos-blockchain-kzgrs-backend", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-utils", + "rand 0.9.2", + "serde", + "serde_with", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", + "tracing-subscriber 0.3.22", +] + +[[package]] +name = "logos-blockchain-da-network-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "arc-swap", + "async-trait", + "bitvec", + "blake2", + "futures", + "libp2p", + "libp2p-identity", + "log", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-common-http-client", + "logos-blockchain-core", + "logos-blockchain-da-messages", + "logos-blockchain-da-network-core", + "logos-blockchain-kzgrs-backend", + "logos-blockchain-libp2p", + "logos-blockchain-sdp-service", + "logos-blockchain-services-utils", + "logos-blockchain-storage-service", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-tracing", + "logos-blockchain-utils", + "multiaddr", + "overwatch", + "rand 0.8.5", + "serde", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", + "url", +] + +[[package]] +name = "logos-blockchain-da-sampling-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "bytes", + "either", + "futures", + "hex", + "libp2p-identity", + "logos-blockchain-core", + "logos-blockchain-da-network-core", + "logos-blockchain-da-network-service", + "logos-blockchain-kzgrs-backend", + "logos-blockchain-services-utils", + "logos-blockchain-storage-service", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-tracing", + "logos-blockchain-tx-service", + "overwatch", + "rand 0.8.5", + "serde", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-da-verifier-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "futures", + "libp2p", + "logos-blockchain-core", + "logos-blockchain-da-network-core", + "logos-blockchain-da-network-service", + "logos-blockchain-kzgrs-backend", + "logos-blockchain-services-utils", + "logos-blockchain-storage-service", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-tracing", + "logos-blockchain-tx-service", + "logos-blockchain-utils", + "overwatch", + "serde", + "serde_with", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-executor" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "axum", + "clap", + "color-eyre", + "futures", + "logos-blockchain-api-service", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-core", + "logos-blockchain-da-dispersal-service", + "logos-blockchain-da-network-core", + "logos-blockchain-da-network-service", + "logos-blockchain-da-sampling-service", + "logos-blockchain-da-verifier-service", + "logos-blockchain-http-api-common", + "logos-blockchain-kzgrs-backend", + "logos-blockchain-libp2p", + "logos-blockchain-network-service", + "logos-blockchain-node", + "logos-blockchain-sdp-service", + "logos-blockchain-services-utils", + "logos-blockchain-storage-service", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-time-service", + "logos-blockchain-tx-service", + "overwatch", + "serde", + "tokio", + "tower 0.4.13", + "tower-http 0.5.2", + "tracing", + "utoipa", + "utoipa-swagger-ui", +] + +[[package]] +name = "logos-blockchain-executor-http-client" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "futures", + "logos-blockchain-common-http-client", + "logos-blockchain-core", + "logos-blockchain-http-api-common", + "reqwest", + "serde", +] + +[[package]] +name = "logos-blockchain-groth16" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "ark-bn254 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-groth16", + "ark-serialize 0.4.2", + "generic-array 1.3.5", + "hex", + "num-bigint", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "logos-blockchain-http-api-common" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "axum", + "governor", + "logos-blockchain-core", + "logos-blockchain-key-management-system-keys", + "serde", + "serde_json", + "serde_with", + "tower_governor", +] + +[[package]] +name = "logos-blockchain-key-management-system-keys" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "bytes", + "ed25519-dalek", + "generic-array 1.3.5", + "logos-blockchain-blend-proofs", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-macros", + "logos-blockchain-poseidon2", + "logos-blockchain-utils", + "logos-blockchain-zksign", + "num-bigint", + "rand_core 0.6.4", + "serde", + "subtle", + "thiserror 2.0.17", + "tokio", + "tracing", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "logos-blockchain-key-management-system-macros" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "logos-blockchain-key-management-system-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "log", + "logos-blockchain-key-management-system-keys", + "overwatch", + "serde", + "thiserror 2.0.17", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-kzgrs" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "ark-bls12-381", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-poly-commit", + "ark-serialize 0.4.2", + "blake2", + "blst", + "num-bigint", + "num-traits", + "rand 0.8.5", + "thiserror 1.0.69", +] + +[[package]] +name = "logos-blockchain-kzgrs-backend" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "blake2", + "itertools 0.12.1", + "logos-blockchain-core", + "logos-blockchain-kzgrs", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "logos-blockchain-ledger" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "logos-blockchain-blend-crypto", + "logos-blockchain-blend-message", + "logos-blockchain-blend-proofs", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-mmr", + "logos-blockchain-utils", + "logos-blockchain-utxotree", + "num-bigint", + "rand 0.8.5", + "rpds", + "serde", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "logos-blockchain-libp2p" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "backon", + "blake2", + "default-net", + "either", + "futures", + "hex", + "igd-next 0.16.2", + "libp2p", + "logos-blockchain-cryptarchia-sync", + "logos-blockchain-utils", + "multiaddr", + "natpmp", + "netdev", + "num_enum", + "rand 0.8.5", + "serde", + "serde_with", + "thiserror 1.0.69", + "tokio", + "tracing", + "zerocopy", +] + +[[package]] +name = "logos-blockchain-mmr" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "ark-ff 0.4.2", + "logos-blockchain-groth16", + "logos-blockchain-poseidon2", + "rpds", + "serde", +] + +[[package]] +name = "logos-blockchain-network-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "futures", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-sync", + "logos-blockchain-libp2p", + "overwatch", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-node" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "axum", + "clap", + "color-eyre", + "futures", + "hex", + "http 1.4.0", + "logos-blockchain-api-service", + "logos-blockchain-blend", + "logos-blockchain-blend-service", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-chain-leader-service", + "logos-blockchain-chain-network-service", + "logos-blockchain-chain-service", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-da-messages", + "logos-blockchain-da-network-core", + "logos-blockchain-da-network-service", + "logos-blockchain-da-sampling-service", + "logos-blockchain-da-verifier-service", + "logos-blockchain-groth16", + "logos-blockchain-http-api-common", + "logos-blockchain-key-management-system-service", + "logos-blockchain-kzgrs-backend", + "logos-blockchain-ledger", + "logos-blockchain-libp2p", + "logos-blockchain-network-service", + "logos-blockchain-pol", + "logos-blockchain-poq", + "logos-blockchain-sdp-service", + "logos-blockchain-services-utils", + "logos-blockchain-storage-service", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-system-sig-service", + "logos-blockchain-time-service", + "logos-blockchain-tracing", + "logos-blockchain-tracing-service", + "logos-blockchain-tx-service", + "logos-blockchain-utils", + "logos-blockchain-wallet-service", + "num-bigint", + "overwatch", + "serde", + "serde_ignored", + "serde_json", + "serde_with", + "serde_yaml", + "thiserror 2.0.17", + "time", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tower-http 0.5.2", + "tracing", + "utoipa", + "utoipa-swagger-ui", +] + +[[package]] +name = "logos-blockchain-pol" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "logos-blockchain-circuits-prover", + "logos-blockchain-circuits-utils", + "logos-blockchain-groth16", + "logos-blockchain-witness-generator", + "num-bigint", + "num-traits", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "logos-blockchain-poq" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "logos-blockchain-circuits-prover", + "logos-blockchain-circuits-utils", + "logos-blockchain-groth16", + "logos-blockchain-pol", + "logos-blockchain-witness-generator", + "num-bigint", + "serde", + "serde_json", + "thiserror 2.0.17", +] + +[[package]] +name = "logos-blockchain-poseidon2" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "ark-bn254 0.4.0", + "ark-ff 0.4.2", + "jf-poseidon2", + "num-bigint", +] + +[[package]] +name = "logos-blockchain-sdp-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "futures", + "logos-blockchain-core", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-tx-service", + "overwatch", + "serde", + "thiserror 2.0.17", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-services-utils" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "futures", + "log", + "overwatch", + "serde", + "serde_json", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "logos-blockchain-storage-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "bytes", + "futures", + "libp2p-identity", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "multiaddr", + "overwatch", + "rocksdb", + "serde", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-subnetworks-assignations" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "counter", + "libp2p-identity", + "logos-blockchain-core", + "logos-blockchain-utils", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "logos-blockchain-system-sig-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-ctrlc", + "async-trait", + "overwatch", + "tracing", +] + +[[package]] +name = "logos-blockchain-tests" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "blst", + "futures", + "futures-util", + "hex", + "logos-blockchain-api-service", + "logos-blockchain-blend-service", + "logos-blockchain-chain-broadcast-service", + "logos-blockchain-chain-leader-service", + "logos-blockchain-chain-network-service", + "logos-blockchain-chain-service", + "logos-blockchain-common-http-client", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-cryptarchia-sync", + "logos-blockchain-da-dispersal-service", + "logos-blockchain-da-network-core", + "logos-blockchain-da-network-service", + "logos-blockchain-da-sampling-service", + "logos-blockchain-da-verifier-service", + "logos-blockchain-executor", + "logos-blockchain-executor-http-client", + "logos-blockchain-groth16", + "logos-blockchain-http-api-common", + "logos-blockchain-key-management-system-service", + "logos-blockchain-kzgrs-backend", + "logos-blockchain-libp2p", + "logos-blockchain-network-service", + "logos-blockchain-node", + "logos-blockchain-sdp-service", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-time-service", + "logos-blockchain-tracing", + "logos-blockchain-tracing-service", + "logos-blockchain-tx-service", + "logos-blockchain-utils", + "logos-blockchain-wallet-service", + "num-bigint", + "rand 0.8.5", + "reqwest", + "serde_json", + "serde_yaml", + "serial_test", + "tempfile", + "time", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-time-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "cfg_eval", + "futures", + "log", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-utils", + "overwatch", + "serde", + "serde_with", + "sntpc", + "thiserror 2.0.17", + "time", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "logos-blockchain-tracing" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "opentelemetry", + "opentelemetry-http", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "opentelemetry_sdk", + "rand 0.8.5", + "reqwest", + "serde", + "tokio", + "tracing", + "tracing-appender", + "tracing-gelf", + "tracing-loki", + "tracing-opentelemetry", + "tracing-subscriber 0.3.22", + "url", +] + +[[package]] +name = "logos-blockchain-tracing-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "logos-blockchain-tracing", + "overwatch", + "serde", + "tracing", + "tracing-appender", + "tracing-subscriber 0.3.22", +] + +[[package]] +name = "logos-blockchain-tx-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "futures", + "logos-blockchain-core", + "logos-blockchain-network-service", + "logos-blockchain-services-utils", + "logos-blockchain-storage-service", + "overwatch", + "rand 0.8.5", + "serde", + "serde_json", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", + "utoipa", +] + +[[package]] +name = "logos-blockchain-utils" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "blake2", + "cipher", + "const-hex", + "humantime", + "overwatch", + "rand 0.8.5", + "serde", + "serde_with", + "time", +] + +[[package]] +name = "logos-blockchain-utxotree" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "ark-ff 0.4.2", + "logos-blockchain-core", + "logos-blockchain-groth16", + "logos-blockchain-poseidon2", + "num-bigint", + "rpds", + "serde", + "thiserror 1.0.69", +] + +[[package]] +name = "logos-blockchain-wallet" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "logos-blockchain-core", + "logos-blockchain-key-management-system-keys", + "logos-blockchain-ledger", + "num-bigint", + "rpds", + "thiserror 2.0.17", + "tracing", +] + +[[package]] +name = "logos-blockchain-wallet-service" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "async-trait", + "bytes", + "futures", + "hex", + "logos-blockchain-chain-service", + "logos-blockchain-core", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-service", + "logos-blockchain-ledger", + "logos-blockchain-services-utils", + "logos-blockchain-storage-service", + "logos-blockchain-wallet", + "overwatch", + "serde", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "logos-blockchain-witness-generator" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "tempfile", +] + +[[package]] +name = "logos-blockchain-zksign" +version = "0.1.0" +source = "git+https://github.com/logos-co/nomos-node.git?rev=97b411ed0ce269e72a6253c8cd48eea41db5ab71#97b411ed0ce269e72a6253c8cd48eea41db5ab71" +dependencies = [ + "logos-blockchain-circuits-prover", + "logos-blockchain-circuits-utils", + "logos-blockchain-groth16", + "logos-blockchain-poseidon2", + "logos-blockchain-witness-generator", + "num-bigint", + "serde", + "serde_json", + "thiserror 2.0.17", +] + [[package]] name = "loki-api" version = "0.1.3" @@ -4173,18 +4838,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "mmr" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "ark-ff 0.4.2", - "groth16", - "poseidon2", - "rpds", - "serde", -] - [[package]] name = "moka" version = "0.12.11" @@ -4460,722 +5113,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "nom_locate" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b577e2d69827c4740cba2b52efaad1c4cc7c73042860b199710b3575c68438d" -dependencies = [ - "bytecount", - "memchr", - "nom 8.0.0", -] - -[[package]] -name = "nomos-api" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "broadcast-service", - "bytes", - "chain-service", - "futures", - "kzgrs-backend", - "nomos-core", - "nomos-da-dispersal", - "nomos-da-network-core", - "nomos-da-network-service", - "nomos-da-sampling", - "nomos-da-verifier", - "nomos-libp2p", - "nomos-network", - "nomos-sdp", - "nomos-storage", - "overwatch", - "serde", - "serde_json", - "subnetworks-assignations", - "tokio", - "tokio-stream", - "tracing", - "tx-service", - "utoipa", - "utoipa-swagger-ui", -] - -[[package]] -name = "nomos-blend" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "nomos-blend-crypto", - "nomos-blend-message", - "nomos-blend-network", - "nomos-blend-proofs", - "nomos-blend-scheduling", -] - -[[package]] -name = "nomos-blend-crypto" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "blake2", - "groth16", - "nomos-utils", - "poq", - "poseidon2", - "rs-merkle-tree", - "serde", - "subtle", - "thiserror 1.0.69", - "x25519-dalek", - "zeroize", -] - -[[package]] -name = "nomos-blend-message" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "blake2", - "derivative", - "groth16", - "itertools 0.14.0", - "key-management-system-keys", - "nomos-blend-crypto", - "nomos-blend-proofs", - "nomos-core", - "nomos-utils", - "serde", - "serde-big-array", - "serde_with", - "thiserror 1.0.69", - "tracing", - "zeroize", -] - -[[package]] -name = "nomos-blend-network" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "either", - "futures", - "futures-timer", - "key-management-system-keys", - "libp2p", - "nomos-blend-message", - "nomos-blend-proofs", - "nomos-blend-scheduling", - "nomos-core", - "nomos-libp2p", - "tracing", -] - -[[package]] -name = "nomos-blend-proofs" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "ed25519-dalek", - "generic-array 1.3.5", - "groth16", - "nomos-blend-crypto", - "num-bigint", - "poq", - "serde", - "thiserror 1.0.69", -] - -[[package]] -name = "nomos-blend-scheduling" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "derivative", - "fork_stream", - "futures", - "key-management-system-keys", - "multiaddr", - "nomos-blend-crypto", - "nomos-blend-message", - "nomos-blend-proofs", - "nomos-core", - "nomos-utils", - "rand 0.8.5", - "serde", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", -] - -[[package]] -name = "nomos-blend-service" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "broadcast-service", - "chain-service", - "cryptarchia-engine", - "fork_stream", - "futures", - "groth16", - "key-management-system-service", - "libp2p", - "libp2p-stream", - "nomos-blend", - "nomos-core", - "nomos-ledger", - "nomos-libp2p", - "nomos-network", - "nomos-sdp", - "nomos-time", - "nomos-utils", - "overwatch", - "poq", - "rand 0.8.5", - "serde", - "serde_with", - "services-utils", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", -] - -[[package]] -name = "nomos-core" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "ark-ff 0.4.2", - "async-trait", - "bincode", - "blake2", - "bytes", - "const-hex", - "cryptarchia-engine", - "futures", - "generic-array 1.3.5", - "groth16", - "hex", - "key-management-system-keys", - "multiaddr", - "nom 8.0.0", - "nomos-blend-proofs", - "nomos-utils", - "num-bigint", - "pol", - "poseidon2", - "serde", - "strum", - "thiserror 1.0.69", - "tracing", -] - -[[package]] -name = "nomos-da-dispersal" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "broadcast-service", - "futures", - "key-management-system-keys", - "kzgrs-backend", - "nomos-core", - "nomos-da-network-core", - "nomos-da-network-service", - "nomos-tracing", - "nomos-utils", - "overwatch", - "serde", - "serde_with", - "services-utils", - "subnetworks-assignations", - "thiserror 2.0.17", - "tokio", - "tokio-stream", - "tracing", -] - -[[package]] -name = "nomos-da-messages" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "blake2", - "futures", - "kzgrs-backend", - "nomos-core", - "serde", - "tokio", -] - -[[package]] -name = "nomos-da-network-core" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "cached", - "fixed", - "futures", - "indexmap 2.12.1", - "kzgrs-backend", - "libp2p", - "libp2p-stream", - "log", - "nomos-core", - "nomos-da-messages", - "nomos-utils", - "rand 0.9.2", - "serde", - "serde_with", - "subnetworks-assignations", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", - "tracing-subscriber 0.3.22", -] - -[[package]] -name = "nomos-da-network-service" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "arc-swap", - "async-trait", - "bitvec", - "blake2", - "broadcast-service", - "common-http-client", - "futures", - "kzgrs-backend", - "libp2p", - "libp2p-identity", - "log", - "multiaddr", - "nomos-core", - "nomos-da-messages", - "nomos-da-network-core", - "nomos-libp2p", - "nomos-sdp", - "nomos-storage", - "nomos-tracing", - "nomos-utils", - "overwatch", - "rand 0.8.5", - "serde", - "services-utils", - "subnetworks-assignations", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", - "url", -] - -[[package]] -name = "nomos-da-sampling" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "bytes", - "futures", - "hex", - "kzgrs-backend", - "libp2p-identity", - "nomos-core", - "nomos-da-network-core", - "nomos-da-network-service", - "nomos-storage", - "nomos-tracing", - "overwatch", - "rand 0.8.5", - "serde", - "services-utils", - "subnetworks-assignations", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", - "tx-service", -] - -[[package]] -name = "nomos-da-verifier" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "futures", - "kzgrs-backend", - "libp2p", - "nomos-core", - "nomos-da-network-core", - "nomos-da-network-service", - "nomos-storage", - "nomos-tracing", - "nomos-utils", - "overwatch", - "serde", - "serde_with", - "services-utils", - "subnetworks-assignations", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", - "tx-service", -] - -[[package]] -name = "nomos-executor" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "axum", - "broadcast-service", - "clap", - "color-eyre", - "futures", - "kzgrs-backend", - "nomos-api", - "nomos-core", - "nomos-da-dispersal", - "nomos-da-network-core", - "nomos-da-network-service", - "nomos-da-sampling", - "nomos-da-verifier", - "nomos-http-api-common", - "nomos-libp2p", - "nomos-network", - "nomos-node", - "nomos-sdp", - "nomos-storage", - "nomos-time", - "overwatch", - "serde", - "services-utils", - "subnetworks-assignations", - "tokio", - "tower 0.4.13", - "tower-http 0.5.2", - "tracing", - "tx-service", - "utoipa", - "utoipa-swagger-ui", -] - -[[package]] -name = "nomos-http-api-common" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "axum", - "governor", - "key-management-system-keys", - "nomos-core", - "serde", - "serde_json", - "serde_with", - "tower_governor", - "tracing", -] - -[[package]] -name = "nomos-ledger" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "cryptarchia-engine", - "groth16", - "key-management-system-keys", - "mmr", - "nomos-blend-crypto", - "nomos-blend-message", - "nomos-blend-proofs", - "nomos-core", - "nomos-utils", - "num-bigint", - "rand 0.8.5", - "rpds", - "serde", - "thiserror 1.0.69", - "tracing", - "utxotree", -] - -[[package]] -name = "nomos-libp2p" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "backon", - "blake2", - "cryptarchia-sync", - "default-net", - "either", - "futures", - "hex", - "igd-next 0.16.2", - "libp2p", - "multiaddr", - "natpmp", - "netdev", - "nomos-utils", - "num_enum", - "rand 0.8.5", - "serde", - "serde_with", - "thiserror 1.0.69", - "tokio", - "tracing", - "zerocopy", -] - -[[package]] -name = "nomos-network" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "cryptarchia-sync", - "futures", - "nomos-core", - "nomos-libp2p", - "overwatch", - "rand 0.8.5", - "rand_chacha 0.3.1", - "serde", - "tokio", - "tokio-stream", - "tracing", -] - -[[package]] -name = "nomos-node" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "axum", - "broadcast-service", - "chain-leader", - "chain-network", - "chain-service", - "clap", - "color-eyre", - "cryptarchia-engine", - "derivative", - "futures", - "groth16", - "hex", - "http 1.4.0", - "key-management-system-service", - "kzgrs-backend", - "nomos-api", - "nomos-blend", - "nomos-blend-service", - "nomos-core", - "nomos-da-messages", - "nomos-da-network-core", - "nomos-da-network-service", - "nomos-da-sampling", - "nomos-da-verifier", - "nomos-http-api-common", - "nomos-ledger", - "nomos-libp2p", - "nomos-network", - "nomos-sdp", - "nomos-storage", - "nomos-system-sig", - "nomos-time", - "nomos-tracing", - "nomos-tracing-service", - "nomos-utils", - "nomos-wallet", - "num-bigint", - "overwatch", - "pol", - "poq", - "serde", - "serde_ignored", - "serde_json", - "serde_with", - "serde_yaml", - "services-utils", - "subnetworks-assignations", - "thiserror 2.0.17", - "time", - "tokio", - "tokio-stream", - "tower 0.4.13", - "tower-http 0.5.2", - "tracing", - "tx-service", - "utoipa", - "utoipa-swagger-ui", -] - -[[package]] -name = "nomos-sdp" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "futures", - "key-management-system-keys", - "nomos-core", - "overwatch", - "serde", - "thiserror 2.0.17", - "tokio", - "tokio-stream", - "tracing", - "tx-service", -] - -[[package]] -name = "nomos-storage" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "bytes", - "cryptarchia-engine", - "futures", - "libp2p-identity", - "multiaddr", - "nomos-core", - "overwatch", - "rocksdb", - "serde", - "thiserror 1.0.69", - "tokio", - "tracing", -] - -[[package]] -name = "nomos-system-sig" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-ctrlc", - "async-trait", - "overwatch", - "tracing", -] - -[[package]] -name = "nomos-time" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "cfg_eval", - "cryptarchia-engine", - "futures", - "log", - "nomos-utils", - "overwatch", - "serde", - "serde_with", - "sntpc", - "thiserror 2.0.17", - "time", - "tokio", - "tokio-stream", - "tracing", -] - -[[package]] -name = "nomos-tracing" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "opentelemetry", - "opentelemetry-http", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", - "opentelemetry_sdk", - "rand 0.8.5", - "reqwest", - "serde", - "tokio", - "tracing", - "tracing-appender", - "tracing-gelf", - "tracing-loki", - "tracing-opentelemetry", - "tracing-subscriber 0.3.22", - "url", -] - -[[package]] -name = "nomos-tracing-service" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "nomos-tracing", - "overwatch", - "serde", - "tracing", - "tracing-appender", - "tracing-subscriber 0.3.22", -] - -[[package]] -name = "nomos-utils" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "blake2", - "cipher", - "const-hex", - "humantime", - "overwatch", - "rand 0.8.5", - "serde", - "serde_with", - "time", -] - -[[package]] -name = "nomos-wallet" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "bytes", - "chain-service", - "futures", - "groth16", - "hex", - "key-management-system-service", - "nomos-core", - "nomos-ledger", - "nomos-storage", - "overwatch", - "serde", - "services-utils", - "thiserror 1.0.69", - "tokio", - "tracing", - "wallet", -] - [[package]] name = "nonempty" version = "0.7.0" @@ -5302,12 +5239,6 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" -[[package]] -name = "once_cell_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" - [[package]] name = "openssl" version = "0.10.75" @@ -5471,7 +5402,7 @@ name = "overwatch-derive" version = "0.1.0" source = "git+https://github.com/logos-co/Overwatch?rev=f5a9902#f5a99022f389d65adbd55e51f1e3f9eead62432a" dependencies = [ - "convert_case 0.8.0", + "convert_case", "proc-macro-error2", "proc-macro2", "quote", @@ -5528,33 +5459,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "peg" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f76678828272f177ac33b7e2ac2e3e73cc6c1cd1e3e387928aa69562fa51367" -dependencies = [ - "peg-macros", - "peg-runtime", -] - -[[package]] -name = "peg-macros" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "636d60acf97633e48d266d7415a9355d4389cea327a193f87df395d88cd2b14d" -dependencies = [ - "peg-runtime", - "proc-macro2", - "quote", -] - -[[package]] -name = "peg-runtime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555b1514d2d99d78150d3c799d4c357a3e2c2a8062cd108e93a06d9057629c5" - [[package]] name = "pem" version = "3.0.6" @@ -5700,22 +5604,6 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" -[[package]] -name = "pol" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "circuits-prover", - "circuits-utils", - "groth16", - "num-bigint", - "num-traits", - "serde", - "serde_json", - "thiserror 2.0.17", - "witness-generator", -] - [[package]] name = "polling" version = "3.11.0" @@ -5730,39 +5618,12 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "poq" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "circuits-prover", - "circuits-utils", - "groth16", - "num-bigint", - "pol", - "serde", - "serde_json", - "thiserror 2.0.17", - "witness-generator", -] - [[package]] name = "portable-atomic" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" -[[package]] -name = "poseidon2" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "ark-bn254 0.4.0", - "ark-ff 0.4.2", - "jf-poseidon2", - "num-bigint", -] - [[package]] name = "potential_utf" version = "0.1.4" @@ -5971,15 +5832,6 @@ dependencies = [ "unsigned-varint 0.8.0", ] -[[package]] -name = "quick-xml" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" -dependencies = [ - "memchr", -] - [[package]] name = "quinn" version = "0.11.9" @@ -6167,26 +6019,6 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "ref-cast" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.111", -] - [[package]] name = "regex" version = "1.12.2" @@ -6353,8 +6185,7 @@ name = "runner-examples" version = "0.1.0" dependencies = [ "anyhow", - "cucumber", - "cucumber_ext", + "async-trait", "testing-framework-core", "testing-framework-runner-compose", "testing-framework-runner-k8s", @@ -6592,17 +6423,6 @@ version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "490dcfcbfef26be6800d11870ff2df8774fa6e86d047e3e8c8a76b25655e41ca" -[[package]] -name = "sealed" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f968c5ea23d555e670b449c1c5e7b2fc399fdaec1d304a17cd48e288abc107" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.111", -] - [[package]] name = "sec1" version = "0.7.3" @@ -6816,21 +6636,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "services-utils" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "futures", - "log", - "overwatch", - "serde", - "serde_json", - "thiserror 1.0.69", - "tracing", -] - [[package]] name = "sha2" version = "0.10.9" @@ -6910,23 +6715,6 @@ version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" -[[package]] -name = "smart-default" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.111", -] - -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - [[package]] name = "snap" version = "1.1.1" @@ -6994,15 +6782,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strip-ansi-escapes" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" -dependencies = [ - "vte", -] - [[package]] name = "strsim" version = "0.11.1" @@ -7030,19 +6809,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "subnetworks-assignations" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "counter", - "libp2p-identity", - "nomos-core", - "nomos-utils", - "rand 0.8.5", - "serde", -] - [[package]] name = "subtle" version = "2.6.1" @@ -7091,39 +6857,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "synthez" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d8a928f38f1bc873f28e0d2ba8298ad65374a6ac2241dabd297271531a736cd" -dependencies = [ - "syn 2.0.111", - "synthez-codegen", - "synthez-core", -] - -[[package]] -name = "synthez-codegen" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb83b8df4238e11746984dfb3819b155cd270de0e25847f45abad56b3671047" -dependencies = [ - "syn 2.0.111", - "synthez-core", -] - -[[package]] -name = "synthez-core" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "906fba967105d822e7c7ed60477b5e76116724d33de68a585681fb253fc30d5c" -dependencies = [ - "proc-macro2", - "quote", - "sealed", - "syn 2.0.111", -] - [[package]] name = "system-configuration" version = "0.5.1" @@ -7213,51 +6946,39 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "terminal_size" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" -dependencies = [ - "rustix", - "windows-sys 0.60.2", -] - [[package]] name = "testing-framework-config" version = "0.1.0" dependencies = [ "blst", - "chain-leader", - "chain-network", - "chain-service", - "cryptarchia-engine", - "cryptarchia-sync", - "groth16", "hex", - "key-management-system-service", - "nomos-api", - "nomos-blend-service", - "nomos-core", - "nomos-da-dispersal", - "nomos-da-network-core", - "nomos-da-network-service", - "nomos-da-sampling", - "nomos-da-verifier", - "nomos-executor", - "nomos-ledger", - "nomos-libp2p", - "nomos-node", - "nomos-sdp", - "nomos-time", - "nomos-tracing", - "nomos-tracing-service", - "nomos-utils", - "nomos-wallet", + "logos-blockchain-api-service", + "logos-blockchain-blend-service", + "logos-blockchain-chain-leader-service", + "logos-blockchain-chain-network-service", + "logos-blockchain-chain-service", + "logos-blockchain-core", + "logos-blockchain-cryptarchia-engine", + "logos-blockchain-cryptarchia-sync", + "logos-blockchain-da-network-core", + "logos-blockchain-da-network-service", + "logos-blockchain-da-sampling-service", + "logos-blockchain-da-verifier-service", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-service", + "logos-blockchain-ledger", + "logos-blockchain-libp2p", + "logos-blockchain-node", + "logos-blockchain-sdp-service", + "logos-blockchain-subnetworks-assignations", + "logos-blockchain-time-service", + "logos-blockchain-tracing", + "logos-blockchain-tracing-service", + "logos-blockchain-utils", + "logos-blockchain-wallet-service", "num-bigint", "rand 0.8.5", "serde", - "subnetworks-assignations", "testing-framework-env", "thiserror 2.0.17", "time", @@ -7270,23 +6991,22 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "chain-service", - "common-http-client", "futures", - "groth16", "hex", - "key-management-system-service", - "nomos-core", - "nomos-da-network-core", - "nomos-da-network-service", - "nomos-executor", - "nomos-http-api-common", - "nomos-libp2p", - "nomos-network", - "nomos-node", - "nomos-tracing", - "nomos-tracing-service", - "nomos-utils", + "logos-blockchain-chain-service", + "logos-blockchain-common-http-client", + "logos-blockchain-core", + "logos-blockchain-da-network-core", + "logos-blockchain-da-network-service", + "logos-blockchain-groth16", + "logos-blockchain-http-api-common", + "logos-blockchain-key-management-system-service", + "logos-blockchain-libp2p", + "logos-blockchain-network-service", + "logos-blockchain-node", + "logos-blockchain-tracing", + "logos-blockchain-tracing-service", + "logos-blockchain-utils", "prometheus-http-query", "rand 0.8.5", "reqwest", @@ -7312,26 +7032,27 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "cfgsync", - "groth16", - "key-management-system-service", - "nomos-core", - "nomos-ledger", - "nomos-tracing", - "nomos-tracing-service", + "cfgsync_tf", + "logos-blockchain-core", + "logos-blockchain-groth16", + "logos-blockchain-key-management-system-service", + "logos-blockchain-ledger", + "logos-blockchain-tests", + "logos-blockchain-tracing", + "logos-blockchain-tracing-service", + "logos-blockchain-zksign", "reqwest", "serde", "tempfile", "tera", + "testing-framework-config", "testing-framework-core", "testing-framework-env", - "tests", "thiserror 2.0.17", "tokio", "tracing", "url", "uuid", - "zksign", ] [[package]] @@ -7342,12 +7063,13 @@ dependencies = [ "async-trait", "k8s-openapi", "kube", - "nomos-tracing", - "nomos-tracing-service", + "logos-blockchain-tracing", + "logos-blockchain-tracing-service", "reqwest", "serde", "serde_yaml", "tempfile", + "testing-framework-config", "testing-framework-core", "testing-framework-env", "thiserror 2.0.17", @@ -7362,21 +7084,11 @@ name = "testing-framework-runner-local" version = "0.1.0" dependencies = [ "async-trait", - "testing-framework-core", - "thiserror 2.0.17", - "tracing", -] - -[[package]] -name = "testing-framework-workflows" -version = "0.1.0" -dependencies = [ - "async-trait", - "chain-service", - "key-management-system-service", - "nomos-core", + "logos-blockchain-libp2p", + "logos-blockchain-network-service", + "logos-blockchain-node", + "logos-blockchain-utils", "rand 0.8.5", - "reqwest", "testing-framework-config", "testing-framework-core", "thiserror 2.0.17", @@ -7385,68 +7097,20 @@ dependencies = [ ] [[package]] -name = "tests" +name = "testing-framework-workflows" version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" dependencies = [ "async-trait", - "blst", - "broadcast-service", - "chain-leader", - "chain-network", - "chain-service", - "common-http-client", - "cryptarchia-engine", - "cryptarchia-sync", - "executor-http-client", - "futures", - "futures-util", - "groth16", - "hex", - "key-management-system-service", - "kzgrs-backend", - "nomos-api", - "nomos-blend-service", - "nomos-core", - "nomos-da-dispersal", - "nomos-da-network-core", - "nomos-da-network-service", - "nomos-da-sampling", - "nomos-da-verifier", - "nomos-executor", - "nomos-http-api-common", - "nomos-libp2p", - "nomos-network", - "nomos-node", - "nomos-sdp", - "nomos-time", - "nomos-tracing", - "nomos-tracing-service", - "nomos-utils", - "nomos-wallet", - "num-bigint", + "logos-blockchain-chain-service", + "logos-blockchain-core", + "logos-blockchain-key-management-system-service", "rand 0.8.5", "reqwest", - "serde_json", - "serde_yaml", - "serial_test", - "subnetworks-assignations", - "tempfile", - "time", + "testing-framework-config", + "testing-framework-core", + "thiserror 2.0.17", "tokio", "tracing", - "tx-service", -] - -[[package]] -name = "textwrap" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" -dependencies = [ - "smawk", - "unicode-linebreak", - "unicode-width", ] [[package]] @@ -8019,48 +7683,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "tx-service" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "async-trait", - "futures", - "nomos-core", - "nomos-network", - "nomos-storage", - "overwatch", - "rand 0.8.5", - "serde", - "serde_json", - "services-utils", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", - "utoipa", -] - -[[package]] -name = "typed-builder" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31aa81521b70f94402501d848ccc0ecaa8f93c8eb6999eb9747e72287757ffda" -dependencies = [ - "typed-builder-macro", -] - -[[package]] -name = "typed-builder-macro" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076a02dc54dd46795c2e9c8282ed40bcfb1e22747e955de9389a1de28190fb26" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.111", -] - [[package]] name = "typenum" version = "1.19.0" @@ -8103,30 +7725,12 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" -[[package]] -name = "unicode-linebreak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" - [[package]] name = "unicode-segmentation" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" -[[package]] -name = "unicode-width" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -8169,12 +7773,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - [[package]] name = "utoipa" version = "4.2.3" @@ -8223,20 +7821,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2eebbbfe4093922c2b6734d7c679ebfebd704a0d7e56dfcb0d05818ce28977d" -[[package]] -name = "utxotree" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "ark-ff 0.4.2", - "groth16", - "num-bigint", - "poseidon2", - "rpds", - "serde", - "thiserror 1.0.69", -] - [[package]] name = "uuid" version = "1.19.0" @@ -8266,15 +7850,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "vte" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" -dependencies = [ - "memchr", -] - [[package]] name = "walkdir" version = "2.5.0" @@ -8285,20 +7860,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "wallet" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "key-management-system-keys", - "nomos-core", - "nomos-ledger", - "num-bigint", - "rpds", - "thiserror 2.0.17", - "tracing", -] - [[package]] name = "want" version = "0.3.1" @@ -8838,15 +8399,6 @@ version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" -[[package]] -name = "witness-generator" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "circuits-utils", - "tempfile", -] - [[package]] name = "writeable" version = "0.6.2" @@ -9047,19 +8599,3 @@ dependencies = [ "num_enum", "thiserror 1.0.69", ] - -[[package]] -name = "zksign" -version = "0.1.0" -source = "git+https://github.com/logos-co/nomos-node.git?rev=1fce2dc3f482c16361316eb2a1b6ccd1206aa917#1fce2dc3f482c16361316eb2a1b6ccd1206aa917" -dependencies = [ - "circuits-prover", - "circuits-utils", - "groth16", - "num-bigint", - "poseidon2", - "serde", - "serde_json", - "thiserror 2.0.17", - "witness-generator", -] diff --git a/Cargo.toml b/Cargo.toml index e7f3f17..0a0c2da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,12 +50,10 @@ chain-service = { package = "logos-blockchain-chain-service", default-features = common-http-client = { package = "logos-blockchain-common-http-client", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } cryptarchia-engine = { package = "logos-blockchain-cryptarchia-engine", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } cryptarchia-sync = { package = "logos-blockchain-cryptarchia-sync", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } -executor-http-client = { package = "logos-blockchain-executor-http-client", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } groth16 = { package = "logos-blockchain-groth16", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } key-management-system-service = { package = "logos-blockchain-key-management-system-service", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } kzgrs = { package = "logos-blockchain-kzgrs", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } kzgrs-backend = { package = "logos-blockchain-kzgrs-backend", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } -logos-blockchain-executor = { package = "logos-blockchain-executor", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } nomos-api = { package = "logos-blockchain-api-service", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } nomos-blend-message = { package = "logos-blockchain-blend-message", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } nomos-blend-service = { package = "logos-blockchain-blend-service", default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "97b411ed0ce269e72a6253c8cd48eea41db5ab71" } diff --git a/README.md b/README.md index 441fbac..b6c3af8 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ cd book && mdbook serve cargo test # Run integration examples -scripts/run/run-examples.sh -t 60 -v 2 -e 1 host +scripts/run/run-examples.sh -t 60 -n 3 host ``` ### Creating Prebuilt Bundles @@ -125,8 +125,7 @@ Key environment variables for customization: |----------|---------|---------| | `POL_PROOF_DEV_MODE=true` | **Required** — Disable expensive proof generation (set automatically by `scripts/run/run-examples.sh`) | (none) | | `NOMOS_TESTNET_IMAGE` | Docker image tag for compose/k8s | `logos-blockchain-testing:local` | -| `NOMOS_DEMO_VALIDATORS` | Number of validator nodes | Varies by example | -| `NOMOS_DEMO_EXECUTORS` | Number of executor nodes | Varies by example | +| `NOMOS_DEMO_NODES` | Number of nodes | Varies by example | | `NOMOS_LOG_DIR` | Directory for persistent log files | (temporary) | | `NOMOS_LOG_LEVEL` | Logging verbosity | `info` | diff --git a/examples/cucumber/features/auto_deployer_smoke.feature b/examples/cucumber/features/auto_deployer_smoke.feature index 7658e0c..28f9210 100644 --- a/examples/cucumber/features/auto_deployer_smoke.feature +++ b/examples/cucumber/features/auto_deployer_smoke.feature @@ -2,7 +2,7 @@ Feature: Testing Framework - Auto Local/Compose Deployer Scenario: Run auto deployer smoke scenario (tx + liveness) Given we have a CLI deployer specified - And topology has 1 validators and 1 executors + And topology has 2 nodes And run duration is 60 seconds And wallets total funds is 1000000000 split across 50 users And transactions rate is 1 per block @@ -13,7 +13,7 @@ Feature: Testing Framework - Auto Local/Compose Deployer # Note: This test may fail on slow computers Scenario: Run auto deployer stress smoke scenario (tx + liveness) Given we have a CLI deployer specified - And topology has 3 validators and 3 executors + And topology has 6 nodes And run duration is 120 seconds And wallets total funds is 1000000000 split across 500 users And transactions rate is 10 per block @@ -23,7 +23,7 @@ Feature: Testing Framework - Auto Local/Compose Deployer Scenario: Run auto deployer stress smoke scenario no liveness (tx) Given we have a CLI deployer specified - And topology has 3 validators and 3 executors + And topology has 6 nodes And run duration is 120 seconds And wallets total funds is 1000000000 split across 500 users And transactions rate is 10 per block diff --git a/examples/cucumber/features/compose_smoke.feature b/examples/cucumber/features/compose_smoke.feature index 02c8805..0a47575 100644 --- a/examples/cucumber/features/compose_smoke.feature +++ b/examples/cucumber/features/compose_smoke.feature @@ -3,7 +3,7 @@ Feature: Testing Framework - Compose Runner Scenario: Run a compose smoke scenario (tx + liveness) Given deployer is "compose" - And topology has 1 validators and 1 executors + And topology has 2 nodes And wallets total funds is 1000 split across 10 users And run duration is 60 seconds And transactions rate is 1 per block diff --git a/examples/cucumber/features/local_smoke.feature b/examples/cucumber/features/local_smoke.feature index 2bab5d4..cc4a789 100644 --- a/examples/cucumber/features/local_smoke.feature +++ b/examples/cucumber/features/local_smoke.feature @@ -3,7 +3,7 @@ Feature: Testing Framework - Local Runner Scenario: Run a local smoke scenario (tx + liveness) Given deployer is "local" - And topology has 1 validators and 1 executors + And topology has 2 nodes And run duration is 60 seconds And wallets total funds is 1000000000 split across 50 users And transactions rate is 1 per block diff --git a/examples/doc-snippets/src/architecture_overview_builder_api.rs b/examples/doc-snippets/src/architecture_overview_builder_api.rs index 7bf0c4b..3baea4a 100644 --- a/examples/doc-snippets/src/architecture_overview_builder_api.rs +++ b/examples/doc-snippets/src/architecture_overview_builder_api.rs @@ -6,7 +6,7 @@ use testing_framework_workflows::ScenarioBuilderExt; use crate::SnippetResult; pub fn scenario_plan() -> SnippetResult> { - ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(2)) + ScenarioBuilder::topology_with(|t| t.network_star().nodes(5)) .wallets(50) .transactions_with(|txs| txs.rate(5).users(20)) .expect_consensus_liveness() diff --git a/examples/doc-snippets/src/chaos_workloads_random_restart.rs b/examples/doc-snippets/src/chaos_workloads_random_restart.rs index 13204e4..bf92b4c 100644 --- a/examples/doc-snippets/src/chaos_workloads_random_restart.rs +++ b/examples/doc-snippets/src/chaos_workloads_random_restart.rs @@ -6,14 +6,13 @@ use testing_framework_workflows::{ScenarioBuilderExt, workloads::chaos::RandomRe use crate::SnippetResult; pub fn random_restart_plan() -> SnippetResult> { - ScenarioBuilder::topology_with(|t| t.network_star().validators(2).executors(1)) + ScenarioBuilder::topology_with(|t| t.network_star().nodes(3)) .enable_node_control() .with_workload(RandomRestartWorkload::new( Duration::from_secs(45), // min delay Duration::from_secs(75), // max delay Duration::from_secs(120), // target cooldown - true, // include validators - true, // include executors + true, // include nodes )) .expect_consensus_liveness() .with_run_duration(Duration::from_secs(150)) diff --git a/examples/doc-snippets/src/custom_workload_example_expectation.rs b/examples/doc-snippets/src/custom_workload_example_expectation.rs index 0278438..61ec5f1 100644 --- a/examples/doc-snippets/src/custom_workload_example_expectation.rs +++ b/examples/doc-snippets/src/custom_workload_example_expectation.rs @@ -18,8 +18,8 @@ impl Expectation for ReachabilityExpectation { } async fn evaluate(&mut self, ctx: &RunContext) -> Result<(), DynError> { - let validators = ctx.node_clients().validator_clients(); - let client = validators.get(self.target_idx).ok_or_else(|| { + let clients = ctx.node_clients().node_clients(); + let client = clients.get(self.target_idx).ok_or_else(|| { Box::new(std::io::Error::new( std::io::ErrorKind::Other, "missing target client", diff --git a/examples/doc-snippets/src/custom_workload_example_workload.rs b/examples/doc-snippets/src/custom_workload_example_workload.rs index 4b545a4..da09bdf 100644 --- a/examples/doc-snippets/src/custom_workload_example_workload.rs +++ b/examples/doc-snippets/src/custom_workload_example_workload.rs @@ -33,18 +33,18 @@ impl Workload for ReachabilityWorkload { topology: &GeneratedTopology, _run_metrics: &RunMetrics, ) -> Result<(), DynError> { - if topology.validators().get(self.target_idx).is_none() { + if topology.nodes().get(self.target_idx).is_none() { return Err(Box::new(std::io::Error::new( std::io::ErrorKind::Other, - "no validator at requested index", + "no node at requested index", ))); } Ok(()) } async fn start(&self, ctx: &RunContext) -> Result<(), DynError> { - let validators = ctx.node_clients().validator_clients(); - let client = validators.get(self.target_idx).ok_or_else(|| { + let clients = ctx.node_clients().node_clients(); + let client = clients.get(self.target_idx).ok_or_else(|| { Box::new(std::io::Error::new( std::io::ErrorKind::Other, "missing target client", diff --git a/examples/doc-snippets/src/dsl_cheat_sheet_build.rs b/examples/doc-snippets/src/dsl_cheat_sheet_build.rs index f6c3762..f8c9c50 100644 --- a/examples/doc-snippets/src/dsl_cheat_sheet_build.rs +++ b/examples/doc-snippets/src/dsl_cheat_sheet_build.rs @@ -4,5 +4,5 @@ use testing_framework_workflows::ScenarioBuilderExt; use crate::SnippetResult; pub fn build_plan() -> SnippetResult> { - ScenarioBuilder::topology_with(|t| t.network_star().validators(1).executors(0)).build() // Construct the final Scenario + ScenarioBuilder::topology_with(|t| t.network_star().nodes(1)).build() // Construct the final Scenario } diff --git a/examples/doc-snippets/src/dsl_cheat_sheet_build_complete_example.rs b/examples/doc-snippets/src/dsl_cheat_sheet_build_complete_example.rs index cc4457b..f87e1ab 100644 --- a/examples/doc-snippets/src/dsl_cheat_sheet_build_complete_example.rs +++ b/examples/doc-snippets/src/dsl_cheat_sheet_build_complete_example.rs @@ -6,7 +6,7 @@ use testing_framework_runner_local::LocalDeployer; use testing_framework_workflows::ScenarioBuilderExt; pub async fn run_test() -> Result<()> { - let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(2)) + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(5)) .wallets(50) .transactions_with(|txs| { txs.rate(5) // 5 transactions per block diff --git a/examples/doc-snippets/src/dsl_cheat_sheet_expectations.rs b/examples/doc-snippets/src/dsl_cheat_sheet_expectations.rs index ecf2437..7d224da 100644 --- a/examples/doc-snippets/src/dsl_cheat_sheet_expectations.rs +++ b/examples/doc-snippets/src/dsl_cheat_sheet_expectations.rs @@ -4,7 +4,7 @@ use testing_framework_workflows::ScenarioBuilderExt; use crate::SnippetResult; pub fn expectations_plan() -> SnippetResult> { - ScenarioBuilder::topology_with(|t| t.network_star().validators(1).executors(0)) + ScenarioBuilder::topology_with(|t| t.network_star().nodes(1)) .expect_consensus_liveness() // Assert blocks are produced continuously .build() } diff --git a/examples/doc-snippets/src/dsl_cheat_sheet_run_duration.rs b/examples/doc-snippets/src/dsl_cheat_sheet_run_duration.rs index 925a735..d22ae46 100644 --- a/examples/doc-snippets/src/dsl_cheat_sheet_run_duration.rs +++ b/examples/doc-snippets/src/dsl_cheat_sheet_run_duration.rs @@ -6,7 +6,7 @@ use testing_framework_workflows::ScenarioBuilderExt; use crate::SnippetResult; pub fn run_duration_plan() -> SnippetResult> { - ScenarioBuilder::topology_with(|t| t.network_star().validators(1).executors(0)) + ScenarioBuilder::topology_with(|t| t.network_star().nodes(1)) .with_run_duration(Duration::from_secs(120)) // Run for 120 seconds .build() } diff --git a/examples/doc-snippets/src/dsl_cheat_sheet_topology.rs b/examples/doc-snippets/src/dsl_cheat_sheet_topology.rs index 9ed2208..6396359 100644 --- a/examples/doc-snippets/src/dsl_cheat_sheet_topology.rs +++ b/examples/doc-snippets/src/dsl_cheat_sheet_topology.rs @@ -3,7 +3,6 @@ use testing_framework_core::scenario::{Builder, ScenarioBuilder}; pub fn topology() -> Builder<()> { ScenarioBuilder::topology_with(|t| { t.network_star() // Star topology (all connect to seed node) - .validators(3) // Number of validator nodes - .executors(2) // Number of executor nodes + .nodes(5) // Number of nodes }) } diff --git a/examples/doc-snippets/src/dsl_cheat_sheet_transactions_workload.rs b/examples/doc-snippets/src/dsl_cheat_sheet_transactions_workload.rs index c4f6fda..c0427e4 100644 --- a/examples/doc-snippets/src/dsl_cheat_sheet_transactions_workload.rs +++ b/examples/doc-snippets/src/dsl_cheat_sheet_transactions_workload.rs @@ -4,7 +4,7 @@ use testing_framework_workflows::ScenarioBuilderExt; use crate::SnippetResult; pub fn transactions_plan() -> SnippetResult> { - ScenarioBuilder::topology_with(|t| t.network_star().validators(1).executors(0)) + ScenarioBuilder::topology_with(|t| t.network_star().nodes(1)) .wallets(50) .transactions_with(|txs| { txs.rate(5) // 5 transactions per block diff --git a/examples/doc-snippets/src/dsl_cheat_sheet_wallets.rs b/examples/doc-snippets/src/dsl_cheat_sheet_wallets.rs index f7d45f0..4e1fe38 100644 --- a/examples/doc-snippets/src/dsl_cheat_sheet_wallets.rs +++ b/examples/doc-snippets/src/dsl_cheat_sheet_wallets.rs @@ -4,7 +4,7 @@ use testing_framework_workflows::ScenarioBuilderExt; use crate::SnippetResult; pub fn wallets_plan() -> SnippetResult> { - ScenarioBuilder::topology_with(|t| t.network_star().validators(1).executors(0)) + ScenarioBuilder::topology_with(|t| t.network_star().nodes(1)) .wallets(50) // Seed 50 funded wallet accounts .build() } diff --git a/examples/doc-snippets/src/dsl_cheat_sheet_workload_chaos.rs b/examples/doc-snippets/src/dsl_cheat_sheet_workload_chaos.rs index 935f5a7..d5c07fc 100644 --- a/examples/doc-snippets/src/dsl_cheat_sheet_workload_chaos.rs +++ b/examples/doc-snippets/src/dsl_cheat_sheet_workload_chaos.rs @@ -7,7 +7,7 @@ use crate::SnippetResult; pub fn chaos_plan() -> SnippetResult> { - ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(2)) + ScenarioBuilder::topology_with(|t| t.network_star().nodes(5)) .enable_node_control() // Enable node control capability .chaos_with(|c| { c.restart() // Random restart chaos diff --git a/examples/doc-snippets/src/dsl_cheat_sheet_workload_execution.rs b/examples/doc-snippets/src/dsl_cheat_sheet_workload_execution.rs index 926d9d4..27c0b10 100644 --- a/examples/doc-snippets/src/dsl_cheat_sheet_workload_execution.rs +++ b/examples/doc-snippets/src/dsl_cheat_sheet_workload_execution.rs @@ -4,7 +4,7 @@ use testing_framework_runner_local::LocalDeployer; use testing_framework_workflows::ScenarioBuilderExt; pub async fn execution() -> Result<()> { - let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(1).executors(0)) + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(1)) .expect_consensus_liveness() .build()?; diff --git a/examples/doc-snippets/src/examples_advanced_aggressive_chaos_test.rs b/examples/doc-snippets/src/examples_advanced_aggressive_chaos_test.rs index 5ab5c88..32e7d5f 100644 --- a/examples/doc-snippets/src/examples_advanced_aggressive_chaos_test.rs +++ b/examples/doc-snippets/src/examples_advanced_aggressive_chaos_test.rs @@ -6,7 +6,7 @@ use testing_framework_runner_compose::ComposeDeployer; use testing_framework_workflows::{ChaosBuilderExt, ScenarioBuilderExt}; pub async fn aggressive_chaos_test() -> Result<()> { - let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(4).executors(2)) + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(6)) .enable_node_control() .wallets(50) .transactions_with(|txs| txs.rate(10).users(20)) diff --git a/examples/doc-snippets/src/examples_advanced_load_progression_test.rs b/examples/doc-snippets/src/examples_advanced_load_progression_test.rs index 489c993..bc5705c 100644 --- a/examples/doc-snippets/src/examples_advanced_load_progression_test.rs +++ b/examples/doc-snippets/src/examples_advanced_load_progression_test.rs @@ -9,13 +9,12 @@ pub async fn load_progression_test() -> Result<()> { for rate in [5, 10, 20, 30] { println!("Testing with rate: {}", rate); - let mut plan = - ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(2)) - .wallets(50) - .transactions_with(|txs| txs.rate(rate).users(20)) - .expect_consensus_liveness() - .with_run_duration(Duration::from_secs(60)) - .build()?; + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(5)) + .wallets(50) + .transactions_with(|txs| txs.rate(rate).users(20)) + .expect_consensus_liveness() + .with_run_duration(Duration::from_secs(60)) + .build()?; let deployer = ComposeDeployer::default(); let runner = deployer.deploy(&plan).await?; diff --git a/examples/doc-snippets/src/examples_advanced_sustained_load_test.rs b/examples/doc-snippets/src/examples_advanced_sustained_load_test.rs index e5be3f8..80d9377 100644 --- a/examples/doc-snippets/src/examples_advanced_sustained_load_test.rs +++ b/examples/doc-snippets/src/examples_advanced_sustained_load_test.rs @@ -6,7 +6,7 @@ use testing_framework_runner_compose::ComposeDeployer; use testing_framework_workflows::ScenarioBuilderExt; pub async fn sustained_load_test() -> Result<()> { - let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(4).executors(2)) + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(6)) .wallets(100) .transactions_with(|txs| txs.rate(15).users(50)) .expect_consensus_liveness() diff --git a/examples/doc-snippets/src/examples_chaos_resilience.rs b/examples/doc-snippets/src/examples_chaos_resilience.rs index 09403c7..d2fb353 100644 --- a/examples/doc-snippets/src/examples_chaos_resilience.rs +++ b/examples/doc-snippets/src/examples_chaos_resilience.rs @@ -6,7 +6,7 @@ use testing_framework_runner_compose::ComposeDeployer; use testing_framework_workflows::{ChaosBuilderExt, ScenarioBuilderExt}; pub async fn chaos_resilience() -> Result<()> { - let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(4).executors(2)) + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(6)) .enable_node_control() .wallets(20) .transactions_with(|txs| txs.rate(3).users(10)) diff --git a/examples/doc-snippets/src/examples_da_and_transactions.rs b/examples/doc-snippets/src/examples_da_and_transactions.rs index dd076c9..af917dc 100644 --- a/examples/doc-snippets/src/examples_da_and_transactions.rs +++ b/examples/doc-snippets/src/examples_da_and_transactions.rs @@ -6,7 +6,7 @@ use testing_framework_runner_local::LocalDeployer; use testing_framework_workflows::ScenarioBuilderExt; pub async fn transactions_multi_node() -> Result<()> { - let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(2)) + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(5)) .wallets(30) .transactions_with(|txs| txs.rate(5).users(15)) .expect_consensus_liveness() diff --git a/examples/doc-snippets/src/examples_simple_consensus.rs b/examples/doc-snippets/src/examples_simple_consensus.rs index 4e93766..1978747 100644 --- a/examples/doc-snippets/src/examples_simple_consensus.rs +++ b/examples/doc-snippets/src/examples_simple_consensus.rs @@ -6,7 +6,7 @@ use testing_framework_runner_local::LocalDeployer; use testing_framework_workflows::ScenarioBuilderExt; pub async fn simple_consensus() -> Result<()> { - let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(0)) + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(3)) .expect_consensus_liveness() .with_run_duration(Duration::from_secs(30)) .build()?; diff --git a/examples/doc-snippets/src/examples_transaction_workload.rs b/examples/doc-snippets/src/examples_transaction_workload.rs index e2a8670..4c0a013 100644 --- a/examples/doc-snippets/src/examples_transaction_workload.rs +++ b/examples/doc-snippets/src/examples_transaction_workload.rs @@ -6,7 +6,7 @@ use testing_framework_runner_local::LocalDeployer; use testing_framework_workflows::ScenarioBuilderExt; pub async fn transaction_workload() -> Result<()> { - let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(2).executors(0)) + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(2)) .wallets(20) .transactions_with(|txs| txs.rate(5).users(10)) .expect_consensus_liveness() diff --git a/examples/doc-snippets/src/internal_crate_reference_add_expectation_builder_ext.rs b/examples/doc-snippets/src/internal_crate_reference_add_expectation_builder_ext.rs index 6085eaf..e61b2f2 100644 --- a/examples/doc-snippets/src/internal_crate_reference_add_expectation_builder_ext.rs +++ b/examples/doc-snippets/src/internal_crate_reference_add_expectation_builder_ext.rs @@ -13,7 +13,7 @@ impl YourExpectationDslExt for testing_framework_core::scenario::Builder SnippetResult<()> { - let _plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(0)) + let _plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(3)) .expect_your_condition() .build()?; Ok(()) diff --git a/examples/doc-snippets/src/internal_crate_reference_add_workload_use_in_examples.rs b/examples/doc-snippets/src/internal_crate_reference_add_workload_use_in_examples.rs index 76c41df..d61d169 100644 --- a/examples/doc-snippets/src/internal_crate_reference_add_workload_use_in_examples.rs +++ b/examples/doc-snippets/src/internal_crate_reference_add_workload_use_in_examples.rs @@ -27,7 +27,7 @@ impl YourWorkloadDslExt for testing_framework_core::scenario::Builder SnippetResult<()> { - let _plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(0)) + let _plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(3)) .your_workload_with(|w| w.some_config()) .build()?; Ok(()) diff --git a/examples/doc-snippets/src/node_control_accessing_control.rs b/examples/doc-snippets/src/node_control_accessing_control.rs index 08f3af8..a7cc27d 100644 --- a/examples/doc-snippets/src/node_control_accessing_control.rs +++ b/examples/doc-snippets/src/node_control_accessing_control.rs @@ -11,8 +11,8 @@ impl Workload for RestartWorkload { async fn start(&self, ctx: &RunContext) -> Result<(), DynError> { if let Some(control) = ctx.node_control() { - // Restart the first validator (index 0) if supported. - control.restart_validator(0).await?; + // Restart the first node (index 0) if supported. + control.restart_node(0).await?; } Ok(()) } diff --git a/examples/doc-snippets/src/node_control_trait.rs b/examples/doc-snippets/src/node_control_trait.rs index 1a438f9..98976ca 100644 --- a/examples/doc-snippets/src/node_control_trait.rs +++ b/examples/doc-snippets/src/node_control_trait.rs @@ -3,6 +3,5 @@ use testing_framework_core::scenario::DynError; #[async_trait] pub trait NodeControlHandle: Send + Sync { - async fn restart_validator(&self, index: usize) -> Result<(), DynError>; - async fn restart_executor(&self, index: usize) -> Result<(), DynError>; + async fn restart_node(&self, index: usize) -> Result<(), DynError>; } diff --git a/examples/doc-snippets/src/quickstart_adjust_topology.rs b/examples/doc-snippets/src/quickstart_adjust_topology.rs index 793b20a..013a22f 100644 --- a/examples/doc-snippets/src/quickstart_adjust_topology.rs +++ b/examples/doc-snippets/src/quickstart_adjust_topology.rs @@ -4,7 +4,7 @@ use testing_framework_runner_local::LocalDeployer; pub async fn run_with_env_overrides() -> Result<()> { // Uses NOMOS_DEMO_* env vars (or legacy *_DEMO_* vars) - let mut plan = ScenarioBuilder::with_node_counts(3, 2) + let mut plan = ScenarioBuilder::with_node_count(5) .with_run_duration(std::time::Duration::from_secs(120)) .build()?; diff --git a/examples/doc-snippets/src/quickstart_core_api_pattern.rs b/examples/doc-snippets/src/quickstart_core_api_pattern.rs index e42e8fc..c027fbf 100644 --- a/examples/doc-snippets/src/quickstart_core_api_pattern.rs +++ b/examples/doc-snippets/src/quickstart_core_api_pattern.rs @@ -6,8 +6,8 @@ use testing_framework_runner_local::LocalDeployer; use testing_framework_workflows::ScenarioBuilderExt; pub async fn run_local_demo() -> Result<()> { - // Define the scenario (1 validator + 1 executor, tx workload) - let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(1).executors(1)) + // Define the scenario (2 nodes, tx workload) + let mut plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(2)) .wallets(1_000) .transactions_with(|txs| { txs.rate(5) // 5 transactions per block diff --git a/examples/doc-snippets/src/quickstart_step_1_topology.rs b/examples/doc-snippets/src/quickstart_step_1_topology.rs index 55a81fb..ea8fa62 100644 --- a/examples/doc-snippets/src/quickstart_step_1_topology.rs +++ b/examples/doc-snippets/src/quickstart_step_1_topology.rs @@ -3,7 +3,6 @@ use testing_framework_core::scenario::ScenarioBuilder; pub fn step_1_topology() -> testing_framework_core::scenario::Builder<()> { ScenarioBuilder::topology_with(|t| { t.network_star() // Star topology: all nodes connect to seed - .validators(1) // 1 validator node - .executors(1) // 1 executor node + .nodes(2) // 2 nodes }) } diff --git a/examples/doc-snippets/src/quickstart_step_2_wallets.rs b/examples/doc-snippets/src/quickstart_step_2_wallets.rs index 19aad8c..169a4d9 100644 --- a/examples/doc-snippets/src/quickstart_step_2_wallets.rs +++ b/examples/doc-snippets/src/quickstart_step_2_wallets.rs @@ -2,5 +2,5 @@ use testing_framework_core::scenario::ScenarioBuilder; use testing_framework_workflows::ScenarioBuilderExt; pub fn step_2_wallets() -> testing_framework_core::scenario::Builder<()> { - ScenarioBuilder::with_node_counts(1, 1).wallets(1_000) // Seed 1,000 funded wallet accounts + ScenarioBuilder::with_node_count(2).wallets(1_000) // Seed 1,000 funded wallet accounts } diff --git a/examples/doc-snippets/src/quickstart_step_3_workloads.rs b/examples/doc-snippets/src/quickstart_step_3_workloads.rs index e145058..2821abd 100644 --- a/examples/doc-snippets/src/quickstart_step_3_workloads.rs +++ b/examples/doc-snippets/src/quickstart_step_3_workloads.rs @@ -2,7 +2,7 @@ use testing_framework_core::scenario::ScenarioBuilder; use testing_framework_workflows::ScenarioBuilderExt; pub fn step_3_workloads() -> testing_framework_core::scenario::Builder<()> { - ScenarioBuilder::with_node_counts(1, 1) + ScenarioBuilder::with_node_count(2) .wallets(1_000) .transactions_with(|txs| { txs.rate(5) // 5 transactions per block diff --git a/examples/doc-snippets/src/quickstart_step_4_expectation.rs b/examples/doc-snippets/src/quickstart_step_4_expectation.rs index 9a24312..c7b17ea 100644 --- a/examples/doc-snippets/src/quickstart_step_4_expectation.rs +++ b/examples/doc-snippets/src/quickstart_step_4_expectation.rs @@ -2,5 +2,5 @@ use testing_framework_core::scenario::ScenarioBuilder; use testing_framework_workflows::ScenarioBuilderExt; pub fn step_4_expectation() -> testing_framework_core::scenario::Builder<()> { - ScenarioBuilder::with_node_counts(1, 1).expect_consensus_liveness() // This says what success means: blocks must be produced continuously. + ScenarioBuilder::with_node_count(2).expect_consensus_liveness() // This says what success means: blocks must be produced continuously. } diff --git a/examples/doc-snippets/src/quickstart_step_5_run_duration.rs b/examples/doc-snippets/src/quickstart_step_5_run_duration.rs index 4043973..ba46831 100644 --- a/examples/doc-snippets/src/quickstart_step_5_run_duration.rs +++ b/examples/doc-snippets/src/quickstart_step_5_run_duration.rs @@ -3,5 +3,5 @@ use std::time::Duration; use testing_framework_core::scenario::ScenarioBuilder; pub fn step_5_run_duration() -> testing_framework_core::scenario::Builder<()> { - ScenarioBuilder::with_node_counts(1, 1).with_run_duration(Duration::from_secs(60)) + ScenarioBuilder::with_node_count(2).with_run_duration(Duration::from_secs(60)) } diff --git a/examples/doc-snippets/src/quickstart_step_6_deploy_and_execute.rs b/examples/doc-snippets/src/quickstart_step_6_deploy_and_execute.rs index 8b82e50..7a900ab 100644 --- a/examples/doc-snippets/src/quickstart_step_6_deploy_and_execute.rs +++ b/examples/doc-snippets/src/quickstart_step_6_deploy_and_execute.rs @@ -3,7 +3,7 @@ use testing_framework_core::scenario::{Deployer, ScenarioBuilder}; use testing_framework_runner_local::LocalDeployer; pub async fn step_6_deploy_and_execute() -> Result<()> { - let mut plan = ScenarioBuilder::with_node_counts(1, 1).build()?; + let mut plan = ScenarioBuilder::with_node_count(2).build()?; let deployer = LocalDeployer::default(); // Use local process deployer let runner = deployer.deploy(&plan).await?; // Provision infrastructure diff --git a/examples/doc-snippets/src/quickstart_swap_deployer_compose.rs b/examples/doc-snippets/src/quickstart_swap_deployer_compose.rs index 5df9522..42e0080 100644 --- a/examples/doc-snippets/src/quickstart_swap_deployer_compose.rs +++ b/examples/doc-snippets/src/quickstart_swap_deployer_compose.rs @@ -4,7 +4,7 @@ use testing_framework_runner_compose::ComposeDeployer; pub async fn run_with_compose_deployer() -> Result<()> { // ... same scenario definition ... - let mut plan = ScenarioBuilder::with_node_counts(1, 1).build()?; + let mut plan = ScenarioBuilder::with_node_count(2).build()?; let deployer = ComposeDeployer::default(); // Use Docker Compose let runner = deployer.deploy(&plan).await?; diff --git a/examples/doc-snippets/src/testing_philosophy_declarative_over_imperative.rs b/examples/doc-snippets/src/testing_philosophy_declarative_over_imperative.rs index 0540082..a4441aa 100644 --- a/examples/doc-snippets/src/testing_philosophy_declarative_over_imperative.rs +++ b/examples/doc-snippets/src/testing_philosophy_declarative_over_imperative.rs @@ -5,7 +5,7 @@ use crate::SnippetResult; pub fn declarative_over_imperative() -> SnippetResult<()> { // Good: declarative - let _plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(2).executors(1)) + let _plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(3)) .transactions_with(|txs| { txs.rate(5) // 5 transactions per block }) @@ -13,7 +13,7 @@ pub fn declarative_over_imperative() -> SnippetResult<()> { .build()?; // Bad: imperative (framework doesn't work this way) - // spawn_validator(); spawn_executor(); + // spawn_node(); spawn_node(); // loop { submit_tx(); check_block(); } Ok(()) diff --git a/examples/doc-snippets/src/testing_philosophy_determinism_first.rs b/examples/doc-snippets/src/testing_philosophy_determinism_first.rs index 6e3f646..937f1ba 100644 --- a/examples/doc-snippets/src/testing_philosophy_determinism_first.rs +++ b/examples/doc-snippets/src/testing_philosophy_determinism_first.rs @@ -7,7 +7,7 @@ use crate::SnippetResult; pub fn determinism_first() -> SnippetResult<()> { // Separate: functional test (deterministic) - let _plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(2).executors(1)) + let _plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(3)) .transactions_with(|txs| { txs.rate(5) // 5 transactions per block }) @@ -15,20 +15,19 @@ pub fn determinism_first() -> SnippetResult<()> { .build()?; // Separate: chaos test (introduces randomness) - let _chaos_plan = - ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(2)) - .enable_node_control() - .chaos_with(|c| { - c.restart() - .min_delay(Duration::from_secs(30)) - .max_delay(Duration::from_secs(60)) - .target_cooldown(Duration::from_secs(45)) - .apply() - }) - .transactions_with(|txs| { - txs.rate(5) // 5 transactions per block - }) - .expect_consensus_liveness() - .build()?; + let _chaos_plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(5)) + .enable_node_control() + .chaos_with(|c| { + c.restart() + .min_delay(Duration::from_secs(30)) + .max_delay(Duration::from_secs(60)) + .target_cooldown(Duration::from_secs(45)) + .apply() + }) + .transactions_with(|txs| { + txs.rate(5) // 5 transactions per block + }) + .expect_consensus_liveness() + .build()?; Ok(()) } diff --git a/examples/doc-snippets/src/testing_philosophy_minimum_run_windows.rs b/examples/doc-snippets/src/testing_philosophy_minimum_run_windows.rs index b9c30f0..5e50e5e 100644 --- a/examples/doc-snippets/src/testing_philosophy_minimum_run_windows.rs +++ b/examples/doc-snippets/src/testing_philosophy_minimum_run_windows.rs @@ -7,14 +7,14 @@ use crate::SnippetResult; pub fn minimum_run_windows() -> SnippetResult<()> { // Bad: too short (~2 blocks with default 2s slots, 0.9 coeff) - let _too_short = ScenarioBuilder::with_node_counts(1, 0) + let _too_short = ScenarioBuilder::with_node_count(1) .with_run_duration(Duration::from_secs(5)) .expect_consensus_liveness() .build()?; // Good: enough blocks for assertions (~27 blocks with default 2s slots, 0.9 // coeff) - let _good = ScenarioBuilder::with_node_counts(1, 0) + let _good = ScenarioBuilder::with_node_count(1) .with_run_duration(Duration::from_secs(60)) .expect_consensus_liveness() .build()?; diff --git a/examples/doc-snippets/src/testing_philosophy_protocol_time_not_wall_time.rs b/examples/doc-snippets/src/testing_philosophy_protocol_time_not_wall_time.rs index b993857..fb1177b 100644 --- a/examples/doc-snippets/src/testing_philosophy_protocol_time_not_wall_time.rs +++ b/examples/doc-snippets/src/testing_philosophy_protocol_time_not_wall_time.rs @@ -7,7 +7,7 @@ use crate::SnippetResult; pub fn protocol_time_not_wall_time() -> SnippetResult<()> { // Good: protocol-oriented thinking - let _plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(2).executors(1)) + let _plan = ScenarioBuilder::topology_with(|t| t.network_star().nodes(3)) .transactions_with(|txs| { txs.rate(5) // 5 transactions per block }) diff --git a/examples/src/bin/compose_runner.rs b/examples/src/bin/compose_runner.rs index 6af825a..b9407d0 100644 --- a/examples/src/bin/compose_runner.rs +++ b/examples/src/bin/compose_runner.rs @@ -24,39 +24,27 @@ async fn main() { tracing_subscriber::fmt::init(); - let validators = read_env_any(&["NOMOS_DEMO_VALIDATORS"], demo::DEFAULT_VALIDATORS); - - let executors = read_env_any(&["NOMOS_DEMO_EXECUTORS"], demo::DEFAULT_EXECUTORS); + let nodes = read_env_any(&["NOMOS_DEMO_NODES"], demo::DEFAULT_NODES); let run_secs = read_env_any(&["NOMOS_DEMO_RUN_SECS"], demo::DEFAULT_RUN_SECS); - info!( - validators, - executors, run_secs, "starting compose runner demo" - ); + info!(nodes, run_secs, "starting compose runner demo"); - if let Err(err) = run_compose_case(validators, executors, Duration::from_secs(run_secs)).await { + if let Err(err) = run_compose_case(nodes, Duration::from_secs(run_secs)).await { warn!("compose runner demo failed: {err:#}"); process::exit(1); } } -async fn run_compose_case( - validators: usize, - executors: usize, - run_duration: Duration, -) -> Result<()> { +async fn run_compose_case(nodes: usize, run_duration: Duration) -> Result<()> { info!( - validators, - executors, + nodes, duration_secs = run_duration.as_secs(), "building scenario plan" ); - let scenario = ScenarioBuilder::topology_with(|t| { - t.network_star().validators(validators).executors(executors) - }) - .enable_node_control(); + let scenario = + ScenarioBuilder::topology_with(|t| t.network_star().nodes(nodes)).enable_node_control(); let scenario = if let Some((chaos_min_delay, chaos_max_delay, chaos_target_cooldown)) = chaos_timings(run_duration) diff --git a/examples/src/bin/k8s_runner.rs b/examples/src/bin/k8s_runner.rs index 2738468..7f118b3 100644 --- a/examples/src/bin/k8s_runner.rs +++ b/examples/src/bin/k8s_runner.rs @@ -17,33 +17,29 @@ const TRANSACTION_WALLETS: usize = 50; async fn main() { tracing_subscriber::fmt::init(); - let validators = read_env_any(&["NOMOS_DEMO_VALIDATORS"], demo::DEFAULT_VALIDATORS); - let executors = read_env_any(&["NOMOS_DEMO_EXECUTORS"], demo::DEFAULT_EXECUTORS); + let nodes = read_env_any(&["NOMOS_DEMO_NODES"], demo::DEFAULT_NODES); let run_secs = read_env_any(&["NOMOS_DEMO_RUN_SECS"], demo::DEFAULT_RUN_SECS); - info!(validators, executors, run_secs, "starting k8s runner demo"); + info!(nodes, run_secs, "starting k8s runner demo"); - if let Err(err) = run_k8s_case(validators, executors, Duration::from_secs(run_secs)).await { + if let Err(err) = run_k8s_case(nodes, Duration::from_secs(run_secs)).await { warn!("k8s runner demo failed: {err:#}"); process::exit(1); } } -async fn run_k8s_case(validators: usize, executors: usize, run_duration: Duration) -> Result<()> { +async fn run_k8s_case(nodes: usize, run_duration: Duration) -> Result<()> { info!( - validators, - executors, + nodes, duration_secs = run_duration.as_secs(), "building scenario plan" ); - let mut scenario = ScenarioBuilder::topology_with(|t| { - t.network_star().validators(validators).executors(executors) - }) - .with_capabilities(ObservabilityCapability::default()) - .wallets(TOTAL_WALLETS) - .transactions_with(|txs| txs.rate(MIXED_TXS_PER_BLOCK).users(TRANSACTION_WALLETS)) - .with_run_duration(run_duration) - .expect_consensus_liveness(); + let mut scenario = ScenarioBuilder::topology_with(|t| t.network_star().nodes(nodes)) + .with_capabilities(ObservabilityCapability::default()) + .wallets(TOTAL_WALLETS) + .transactions_with(|txs| txs.rate(MIXED_TXS_PER_BLOCK).users(TRANSACTION_WALLETS)) + .with_run_duration(run_duration) + .expect_consensus_liveness(); if let Ok(url) = env::var("NOMOS_METRICS_QUERY_URL") { if !url.trim().is_empty() { diff --git a/examples/src/bin/local_runner.rs b/examples/src/bin/local_runner.rs index 8acf0b9..4df62cf 100644 --- a/examples/src/bin/local_runner.rs +++ b/examples/src/bin/local_runner.rs @@ -22,34 +22,27 @@ async fn main() { process::exit(1); } - let validators = read_env_any(&["NOMOS_DEMO_VALIDATORS"], demo::DEFAULT_VALIDATORS); - let executors = read_env_any(&["NOMOS_DEMO_EXECUTORS"], demo::DEFAULT_EXECUTORS); + let nodes = read_env_any(&["NOMOS_DEMO_NODES"], demo::DEFAULT_NODES); let run_secs = read_env_any(&["NOMOS_DEMO_RUN_SECS"], demo::DEFAULT_RUN_SECS); - info!( - validators, - executors, run_secs, "starting local runner demo" - ); + info!(nodes, run_secs, "starting local runner demo"); - if let Err(err) = run_local_case(validators, executors, Duration::from_secs(run_secs)).await { + if let Err(err) = run_local_case(nodes, Duration::from_secs(run_secs)).await { warn!("local runner demo failed: {err:#}"); process::exit(1); } } -async fn run_local_case(validators: usize, executors: usize, run_duration: Duration) -> Result<()> { +async fn run_local_case(nodes: usize, run_duration: Duration) -> Result<()> { info!( - validators, - executors, + nodes, duration_secs = run_duration.as_secs(), "building scenario plan" ); - let scenario = ScenarioBuilder::topology_with(|t| { - t.network_star().validators(validators).executors(executors) - }) - .wallets(TOTAL_WALLETS) - .with_run_duration(run_duration); + let scenario = ScenarioBuilder::topology_with(|t| t.network_star().nodes(nodes)) + .wallets(TOTAL_WALLETS) + .with_run_duration(run_duration); let scenario = if run_duration.as_secs() <= SMOKE_RUN_SECS_MAX { scenario diff --git a/examples/src/demo.rs b/examples/src/demo.rs index 75f8265..cf56a9b 100644 --- a/examples/src/demo.rs +++ b/examples/src/demo.rs @@ -1,3 +1,2 @@ -pub const DEFAULT_VALIDATORS: usize = 2; -pub const DEFAULT_EXECUTORS: usize = 0; +pub const DEFAULT_NODES: usize = 2; pub const DEFAULT_RUN_SECS: u64 = 60; diff --git a/examples/tests/dynamic_join.rs b/examples/tests/dynamic_join.rs index 7522a62..d892b5a 100644 --- a/examples/tests/dynamic_join.rs +++ b/examples/tests/dynamic_join.rs @@ -37,7 +37,7 @@ impl Workload for JoinNodeWorkload { sleep(START_DELAY).await; - let node = handle.start_validator(&self.name).await?; + let node = handle.start_node(&self.name).await?; let client = node.api; timeout(READY_TIMEOUT, async { @@ -86,7 +86,7 @@ impl Workload for JoinNodeWithPeersWorkload { let options = StartNodeOptions { peers: PeerSelection::Named(self.peers.clone()), }; - let node = handle.start_validator_with(&self.name, options).await?; + let node = handle.start_node_with(&self.name, options).await?; let client = node.api; timeout(READY_TIMEOUT, async { @@ -110,13 +110,12 @@ impl Workload for JoinNodeWithPeersWorkload { async fn dynamic_join_reaches_consensus_liveness() -> Result<()> { let _ = try_init(); - let mut scenario = - ScenarioBuilder::topology_with(|t| t.network_star().validators(2).executors(0)) - .enable_node_control() - .with_workload(JoinNodeWorkload::new("joiner")) - .expect_consensus_liveness() - .with_run_duration(Duration::from_secs(60)) - .build()?; + let mut scenario = ScenarioBuilder::topology_with(|t| t.network_star().nodes(2)) + .enable_node_control() + .with_workload(JoinNodeWorkload::new("joiner")) + .expect_consensus_liveness() + .with_run_duration(Duration::from_secs(60)) + .build()?; let deployer = LocalDeployer::default(); let runner = deployer.deploy(&scenario).await?; @@ -128,16 +127,15 @@ async fn dynamic_join_reaches_consensus_liveness() -> Result<()> { #[tokio::test] #[ignore = "run manually with `cargo test -p runner-examples -- --ignored`"] async fn dynamic_join_with_peers_reaches_consensus_liveness() -> Result<()> { - let mut scenario = - ScenarioBuilder::topology_with(|t| t.network_star().validators(2).executors(0)) - .enable_node_control() - .with_workload(JoinNodeWithPeersWorkload::new( - "joiner", - vec!["validator-0".to_string()], - )) - .expect_consensus_liveness() - .with_run_duration(Duration::from_secs(60)) - .build()?; + let mut scenario = ScenarioBuilder::topology_with(|t| t.network_star().nodes(2)) + .enable_node_control() + .with_workload(JoinNodeWithPeersWorkload::new( + "joiner", + vec!["node-0".to_string()], + )) + .expect_consensus_liveness() + .with_run_duration(Duration::from_secs(60)) + .build()?; let deployer = LocalDeployer::default(); let runner = deployer.deploy(&scenario).await?; diff --git a/examples/tests/manual_cluster.rs b/examples/tests/manual_cluster.rs index 7d50c0c..db9de45 100644 --- a/examples/tests/manual_cluster.rs +++ b/examples/tests/manual_cluster.rs @@ -18,15 +18,15 @@ async fn manual_cluster_two_clusters_merge() -> Result<()> { // Required env vars (set on the command line when running this test): // - `POL_PROOF_DEV_MODE=true` // - `RUST_LOG=info` (optional) - let config = TopologyConfig::with_node_numbers(2, 0); + let config = TopologyConfig::with_node_count(2); let deployer = LocalDeployer::new(); let cluster = deployer.manual_cluster(config)?; // Nodes are stopped automatically when the cluster is dropped. - println!("starting validator a"); + println!("starting node a"); - let validator_a = cluster - .start_validator_with( + let node_a = cluster + .start_node_with( "a", StartNodeOptions { peers: PeerSelection::None, @@ -38,12 +38,12 @@ async fn manual_cluster_two_clusters_merge() -> Result<()> { println!("waiting briefly before starting c"); sleep(Duration::from_secs(30)).await; - println!("starting validator c -> a"); - let validator_c = cluster - .start_validator_with( + println!("starting node c -> a"); + let node_c = cluster + .start_node_with( "c", StartNodeOptions { - peers: PeerSelection::Named(vec!["validator-a".to_owned()]), + peers: PeerSelection::Named(vec!["node-a".to_owned()]), }, ) .await? @@ -54,12 +54,12 @@ async fn manual_cluster_two_clusters_merge() -> Result<()> { sleep(Duration::from_secs(5)).await; - let a_info = validator_a.consensus_info().await?; - let c_info = validator_c.consensus_info().await?; + let a_info = node_a.consensus_info().await?; + let c_info = node_c.consensus_info().await?; let height_diff = a_info.height.abs_diff(c_info.height); println!( - "final heights: validator-a={}, validator-c={}, diff={}", + "final heights: node-a={}, node-c={}, diff={}", a_info.height, c_info.height, height_diff ); diff --git a/scripts/build/build-bundle.sh b/scripts/build/build-bundle.sh index b3169a2..16622f0 100755 --- a/scripts/build/build-bundle.sh +++ b/scripts/build/build-bundle.sh @@ -322,7 +322,6 @@ build_bundle::prepare_circuits() { fi NODE_BIN="${NODE_TARGET}/debug/logos-blockchain-node" - EXEC_BIN="${NODE_TARGET}/debug/logos-blockchain-executor" CLI_BIN="${NODE_TARGET}/debug/logos-blockchain-cli" } @@ -360,13 +359,13 @@ build_bundle::build_binaries() { LOGOS_BLOCKCHAIN_CIRCUITS="${CIRCUITS_DIR}" \ RUSTUP_TOOLCHAIN="${BUNDLE_RUSTUP_TOOLCHAIN}" \ cargo build --all-features \ - -p logos-blockchain-node -p logos-blockchain-executor -p logos-blockchain-cli \ + -p logos-blockchain-node -p logos-blockchain-cli \ --target-dir "${NODE_TARGET}" else RUSTFLAGS='--cfg feature="pol-dev-mode"' NOMOS_CIRCUITS="${CIRCUITS_DIR}" \ LOGOS_BLOCKCHAIN_CIRCUITS="${CIRCUITS_DIR}" \ cargo build --all-features \ - -p logos-blockchain-node -p logos-blockchain-executor -p logos-blockchain-cli \ + -p logos-blockchain-node -p logos-blockchain-cli \ --target-dir "${NODE_TARGET}" fi ) @@ -380,7 +379,6 @@ build_bundle::package_bundle() { cp -a "${CIRCUITS_DIR}/." "${bundle_dir}/artifacts/circuits/" mkdir -p "${bundle_dir}/artifacts" cp "${NODE_BIN}" "${bundle_dir}/artifacts/logos-blockchain-node" - cp "${EXEC_BIN}" "${bundle_dir}/artifacts/logos-blockchain-executor" cp "${CLI_BIN}" "${bundle_dir}/artifacts/logos-blockchain-cli" { echo "nomos_node_path=${NOMOS_NODE_PATH:-}" diff --git a/scripts/build/build-linux-binaries.sh b/scripts/build/build-linux-binaries.sh index 568815d..93f12c4 100755 --- a/scripts/build/build-linux-binaries.sh +++ b/scripts/build/build-linux-binaries.sh @@ -126,7 +126,11 @@ build_linux_binaries::stage_from_bundle() { local tar_path="$1" local extract_dir extract_dir="$(common::tmpdir nomos-linux-bundle.XXXXXX)" - cleanup() { rm -rf "${extract_dir}" 2>/dev/null || true; } + cleanup() { + if [ -n "${extract_dir:-}" ]; then + rm -rf "${extract_dir}" 2>/dev/null || true + fi + } trap cleanup EXIT echo "==> Extracting ${tar_path}" @@ -134,7 +138,6 @@ build_linux_binaries::stage_from_bundle() { local artifacts="${extract_dir}/artifacts" [ -f "${artifacts}/logos-blockchain-node" ] || common::die "Missing logos-blockchain-node in bundle: ${tar_path}" - [ -f "${artifacts}/logos-blockchain-executor" ] || common::die "Missing logos-blockchain-executor in bundle: ${tar_path}" [ -f "${artifacts}/logos-blockchain-cli" ] || common::die "Missing logos-blockchain-cli in bundle: ${tar_path}" [ -d "${artifacts}/circuits" ] || common::die "Missing circuits/ in bundle: ${tar_path}" @@ -144,7 +147,7 @@ build_linux_binaries::stage_from_bundle() { echo "==> Staging binaries to ${bin_out}" mkdir -p "${bin_out}" - cp "${artifacts}/logos-blockchain-node" "${artifacts}/logos-blockchain-executor" "${artifacts}/logos-blockchain-cli" "${bin_out}/" + cp "${artifacts}/logos-blockchain-node" "${artifacts}/logos-blockchain-cli" "${bin_out}/" echo "==> Staging circuits to ${circuits_out}" rm -rf "${circuits_out}" diff --git a/scripts/build/build_test_image.sh b/scripts/build/build_test_image.sh index e1edaab..7dbe2ee 100755 --- a/scripts/build/build_test_image.sh +++ b/scripts/build/build_test_image.sh @@ -137,9 +137,9 @@ build_test_image::print_config() { } build_test_image::have_host_binaries() { - # Preserve existing behavior: only require node+executor on the host. + # Preserve existing behavior: only require logos-blockchain-node on the host. # If logos-blockchain-cli is missing, the Dockerfile can still build it from source. - [ -x "${BIN_DST}/logos-blockchain-node" ] && [ -x "${BIN_DST}/logos-blockchain-executor" ] + [ -x "${BIN_DST}/logos-blockchain-node" ] } build_test_image::restore_from_bundle() { @@ -153,13 +153,13 @@ build_test_image::restore_from_bundle() { tar -xzf "${TAR_PATH}" -C "${tmp_extract}" local artifacts="${tmp_extract}/artifacts" - for bin in logos-blockchain-node logos-blockchain-executor logos-blockchain-cli; do + for bin in logos-blockchain-node logos-blockchain-cli; do [ -f "${artifacts}/${bin}" ] || build_test_image::fail "Bundle ${TAR_PATH} missing artifacts/${bin}" done mkdir -p "${BIN_DST}" - cp "${artifacts}/logos-blockchain-node" "${artifacts}/logos-blockchain-executor" "${artifacts}/logos-blockchain-cli" "${BIN_DST}/" - chmod +x "${BIN_DST}/logos-blockchain-node" "${BIN_DST}/logos-blockchain-executor" "${BIN_DST}/logos-blockchain-cli" || true + cp "${artifacts}/logos-blockchain-node" "${artifacts}/logos-blockchain-cli" "${BIN_DST}/" + chmod +x "${BIN_DST}/logos-blockchain-node" "${BIN_DST}/logos-blockchain-cli" || true if [ -d "${artifacts}/circuits" ]; then mkdir -p "${CIRCUITS_DIR_HOST}" diff --git a/scripts/ops/update-nomos-rev.sh b/scripts/ops/update-nomos-rev.sh index 48ca772..66759c5 100755 --- a/scripts/ops/update-nomos-rev.sh +++ b/scripts/ops/update-nomos-rev.sh @@ -161,8 +161,6 @@ targets = [ "logos-blockchain-da-network-service", "logos-blockchain-da-sampling-service", "logos-blockchain-da-verifier-service", - "logos-blockchain-executor", - "logos-blockchain-executor-http-client", "logos-blockchain-groth16", "logos-blockchain-http-api-common", "logos-blockchain-key-management-system-service", diff --git a/scripts/run/run-examples.sh b/scripts/run/run-examples.sh index 5823dc5..1fa5da3 100755 --- a/scripts/run/run-examples.sh +++ b/scripts/run/run-examples.sh @@ -44,8 +44,7 @@ Modes: Options: -t, --run-seconds N Duration to run the demo (required) - -v, --validators N Number of validators (required) - -e, --executors N Number of executors (required) + -n, --nodes N Number of nodes (required) --bundle PATH Convenience alias for setting NOMOS_BINARIES_TAR=PATH --metrics-query-url URL PromQL base URL the runner process can query (optional) --metrics-otlp-ingest-url URL Full OTLP HTTP ingest URL for node metrics export (optional) @@ -116,8 +115,7 @@ run_examples::select_bin() { run_examples::parse_args() { MODE="compose" RUN_SECS_RAW="" - DEMO_VALIDATORS="" - DEMO_EXECUTORS="" + DEMO_NODES="" IMAGE_SELECTION_MODE="auto" METRICS_QUERY_URL="" METRICS_OTLP_INGEST_URL="" @@ -140,20 +138,12 @@ run_examples::parse_args() { RUN_SECS_RAW="${1#*=}" shift ;; - -v|--validators) - DEMO_VALIDATORS="${2:-}" + -n|--nodes) + DEMO_NODES="${2:-}" shift 2 ;; - --validators=*) - DEMO_VALIDATORS="${1#*=}" - shift - ;; - -e|--executors) - DEMO_EXECUTORS="${2:-}" - shift 2 - ;; - --executors=*) - DEMO_EXECUTORS="${1#*=}" + --nodes=*) + DEMO_NODES="${1#*=}" shift ;; --bundle) @@ -232,14 +222,11 @@ run_examples::parse_args() { fi RUN_SECS="${RUN_SECS_RAW}" - if [ -z "${DEMO_VALIDATORS}" ] || [ -z "${DEMO_EXECUTORS}" ]; then - run_examples::fail_with_usage "validators and executors must be provided via -v/--validators and -e/--executors" + if [ -z "${DEMO_NODES}" ]; then + run_examples::fail_with_usage "nodes must be provided via -n/--nodes" fi - if ! common::is_uint "${DEMO_VALIDATORS}" ; then - run_examples::fail_with_usage "validators must be a non-negative integer (pass -v/--validators)" - fi - if ! common::is_uint "${DEMO_EXECUTORS}" ; then - run_examples::fail_with_usage "executors must be a non-negative integer (pass -e/--executors)" + if ! common::is_uint "${DEMO_NODES}" ; then + run_examples::fail_with_usage "nodes must be a non-negative integer (pass -n/--nodes)" fi } @@ -388,7 +375,7 @@ run_examples::restore_binaries_from_tar() { RESTORED_BIN_DIR="${src}" export RESTORED_BIN_DIR - if [ ! -f "${src}/logos-blockchain-node" ] || [ ! -f "${src}/logos-blockchain-executor" ] || [ ! -f "${src}/logos-blockchain-cli" ]; then + if [ ! -f "${src}/logos-blockchain-node" ] || [ ! -f "${src}/logos-blockchain-cli" ]; then echo "Binaries missing in ${tar_path}; provide a prebuilt binaries tarball." >&2 return 1 fi @@ -397,11 +384,12 @@ run_examples::restore_binaries_from_tar() { if [ "${MODE}" != "host" ] && ! run_examples::host_bin_matches_arch "${src}/logos-blockchain-node"; then echo "Bundled binaries do not match host arch; skipping copy so containers rebuild from source." copy_bins=0 - rm -f "${bin_dst}/logos-blockchain-node" "${bin_dst}/logos-blockchain-executor" "${bin_dst}/logos-blockchain-cli" + rm -f "${bin_dst}/logos-blockchain-node" "${bin_dst}/logos-blockchain-cli" fi if [ "${copy_bins}" -eq 1 ]; then mkdir -p "${bin_dst}" - cp "${src}/logos-blockchain-node" "${src}/logos-blockchain-executor" "${src}/logos-blockchain-cli" "${bin_dst}/" + cp "${src}/logos-blockchain-node" "${src}/logos-blockchain-cli" "${bin_dst}/" + fi fi if [ -d "${circuits_src}" ] && [ -f "${circuits_src}/${KZG_FILE}" ]; then @@ -436,8 +424,8 @@ run_examples::prepare_bundles() { HOST_TAR="${ROOT_DIR}/.tmp/nomos-binaries-host-${VERSION}.tar.gz" LINUX_TAR="${ROOT_DIR}/.tmp/nomos-binaries-linux-${VERSION}.tar.gz" - if [ -n "${LOGOS_BLOCKCHAIN_NODE_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_NODE_BIN}" ] && [ -n "${LOGOS_BLOCKCHAIN_EXECUTOR_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_EXECUTOR_BIN}" ]; then - echo "==> Using pre-specified host binaries (LOGOS_BLOCKCHAIN_NODE_BIN/LOGOS_BLOCKCHAIN_EXECUTOR_BIN); skipping tarball restore" + if [ -n "${LOGOS_BLOCKCHAIN_NODE_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_NODE_BIN}" ]; then + echo "==> Using pre-specified host binaries (LOGOS_BLOCKCHAIN_NODE_BIN); skipping tarball restore" return 0 fi @@ -508,20 +496,18 @@ run_examples::validate_restored_bundle() { common::die "KZG params missing at ${KZG_HOST_PATH}; ensure the tarball contains circuits." fi - if [ "${MODE}" = "host" ] && ! { [ -n "${LOGOS_BLOCKCHAIN_NODE_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_NODE_BIN:-}" ] && [ -n "${LOGOS_BLOCKCHAIN_EXECUTOR_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_EXECUTOR_BIN:-}" ]; }; then - local tar_node tar_exec + if [ "${MODE}" = "host" ] && ! { [ -n "${LOGOS_BLOCKCHAIN_NODE_BIN:-}" ] && [ -x "${LOGOS_BLOCKCHAIN_NODE_BIN:-}" ]; }; then + local tar_node tar_node="${RESTORED_BIN_DIR:-${ROOT_DIR}/testing-framework/assets/stack/bin}/logos-blockchain-node" - tar_exec="${RESTORED_BIN_DIR:-${ROOT_DIR}/testing-framework/assets/stack/bin}/logos-blockchain-executor" - [ -x "${tar_node}" ] && [ -x "${tar_exec}" ] || common::die \ + [ -x "${tar_node}" ] || common::die \ "Restored tarball missing host executables; provide a host-compatible binaries tarball." - run_examples::host_bin_matches_arch "${tar_node}" && run_examples::host_bin_matches_arch "${tar_exec}" || common::die \ + run_examples::host_bin_matches_arch "${tar_node}" || common::die \ "Restored executables do not match host architecture; provide a host-compatible binaries tarball." echo "==> Using restored host binaries from tarball" LOGOS_BLOCKCHAIN_NODE_BIN="${tar_node}" - LOGOS_BLOCKCHAIN_EXECUTOR_BIN="${tar_exec}" - export LOGOS_BLOCKCHAIN_NODE_BIN LOGOS_BLOCKCHAIN_EXECUTOR_BIN + export LOGOS_BLOCKCHAIN_NODE_BIN fi } @@ -571,8 +557,7 @@ run_examples::run() { kzg_path="$(run_examples::kzg_path_for_mode)" export NOMOS_DEMO_RUN_SECS="${RUN_SECS}" - export NOMOS_DEMO_VALIDATORS="${DEMO_VALIDATORS}" - export NOMOS_DEMO_EXECUTORS="${DEMO_EXECUTORS}" + export NOMOS_DEMO_NODES="${DEMO_NODES}" if [ -n "${METRICS_QUERY_URL}" ]; then export NOMOS_METRICS_QUERY_URL="${METRICS_QUERY_URL}" @@ -591,7 +576,6 @@ run_examples::run() { LOGOS_BLOCKCHAIN_CIRCUITS="${HOST_BUNDLE_PATH}" \ LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH="${kzg_path}" \ LOGOS_BLOCKCHAIN_NODE_BIN="${LOGOS_BLOCKCHAIN_NODE_BIN:-}" \ - LOGOS_BLOCKCHAIN_EXECUTOR_BIN="${LOGOS_BLOCKCHAIN_EXECUTOR_BIN:-}" \ COMPOSE_CIRCUITS_PLATFORM="${COMPOSE_CIRCUITS_PLATFORM:-}" \ cargo run -p runner-examples --bin "${BIN}" } diff --git a/scripts/run/run-test-matrix.sh b/scripts/run/run-test-matrix.sh index 2170757..c12dc85 100755 --- a/scripts/run/run-test-matrix.sh +++ b/scripts/run/run-test-matrix.sh @@ -17,8 +17,7 @@ image rebuilds (where it makes sense), after cleaning and rebuilding bundles. Options: -t, --run-seconds N Demo duration for each run (default: 120) - -v, --validators N Validators (default: 1) - -e, --executors N Executors (default: 1) + -n, --nodes N Nodes (default: 2) --modes LIST Comma-separated: host,compose,k8s (default: host,compose,k8s) --no-clean Skip scripts/ops/clean.sh step --no-bundles Skip scripts/build/build-bundle.sh (uses existing .tmp tarballs) @@ -45,8 +44,7 @@ matrix::have() { command -v "$1" >/dev/null 2>&1; } matrix::parse_args() { RUN_SECS=120 - VALIDATORS=1 - EXECUTORS=1 + NODES=2 MODES_RAW="host,compose,k8s" DO_CLEAN=1 DO_BUNDLES=1 @@ -61,10 +59,8 @@ matrix::parse_args() { -h|--help) matrix::usage; exit 0 ;; -t|--run-seconds) RUN_SECS="${2:-}"; shift 2 ;; --run-seconds=*) RUN_SECS="${1#*=}"; shift ;; - -v|--validators) VALIDATORS="${2:-}"; shift 2 ;; - --validators=*) VALIDATORS="${1#*=}"; shift ;; - -e|--executors) EXECUTORS="${2:-}"; shift 2 ;; - --executors=*) EXECUTORS="${1#*=}"; shift ;; + -n|--nodes) NODES="${2:-}"; shift 2 ;; + --nodes=*) NODES="${1#*=}"; shift ;; --modes) MODES_RAW="${2:-}"; shift 2 ;; --modes=*) MODES_RAW="${1#*=}"; shift ;; --no-clean) DO_CLEAN=0; shift ;; @@ -82,8 +78,7 @@ matrix::parse_args() { common::is_uint "${RUN_SECS}" || matrix::die "--run-seconds must be an integer" [ "${RUN_SECS}" -gt 0 ] || matrix::die "--run-seconds must be > 0" - common::is_uint "${VALIDATORS}" || matrix::die "--validators must be an integer" - common::is_uint "${EXECUTORS}" || matrix::die "--executors must be an integer" + common::is_uint "${NODES}" || matrix::die "--nodes must be an integer" } matrix::split_modes() { @@ -220,7 +215,7 @@ matrix::main() { host) matrix::run_case "host" \ "${ROOT_DIR}/scripts/run/run-examples.sh" \ - -t "${RUN_SECS}" -v "${VALIDATORS}" -e "${EXECUTORS}" \ + -t "${RUN_SECS}" -n "${NODES}" \ "${forward[@]}" \ host ;; @@ -228,7 +223,7 @@ matrix::main() { if [ "${SKIP_IMAGE_BUILD_VARIANTS}" -eq 0 ]; then matrix::run_case "compose.image_build" \ "${ROOT_DIR}/scripts/run/run-examples.sh" \ - -t "${RUN_SECS}" -v "${VALIDATORS}" -e "${EXECUTORS}" \ + -t "${RUN_SECS}" -n "${NODES}" \ "${forward[@]}" \ compose else @@ -238,7 +233,7 @@ matrix::main() { matrix::run_case "compose.skip_image_build" \ "${ROOT_DIR}/scripts/run/run-examples.sh" \ --no-image-build \ - -t "${RUN_SECS}" -v "${VALIDATORS}" -e "${EXECUTORS}" \ + -t "${RUN_SECS}" -n "${NODES}" \ "${forward[@]}" \ compose ;; @@ -259,7 +254,7 @@ matrix::main() { fi matrix::run_case "k8s.image_build" \ "${ROOT_DIR}/scripts/run/run-examples.sh" \ - -t "${RUN_SECS}" -v "${VALIDATORS}" -e "${EXECUTORS}" \ + -t "${RUN_SECS}" -n "${NODES}" \ "${forward[@]}" \ k8s unset NOMOS_FORCE_IMAGE_BUILD || true @@ -273,7 +268,7 @@ matrix::main() { matrix::run_case "k8s.skip_image_build" \ "${ROOT_DIR}/scripts/run/run-examples.sh" \ --no-image-build \ - -t "${RUN_SECS}" -v "${VALIDATORS}" -e "${EXECUTORS}" \ + -t "${RUN_SECS}" -n "${NODES}" \ "${forward[@]}" \ k8s ;; diff --git a/testing-framework/assets/stack/Dockerfile.base b/testing-framework/assets/stack/Dockerfile.base index 24e5e04..399eeb0 100644 --- a/testing-framework/assets/stack/Dockerfile.base +++ b/testing-framework/assets/stack/Dockerfile.base @@ -82,7 +82,6 @@ COPY --from=builder /opt/circuits /opt/circuits COPY --from=builder /workspace/testing-framework/assets/stack/kzgrs_test_params/kzgrs_test_params /opt/nomos/kzg-params/kzgrs_test_params COPY --from=builder /workspace/artifacts/logos-blockchain-node /usr/bin/logos-blockchain-node -COPY --from=builder /workspace/artifacts/logos-blockchain-executor /usr/bin/logos-blockchain-executor COPY --from=builder /workspace/artifacts/logos-blockchain-cli /usr/bin/logos-blockchain-cli COPY --from=builder /workspace/artifacts/cfgsync-server /usr/bin/cfgsync-server COPY --from=builder /workspace/artifacts/cfgsync-client /usr/bin/cfgsync-client diff --git a/testing-framework/assets/stack/scripts/docker/prepare_binaries.sh b/testing-framework/assets/stack/scripts/docker/prepare_binaries.sh index 50d03d6..524b0e2 100755 --- a/testing-framework/assets/stack/scripts/docker/prepare_binaries.sh +++ b/testing-framework/assets/stack/scripts/docker/prepare_binaries.sh @@ -9,7 +9,6 @@ TARGET_ARCH="$(uname -m)" have_prebuilt() { [ -f testing-framework/assets/stack/bin/logos-blockchain-node ] && \ - [ -f testing-framework/assets/stack/bin/logos-blockchain-executor ] && \ [ -f testing-framework/assets/stack/bin/logos-blockchain-cli ] } @@ -34,7 +33,6 @@ bin_matches_arch() { if have_prebuilt && bin_matches_arch; then echo "Using prebuilt logos-blockchain binaries from testing-framework/assets/stack/bin" cp testing-framework/assets/stack/bin/logos-blockchain-node /workspace/artifacts/logos-blockchain-node - cp testing-framework/assets/stack/bin/logos-blockchain-executor /workspace/artifacts/logos-blockchain-executor cp testing-framework/assets/stack/bin/logos-blockchain-cli /workspace/artifacts/logos-blockchain-cli exit 0 fi @@ -67,10 +65,9 @@ fi RUSTFLAGS='--cfg feature="pol-dev-mode"' NOMOS_CIRCUITS=/opt/circuits \ LOGOS_BLOCKCHAIN_CIRCUITS=/opt/circuits \ cargo build --features "testing" \ - -p logos-blockchain-node -p logos-blockchain-executor -p logos-blockchain-cli + -p logos-blockchain-node -p logos-blockchain-cli cp /tmp/nomos-node/target/debug/logos-blockchain-node /workspace/artifacts/logos-blockchain-node -cp /tmp/nomos-node/target/debug/logos-blockchain-executor /workspace/artifacts/logos-blockchain-executor cp /tmp/nomos-node/target/debug/logos-blockchain-cli /workspace/artifacts/logos-blockchain-cli rm -rf /tmp/nomos-node/target/debug/incremental diff --git a/testing-framework/assets/stack/scripts/run_nomos.sh b/testing-framework/assets/stack/scripts/run_nomos.sh index ea83f53..3e6b76f 100755 --- a/testing-framework/assets/stack/scripts/run_nomos.sh +++ b/testing-framework/assets/stack/scripts/run_nomos.sh @@ -2,16 +2,6 @@ set -e -role="${1:-validator}" - -bin_for_role() { - case "$1" in - validator) echo "/usr/bin/logos-blockchain-node" ;; - executor) echo "/usr/bin/logos-blockchain-executor" ;; - *) echo "Unknown role: $1" >&2; exit 2 ;; - esac -} - check_binary_arch() { bin_path="$1" label="$2" @@ -37,16 +27,15 @@ check_binary_arch() { fi } -bin_path="$(bin_for_role "$role")" -check_binary_arch "$bin_path" "logos-blockchain-${role}" +bin_path="/usr/bin/logos-blockchain-node" +check_binary_arch "$bin_path" "logos-blockchain-node" KZG_CONTAINER_PATH="${NOMOS_KZG_CONTAINER_PATH:-/kzgrs_test_params/kzgrs_test_params}" -host_identifier_default="${role}-$(hostname -i)" +host_identifier_default="node-$(hostname -i)" export CFG_FILE_PATH="/config.yaml" \ CFG_SERVER_ADDR="${CFG_SERVER_ADDR:-http://cfgsync:${NOMOS_CFGSYNC_PORT:-4400}}" \ CFG_HOST_IP=$(hostname -i) \ - CFG_HOST_KIND="${CFG_HOST_KIND:-$role}" \ CFG_HOST_IDENTIFIER="${CFG_HOST_IDENTIFIER:-$host_identifier_default}" \ LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH="${LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH:-${KZG_CONTAINER_PATH}}" \ NOMOS_TIME_BACKEND="${NOMOS_TIME_BACKEND:-monotonic}" \ diff --git a/testing-framework/assets/stack/scripts/run_nomos_executor.sh b/testing-framework/assets/stack/scripts/run_nomos_executor.sh deleted file mode 100755 index 3bda55b..0000000 --- a/testing-framework/assets/stack/scripts/run_nomos_executor.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec /etc/nomos/scripts/run_nomos.sh executor diff --git a/testing-framework/assets/stack/scripts/run_nomos_node.sh b/testing-framework/assets/stack/scripts/run_nomos_node.sh index 12d8bd2..3789779 100755 --- a/testing-framework/assets/stack/scripts/run_nomos_node.sh +++ b/testing-framework/assets/stack/scripts/run_nomos_node.sh @@ -1,2 +1,2 @@ #!/bin/sh -exec /etc/nomos/scripts/run_nomos.sh validator +exec /etc/nomos/scripts/run_nomos.sh diff --git a/testing-framework/configs/Cargo.toml b/testing-framework/configs/Cargo.toml index 9c47da9..54e47f2 100644 --- a/testing-framework/configs/Cargo.toml +++ b/testing-framework/configs/Cargo.toml @@ -19,11 +19,9 @@ cryptarchia-sync = { workspace = true } groth16 = { workspace = true } hex = { version = "0.4.3", default-features = false } key-management-system-service = { workspace = true } -logos-blockchain-executor = { workspace = true, default-features = false, features = ["testing", "tracing"] } nomos-api = { workspace = true } nomos-blend-service = { workspace = true, features = ["libp2p"] } nomos-core = { workspace = true } -nomos-da-dispersal = { workspace = true } nomos-da-network-core = { workspace = true } nomos-da-network-service = { workspace = true } nomos-da-sampling = { workspace = true } diff --git a/testing-framework/configs/src/nodes/common.rs b/testing-framework/configs/src/nodes/common.rs index 4f5a90a..389d879 100644 --- a/testing-framework/configs/src/nodes/common.rs +++ b/testing-framework/configs/src/nodes/common.rs @@ -226,10 +226,6 @@ pub(crate) fn wallet_settings(config: &GeneralConfig) -> WalletServiceSettings { wallet_settings_with_leader(config, true) } -pub(crate) fn wallet_settings_for_executor(config: &GeneralConfig) -> WalletServiceSettings { - wallet_settings_with_leader(config, false) -} - fn wallet_settings_with_leader( config: &GeneralConfig, include_leader: bool, diff --git a/testing-framework/configs/src/nodes/executor.rs b/testing-framework/configs/src/nodes/executor.rs deleted file mode 100644 index df08562..0000000 --- a/testing-framework/configs/src/nodes/executor.rs +++ /dev/null @@ -1,127 +0,0 @@ -use logos_blockchain_executor::config::Config as ExecutorConfig; -use nomos_da_dispersal::{ - DispersalServiceSettings, - backend::kzgrs::{DispersalKZGRSBackendSettings, EncoderSettings}, -}; -use nomos_da_network_core::protocols::sampling::SubnetsConfig; -use nomos_da_network_service::{ - NetworkConfig as DaNetworkConfig, - api::http::ApiAdapterSettings, - backends::libp2p::{ - common::DaNetworkBackendSettings, executor::DaNetworkExecutorBackendSettings, - }, -}; -use nomos_node::{RocksBackendSettings, config::deployment::DeploymentSettings}; -use nomos_sdp::SdpSettings; - -use crate::{ - nodes::{ - blend::build_blend_service_config, - common::{ - cryptarchia_config, cryptarchia_deployment, da_sampling_config, da_verifier_config, - http_config, mempool_config, mempool_deployment, testing_http_config, time_config, - time_deployment, tracing_settings, wallet_settings_for_executor, - }, - }, - timeouts, - topology::configs::GeneralConfig, -}; - -#[must_use] -pub fn create_executor_config(config: GeneralConfig) -> ExecutorConfig { - let network_config = config.network_config.clone(); - let (blend_user_config, blend_deployment, network_deployment) = - build_blend_service_config(&config.blend_config); - - let deployment_settings = - build_executor_deployment_settings(&config, blend_deployment, network_deployment); - - ExecutorConfig { - network: network_config, - blend: blend_user_config, - deployment: deployment_settings, - cryptarchia: cryptarchia_config(&config), - da_network: DaNetworkConfig { - backend: build_executor_da_network_backend_settings(&config), - membership: config.da_config.membership.clone(), - api_adapter_settings: ApiAdapterSettings { - api_port: config.api_config.address.port(), - is_secure: false, - }, - subnet_refresh_interval: config.da_config.subnets_refresh_interval, - subnet_threshold: config.da_config.num_samples as usize, - min_session_members: config.da_config.num_samples as usize, - }, - da_verifier: da_verifier_config(&config), - tracing: tracing_settings(&config), - http: http_config(&config), - da_sampling: da_sampling_config(&config), - storage: rocks_storage_settings(), - da_dispersal: DispersalServiceSettings { - backend: build_dispersal_backend_settings(&config), - }, - time: time_config(&config), - mempool: mempool_config(), - sdp: SdpSettings { declaration: None }, - wallet: wallet_settings_for_executor(&config), - key_management: config.kms_config.clone(), - testing_http: testing_http_config(&config), - } -} - -fn build_executor_deployment_settings( - config: &GeneralConfig, - blend_deployment: nomos_node::config::blend::deployment::Settings, - network_deployment: nomos_node::config::network::deployment::Settings, -) -> DeploymentSettings { - DeploymentSettings::new_custom( - blend_deployment, - network_deployment, - cryptarchia_deployment(config), - time_deployment(config), - mempool_deployment(), - ) -} - -fn build_executor_da_network_backend_settings( - config: &GeneralConfig, -) -> DaNetworkExecutorBackendSettings { - DaNetworkExecutorBackendSettings { - validator_settings: DaNetworkBackendSettings { - node_key: config.da_config.node_key.clone(), - listening_address: config.da_config.listening_address.clone(), - policy_settings: config.da_config.policy_settings.clone(), - monitor_settings: config.da_config.monitor_settings.clone(), - balancer_interval: config.da_config.balancer_interval, - redial_cooldown: config.da_config.redial_cooldown, - replication_settings: config.da_config.replication_settings, - subnets_settings: SubnetsConfig { - num_of_subnets: config.da_config.num_samples as usize, - shares_retry_limit: config.da_config.retry_shares_limit, - commitments_retry_limit: config.da_config.retry_commitments_limit, - }, - }, - num_subnets: config.da_config.num_subnets, - } -} - -fn rocks_storage_settings() -> RocksBackendSettings { - RocksBackendSettings { - db_path: "./db".into(), - read_only: false, - column_family: Some("blocks".into()), - } -} - -fn build_dispersal_backend_settings(config: &GeneralConfig) -> DispersalKZGRSBackendSettings { - DispersalKZGRSBackendSettings { - encoder_settings: EncoderSettings { - num_columns: config.da_config.num_subnets as usize, - with_cache: false, - global_params_path: config.da_config.global_params_path.clone(), - }, - dispersal_timeout: timeouts::dispersal_timeout(), - retry_cooldown: timeouts::retry_cooldown(), - retry_limit: 2, - } -} diff --git a/testing-framework/configs/src/nodes/mod.rs b/testing-framework/configs/src/nodes/mod.rs index e5d3ca3..085d7d8 100644 --- a/testing-framework/configs/src/nodes/mod.rs +++ b/testing-framework/configs/src/nodes/mod.rs @@ -1,5 +1,4 @@ pub(crate) mod blend; pub(crate) mod common; -pub mod executor; pub mod kms; -pub mod validator; +pub mod node; diff --git a/testing-framework/configs/src/nodes/validator.rs b/testing-framework/configs/src/nodes/node.rs similarity index 88% rename from testing-framework/configs/src/nodes/validator.rs rename to testing-framework/configs/src/nodes/node.rs index d6e59c8..5afc5db 100644 --- a/testing-framework/configs/src/nodes/validator.rs +++ b/testing-framework/configs/src/nodes/node.rs @@ -6,7 +6,7 @@ use nomos_da_network_service::{ backends::libp2p::common::DaNetworkBackendSettings, }; use nomos_node::{ - Config as ValidatorConfig, RocksBackendSettings, config::deployment::DeploymentSettings, + Config as NodeConfig, RocksBackendSettings, config::deployment::DeploymentSettings, }; use nomos_sdp::SdpSettings; @@ -23,21 +23,21 @@ use crate::{ }; #[must_use] -pub fn create_validator_config(config: GeneralConfig) -> ValidatorConfig { +pub fn create_node_config(config: GeneralConfig) -> NodeConfig { let network_config = config.network_config.clone(); let (blend_user_config, blend_deployment, network_deployment) = build_blend_service_config(&config.blend_config); let deployment_settings = - build_validator_deployment_settings(&config, blend_deployment, network_deployment); + build_node_deployment_settings(&config, blend_deployment, network_deployment); - ValidatorConfig { + NodeConfig { network: network_config, blend: blend_user_config, deployment: deployment_settings, cryptarchia: cryptarchia_config(&config), da_network: DaNetworkConfig { - backend: build_validator_da_network_backend_settings(&config), + backend: build_node_da_network_backend_settings(&config), membership: config.da_config.membership.clone(), api_adapter_settings: ApiAdapterSettings { api_port: config.api_config.address.port(), @@ -61,7 +61,7 @@ pub fn create_validator_config(config: GeneralConfig) -> ValidatorConfig { } } -fn build_validator_deployment_settings( +fn build_node_deployment_settings( config: &GeneralConfig, blend_deployment: nomos_node::config::blend::deployment::Settings, network_deployment: nomos_node::config::network::deployment::Settings, @@ -75,7 +75,7 @@ fn build_validator_deployment_settings( ) } -fn build_validator_da_network_backend_settings(config: &GeneralConfig) -> DaNetworkBackendSettings { +fn build_node_da_network_backend_settings(config: &GeneralConfig) -> DaNetworkBackendSettings { let da_policy_settings = config.da_config.policy_settings.clone(); DaNetworkBackendSettings { diff --git a/testing-framework/core/Cargo.toml b/testing-framework/core/Cargo.toml index d255da3..1e3e6a6 100644 --- a/testing-framework/core/Cargo.toml +++ b/testing-framework/core/Cargo.toml @@ -24,7 +24,6 @@ futures = { default-features = false, version = "0.3" } groth16 = { workspace = true } hex = { version = "0.4.3", default-features = false } key-management-system-service = { workspace = true } -logos-blockchain-executor = { workspace = true, default-features = false, features = ["testing", "tracing"] } nomos-core = { workspace = true } nomos-da-network-core = { workspace = true } nomos-da-network-service = { workspace = true } diff --git a/testing-framework/core/src/manual.rs b/testing-framework/core/src/manual.rs index 96ff684..1f8618b 100644 --- a/testing-framework/core/src/manual.rs +++ b/testing-framework/core/src/manual.rs @@ -5,13 +5,7 @@ use crate::scenario::{DynError, StartNodeOptions, StartedNode}; /// Interface for imperative, deployer-backed manual clusters. #[async_trait] pub trait ManualClusterHandle: Send + Sync { - async fn start_validator_with( - &self, - name: &str, - options: StartNodeOptions, - ) -> Result; - - async fn start_executor_with( + async fn start_node_with( &self, name: &str, options: StartNodeOptions, diff --git a/testing-framework/core/src/nodes/executor.rs b/testing-framework/core/src/nodes/executor.rs deleted file mode 100644 index cb589ae..0000000 --- a/testing-framework/core/src/nodes/executor.rs +++ /dev/null @@ -1,111 +0,0 @@ -use std::{ - ops::Deref, - path::{Path, PathBuf}, - time::Duration, -}; - -use logos_blockchain_executor::config::Config; -use nomos_tracing_service::LoggerLayer; -pub use testing_framework_config::nodes::executor::create_executor_config; -use tracing::{debug, info}; - -use super::{persist_tempdir, should_persist_tempdir}; -use crate::{ - IS_DEBUG_TRACING, - nodes::{ - LOGS_PREFIX, - common::{ - binary::{BinaryConfig, BinaryResolver}, - lifecycle::{kill::kill_child, monitor::is_running}, - node::{NodeAddresses, NodeConfigCommon, NodeHandle, SpawnNodeError, spawn_node}, - }, - }, -}; - -const BIN_PATH: &str = "target/debug/logos-blockchain-executor"; - -fn binary_path() -> PathBuf { - let cfg = BinaryConfig { - env_var: "LOGOS_BLOCKCHAIN_EXECUTOR_BIN", - binary_name: "logos-blockchain-executor", - fallback_path: BIN_PATH, - shared_bin_subpath: "../assets/stack/bin/logos-blockchain-executor", - }; - BinaryResolver::resolve_path(&cfg) -} - -pub struct Executor { - handle: NodeHandle, -} - -impl Deref for Executor { - type Target = NodeHandle; - - fn deref(&self) -> &Self::Target { - &self.handle - } -} - -impl Drop for Executor { - fn drop(&mut self) { - if should_persist_tempdir() - && let Err(e) = persist_tempdir(&mut self.handle.tempdir, "logos-blockchain-executor") - { - debug!(error = ?e, "failed to persist executor tempdir"); - } - - debug!("stopping executor process"); - kill_child(&mut self.handle.child); - } -} - -impl Executor { - pub async fn spawn(config: Config, label: &str) -> Result { - let log_prefix = format!("{LOGS_PREFIX}-{label}"); - let handle = spawn_node( - config, - &log_prefix, - "executor.yaml", - binary_path(), - !*IS_DEBUG_TRACING, - ) - .await?; - - info!("executor spawned and ready"); - - Ok(Self { handle }) - } - - /// Check if the executor process is still running - pub fn is_running(&mut self) -> bool { - is_running(&mut self.handle.child) - } - - /// Wait for the executor process to exit, with a timeout. - pub async fn wait_for_exit(&mut self, timeout: Duration) -> bool { - self.handle.wait_for_exit(timeout).await - } -} - -impl NodeConfigCommon for Config { - fn set_logger(&mut self, logger: LoggerLayer) { - self.tracing.logger = logger; - } - - fn set_paths(&mut self, base: &Path) { - self.storage.db_path = base.join("db"); - base.clone_into( - &mut self - .da_verifier - .storage_adapter_settings - .blob_storage_directory, - ); - } - - fn addresses(&self) -> NodeAddresses { - ( - self.http.backend_settings.address, - Some(self.testing_http.backend_settings.address), - ) - } -} diff --git a/testing-framework/core/src/nodes/mod.rs b/testing-framework/core/src/nodes/mod.rs index 9793647..d6abce5 100644 --- a/testing-framework/core/src/nodes/mod.rs +++ b/testing-framework/core/src/nodes/mod.rs @@ -1,7 +1,6 @@ mod api_client; pub mod common; -pub mod executor; -pub mod validator; +pub mod node; use std::sync::LazyLock; diff --git a/testing-framework/core/src/nodes/validator.rs b/testing-framework/core/src/nodes/node.rs similarity index 82% rename from testing-framework/core/src/nodes/validator.rs rename to testing-framework/core/src/nodes/node.rs index c183e0b..d435d21 100644 --- a/testing-framework/core/src/nodes/validator.rs +++ b/testing-framework/core/src/nodes/node.rs @@ -2,7 +2,7 @@ use std::{ops::Deref, path::PathBuf, time::Duration}; use nomos_node::Config; use nomos_tracing_service::LoggerLayer; -pub use testing_framework_config::nodes::validator::create_validator_config; +pub use testing_framework_config::nodes::node::create_node_config; use tracing::{debug, info}; use super::{persist_tempdir, should_persist_tempdir}; @@ -30,16 +30,11 @@ fn binary_path() -> PathBuf { BinaryResolver::resolve_path(&cfg) } -pub enum Pool { - Da, - Mantle, -} - -pub struct Validator { +pub struct Node { handle: NodeHandle, } -impl Deref for Validator { +impl Deref for Node { type Target = NodeHandle; fn deref(&self) -> &Self::Target { @@ -47,26 +42,26 @@ impl Deref for Validator { } } -impl Drop for Validator { +impl Drop for Node { fn drop(&mut self) { if should_persist_tempdir() && let Err(e) = persist_tempdir(&mut self.handle.tempdir, "logos-blockchain-node") { - debug!(error = ?e, "failed to persist validator tempdir"); + debug!(error = ?e, "failed to persist node tempdir"); } - debug!("stopping validator process"); + debug!("stopping node process"); kill_child(&mut self.handle.child); } } -impl Validator { - /// Check if the validator process is still running +impl Node { + /// Check if the node process is still running pub fn is_running(&mut self) -> bool { is_running(&mut self.handle.child) } - /// Wait for the validator process to exit, with a timeout + /// Wait for the node process to exit, with a timeout /// Returns true if the process exited within the timeout, false otherwise pub async fn wait_for_exit(&mut self, timeout: Duration) -> bool { self.handle.wait_for_exit(timeout).await @@ -77,13 +72,13 @@ impl Validator { let handle = spawn_node( config, &log_prefix, - "validator.yaml", + "node.yaml", binary_path(), !*IS_DEBUG_TRACING, ) .await?; - info!("validator spawned and ready"); + info!("node spawned and ready"); Ok(Self { handle }) } diff --git a/testing-framework/core/src/scenario/capabilities.rs b/testing-framework/core/src/scenario/capabilities.rs index d6784bc..71fd98f 100644 --- a/testing-framework/core/src/scenario/capabilities.rs +++ b/testing-framework/core/src/scenario/capabilities.rs @@ -2,7 +2,7 @@ use async_trait::async_trait; use reqwest::Url; use super::DynError; -use crate::{nodes::ApiClient, topology::generation::NodeRole}; +use crate::nodes::ApiClient; /// Marker type used by scenario builders to request node control support. #[derive(Clone, Copy, Debug, Default)] @@ -66,35 +66,21 @@ impl RequiresNodeControl for ObservabilityCapability { const REQUIRED: bool = false; } -/// Interface exposed by runners that can restart nodes at runtime. +/// Interface exposed by runners that can restart/start nodes at runtime. #[async_trait] pub trait NodeControlHandle: Send + Sync { - async fn restart_validator(&self, index: usize) -> Result<(), DynError>; + async fn restart_node(&self, index: usize) -> Result<(), DynError>; - async fn restart_executor(&self, index: usize) -> Result<(), DynError>; - - async fn start_validator(&self, _name: &str) -> Result { - Err("start_validator not supported by this deployer".into()) + async fn start_node(&self, _name: &str) -> Result { + Err("start_node not supported by this deployer".into()) } - async fn start_executor(&self, _name: &str) -> Result { - Err("start_executor not supported by this deployer".into()) - } - - async fn start_validator_with( + async fn start_node_with( &self, _name: &str, _options: StartNodeOptions, ) -> Result { - Err("start_validator_with not supported by this deployer".into()) - } - - async fn start_executor_with( - &self, - _name: &str, - _options: StartNodeOptions, - ) -> Result { - Err("start_executor_with not supported by this deployer".into()) + Err("start_node_with not supported by this deployer".into()) } fn node_client(&self, _name: &str) -> Option { @@ -105,6 +91,5 @@ pub trait NodeControlHandle: Send + Sync { #[derive(Clone)] pub struct StartedNode { pub name: String, - pub role: NodeRole, pub api: ApiClient, } diff --git a/testing-framework/core/src/scenario/cfgsync.rs b/testing-framework/core/src/scenario/cfgsync.rs index 43dc888..aa8a8a2 100644 --- a/testing-framework/core/src/scenario/cfgsync.rs +++ b/testing-framework/core/src/scenario/cfgsync.rs @@ -75,13 +75,10 @@ pub fn apply_topology_overrides( use_kzg_mount: bool, ) { debug!( - validators = topology.validators().len(), - executors = topology.executors().len(), - use_kzg_mount, - "applying topology overrides to cfgsync config" + nodes = topology.nodes().len(), + use_kzg_mount, "applying topology overrides to cfgsync config" ); - let hosts = topology.validators().len() + topology.executors().len(); - cfg.n_hosts = hosts; + cfg.n_hosts = topology.nodes().len(); let consensus = &topology.config().consensus_params; cfg.security_param = consensus.security_param; @@ -89,9 +86,15 @@ pub fn apply_topology_overrides( let config = topology.config(); cfg.wallet = config.wallet_config.clone(); - cfg.ids = Some(topology.nodes().map(|node| node.id).collect()); - cfg.da_ports = Some(topology.nodes().map(|node| node.da_port).collect()); - cfg.blend_ports = Some(topology.nodes().map(|node| node.blend_port).collect()); + cfg.ids = Some(topology.nodes().iter().map(|node| node.id).collect()); + cfg.da_ports = Some(topology.nodes().iter().map(|node| node.da_port).collect()); + cfg.blend_ports = Some( + topology + .nodes() + .iter() + .map(|node| node.blend_port) + .collect(), + ); let da = &config.da_params; cfg.subnetwork_size = da.subnetwork_size; diff --git a/testing-framework/core/src/scenario/definition.rs b/testing-framework/core/src/scenario/definition.rs index f2c4e32..f792a86 100644 --- a/testing-framework/core/src/scenario/definition.rs +++ b/testing-framework/core/src/scenario/definition.rs @@ -104,8 +104,7 @@ pub type ScenarioBuilder = Builder<()>; /// Builder for shaping the scenario topology. pub struct TopologyConfigurator { builder: Builder, - validators: usize, - executors: usize, + nodes: usize, network_star: bool, } @@ -124,14 +123,12 @@ impl Builder { } #[must_use] - pub fn with_node_counts(validators: usize, executors: usize) -> Self { - Self::new(TopologyBuilder::new(TopologyConfig::with_node_numbers( - validators, executors, - ))) + pub fn with_node_count(nodes: usize) -> Self { + Self::new(TopologyBuilder::new(TopologyConfig::with_node_count(nodes))) } /// Convenience constructor that immediately enters topology configuration, - /// letting callers set counts via `validators`/`executors`. + /// letting callers set counts via `nodes`. pub fn topology() -> TopologyConfigurator { TopologyConfigurator::new(Self::new(TopologyBuilder::new(TopologyConfig::empty()))) } @@ -263,8 +260,7 @@ impl Builder { let workloads: Vec> = workloads.into_iter().map(Arc::from).collect(); info!( - validators = generated.validators().len(), - executors = generated.executors().len(), + nodes = generated.nodes().len(), duration_secs = duration.as_secs(), workloads = workloads.len(), expectations = expectations.len(), @@ -285,23 +281,15 @@ impl TopologyConfigurator { const fn new(builder: Builder) -> Self { Self { builder, - validators: 0, - executors: 0, + nodes: 0, network_star: false, } } - /// Set the number of validator nodes. + /// Set the number of nodes. #[must_use] - pub fn validators(mut self, count: usize) -> Self { - self.validators = count; - self - } - - /// Set the number of executor nodes. - #[must_use] - pub fn executors(mut self, count: usize) -> Self { - self.executors = count; + pub fn nodes(mut self, count: usize) -> Self { + self.nodes = count; self } @@ -315,7 +303,7 @@ impl TopologyConfigurator { /// Finalize and return the underlying scenario builder. #[must_use] pub fn apply(self) -> Builder { - let mut config = TopologyConfig::with_node_numbers(self.validators, self.executors); + let mut config = TopologyConfig::with_node_count(self.nodes); if self.network_star { config.network_params.libp2p_network_layout = Libp2pNetworkLayout::Star; } diff --git a/testing-framework/core/src/scenario/http_probe.rs b/testing-framework/core/src/scenario/http_probe.rs index be67bf3..24d4e25 100644 --- a/testing-framework/core/src/scenario/http_probe.rs +++ b/testing-framework/core/src/scenario/http_probe.rs @@ -7,35 +7,18 @@ use thiserror::Error; use tokio::time::{Instant, sleep}; use tracing::{debug, info}; -/// Role used for labelling readiness probes. -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub enum NodeRole { - Validator, - Executor, -} - -impl NodeRole { - #[must_use] - pub const fn label(self) -> &'static str { - match self { - Self::Validator => "validator", - Self::Executor => "executor", - } - } -} - /// Error raised when HTTP readiness checks time out. #[derive(Clone, Copy, Debug, Error)] -#[error("timeout waiting for {role} HTTP endpoint on port {port} after {timeout:?}", role = role.label())] +#[error("timeout waiting for {role} HTTP endpoint on port {port} after {timeout:?}")] pub struct HttpReadinessError { - role: NodeRole, + role: &'static str, port: u16, timeout: Duration, } impl HttpReadinessError { #[must_use] - pub const fn new(role: NodeRole, port: u16, timeout: Duration) -> Self { + pub const fn new(role: &'static str, port: u16, timeout: Duration) -> Self { Self { role, port, @@ -44,7 +27,7 @@ impl HttpReadinessError { } #[must_use] - pub const fn role(&self) -> NodeRole { + pub const fn role(&self) -> &'static str { self.role } @@ -62,7 +45,7 @@ impl HttpReadinessError { /// Wait for HTTP readiness on the provided ports against localhost. pub async fn wait_for_http_ports( ports: &[u16], - role: NodeRole, + role: &'static str, timeout_duration: Duration, poll_interval: Duration, ) -> Result<(), HttpReadinessError> { @@ -72,7 +55,7 @@ pub async fn wait_for_http_ports( /// Wait for HTTP readiness on the provided ports against a specific host. pub async fn wait_for_http_ports_with_host( ports: &[u16], - role: NodeRole, + role: &'static str, host: &str, timeout_duration: Duration, poll_interval: Duration, @@ -82,7 +65,7 @@ pub async fn wait_for_http_ports_with_host( } info!( - role = role.label(), + role, ?ports, host, timeout_secs = timeout_duration.as_secs_f32(), @@ -108,13 +91,13 @@ pub async fn wait_for_http_ports_with_host( async fn wait_for_single_port( client: ReqwestClient, port: u16, - role: NodeRole, + role: &'static str, host: &str, timeout_duration: Duration, poll_interval: Duration, ) -> Result<(), HttpReadinessError> { let url = format!("http://{host}:{port}{}", paths::CRYPTARCHIA_INFO); - debug!(role = role.label(), %url, "probing HTTP endpoint"); + debug!(role, %url, "probing HTTP endpoint"); let start = Instant::now(); let deadline = start + timeout_duration; let mut attempts: u64 = 0; @@ -125,7 +108,7 @@ async fn wait_for_single_port( let last_failure: Option = match client.get(&url).send().await { Ok(response) if response.status().is_success() => { info!( - role = role.label(), + role, port, host, %url, @@ -144,7 +127,7 @@ async fn wait_for_single_port( if attempts == 1 || attempts % 10 == 0 { debug!( - role = role.label(), + role, port, host, %url, @@ -157,7 +140,7 @@ async fn wait_for_single_port( if Instant::now() >= deadline { info!( - role = role.label(), + role, port, host, %url, diff --git a/testing-framework/core/src/scenario/runtime/metrics.rs b/testing-framework/core/src/scenario/runtime/metrics.rs index 4903513..7c6656f 100644 --- a/testing-framework/core/src/scenario/runtime/metrics.rs +++ b/testing-framework/core/src/scenario/runtime/metrics.rs @@ -6,8 +6,8 @@ use tracing::warn; pub const CONSENSUS_PROCESSED_BLOCKS: &str = "consensus_processed_blocks"; pub const CONSENSUS_TRANSACTIONS_TOTAL: &str = "consensus_transactions_total"; -const CONSENSUS_TRANSACTIONS_VALIDATOR_QUERY: &str = - r#"sum(consensus_transactions_total{job=~"validator-.*"})"#; +const CONSENSUS_TRANSACTIONS_NODE_QUERY: &str = + r#"sum(consensus_transactions_total{job=~"node-.*"})"#; /// Telemetry handles available during a run. #[derive(Clone, Default)] @@ -71,21 +71,21 @@ impl Metrics { .prometheus() .ok_or_else(|| MetricsError::new("prometheus endpoint unavailable"))?; - match handle.instant_samples(CONSENSUS_TRANSACTIONS_VALIDATOR_QUERY) { + match handle.instant_samples(CONSENSUS_TRANSACTIONS_NODE_QUERY) { Ok(samples) if !samples.is_empty() => { return Ok(samples.into_iter().map(|sample| sample.value).sum()); } Ok(_) => { warn!( - query = CONSENSUS_TRANSACTIONS_VALIDATOR_QUERY, - "validator-specific consensus transaction metric returned no samples; falling back to aggregate counter" + query = CONSENSUS_TRANSACTIONS_NODE_QUERY, + "node-specific consensus transaction metric returned no samples; falling back to aggregate counter" ); } Err(err) => { warn!( - query = CONSENSUS_TRANSACTIONS_VALIDATOR_QUERY, + query = CONSENSUS_TRANSACTIONS_NODE_QUERY, error = %err, - "failed to query validator-specific consensus transaction metric; falling back to aggregate counter" + "failed to query node-specific consensus transaction metric; falling back to aggregate counter" ); } } diff --git a/testing-framework/core/src/scenario/runtime/node_clients.rs b/testing-framework/core/src/scenario/runtime/node_clients.rs index aae6724..da084ca 100644 --- a/testing-framework/core/src/scenario/runtime/node_clients.rs +++ b/testing-framework/core/src/scenario/runtime/node_clients.rs @@ -1,4 +1,5 @@ use std::{ + future::Future, pin::Pin, sync::{Arc, RwLock}, }; @@ -11,7 +12,7 @@ use crate::{ topology::{deployment::Topology, generation::GeneratedTopology}, }; -/// Collection of API clients for the validator and executor set. +/// Collection of API clients for the node set. #[derive(Clone, Default)] pub struct NodeClients { inner: Arc>, @@ -19,118 +20,60 @@ pub struct NodeClients { #[derive(Default)] struct NodeClientsInner { - validators: Vec, - executors: Vec, + nodes: Vec, } impl NodeClients { #[must_use] - /// Build clients from preconstructed vectors. - pub fn new(validators: Vec, executors: Vec) -> Self { + /// Build clients from a preconstructed vector. + pub fn new(nodes: Vec) -> Self { Self { - inner: Arc::new(RwLock::new(NodeClientsInner { - validators, - executors, - })), + inner: Arc::new(RwLock::new(NodeClientsInner { nodes })), } } #[must_use] /// Derive clients from a spawned topology. pub fn from_topology(_descriptors: &GeneratedTopology, topology: &Topology) -> Self { - let validator_clients = topology.validators().iter().map(|node| { + let node_clients = topology.nodes().iter().map(|node| { let testing = node.testing_url(); ApiClient::from_urls(node.url(), testing) }); - let executor_clients = topology.executors().iter().map(|node| { - let testing = node.testing_url(); - ApiClient::from_urls(node.url(), testing) - }); - - Self::new(validator_clients.collect(), executor_clients.collect()) + Self::new(node_clients.collect()) } #[must_use] - /// Validator API clients. - pub fn validator_clients(&self) -> Vec { + /// Node API clients. + pub fn node_clients(&self) -> Vec { self.inner .read() .unwrap_or_else(|poisoned| poisoned.into_inner()) - .validators + .nodes .clone() } #[must_use] - /// Executor API clients. - pub fn executor_clients(&self) -> Vec { - self.inner - .read() - .unwrap_or_else(|poisoned| poisoned.into_inner()) - .executors - .clone() - } - - #[must_use] - /// Choose a random validator client if present. - pub fn random_validator(&self) -> Option { - let validators = self.validator_clients(); - if validators.is_empty() { + /// Choose a random node client if present. + pub fn random_node(&self) -> Option { + let nodes = self.node_clients(); + if nodes.is_empty() { return None; } let mut rng = thread_rng(); - let idx = rng.gen_range(0..validators.len()); - validators.get(idx).cloned() - } - - #[must_use] - /// Choose a random executor client if present. - pub fn random_executor(&self) -> Option { - let executors = self.executor_clients(); - if executors.is_empty() { - return None; - } - let mut rng = thread_rng(); - let idx = rng.gen_range(0..executors.len()); - executors.get(idx).cloned() + let idx = rng.gen_range(0..nodes.len()); + nodes.get(idx).cloned() } /// Iterator over all clients. pub fn all_clients(&self) -> Vec { - let guard = self - .inner - .read() - .unwrap_or_else(|poisoned| poisoned.into_inner()); - - guard - .validators - .iter() - .chain(guard.executors.iter()) - .cloned() - .collect() + self.node_clients() } #[must_use] - /// Choose any random client from validators+executors. + /// Choose any random client. pub fn any_client(&self) -> Option { - let guard = self - .inner - .read() - .unwrap_or_else(|poisoned| poisoned.into_inner()); - - let validator_count = guard.validators.len(); - let executor_count = guard.executors.len(); - let total = validator_count + executor_count; - if total == 0 { - return None; - } - let mut rng = thread_rng(); - let choice = rng.gen_range(0..total); - if choice < validator_count { - guard.validators.get(choice).cloned() - } else { - guard.executors.get(choice - validator_count).cloned() - } + self.random_node() } #[must_use] @@ -139,22 +82,13 @@ impl NodeClients { ClusterClient::new(self) } - pub fn add_validator(&self, client: ApiClient) { + pub fn add_node(&self, client: ApiClient) { let mut guard = self .inner .write() .unwrap_or_else(|poisoned| poisoned.into_inner()); - guard.validators.push(client); - } - - pub fn add_executor(&self, client: ApiClient) { - let mut guard = self - .inner - .write() - .unwrap_or_else(|poisoned| poisoned.into_inner()); - - guard.executors.push(client); + guard.nodes.push(client); } pub fn clear(&self) { @@ -163,8 +97,7 @@ impl NodeClients { .write() .unwrap_or_else(|poisoned| poisoned.into_inner()); - guard.validators.clear(); - guard.executors.clear(); + guard.nodes.clear(); } } diff --git a/testing-framework/core/src/topology/config.rs b/testing-framework/core/src/topology/config.rs index ec21478..32aec84 100644 --- a/testing-framework/core/src/topology/config.rs +++ b/testing-framework/core/src/topology/config.rs @@ -4,7 +4,6 @@ use nomos_core::{ mantle::GenesisTx as _, sdp::{Locator, ServiceType}, }; -use nomos_da_network_core::swarm::DAConnectionPolicySettings; use testing_framework_config::topology::{ configs::{ api::{ApiConfigError, create_api_configs}, @@ -24,12 +23,11 @@ use thiserror::Error; use crate::topology::{ configs::{GeneralConfig, time::default_time_config}, - generation::{GeneratedNodeConfig, GeneratedTopology, NodeRole}, + generation::{GeneratedNodeConfig, GeneratedTopology}, utils::{TopologyResolveError, create_kms_configs, resolve_ids, resolve_ports}, }; const DEFAULT_DA_BALANCER_INTERVAL: Duration = Duration::from_secs(1); -const VALIDATOR_EXECUTOR_DA_BALANCER_INTERVAL: Duration = Duration::from_secs(5); #[derive(Debug, Error)] pub enum TopologyBuildError { @@ -58,8 +56,7 @@ pub enum TopologyBuildError { /// High-level topology settings used to generate node configs for a scenario. #[derive(Clone)] pub struct TopologyConfig { - pub n_validators: usize, - pub n_executors: usize, + pub n_nodes: usize, pub consensus_params: ConsensusParams, pub da_params: DaParams, pub network_params: NetworkParams, @@ -71,8 +68,7 @@ impl TopologyConfig { #[must_use] pub fn empty() -> Self { Self { - n_validators: 0, - n_executors: 0, + n_nodes: 0, consensus_params: ConsensusParams::default_for_participants(1), da_params: DaParams::default(), network_params: NetworkParams::default(), @@ -81,11 +77,10 @@ impl TopologyConfig { } #[must_use] - /// Convenience config with two validators for consensus-only scenarios. - pub fn two_validators() -> Self { + /// Convenience config with two nodes for consensus-only scenarios. + pub fn two_nodes() -> Self { Self { - n_validators: 2, - n_executors: 0, + n_nodes: 2, consensus_params: ConsensusParams::default_for_participants(2), da_params: DaParams::default(), network_params: NetworkParams::default(), @@ -94,36 +89,9 @@ impl TopologyConfig { } #[must_use] - /// Single validator + single executor config for minimal dual-role setups. - pub fn validator_and_executor() -> Self { - Self { - n_validators: 1, - n_executors: 1, - consensus_params: ConsensusParams::default_for_participants(2), - da_params: DaParams { - dispersal_factor: 2, - subnetwork_size: 2, - num_subnets: 2, - policy_settings: DAConnectionPolicySettings { - min_dispersal_peers: 1, - min_replication_peers: 1, - max_dispersal_failures: 0, - max_sampling_failures: 0, - max_replication_failures: 0, - malicious_threshold: 0, - }, - balancer_interval: DEFAULT_DA_BALANCER_INTERVAL, - ..Default::default() - }, - network_params: NetworkParams::default(), - wallet_config: WalletConfig::default(), - } - } - - #[must_use] - /// Build a topology with explicit validator and executor counts. - pub fn with_node_numbers(validators: usize, executors: usize) -> Self { - let participants = validators + executors; + /// Build a topology with explicit node count. + pub fn with_node_count(nodes: usize) -> Self { + let participants = nodes; let mut da_params = DaParams::default(); let da_nodes = participants; @@ -145,8 +113,7 @@ impl TopologyConfig { } Self { - n_validators: validators, - n_executors: executors, + n_nodes: nodes, consensus_params: ConsensusParams::default_for_participants(participants), da_params, network_params: NetworkParams::default(), @@ -154,37 +121,6 @@ impl TopologyConfig { } } - #[must_use] - /// Build a topology with one executor and a configurable validator set. - pub fn validators_and_executor( - num_validators: usize, - num_subnets: usize, - dispersal_factor: usize, - ) -> Self { - Self { - n_validators: num_validators, - n_executors: 1, - consensus_params: ConsensusParams::default_for_participants(num_validators + 1), - da_params: DaParams { - dispersal_factor, - subnetwork_size: num_subnets, - num_subnets: num_subnets as u16, - policy_settings: DAConnectionPolicySettings { - min_dispersal_peers: num_subnets, - min_replication_peers: dispersal_factor - 1, - max_dispersal_failures: 0, - max_sampling_failures: 0, - max_replication_failures: 0, - malicious_threshold: 0, - }, - balancer_interval: VALIDATOR_EXECUTOR_DA_BALANCER_INTERVAL, - ..Default::default() - }, - network_params: NetworkParams::default(), - wallet_config: WalletConfig::default(), - } - } - #[must_use] pub const fn wallet(&self) -> &WalletConfig { &self.wallet_config @@ -234,23 +170,9 @@ impl TopologyBuilder { } #[must_use] - pub const fn with_validator_count(mut self, validators: usize) -> Self { - self.config.n_validators = validators; - self - } - - #[must_use] - /// Set executor count. - pub const fn with_executor_count(mut self, executors: usize) -> Self { - self.config.n_executors = executors; - self - } - - #[must_use] - /// Set validator and executor counts together. - pub const fn with_node_counts(mut self, validators: usize, executors: usize) -> Self { - self.config.n_validators = validators; - self.config.n_executors = executors; + /// Set total node count. + pub const fn with_node_count(mut self, nodes: usize) -> Self { + self.config.n_nodes = nodes; self } @@ -312,7 +234,7 @@ impl TopologyBuilder { let kms_configs = create_kms_configs(&blend_configs, &da_configs, &config.wallet_config.accounts); - let (validators, executors) = build_node_descriptors( + let nodes = build_node_descriptors( &config, n_participants, &ids, @@ -329,11 +251,7 @@ impl TopologyBuilder { &time_config, )?; - Ok(GeneratedTopology { - config, - validators, - executors, - }) + Ok(GeneratedTopology { config, nodes }) } #[must_use] @@ -343,7 +261,7 @@ impl TopologyBuilder { } fn participant_count(config: &TopologyConfig) -> Result { - let n_participants = config.n_validators + config.n_executors; + let n_participants = config.n_nodes; if n_participants == 0 { return Err(TopologyBuildError::EmptyParticipants); } @@ -436,9 +354,8 @@ fn build_node_descriptors( tracing_configs: &[testing_framework_config::topology::configs::tracing::GeneralTracingConfig], kms_configs: &[key_management_system_service::backend::preload::PreloadKMSBackendSettings], time_config: &testing_framework_config::topology::configs::time::GeneralTimeConfig, -) -> Result<(Vec, Vec), TopologyBuildError> { - let mut validators = Vec::with_capacity(config.n_validators); - let mut executors = Vec::with_capacity(config.n_executors); +) -> Result, TopologyBuildError> { + let mut nodes = Vec::with_capacity(config.n_nodes); for i in 0..n_participants { let consensus_config = @@ -468,31 +385,17 @@ fn build_node_descriptors( kms_config, }; - let (role, index) = node_role_and_index(i, config.n_validators); let descriptor = GeneratedNodeConfig { - role, - index, + index: i, id, general, da_port, blend_port, }; - - match role { - NodeRole::Validator => validators.push(descriptor), - NodeRole::Executor => executors.push(descriptor), - } + nodes.push(descriptor); } - Ok((validators, executors)) -} - -fn node_role_and_index(i: usize, n_validators: usize) -> (NodeRole, usize) { - if i < n_validators { - (NodeRole::Validator, i) - } else { - (NodeRole::Executor, i - n_validators) - } + Ok(nodes) } fn get_cloned( diff --git a/testing-framework/core/src/topology/deployment.rs b/testing-framework/core/src/topology/deployment.rs index e8126d1..21064dd 100644 --- a/testing-framework/core/src/topology/deployment.rs +++ b/testing-framework/core/src/topology/deployment.rs @@ -6,8 +6,7 @@ use thiserror::Error; use crate::{ nodes::{ common::node::SpawnNodeError, - executor::{Executor, create_executor_config}, - validator::{Validator, create_validator_config}, + node::{Node, create_node_config}, }, topology::{ config::{TopologyBuildError, TopologyBuilder, TopologyConfig}, @@ -23,11 +22,10 @@ use crate::{ /// Runtime representation of a spawned topology with running nodes. pub struct Topology { - pub(crate) validators: Vec, - pub(crate) executors: Vec, + pub(crate) nodes: Vec, } -pub type DeployedNodes = (Vec, Vec); +pub type DeployedNodes = Vec; #[derive(Debug, Error)] pub enum SpawnTopologyError { @@ -40,20 +38,15 @@ pub enum SpawnTopologyError { impl Topology { pub async fn spawn(config: TopologyConfig) -> Result { let generated = TopologyBuilder::new(config.clone()).build()?; - let n_validators = config.n_validators; - let n_executors = config.n_executors; let node_configs = generated .nodes() + .iter() .map(|node| node.general.clone()) .collect::>(); - let (validators, executors) = - Self::spawn_validators_executors(node_configs, n_validators, n_executors).await?; + let nodes = Self::spawn_nodes(node_configs).await?; - Ok(Self { - validators, - executors, - }) + Ok(Self { nodes }) } pub async fn spawn_with_empty_membership( @@ -70,49 +63,30 @@ impl Topology { let node_configs = generated .nodes() + .iter() .map(|node| node.general.clone()) .collect::>(); - let (validators, executors) = - Self::spawn_validators_executors(node_configs, config.n_validators, config.n_executors) - .await?; + let nodes = Self::spawn_nodes(node_configs).await?; - Ok(Self { - validators, - executors, - }) + Ok(Self { nodes }) } - pub(crate) async fn spawn_validators_executors( - config: Vec, - n_validators: usize, - n_executors: usize, + pub(crate) async fn spawn_nodes( + configs: Vec, ) -> Result { - let mut validators = Vec::new(); - for i in 0..n_validators { - let config = create_validator_config(config[i].clone()); - let label = format!("validator-{i}"); - validators.push(Validator::spawn(config, &label).await?); + let mut nodes = Vec::with_capacity(configs.len()); + for (idx, config) in configs.into_iter().enumerate() { + let config = create_node_config(config); + let label = format!("node-{idx}"); + nodes.push(Node::spawn(config, &label).await?); } - - let mut executors = Vec::new(); - for i in 0..n_executors { - let config = create_executor_config(config[n_validators + i].clone()); - let label = format!("executor-{i}"); - executors.push(Executor::spawn(config, &label).await?); - } - - Ok((validators, executors)) + Ok(nodes) } #[must_use] - pub fn validators(&self) -> &[Validator] { - &self.validators - } - - #[must_use] - pub fn executors(&self) -> &[Executor] { - &self.executors + pub fn nodes(&self) -> &[Node] { + &self.nodes } pub async fn wait_network_ready(&self) -> Result<(), ReadinessError> { @@ -136,7 +110,7 @@ impl Topology { } pub async fn wait_da_balancer_ready(&self) -> Result<(), ReadinessError> { - if self.validators.is_empty() && self.executors.is_empty() { + if self.nodes.is_empty() { return Ok(()); } @@ -174,9 +148,7 @@ impl Topology { session: SessionNumber, expect_non_empty: bool, ) -> Result<(), ReadinessError> { - let total_nodes = self.validators.len() + self.executors.len(); - - if total_nodes == 0 { + if self.nodes.is_empty() { return Ok(()); } @@ -193,19 +165,14 @@ impl Topology { } fn node_listen_ports(&self) -> Vec { - self.validators + self.nodes .iter() .map(|node| node.config().network.backend.swarm.port) - .chain( - self.executors - .iter() - .map(|node| node.config().network.backend.swarm.port), - ) .collect() } fn node_initial_peer_ports(&self) -> Vec> { - self.validators + self.nodes .iter() .map(|node| { node.config() @@ -216,34 +183,14 @@ impl Topology { .filter_map(multiaddr_port) .collect::>() }) - .chain(self.executors.iter().map(|node| { - node.config() - .network - .backend - .initial_peers - .iter() - .filter_map(multiaddr_port) - .collect::>() - })) .collect() } fn node_labels(&self) -> Vec { - self.validators + self.nodes .iter() .enumerate() - .map(|(idx, node)| { - format!( - "validator#{idx}@{}", - node.config().network.backend.swarm.port - ) - }) - .chain(self.executors.iter().enumerate().map(|(idx, node)| { - format!( - "executor#{idx}@{}", - node.config().network.backend.swarm.port - ) - })) + .map(|(idx, node)| format!("node#{idx}@{}", node.config().network.backend.swarm.port)) .collect() } } diff --git a/testing-framework/core/src/topology/generation.rs b/testing-framework/core/src/topology/generation.rs index 574cad8..d7a5b80 100644 --- a/testing-framework/core/src/topology/generation.rs +++ b/testing-framework/core/src/topology/generation.rs @@ -9,17 +9,9 @@ use crate::topology::{ readiness::{HttpMembershipReadiness, HttpNetworkReadiness, ReadinessCheck, ReadinessError}, }; -/// Node role within the generated topology. -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum NodeRole { - Validator, - Executor, -} - /// Fully generated configuration for an individual node. #[derive(Clone)] pub struct GeneratedNodeConfig { - pub role: NodeRole, pub index: usize, pub id: [u8; 32], pub general: GeneralConfig, @@ -28,12 +20,6 @@ pub struct GeneratedNodeConfig { } impl GeneratedNodeConfig { - #[must_use] - /// Logical role of the node. - pub const fn role(&self) -> NodeRole { - self.role - } - #[must_use] /// Zero-based index within its role group. pub const fn index(&self) -> usize { @@ -61,8 +47,7 @@ impl GeneratedNodeConfig { #[derive(Clone)] pub struct GeneratedTopology { pub(crate) config: TopologyConfig, - pub(crate) validators: Vec, - pub(crate) executors: Vec, + pub(crate) nodes: Vec, } impl GeneratedTopology { @@ -73,26 +58,15 @@ impl GeneratedTopology { } #[must_use] - /// All validator configs. - pub fn validators(&self) -> &[GeneratedNodeConfig] { - &self.validators - } - - #[must_use] - /// All executor configs. - pub fn executors(&self) -> &[GeneratedNodeConfig] { - &self.executors - } - - /// Iterator over all node configs in role order. - pub fn nodes(&self) -> impl Iterator { - self.validators.iter().chain(self.executors.iter()) + /// All node configs. + pub fn nodes(&self) -> &[GeneratedNodeConfig] { + &self.nodes } #[must_use] /// Slot duration from the first node (assumes homogeneous configs). pub fn slot_duration(&self) -> Option { - self.validators + self.nodes .first() .map(|node| node.general.time_config.slot_duration) } @@ -106,55 +80,33 @@ impl GeneratedTopology { pub async fn spawn_local(&self) -> Result { let configs = self .nodes() + .iter() .map(|node| node.general.clone()) .collect::>(); - let (validators, executors) = Topology::spawn_validators_executors( - configs, - self.config.n_validators, - self.config.n_executors, - ) - .await?; - - Ok(Topology { - validators, - executors, - }) + let nodes = Topology::spawn_nodes(configs).await?; + Ok(Topology { nodes }) } pub async fn wait_remote_readiness( &self, - // Node endpoints - validator_endpoints: &[Url], - executor_endpoints: &[Url], - - // Membership endpoints - validator_membership_endpoints: Option<&[Url]>, - executor_membership_endpoints: Option<&[Url]>, + node_endpoints: &[Url], + membership_endpoints: Option<&[Url]>, ) -> Result<(), ReadinessError> { - let total_nodes = self.validators.len() + self.executors.len(); - if total_nodes == 0 { + if self.nodes.is_empty() { return Ok(()); } let labels = self.labels(); let client = Client::new(); - let endpoints = - collect_node_endpoints(self, validator_endpoints, executor_endpoints, total_nodes); + let endpoints = collect_node_endpoints(self, node_endpoints); wait_for_network_readiness(self, &client, &endpoints, &labels).await?; - if validator_membership_endpoints.is_none() && executor_membership_endpoints.is_none() { + let Some(membership_endpoints) = membership_endpoints else { return Ok(()); - } - - let membership_endpoints = collect_membership_endpoints( - self, - total_nodes, - validator_membership_endpoints, - executor_membership_endpoints, - ); + }; let membership_check = HttpMembershipReadiness { client: &client, @@ -168,19 +120,14 @@ impl GeneratedTopology { } fn listen_ports(&self) -> Vec { - self.validators + self.nodes .iter() .map(|node| node.general.network_config.backend.swarm.port) - .chain( - self.executors - .iter() - .map(|node| node.general.network_config.backend.swarm.port), - ) .collect() } fn initial_peer_ports(&self) -> Vec> { - self.validators + self.nodes .iter() .map(|node| { node.general @@ -191,59 +138,30 @@ impl GeneratedTopology { .filter_map(crate::topology::utils::multiaddr_port) .collect::>() }) - .chain(self.executors.iter().map(|node| { - node.general - .network_config - .backend - .initial_peers - .iter() - .filter_map(crate::topology::utils::multiaddr_port) - .collect::>() - })) .collect() } fn labels(&self) -> Vec { - self.validators + self.nodes .iter() .enumerate() .map(|(idx, node)| { format!( - "validator#{idx}@{}", + "node#{idx}@{}", node.general.network_config.backend.swarm.port ) }) - .chain(self.executors.iter().enumerate().map(|(idx, node)| { - format!( - "executor#{idx}@{}", - node.general.network_config.backend.swarm.port - ) - })) .collect() } } -fn collect_node_endpoints( - topology: &GeneratedTopology, - validator_endpoints: &[Url], - executor_endpoints: &[Url], - total_nodes: usize, -) -> Vec { +fn collect_node_endpoints(topology: &GeneratedTopology, node_endpoints: &[Url]) -> Vec { assert_eq!( - topology.validators.len(), - validator_endpoints.len(), - "validator endpoints must match topology" + topology.nodes.len(), + node_endpoints.len(), + "node endpoints must match topology" ); - assert_eq!( - topology.executors.len(), - executor_endpoints.len(), - "executor endpoints must match topology" - ); - - let mut endpoints = Vec::with_capacity(total_nodes); - endpoints.extend_from_slice(validator_endpoints); - endpoints.extend_from_slice(executor_endpoints); - endpoints + node_endpoints.to_vec() } async fn wait_for_network_readiness( @@ -271,52 +189,6 @@ async fn wait_for_network_readiness( network_check.wait().await } -fn collect_membership_endpoints( - topology: &GeneratedTopology, - total_nodes: usize, - validator_membership_endpoints: Option<&[Url]>, - executor_membership_endpoints: Option<&[Url]>, -) -> Vec { - let mut membership_endpoints = Vec::with_capacity(total_nodes); - - membership_endpoints.extend(collect_role_membership_endpoints( - &topology.validators, - validator_membership_endpoints, - "validator membership endpoints must match topology", - )); - membership_endpoints.extend(collect_role_membership_endpoints( - &topology.executors, - executor_membership_endpoints, - "executor membership endpoints must match topology", - )); - - membership_endpoints -} - -fn collect_role_membership_endpoints( - nodes: &[GeneratedNodeConfig], - membership_endpoints: Option<&[Url]>, - mismatch_message: &'static str, -) -> Vec { - match membership_endpoints { - Some(urls) => { - assert_eq!(nodes.len(), urls.len(), "{mismatch_message}"); - urls.to_vec() - } - None => nodes - .iter() - .map(|node| testing_base_url(node.testing_http_port())) - .collect(), - } -} - -fn testing_base_url(port: u16) -> Url { - Url::parse(&format!("http://127.0.0.1:{port}/")).unwrap_or_else(|_| unsafe { - // Safety: `port` is a valid u16 port. - std::hint::unreachable_unchecked() - }) -} - pub fn find_expected_peer_counts( listen_ports: &[u16], initial_peer_ports: &[HashSet], diff --git a/testing-framework/core/src/topology/readiness/balancer.rs b/testing-framework/core/src/topology/readiness/balancer.rs index 57d3bb8..5680130 100644 --- a/testing-framework/core/src/topology/readiness/balancer.rs +++ b/testing-framework/core/src/topology/readiness/balancer.rs @@ -23,33 +23,17 @@ impl<'a> ReadinessCheck<'a> for DaBalancerReadiness<'a> { async fn collect(&'a self) -> Self::Data { let mut data = Vec::new(); - for (idx, validator) in self.topology.validators.iter().enumerate() { + for (idx, node) in self.topology.nodes.iter().enumerate() { let label = self .labels .get(idx) .cloned() - .unwrap_or_else(|| format!("validator#{idx}")); + .unwrap_or_else(|| format!("node#{idx}")); data.push( ( label, - validator.config().da_network.subnet_threshold, - validator.api().balancer_stats().await, - ) - .into(), - ); - } - for (offset, executor) in self.topology.executors.iter().enumerate() { - let label_index = self.topology.validators.len() + offset; - let label = self - .labels - .get(label_index) - .cloned() - .unwrap_or_else(|| format!("executor#{offset}")); - data.push( - ( - label, - executor.config().da_network.subnet_threshold, - executor.api().balancer_stats().await, + node.config().da_network.subnet_threshold, + node.api().balancer_stats().await, ) .into(), ); @@ -58,7 +42,7 @@ impl<'a> ReadinessCheck<'a> for DaBalancerReadiness<'a> { } fn is_ready(&self, data: &Self::Data) -> bool { - if self.topology.validators.len() + self.topology.executors.len() <= 1 { + if self.topology.nodes.len() <= 1 { return true; } data.iter().all(|entry| { diff --git a/testing-framework/core/src/topology/readiness/membership.rs b/testing-framework/core/src/topology/readiness/membership.rs index 9fe3fd5..a7d750b 100644 --- a/testing-framework/core/src/topology/readiness/membership.rs +++ b/testing-framework/core/src/topology/readiness/membership.rs @@ -38,14 +38,7 @@ impl<'a> ReadinessCheck<'a> for MembershipReadiness<'a> { type Data = Vec; async fn collect(&'a self) -> Self::Data { - let (validator_statuses, executor_statuses) = tokio::join!( - collect_validator_statuses(self), - collect_executor_statuses(self) - ); - validator_statuses - .into_iter() - .chain(executor_statuses) - .collect() + collect_node_statuses(self).await } fn is_ready(&self, data: &Self::Data) -> bool { @@ -107,12 +100,10 @@ impl<'a> ReadinessCheck<'a> for HttpMembershipReadiness<'a> { } } -async fn collect_validator_statuses( - readiness: &MembershipReadiness<'_>, -) -> Vec { - let validator_futures = readiness +async fn collect_node_statuses(readiness: &MembershipReadiness<'_>) -> Vec { + let node_futures = readiness .topology - .validators + .nodes .iter() .enumerate() .map(|(idx, node)| { @@ -120,7 +111,7 @@ async fn collect_validator_statuses( .labels .get(idx) .cloned() - .unwrap_or_else(|| format!("validator#{idx}")); + .unwrap_or_else(|| format!("node#{idx}")); async move { let result = node .api() @@ -131,36 +122,7 @@ async fn collect_validator_statuses( } }); - futures::future::join_all(validator_futures).await -} - -async fn collect_executor_statuses( - readiness: &MembershipReadiness<'_>, -) -> Vec { - let offset = readiness.topology.validators.len(); - let executor_futures = readiness - .topology - .executors - .iter() - .enumerate() - .map(|(idx, node)| { - let global_idx = offset + idx; - let label = readiness - .labels - .get(global_idx) - .cloned() - .unwrap_or_else(|| format!("executor#{idx}")); - async move { - let result = node - .api() - .da_get_membership_checked(&readiness.session) - .await - .map_err(MembershipError::from); - NodeMembershipStatus { label, result } - } - }); - - futures::future::join_all(executor_futures).await + futures::future::join_all(node_futures).await } pub async fn try_fetch_membership( diff --git a/testing-framework/core/src/topology/readiness/network.rs b/testing-framework/core/src/topology/readiness/network.rs index f251b91..bcbb3a5 100644 --- a/testing-framework/core/src/topology/readiness/network.rs +++ b/testing-framework/core/src/topology/readiness/network.rs @@ -36,14 +36,7 @@ impl<'a> ReadinessCheck<'a> for NetworkReadiness<'a> { type Data = Vec; async fn collect(&'a self) -> Self::Data { - let (validator_statuses, executor_statuses) = tokio::join!( - collect_validator_statuses(self), - collect_executor_statuses(self) - ); - validator_statuses - .into_iter() - .chain(executor_statuses) - .collect() + collect_node_statuses(self).await } fn is_ready(&self, data: &Self::Data) -> bool { @@ -107,10 +100,10 @@ impl<'a> ReadinessCheck<'a> for HttpNetworkReadiness<'a> { } } -async fn collect_validator_statuses(readiness: &NetworkReadiness<'_>) -> Vec { - let validator_futures = readiness +async fn collect_node_statuses(readiness: &NetworkReadiness<'_>) -> Vec { + let node_futures = readiness .topology - .validators + .nodes .iter() .enumerate() .map(|(idx, node)| { @@ -118,7 +111,7 @@ async fn collect_validator_statuses(readiness: &NetworkReadiness<'_>) -> Vec) -> Vec) -> Vec { - let offset = readiness.topology.validators.len(); - let executor_futures = readiness - .topology - .executors - .iter() - .enumerate() - .map(|(idx, node)| { - let global_idx = offset + idx; - let label = readiness - .labels - .get(global_idx) - .cloned() - .unwrap_or_else(|| format!("executor#{idx}")); - let expected_peers = readiness.expected_peer_counts.get(global_idx).copied(); - async move { - let result = node - .api() - .network_info() - .await - .map_err(NetworkInfoError::from); - NodeNetworkStatus { - label, - expected_peers, - result, - } - } - }); - - futures::future::join_all(executor_futures).await + futures::future::join_all(node_futures).await } pub async fn try_fetch_network_info( diff --git a/testing-framework/cucumber/src/world.rs b/testing-framework/cucumber/src/world.rs index 911b2f8..9144687 100644 --- a/testing-framework/cucumber/src/world.rs +++ b/testing-framework/cucumber/src/world.rs @@ -35,8 +35,7 @@ pub struct ScenarioSpec { #[derive(Debug, Clone, Copy)] pub struct TopologySpec { - pub validators: usize, - pub executors: usize, + pub nodes: usize, pub network: NetworkKind, } @@ -101,15 +100,9 @@ impl TestingFrameworkWorld { Ok(()) } - pub fn set_topology( - &mut self, - validators: usize, - executors: usize, - network: NetworkKind, - ) -> StepResult { + pub fn set_topology(&mut self, nodes: usize, network: NetworkKind) -> StepResult { self.spec.topology = Some(TopologySpec { - validators: positive_usize("validators", validators)?, - executors, + nodes: positive_usize("nodes", nodes)?, network, }); Ok(()) @@ -209,23 +202,9 @@ impl TestingFrameworkWorld { .is_some_and(|p| p.is_file()) || shared_host_bin_path("nomos-node").is_file(); - let requires_executor_bin = self - .spec - .topology - .is_some_and(|topology| topology.executors > 0); - - let exec_ok = if requires_executor_bin { - env::var_os("NOMOS_EXECUTOR_BIN") - .map(PathBuf::from) - .is_some_and(|p| p.is_file()) - || shared_host_bin_path("nomos-executor").is_file() - } else { - true - }; - - if !(node_ok && exec_ok) { + if !node_ok { return Err(StepError::Preflight { - message: "Missing Logos host binaries. Set NOMOS_NODE_BIN (and NOMOS_EXECUTOR_BIN if your scenario uses executors), or run `scripts/run/run-examples.sh host` to restore them into `testing-framework/assets/stack/bin`.".to_owned(), + message: "Missing Logos host binaries. Set NOMOS_NODE_BIN, or run `scripts/run/run-examples.sh host` to restore them into `testing-framework/assets/stack/bin`.".to_owned(), }); } } @@ -284,8 +263,7 @@ fn make_builder(topology: TopologySpec) -> Builder<()> { let base = match topology.network { NetworkKind::Star => t.network_star(), }; - base.validators(topology.validators) - .executors(topology.executors) + base.nodes(topology.nodes) }) } diff --git a/testing-framework/deployers/compose/assets/docker-compose.yml.tera b/testing-framework/deployers/compose/assets/docker-compose.yml.tera index 83098c5..ba21922 100644 --- a/testing-framework/deployers/compose/assets/docker-compose.yml.tera +++ b/testing-framework/deployers/compose/assets/docker-compose.yml.tera @@ -1,35 +1,5 @@ services: -{% for node in validators %} - {{ node.name }}: - image: {{ node.image }} -{% if node.platform %} platform: {{ node.platform }} -{% endif %} entrypoint: {{ node.entrypoint }} - volumes: -{% for volume in node.volumes %} - - {{ volume }} -{% endfor %} -{% if node.extra_hosts | length > 0 %} - extra_hosts: -{% for host in node.extra_hosts %} - - {{ host }} -{% endfor %} -{% endif %} - ports: -{% for port in node.ports %} - - {{ port }} -{% endfor %} - environment: -{% for env in node.environment %} - {{ env.key }}: "{{ env.value }}" -{% endfor %} - cap_add: - - SYS_ADMIN - - SYS_PTRACE - security_opt: - - seccomp=unconfined - restart: on-failure - -{% endfor %}{% for node in executors %} +{% for node in nodes %} {{ node.name }}: image: {{ node.image }} {% if node.platform %} platform: {{ node.platform }} diff --git a/testing-framework/deployers/compose/src/deployer/clients.rs b/testing-framework/deployers/compose/src/deployer/clients.rs index 042eeb1..10840dc 100644 --- a/testing-framework/deployers/compose/src/deployer/clients.rs +++ b/testing-framework/deployers/compose/src/deployer/clients.rs @@ -59,7 +59,7 @@ impl ClientBuilder { .await); } }; - info!("block feed connected to validator"); + info!("block feed connected to node"); Ok(pair) } } diff --git a/testing-framework/deployers/compose/src/deployer/mod.rs b/testing-framework/deployers/compose/src/deployer/mod.rs index 03af600..0555ae0 100644 --- a/testing-framework/deployers/compose/src/deployer/mod.rs +++ b/testing-framework/deployers/compose/src/deployer/mod.rs @@ -102,14 +102,14 @@ mod tests { use testing_framework_core::{ scenario::ScenarioBuilder, topology::{ - generation::{GeneratedNodeConfig, GeneratedTopology, NodeRole as TopologyNodeRole}, + generation::{GeneratedNodeConfig, GeneratedTopology}, utils::multiaddr_port, }, }; #[test] fn cfgsync_prebuilt_configs_preserve_genesis() { - let scenario = ScenarioBuilder::topology_with(|t| t.validators(1).executors(1)) + let scenario = ScenarioBuilder::topology_with(|t| t.nodes(2)) .build() .expect("scenario build should succeed"); let topology = scenario.topology().clone(); @@ -121,9 +121,15 @@ mod tests { &topology.config().da_params, &tracing_settings, &topology.config().wallet_config, - Some(topology.nodes().map(|node| node.id).collect()), - Some(topology.nodes().map(|node| node.da_port).collect()), - Some(topology.nodes().map(|node| node.blend_port).collect()), + Some(topology.nodes().iter().map(|node| node.id).collect()), + Some(topology.nodes().iter().map(|node| node.da_port).collect()), + Some( + topology + .nodes() + .iter() + .map(|node| node.blend_port) + .collect(), + ), hosts, ) .expect("cfgsync config generation should succeed"); @@ -133,7 +139,7 @@ mod tests { .collect(); for node in topology.nodes() { - let identifier = identifier_for(node.role(), node.index()); + let identifier = identifier_for(node.index()); let cfgsync_config = configs_by_identifier .get(&identifier) .unwrap_or_else(|| panic!("missing cfgsync config for {identifier}")); @@ -164,7 +170,7 @@ mod tests { #[test] fn cfgsync_genesis_proofs_verify_against_ledger() { - let scenario = ScenarioBuilder::topology_with(|t| t.validators(1).executors(1)) + let scenario = ScenarioBuilder::topology_with(|t| t.nodes(2)) .build() .expect("scenario build should succeed"); let topology = scenario.topology().clone(); @@ -176,9 +182,15 @@ mod tests { &topology.config().da_params, &tracing_settings, &topology.config().wallet_config, - Some(topology.nodes().map(|node| node.id).collect()), - Some(topology.nodes().map(|node| node.da_port).collect()), - Some(topology.nodes().map(|node| node.blend_port).collect()), + Some(topology.nodes().iter().map(|node| node.id).collect()), + Some(topology.nodes().iter().map(|node| node.da_port).collect()), + Some( + topology + .nodes() + .iter() + .map(|node| node.blend_port) + .collect(), + ), hosts, ) .expect("cfgsync config generation should succeed"); @@ -188,7 +200,7 @@ mod tests { .collect(); for node in topology.nodes() { - let identifier = identifier_for(node.role(), node.index()); + let identifier = identifier_for(node.index()); let cfgsync_config = configs_by_identifier .get(&identifier) .unwrap_or_else(|| panic!("missing cfgsync config for {identifier}")); @@ -203,7 +215,7 @@ mod tests { #[test] fn cfgsync_docker_overrides_produce_valid_genesis() { - let scenario = ScenarioBuilder::topology_with(|t| t.validators(1).executors(1)) + let scenario = ScenarioBuilder::topology_with(|t| t.nodes(2)) .build() .expect("scenario build should succeed"); let topology = scenario.topology().clone(); @@ -215,9 +227,15 @@ mod tests { &topology.config().da_params, &tracing_settings, &topology.config().wallet_config, - Some(topology.nodes().map(|node| node.id).collect()), - Some(topology.nodes().map(|node| node.da_port).collect()), - Some(topology.nodes().map(|node| node.blend_port).collect()), + Some(topology.nodes().iter().map(|node| node.id).collect()), + Some(topology.nodes().iter().map(|node| node.da_port).collect()), + Some( + topology + .nodes() + .iter() + .map(|node| node.blend_port) + .collect(), + ), hosts, ) .expect("cfgsync config generation should succeed"); @@ -237,7 +255,7 @@ mod tests { #[test] fn cfgsync_configs_match_topology_ports_and_genesis() { - let scenario = ScenarioBuilder::topology_with(|t| t.validators(1).executors(1)) + let scenario = ScenarioBuilder::topology_with(|t| t.nodes(2)) .build() .expect("scenario build should succeed"); let topology = scenario.topology().clone(); @@ -249,9 +267,15 @@ mod tests { &topology.config().da_params, &tracing_settings, &topology.config().wallet_config, - Some(topology.nodes().map(|node| node.id).collect()), - Some(topology.nodes().map(|node| node.da_port).collect()), - Some(topology.nodes().map(|node| node.blend_port).collect()), + Some(topology.nodes().iter().map(|node| node.id).collect()), + Some(topology.nodes().iter().map(|node| node.da_port).collect()), + Some( + topology + .nodes() + .iter() + .map(|node| node.blend_port) + .collect(), + ), hosts, ) .expect("cfgsync config generation should succeed"); @@ -261,7 +285,7 @@ mod tests { .collect(); for node in topology.nodes() { - let identifier = identifier_for(node.role(), node.index()); + let identifier = identifier_for(node.index()); let cfg = configs_by_identifier .get(&identifier) .unwrap_or_else(|| panic!("missing cfgsync config for {identifier}")); @@ -303,20 +327,21 @@ mod tests { } fn hosts_from_topology(topology: &GeneratedTopology) -> Vec { - topology.nodes().map(host_from_node).collect() + topology.nodes().iter().map(host_from_node).collect() } fn docker_style_hosts(topology: &GeneratedTopology) -> Vec { topology .nodes() + .iter() .map(|node| docker_host(node, 10 + node.index() as u8)) .collect() } fn host_from_node(node: &GeneratedNodeConfig) -> Host { - let identifier = identifier_for(node.role(), node.index()); + let identifier = identifier_for(node.index()); let ip = Ipv4Addr::LOCALHOST; - let mut host = make_host(node.role(), ip, identifier); + let mut host = make_host(ip, identifier); host.network_port = node.network_port(); host.da_network_port = node.da_port; host.blend_port = node.blend_port; @@ -324,9 +349,9 @@ mod tests { } fn docker_host(node: &GeneratedNodeConfig, octet: u8) -> Host { - let identifier = identifier_for(node.role(), node.index()); + let identifier = identifier_for(node.index()); let ip = Ipv4Addr::new(172, 23, 0, octet); - let mut host = make_host(node.role(), ip, identifier); + let mut host = make_host(ip, identifier); host.network_port = node.network_port().saturating_add(1000); host.da_network_port = node.da_port.saturating_add(1000); host.blend_port = node.blend_port.saturating_add(1000); @@ -335,9 +360,8 @@ mod tests { fn tracing_settings(topology: &GeneratedTopology) -> TracingSettings { topology - .validators() + .nodes() .first() - .or_else(|| topology.executors().first()) .expect("topology must contain at least one node") .general .tracing_config @@ -345,14 +369,11 @@ mod tests { .clone() } - fn identifier_for(role: TopologyNodeRole, index: usize) -> String { - match role { - TopologyNodeRole::Validator => format!("validator-{index}"), - TopologyNodeRole::Executor => format!("executor-{index}"), - } + fn identifier_for(index: usize) -> String { + format!("node-{index}") } - fn make_host(role: TopologyNodeRole, ip: Ipv4Addr, identifier: String) -> Host { + fn make_host(ip: Ipv4Addr, identifier: String) -> Host { let ports = PortOverrides { network_port: None, da_network_port: None, @@ -360,10 +381,7 @@ mod tests { api_port: None, testing_http_port: None, }; - match role { - TopologyNodeRole::Validator => Host::validator_from_ip(ip, identifier, ports), - TopologyNodeRole::Executor => Host::executor_from_ip(ip, identifier, ports), - } + Host::node_from_ip(ip, identifier, ports) } fn declaration_fingerprint( diff --git a/testing-framework/deployers/compose/src/deployer/orchestrator.rs b/testing-framework/deployers/compose/src/deployer/orchestrator.rs index 95bc984..839b5ea 100644 --- a/testing-framework/deployers/compose/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/compose/src/deployer/orchestrator.rs @@ -50,8 +50,7 @@ impl DeploymentOrchestrator { } = setup.prepare_workspace(&observability).await?; tracing::info!( - validators = descriptors.validators().len(), - executors = descriptors.executors().len(), + nodes = descriptors.nodes().len(), duration_secs = scenario.duration().as_secs(), readiness_checks = self.deployer.readiness_checks, metrics_query_url = observability.metrics_query_url.as_ref().map(|u| u.as_str()), @@ -63,8 +62,6 @@ impl DeploymentOrchestrator { "compose deployment starting" ); - let validator_count = descriptors.validators().len(); - let executor_count = descriptors.executors().len(); let host_ports = PortManager::prepare(&mut environment, &descriptors).await?; wait_for_readiness_or_grace_period( @@ -104,8 +101,7 @@ impl DeploymentOrchestrator { ); info!( - validators = validator_count, - executors = executor_count, + nodes = host_ports.nodes.len(), duration_secs = scenario.duration().as_secs(), readiness_checks = self.deployer.readiness_checks, host, @@ -198,38 +194,22 @@ fn maybe_print_endpoints(observability: &ObservabilityInputs, host: &str, ports: } fn log_profiling_urls(host: &str, ports: &HostPortMapping) { - for (idx, node) in ports.validators.iter().enumerate() { + for (idx, node) in ports.nodes.iter().enumerate() { tracing::info!( - validator = idx, + node = idx, profiling_url = %format!( "http://{}:{}/debug/pprof/profile?seconds=15&format=proto", host, node.api ), - "validator profiling endpoint (profiling feature required)" - ); - } - for (idx, node) in ports.executors.iter().enumerate() { - tracing::info!( - executor = idx, - profiling_url = %format!( - "http://{}:{}/debug/pprof/profile?seconds=15&format=proto", - host, node.api - ), - "executor profiling endpoint (profiling feature required)" + "node profiling endpoint (profiling feature required)" ); } } fn print_profiling_urls(host: &str, ports: &HostPortMapping) { - for (idx, node) in ports.validators.iter().enumerate() { + for (idx, node) in ports.nodes.iter().enumerate() { println!( - "TESTNET_PPROF validator_{}=http://{}:{}/debug/pprof/profile?seconds=15&format=proto", - idx, host, node.api - ); - } - for (idx, node) in ports.executors.iter().enumerate() { - println!( - "TESTNET_PPROF executor_{}=http://{}:{}/debug/pprof/profile?seconds=15&format=proto", + "TESTNET_PPROF node_{}=http://{}:{}/debug/pprof/profile?seconds=15&format=proto", idx, host, node.api ); } diff --git a/testing-framework/deployers/compose/src/deployer/ports.rs b/testing-framework/deployers/compose/src/deployer/ports.rs index 2ca9708..eb076f5 100644 --- a/testing-framework/deployers/compose/src/deployer/ports.rs +++ b/testing-framework/deployers/compose/src/deployer/ports.rs @@ -17,15 +17,13 @@ impl PortManager { descriptors: &GeneratedTopology, ) -> Result { debug!( - validators = descriptors.validators().len(), - executors = descriptors.executors().len(), + nodes = descriptors.nodes().len(), "resolving host ports for compose services" ); match discover_host_ports(environment, descriptors).await { Ok(mapping) => { info!( - validator_ports = ?mapping.validator_api_ports(), - executor_ports = ?mapping.executor_api_ports(), + node_ports = ?mapping.node_api_ports(), "resolved container host ports" ); Ok(mapping) diff --git a/testing-framework/deployers/compose/src/deployer/readiness.rs b/testing-framework/deployers/compose/src/deployer/readiness.rs index b0e5eb6..f31f1c7 100644 --- a/testing-framework/deployers/compose/src/deployer/readiness.rs +++ b/testing-framework/deployers/compose/src/deployer/readiness.rs @@ -7,7 +7,7 @@ use crate::{ environment::StackEnvironment, ports::{HostPortMapping, ensure_remote_readiness_with_ports}, }, - lifecycle::readiness::{ensure_executors_ready_with_ports, ensure_validators_ready_with_ports}, + lifecycle::readiness::ensure_nodes_ready_with_ports, }; pub struct ReadinessChecker; @@ -18,25 +18,13 @@ impl ReadinessChecker { host_ports: &HostPortMapping, environment: &mut StackEnvironment, ) -> Result<(), ComposeRunnerError> { - let validator_ports = host_ports.validator_api_ports(); - info!(ports = ?validator_ports, "waiting for validator HTTP endpoints"); - if let Err(err) = ensure_validators_ready_with_ports(&validator_ports).await { + let node_ports = host_ports.node_api_ports(); + info!(ports = ?node_ports, "waiting for node HTTP endpoints"); + if let Err(err) = ensure_nodes_ready_with_ports(&node_ports).await { return fail_readiness_step( environment, - "validator readiness failed", - "validator readiness failed", - err, - ) - .await; - } - - let executor_ports = host_ports.executor_api_ports(); - info!(ports = ?executor_ports, "waiting for executor HTTP endpoints"); - if let Err(err) = ensure_executors_ready_with_ports(&executor_ports).await { - return fail_readiness_step( - environment, - "executor readiness failed", - "executor readiness failed", + "node readiness failed", + "node readiness failed", err, ) .await; diff --git a/testing-framework/deployers/compose/src/deployer/setup.rs b/testing-framework/deployers/compose/src/deployer/setup.rs index 3cccee7..ac0e664 100644 --- a/testing-framework/deployers/compose/src/deployer/setup.rs +++ b/testing-framework/deployers/compose/src/deployer/setup.rs @@ -32,8 +32,7 @@ impl DeploymentSetup { ensure_supported_topology(&self.descriptors)?; info!( - validators = self.descriptors.validators().len(), - executors = self.descriptors.executors().len(), + nodes = self.descriptors.nodes().len(), "starting compose deployment" ); diff --git a/testing-framework/deployers/compose/src/descriptor/mod.rs b/testing-framework/deployers/compose/src/descriptor/mod.rs index a7c6f39..28c098c 100644 --- a/testing-framework/deployers/compose/src/descriptor/mod.rs +++ b/testing-framework/deployers/compose/src/descriptor/mod.rs @@ -20,8 +20,7 @@ use testing_framework_config::constants::DEFAULT_CFGSYNC_PORT; /// Top-level docker-compose descriptor built from a GeneratedTopology. #[derive(Clone, Debug, Serialize)] pub struct ComposeDescriptor { - validators: Vec, - executors: Vec, + nodes: Vec, } impl ComposeDescriptor { @@ -32,13 +31,8 @@ impl ComposeDescriptor { } #[cfg(test)] - pub fn validators(&self) -> &[NodeDescriptor] { - &self.validators - } - - #[cfg(test)] - pub fn executors(&self) -> &[NodeDescriptor] { - &self.executors + pub fn nodes(&self) -> &[NodeDescriptor] { + &self.nodes } } @@ -80,56 +74,20 @@ impl<'a> ComposeDescriptorBuilder<'a> { let (image, platform) = resolve_image(); - let validators = build_nodes( - self.topology.validators(), - ComposeNodeKind::Validator, + let nodes = build_nodes( + self.topology.nodes(), &image, platform.as_deref(), self.use_kzg_mount, cfgsync_port, ); - let executors = build_nodes( - self.topology.executors(), - ComposeNodeKind::Executor, - &image, - platform.as_deref(), - self.use_kzg_mount, - cfgsync_port, - ); - - ComposeDescriptor { - validators, - executors, - } - } -} - -#[derive(Clone, Copy)] -pub(crate) enum ComposeNodeKind { - Validator, - Executor, -} - -impl ComposeNodeKind { - fn instance_name(self, index: usize) -> String { - match self { - Self::Validator => format!("validator-{index}"), - Self::Executor => format!("executor-{index}"), - } - } - - const fn entrypoint(self) -> &'static str { - match self { - Self::Validator => "/etc/nomos/scripts/run_nomos_node.sh", - Self::Executor => "/etc/nomos/scripts/run_nomos_executor.sh", - } + ComposeDescriptor { nodes } } } fn build_nodes( nodes: &[GeneratedNodeConfig], - kind: ComposeNodeKind, image: &str, platform: Option<&str>, use_kzg_mount: bool, @@ -139,15 +97,7 @@ fn build_nodes( .iter() .enumerate() .map(|(index, node)| { - NodeDescriptor::from_node( - kind, - index, - node, - image, - platform, - use_kzg_mount, - cfgsync_port, - ) + NodeDescriptor::from_node(index, node, image, platform, use_kzg_mount, cfgsync_port) }) .collect() } diff --git a/testing-framework/deployers/compose/src/descriptor/node.rs b/testing-framework/deployers/compose/src/descriptor/node.rs index 930f6e5..2bb17d9 100644 --- a/testing-framework/deployers/compose/src/descriptor/node.rs +++ b/testing-framework/deployers/compose/src/descriptor/node.rs @@ -1,9 +1,9 @@ use serde::Serialize; use testing_framework_core::topology::generation::GeneratedNodeConfig; -use super::{ComposeNodeKind, base_environment, base_volumes, default_extra_hosts}; +use super::{base_environment, base_volumes, default_extra_hosts}; -/// Describes a validator or executor container in the compose stack. +/// Describes a node container in the compose stack. #[derive(Clone, Debug, Serialize)] pub struct NodeDescriptor { name: String, @@ -45,7 +45,6 @@ impl EnvEntry { impl NodeDescriptor { pub(crate) fn from_node( - kind: ComposeNodeKind, index: usize, node: &GeneratedNodeConfig, image: &str, @@ -53,8 +52,9 @@ impl NodeDescriptor { use_kzg_mount: bool, cfgsync_port: u16, ) -> Self { + const ENTRYPOINT: &str = "/etc/nomos/scripts/run_nomos_node.sh"; let mut environment = base_environment(cfgsync_port, use_kzg_mount); - let identifier = kind.instance_name(index); + let identifier = format!("node-{index}"); let api_port = node.general.api_config.address.port(); let testing_port = node.general.api_config.testing_http_address.port(); environment.extend([ @@ -78,9 +78,9 @@ impl NodeDescriptor { ]; Self { - name: kind.instance_name(index), + name: format!("node-{index}"), image: image.to_owned(), - entrypoint: kind.entrypoint().to_owned(), + entrypoint: ENTRYPOINT.to_owned(), volumes: base_volumes(use_kzg_mount), extra_hosts: default_extra_hosts(), ports, diff --git a/testing-framework/deployers/compose/src/docker/control.rs b/testing-framework/deployers/compose/src/docker/control.rs index 9191a38..4a27e02 100644 --- a/testing-framework/deployers/compose/src/docker/control.rs +++ b/testing-framework/deployers/compose/src/docker/control.rs @@ -45,23 +45,13 @@ pub struct ComposeNodeControl { #[async_trait::async_trait] impl NodeControlHandle for ComposeNodeControl { - async fn restart_validator(&self, index: usize) -> Result<(), DynError> { + async fn restart_node(&self, index: usize) -> Result<(), DynError> { restart_compose_service( &self.compose_file, &self.project_name, - &format!("validator-{index}"), + &format!("node-{index}"), ) .await - .map_err(|err| format!("validator restart failed: {err}").into()) - } - - async fn restart_executor(&self, index: usize) -> Result<(), DynError> { - restart_compose_service( - &self.compose_file, - &self.project_name, - &format!("executor-{index}"), - ) - .await - .map_err(|err| format!("executor restart failed: {err}").into()) + .map_err(|err| format!("node restart failed: {err}").into()) } } diff --git a/testing-framework/deployers/compose/src/errors.rs b/testing-framework/deployers/compose/src/errors.rs index b2f53f0..577b09c 100644 --- a/testing-framework/deployers/compose/src/errors.rs +++ b/testing-framework/deployers/compose/src/errors.rs @@ -1,10 +1,7 @@ use std::path::PathBuf; use testing_framework_core::{ - scenario::{ - MetricsError, - http_probe::{HttpReadinessError, NodeRole}, - }, + scenario::{MetricsError, http_probe::HttpReadinessError}, topology::readiness::ReadinessError, }; use url::ParseError; @@ -14,10 +11,8 @@ use crate::{docker::commands::ComposeCommandError, infrastructure::template::Tem #[derive(Debug, thiserror::Error)] /// Top-level compose runner errors. pub enum ComposeRunnerError { - #[error( - "compose runner requires at least one validator (validators={validators}, executors={executors})" - )] - MissingValidator { validators: usize, executors: usize }, + #[error("compose runner requires at least one node (nodes={nodes})")] + MissingNode { nodes: usize }, #[error("docker does not appear to be available on this host")] DockerUnavailable, #[error("failed to resolve host port for {service} container port {container_port}: {source}")] @@ -39,7 +34,7 @@ pub enum ComposeRunnerError { NodeClients(#[from] NodeClientError), #[error(transparent)] Telemetry(#[from] MetricsError), - #[error("block feed requires at least one validator client")] + #[error("block feed requires at least one node client")] BlockFeedMissing, #[error("failed to start block feed: {source}")] BlockFeed { @@ -105,9 +100,9 @@ pub enum ConfigError { pub enum StackReadinessError { #[error(transparent)] Http(#[from] HttpReadinessError), - #[error("failed to build readiness URL for {role} port {port}: {source}", role = role.label())] + #[error("failed to build readiness URL for {role} port {port}: {source}")] Endpoint { - role: NodeRole, + role: &'static str, port: u16, #[source] source: ParseError, @@ -122,12 +117,9 @@ pub enum StackReadinessError { #[derive(Debug, thiserror::Error)] /// Node client construction failures. pub enum NodeClientError { - #[error( - "failed to build {endpoint} client URL for {role} port {port}: {source}", - role = role.label() - )] + #[error("failed to build {endpoint} client URL for {role} port {port}: {source}")] Endpoint { - role: NodeRole, + role: &'static str, endpoint: &'static str, port: u16, #[source] diff --git a/testing-framework/deployers/compose/src/infrastructure/cfgsync.rs b/testing-framework/deployers/compose/src/infrastructure/cfgsync.rs index 590b80a..f8e71ae 100644 --- a/testing-framework/deployers/compose/src/infrastructure/cfgsync.rs +++ b/testing-framework/deployers/compose/src/infrastructure/cfgsync.rs @@ -70,8 +70,7 @@ pub fn update_cfgsync_config( path = %path.display(), use_kzg_mount, port, - validators = topology.validators().len(), - executors = topology.executors().len(), + nodes = topology.nodes().len(), "updating cfgsync template" ); let mut cfg = load_cfgsync_template(path)?; diff --git a/testing-framework/deployers/compose/src/infrastructure/environment.rs b/testing-framework/deployers/compose/src/infrastructure/environment.rs index a85c7ee..c24e33c 100644 --- a/testing-framework/deployers/compose/src/infrastructure/environment.rs +++ b/testing-framework/deployers/compose/src/infrastructure/environment.rs @@ -133,16 +133,13 @@ impl StackEnvironment { } } -/// Verifies the topology has at least one validator so compose can start. +/// Verifies the topology has at least one node so compose can start. pub fn ensure_supported_topology( descriptors: &GeneratedTopology, ) -> Result<(), ComposeRunnerError> { - let validators = descriptors.validators().len(); - if validators == 0 { - return Err(ComposeRunnerError::MissingValidator { - validators, - executors: descriptors.executors().len(), - }); + let nodes = descriptors.nodes().len(); + if nodes == 0 { + return Err(ComposeRunnerError::MissingNode { nodes }); } Ok(()) } diff --git a/testing-framework/deployers/compose/src/infrastructure/ports.rs b/testing-framework/deployers/compose/src/infrastructure/ports.rs index 5cafbe1..f777e29 100644 --- a/testing-framework/deployers/compose/src/infrastructure/ports.rs +++ b/testing-framework/deployers/compose/src/infrastructure/ports.rs @@ -2,11 +2,7 @@ use std::time::Duration; use anyhow::{Context as _, anyhow}; use reqwest::Url; -use testing_framework_core::{ - adjust_timeout, - scenario::http_probe::NodeRole as HttpNodeRole, - topology::generation::{GeneratedTopology, NodeRole as TopologyNodeRole}, -}; +use testing_framework_core::{adjust_timeout, topology::generation::GeneratedTopology}; use tokio::{process::Command, time::timeout}; use tracing::{debug, info}; use url::ParseError; @@ -25,22 +21,16 @@ pub struct NodeHostPorts { pub testing: u16, } -/// All host port mappings for validators and executors. +/// All host port mappings for nodes. #[derive(Clone, Debug)] pub struct HostPortMapping { - pub validators: Vec, - pub executors: Vec, + pub nodes: Vec, } impl HostPortMapping { - /// Returns API ports for all validators. - pub fn validator_api_ports(&self) -> Vec { - self.validators.iter().map(|ports| ports.api).collect() - } - - /// Returns API ports for all executors. - pub fn executor_api_ports(&self) -> Vec { - self.executors.iter().map(|ports| ports.api).collect() + /// Returns API ports for all nodes. + pub fn node_api_ports(&self) -> Vec { + self.nodes.iter().map(|ports| ports.api).collect() } } @@ -52,34 +42,21 @@ pub async fn discover_host_ports( debug!( compose_file = %environment.compose_path().display(), project = environment.project_name(), - validators = descriptors.validators().len(), - executors = descriptors.executors().len(), + nodes = descriptors.nodes().len(), "resolving compose host ports" ); - let mut validators = Vec::new(); - for node in descriptors.validators() { - let service = node_identifier(TopologyNodeRole::Validator, node.index()); + let mut nodes = Vec::new(); + for node in descriptors.nodes() { + let service = node_identifier(node.index()); let api = resolve_service_port(environment, &service, node.api_port()).await?; let testing = resolve_service_port(environment, &service, node.testing_http_port()).await?; - validators.push(NodeHostPorts { api, testing }); + nodes.push(NodeHostPorts { api, testing }); } - let mut executors = Vec::new(); - for node in descriptors.executors() { - let service = node_identifier(TopologyNodeRole::Executor, node.index()); - let api = resolve_service_port(environment, &service, node.api_port()).await?; - let testing = resolve_service_port(environment, &service, node.testing_http_port()).await?; - executors.push(NodeHostPorts { api, testing }); - } - - let mapping = HostPortMapping { - validators, - executors, - }; + let mapping = HostPortMapping { nodes }; info!( - validator_ports = ?mapping.validators, - executor_ports = ?mapping.executors, + node_ports = ?mapping.nodes, "compose host ports resolved" ); @@ -149,36 +126,32 @@ pub async fn ensure_remote_readiness_with_ports( descriptors: &GeneratedTopology, mapping: &HostPortMapping, ) -> Result<(), StackReadinessError> { - let validator_urls = mapping - .validators + let node_urls = mapping + .nodes .iter() - .map(|ports| readiness_url(HttpNodeRole::Validator, ports.api)) - .collect::, _>>()?; - let executor_urls = mapping - .executors - .iter() - .map(|ports| readiness_url(HttpNodeRole::Executor, ports.api)) + .map(|ports| readiness_url(ports.api)) .collect::, _>>()?; descriptors - .wait_remote_readiness(&validator_urls, &executor_urls, None, None) + .wait_remote_readiness(&node_urls, None) .await .map_err(|source| StackReadinessError::Remote { source }) } -fn readiness_url(role: HttpNodeRole, port: u16) -> Result { - localhost_url(port).map_err(|source| StackReadinessError::Endpoint { role, port, source }) +fn readiness_url(port: u16) -> Result { + localhost_url(port).map_err(|source| StackReadinessError::Endpoint { + role: "node", + port, + source, + }) } fn localhost_url(port: u16) -> Result { Url::parse(&format!("http://{}:{port}/", compose_runner_host())) } -fn node_identifier(role: TopologyNodeRole, index: usize) -> String { - match role { - TopologyNodeRole::Validator => format!("validator-{index}"), - TopologyNodeRole::Executor => format!("executor-{index}"), - } +fn node_identifier(index: usize) -> String { + format!("node-{index}") } pub(crate) fn compose_runner_host() -> String { diff --git a/testing-framework/deployers/compose/src/lifecycle/block_feed.rs b/testing-framework/deployers/compose/src/lifecycle/block_feed.rs index 8f69ab0..ec18b06 100644 --- a/testing-framework/deployers/compose/src/lifecycle/block_feed.rs +++ b/testing-framework/deployers/compose/src/lifecycle/block_feed.rs @@ -13,13 +13,12 @@ async fn spawn_block_feed_with( node_clients: &NodeClients, ) -> Result<(BlockFeed, BlockFeedTask), ComposeRunnerError> { debug!( - validators = node_clients.validator_clients().len(), - executors = node_clients.executor_clients().len(), - "selecting validator client for block feed" + nodes = node_clients.node_clients().len(), + "selecting node client for block feed" ); let block_source_client = node_clients - .random_validator() + .random_node() .ok_or(ComposeRunnerError::BlockFeedMissing)?; spawn_block_feed(block_source_client) diff --git a/testing-framework/deployers/compose/src/lifecycle/readiness.rs b/testing-framework/deployers/compose/src/lifecycle/readiness.rs index 7c7082c..31c4ead 100644 --- a/testing-framework/deployers/compose/src/lifecycle/readiness.rs +++ b/testing-framework/deployers/compose/src/lifecycle/readiness.rs @@ -2,36 +2,25 @@ use std::time::Duration; use reqwest::Url; use testing_framework_core::{ - nodes::ApiClient, - scenario::{NodeClients, http_probe::NodeRole as HttpNodeRole}, - topology::generation::{GeneratedTopology, NodeRole as TopologyNodeRole}, + nodes::ApiClient, scenario::NodeClients, topology::generation::GeneratedTopology, }; use tokio::time::sleep; use crate::{ errors::{NodeClientError, StackReadinessError}, infrastructure::ports::{HostPortMapping, NodeHostPorts}, - lifecycle::wait::{wait_for_executors, wait_for_validators}, + lifecycle::wait::wait_for_nodes, }; const DISABLED_READINESS_SLEEP: Duration = Duration::from_secs(5); -/// Wait until all validators respond on their API ports. -pub async fn ensure_validators_ready_with_ports(ports: &[u16]) -> Result<(), StackReadinessError> { +/// Wait until all nodes respond on their API ports. +pub async fn ensure_nodes_ready_with_ports(ports: &[u16]) -> Result<(), StackReadinessError> { if ports.is_empty() { return Ok(()); } - wait_for_validators(ports).await.map_err(Into::into) -} - -/// Wait until all executors respond on their API ports. -pub async fn ensure_executors_ready_with_ports(ports: &[u16]) -> Result<(), StackReadinessError> { - if ports.is_empty() { - return Ok(()); - } - - wait_for_executors(ports).await.map_err(Into::into) + wait_for_nodes(ports).await.map_err(Into::into) } /// Allow a brief pause when readiness probes are disabled. @@ -47,29 +36,22 @@ pub fn build_node_clients_with_ports( mapping: &HostPortMapping, host: &str, ) -> Result { - let validators = descriptors - .validators() + let nodes = descriptors + .nodes() .iter() - .zip(mapping.validators.iter()) - .map(|(node, ports)| api_client_from_host_ports(to_http_role(node.role()), ports, host)) - .collect::, _>>()?; - let executors = descriptors - .executors() - .iter() - .zip(mapping.executors.iter()) - .map(|(node, ports)| api_client_from_host_ports(to_http_role(node.role()), ports, host)) + .zip(mapping.nodes.iter()) + .map(|(_, ports)| api_client_from_host_ports(ports, host)) .collect::, _>>()?; - Ok(NodeClients::new(validators, executors)) + Ok(NodeClients::new(nodes)) } fn api_client_from_host_ports( - role: HttpNodeRole, ports: &NodeHostPorts, host: &str, ) -> Result { let base_url = localhost_url(ports.api, host).map_err(|source| NodeClientError::Endpoint { - role, + role: "node", endpoint: "api", port: ports.api, source, @@ -78,7 +60,7 @@ fn api_client_from_host_ports( let testing_url = Some( localhost_url(ports.testing, host).map_err(|source| NodeClientError::Endpoint { - role, + role: "node", endpoint: "testing", port: ports.testing, source, @@ -88,13 +70,6 @@ fn api_client_from_host_ports( Ok(ApiClient::from_urls(base_url, testing_url)) } -fn to_http_role(role: TopologyNodeRole) -> testing_framework_core::scenario::http_probe::NodeRole { - match role { - TopologyNodeRole::Validator => HttpNodeRole::Validator, - TopologyNodeRole::Executor => HttpNodeRole::Executor, - } -} - fn localhost_url(port: u16, host: &str) -> Result { Url::parse(&format!("http://{host}:{port}/")) } diff --git a/testing-framework/deployers/compose/src/lifecycle/wait.rs b/testing-framework/deployers/compose/src/lifecycle/wait.rs index 0d06ab0..1ee133b 100644 --- a/testing-framework/deployers/compose/src/lifecycle/wait.rs +++ b/testing-framework/deployers/compose/src/lifecycle/wait.rs @@ -2,7 +2,7 @@ use std::{env, time::Duration}; use testing_framework_core::{ adjust_timeout, - scenario::http_probe::{self, HttpReadinessError, NodeRole}, + scenario::http_probe::{self, HttpReadinessError}, }; use tracing::{debug, info}; @@ -12,23 +12,15 @@ const POLL_INTERVAL_MILLIS: u64 = 250; const DEFAULT_WAIT: Duration = Duration::from_secs(DEFAULT_WAIT_TIMEOUT_SECS); const POLL_INTERVAL: Duration = Duration::from_millis(POLL_INTERVAL_MILLIS); -pub async fn wait_for_validators(ports: &[u16]) -> Result<(), HttpReadinessError> { - wait_for_ports(ports, NodeRole::Validator).await -} - -pub async fn wait_for_executors(ports: &[u16]) -> Result<(), HttpReadinessError> { - wait_for_ports(ports, NodeRole::Executor).await -} - -async fn wait_for_ports(ports: &[u16], role: NodeRole) -> Result<(), HttpReadinessError> { +pub async fn wait_for_nodes(ports: &[u16]) -> Result<(), HttpReadinessError> { let host = compose_runner_host(); let timeout = compose_http_timeout(); - info!(role = ?role, ports = ?ports, host, "waiting for compose HTTP readiness"); + info!(role = "node", ports = ?ports, host, "waiting for compose HTTP readiness"); http_probe::wait_for_http_ports_with_host( ports, - role, + "node", &host, adjust_timeout(timeout), POLL_INTERVAL, diff --git a/testing-framework/deployers/k8s/helm/nomos-runner/templates/_helpers.tpl b/testing-framework/deployers/k8s/helm/nomos-runner/templates/_helpers.tpl index cd8406f..92c9987 100644 --- a/testing-framework/deployers/k8s/helm/nomos-runner/templates/_helpers.tpl +++ b/testing-framework/deployers/k8s/helm/nomos-runner/templates/_helpers.tpl @@ -20,20 +20,11 @@ app.kubernetes.io/name: {{ include "nomos-runner.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} -{{- define "nomos-runner.validatorLabels" -}} +{{- define "nomos-runner.nodeLabels" -}} {{- $root := index . "root" -}} {{- $index := index . "index" -}} app.kubernetes.io/name: {{ include "nomos-runner.chart" $root }} app.kubernetes.io/instance: {{ $root.Release.Name }} -nomos/logical-role: validator -nomos/validator-index: "{{ $index }}" -{{- end -}} - -{{- define "nomos-runner.executorLabels" -}} -{{- $root := index . "root" -}} -{{- $index := index . "index" -}} -app.kubernetes.io/name: {{ include "nomos-runner.chart" $root }} -app.kubernetes.io/instance: {{ $root.Release.Name }} -nomos/logical-role: executor -nomos/executor-index: "{{ $index }}" +nomos/logical-role: node +nomos/node-index: "{{ $index }}" {{- end -}} diff --git a/testing-framework/deployers/k8s/helm/nomos-runner/templates/configmap.yaml b/testing-framework/deployers/k8s/helm/nomos-runner/templates/configmap.yaml index afa6fef..ef8babd 100644 --- a/testing-framework/deployers/k8s/helm/nomos-runner/templates/configmap.yaml +++ b/testing-framework/deployers/k8s/helm/nomos-runner/templates/configmap.yaml @@ -28,10 +28,4 @@ data: {{ .Values.scripts.runNomosNodeSh | indent 4 }} {{- else }} {{ "" | indent 4 }} -{{- end }} - run_nomos_executor.sh: | -{{- if .Values.scripts.runNomosExecutorSh }} -{{ .Values.scripts.runNomosExecutorSh | indent 4 }} -{{- else }} -{{ "" | indent 4 }} {{- end }} diff --git a/testing-framework/deployers/k8s/helm/nomos-runner/templates/executor-deployments.yaml b/testing-framework/deployers/k8s/helm/nomos-runner/templates/executor-deployments.yaml deleted file mode 100644 index 0c10a5b..0000000 --- a/testing-framework/deployers/k8s/helm/nomos-runner/templates/executor-deployments.yaml +++ /dev/null @@ -1,73 +0,0 @@ -{{- $root := . -}} -{{- $nodes := default (list) .Values.executors.nodes }} -{{- range $i, $node := $nodes }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "nomos-runner.fullname" $root }}-executor-{{ $i }} - labels: - {{- include "nomos-runner.executorLabels" (dict "root" $root "index" $i) | nindent 4 }} -spec: - replicas: 1 - selector: - matchLabels: - {{- include "nomos-runner.executorLabels" (dict "root" $root "index" $i) | nindent 6 }} - template: - metadata: - labels: - {{- include "nomos-runner.executorLabels" (dict "root" $root "index" $i) | nindent 8 }} - spec: - containers: - - name: executor - image: {{ $root.Values.image }} - imagePullPolicy: {{ $root.Values.imagePullPolicy }} - command: ["/etc/nomos/scripts/run_nomos_executor.sh"] - ports: - - name: http - containerPort: {{ default 18080 $node.apiPort }} - - name: testing-http - containerPort: {{ default 18081 $node.testingHttpPort }} - env: - - name: CFG_SERVER_ADDR - value: http://{{ include "nomos-runner.fullname" $root }}-cfgsync:{{ $root.Values.cfgsync.port }} - - name: NOMOS_TIME_BACKEND - value: {{ $root.Values.timeBackend | default "monotonic" | quote }} - - name: LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH - value: '{{ if eq $root.Values.kzg.mode "inImage" }}{{ $root.Values.kzg.inImageParamsPath }}{{ else }}{{ $root.Values.kzg.hostPathParamsPath }}{{ end }}' - {{- range $key, $value := $node.env }} - - name: {{ $key }} - value: "{{ $value }}" - {{- end }} - volumeMounts: - - name: assets - mountPath: /etc/nomos - readOnly: true - {{- if eq $root.Values.kzg.mode "hostPath" }} - - name: kzg-params - mountPath: /kzgrs_test_params - readOnly: true - {{- end }} - volumes: - - name: assets - configMap: - name: {{ include "nomos-runner.fullname" $root }}-assets - defaultMode: 0755 - items: - - key: cfgsync.yaml - path: cfgsync.yaml - - key: run_cfgsync.sh - path: scripts/run_cfgsync.sh - - key: run_nomos.sh - path: scripts/run_nomos.sh - - key: run_nomos_executor.sh - path: scripts/run_nomos_executor.sh - - key: run_nomos_node.sh - path: scripts/run_nomos_node.sh - {{- if eq $root.Values.kzg.mode "hostPath" }} - - name: kzg-params - persistentVolumeClaim: - claimName: {{ include "nomos-runner.fullname" $root }}-kzg - readOnly: true - {{- end }} -{{- end }} diff --git a/testing-framework/deployers/k8s/helm/nomos-runner/templates/validator-deployments.yaml b/testing-framework/deployers/k8s/helm/nomos-runner/templates/node-deployments.yaml similarity index 83% rename from testing-framework/deployers/k8s/helm/nomos-runner/templates/validator-deployments.yaml rename to testing-framework/deployers/k8s/helm/nomos-runner/templates/node-deployments.yaml index d0a6fc9..c5bf45d 100644 --- a/testing-framework/deployers/k8s/helm/nomos-runner/templates/validator-deployments.yaml +++ b/testing-framework/deployers/k8s/helm/nomos-runner/templates/node-deployments.yaml @@ -1,25 +1,25 @@ {{- $root := . -}} -{{- $nodes := default (list) .Values.validators.nodes }} +{{- $nodes := default (list) .Values.nodes.nodes }} {{- range $i, $node := $nodes }} --- apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "nomos-runner.fullname" $root }}-validator-{{ $i }} + name: {{ include "nomos-runner.fullname" $root }}-node-{{ $i }} labels: - {{- include "nomos-runner.validatorLabels" (dict "root" $root "index" $i) | nindent 4 }} + {{- include "nomos-runner.nodeLabels" (dict "root" $root "index" $i) | nindent 4 }} spec: replicas: 1 selector: matchLabels: - {{- include "nomos-runner.validatorLabels" (dict "root" $root "index" $i) | nindent 6 }} + {{- include "nomos-runner.nodeLabels" (dict "root" $root "index" $i) | nindent 6 }} template: metadata: labels: - {{- include "nomos-runner.validatorLabels" (dict "root" $root "index" $i) | nindent 8 }} + {{- include "nomos-runner.nodeLabels" (dict "root" $root "index" $i) | nindent 8 }} spec: containers: - - name: validator + - name: node image: {{ $root.Values.image }} imagePullPolicy: {{ $root.Values.imagePullPolicy }} command: ["/etc/nomos/scripts/run_nomos_node.sh"] diff --git a/testing-framework/deployers/k8s/helm/nomos-runner/templates/executor-services.yaml b/testing-framework/deployers/k8s/helm/nomos-runner/templates/node-services.yaml similarity index 53% rename from testing-framework/deployers/k8s/helm/nomos-runner/templates/executor-services.yaml rename to testing-framework/deployers/k8s/helm/nomos-runner/templates/node-services.yaml index 279a976..62a0f30 100644 --- a/testing-framework/deployers/k8s/helm/nomos-runner/templates/executor-services.yaml +++ b/testing-framework/deployers/k8s/helm/nomos-runner/templates/node-services.yaml @@ -1,17 +1,17 @@ {{- $root := . -}} -{{- $nodes := default (list) .Values.executors.nodes }} +{{- $nodes := default (list) .Values.nodes.nodes }} {{- range $i, $node := $nodes }} --- apiVersion: v1 kind: Service metadata: - name: {{ include "nomos-runner.fullname" $root }}-executor-{{ $i }} + name: {{ include "nomos-runner.fullname" $root }}-node-{{ $i }} labels: - {{- include "nomos-runner.executorLabels" (dict "root" $root "index" $i) | nindent 4 }} + {{- include "nomos-runner.nodeLabels" (dict "root" $root "index" $i) | nindent 4 }} spec: type: NodePort selector: - {{- include "nomos-runner.executorLabels" (dict "root" $root "index" $i) | nindent 4 }} + {{- include "nomos-runner.nodeLabels" (dict "root" $root "index" $i) | nindent 4 }} ports: - name: http port: {{ default 18080 $node.apiPort }} diff --git a/testing-framework/deployers/k8s/helm/nomos-runner/templates/validator-services.yaml b/testing-framework/deployers/k8s/helm/nomos-runner/templates/validator-services.yaml deleted file mode 100644 index ff94e2e..0000000 --- a/testing-framework/deployers/k8s/helm/nomos-runner/templates/validator-services.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- $root := . -}} -{{- $nodes := default (list) .Values.validators.nodes }} -{{- range $i, $node := $nodes }} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ include "nomos-runner.fullname" $root }}-validator-{{ $i }} - labels: - {{- include "nomos-runner.validatorLabels" (dict "root" $root "index" $i) | nindent 4 }} -spec: - type: NodePort - selector: - {{- include "nomos-runner.validatorLabels" (dict "root" $root "index" $i) | nindent 4 }} - ports: - - name: http - port: {{ default 18080 $node.apiPort }} - targetPort: http - - name: testing-http - port: {{ default 18081 $node.testingHttpPort }} - targetPort: testing-http -{{- end }} diff --git a/testing-framework/deployers/k8s/helm/nomos-runner/values.yaml b/testing-framework/deployers/k8s/helm/nomos-runner/values.yaml index 5671f0d..56620b9 100644 --- a/testing-framework/deployers/k8s/helm/nomos-runner/values.yaml +++ b/testing-framework/deployers/k8s/helm/nomos-runner/values.yaml @@ -13,13 +13,8 @@ scripts: runCfgsyncSh: "" runNomosSh: "" runNomosNodeSh: "" - runNomosExecutorSh: "" -validators: - count: 1 - nodes: [] - -executors: +nodes: count: 1 nodes: [] diff --git a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs index 1dca17f..6412291 100644 --- a/testing-framework/deployers/k8s/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/k8s/src/deployer/orchestrator.rs @@ -56,10 +56,8 @@ impl K8sDeployer { #[derive(Debug, thiserror::Error)] /// High-level runner failures returned to the scenario harness. pub enum K8sRunnerError { - #[error( - "kubernetes runner requires at least one validator and one executor (validators={validators}, executors={executors})" - )] - UnsupportedTopology { validators: usize, executors: usize }, + #[error("kubernetes runner requires at least one node (nodes={nodes})")] + UnsupportedTopology { nodes: usize }, #[error("failed to initialise kubernetes client: {source}")] ClientInit { #[source] @@ -124,13 +122,9 @@ impl From for K8sRunnerError { } fn ensure_supported_topology(descriptors: &GeneratedTopology) -> Result<(), K8sRunnerError> { - let validators = descriptors.validators().len(); - let executors = descriptors.executors().len(); - if validators == 0 || executors == 0 { - return Err(K8sRunnerError::UnsupportedTopology { - validators, - executors, - }); + let nodes = descriptors.nodes().len(); + if nodes == 0 { + return Err(K8sRunnerError::UnsupportedTopology { nodes }); } Ok(()) } @@ -143,15 +137,13 @@ async fn deploy_with_observability( let observability = resolve_observability_inputs(observability)?; let descriptors = scenario.topology().clone(); - let validator_count = descriptors.validators().len(); - let executor_count = descriptors.executors().len(); + let node_count = descriptors.nodes().len(); ensure_supported_topology(&descriptors)?; let client = init_kube_client().await?; info!( - validators = validator_count, - executors = executor_count, + nodes = node_count, duration_secs = scenario.duration().as_secs(), readiness_checks = deployer.readiness_checks, metrics_query_url = observability.metrics_query_url.as_ref().map(|u| u.as_str()), @@ -203,8 +195,7 @@ async fn deploy_with_observability( telemetry, block_feed, block_feed_guard, - validator_count, - executor_count, + node_count, ) } @@ -216,14 +207,13 @@ async fn setup_cluster( observability: &ObservabilityInputs, ) -> Result { let assets = prepare_assets(descriptors, observability.metrics_otlp_ingest_url.as_ref())?; - let validators = descriptors.validators().len(); - let executors = descriptors.executors().len(); + let nodes = descriptors.nodes().len(); let (namespace, release) = cluster_identifiers(); - info!(%namespace, %release, validators, executors, "preparing k8s assets and namespace"); + info!(%namespace, %release, nodes, "preparing k8s assets and namespace"); let mut cleanup_guard = - Some(install_stack(client, &assets, &namespace, &release, validators, executors).await?); + Some(install_stack(client, &assets, &namespace, &release, nodes).await?); info!("waiting for helm-managed services to become ready"); let cluster_ready = @@ -338,19 +328,9 @@ fn maybe_print_endpoints( .unwrap_or_else(|| "".to_string()) ); - let validator_clients = node_clients.validator_clients(); - for (idx, client) in validator_clients.iter().enumerate() { + for (idx, client) in node_clients.node_clients().iter().enumerate() { println!( - "TESTNET_PPROF validator_{}={}/debug/pprof/profile?seconds=15&format=proto", - idx, - client.base_url() - ); - } - - let executor_clients = node_clients.executor_clients(); - for (idx, client) in executor_clients.iter().enumerate() { - println!( - "TESTNET_PPROF executor_{}={}/debug/pprof/profile?seconds=15&format=proto", + "TESTNET_PPROF node_{}={}/debug/pprof/profile?seconds=15&format=proto", idx, client.base_url() ); @@ -366,8 +346,7 @@ fn finalize_runner( telemetry: testing_framework_core::scenario::Metrics, block_feed: testing_framework_core::scenario::BlockFeed, block_feed_guard: BlockFeedTask, - validator_count: usize, - executor_count: usize, + node_count: usize, ) -> Result { let environment = cluster .take() @@ -393,8 +372,7 @@ fn finalize_runner( ); info!( - validators = validator_count, - executors = executor_count, + nodes = node_count, duration_secs = duration.as_secs(), "k8s deployment ready; handing control to scenario runner" ); diff --git a/testing-framework/deployers/k8s/src/infrastructure/assets.rs b/testing-framework/deployers/k8s/src/infrastructure/assets.rs index 909ec9e..c8fac1f 100644 --- a/testing-framework/deployers/k8s/src/infrastructure/assets.rs +++ b/testing-framework/deployers/k8s/src/infrastructure/assets.rs @@ -31,7 +31,6 @@ pub struct RunnerAssets { pub run_cfgsync_script: PathBuf, pub run_nomos_script: PathBuf, pub run_nomos_node_script: PathBuf, - pub run_nomos_executor_script: PathBuf, pub values_file: PathBuf, _tempdir: TempDir, } @@ -84,8 +83,7 @@ pub fn prepare_assets( metrics_otlp_ingest_url: Option<&Url>, ) -> Result { info!( - validators = topology.validators().len(), - executors = topology.executors().len(), + nodes = topology.nodes().len(), "preparing k8s runner assets" ); @@ -130,7 +128,6 @@ pub fn prepare_assets( run_nomos_script: scripts.run_shared, run_cfgsync_script: scripts.run_cfgsync, run_nomos_node_script: scripts.run_node, - run_nomos_executor_script: scripts.run_executor, values_file, _tempdir: tempdir, }) @@ -207,7 +204,6 @@ struct ScriptPaths { run_cfgsync: PathBuf, run_shared: PathBuf, run_node: PathBuf, - run_executor: PathBuf, } fn validate_scripts(root: &Path) -> Result { @@ -215,9 +211,8 @@ fn validate_scripts(root: &Path) -> Result { let run_cfgsync = scripts_dir.join("run_cfgsync.sh"); let run_shared = scripts_dir.join("run_nomos.sh"); let run_node = scripts_dir.join("run_nomos_node.sh"); - let run_executor = scripts_dir.join("run_nomos_executor.sh"); - for path in [&run_cfgsync, &run_shared, &run_node, &run_executor] { + for path in [&run_cfgsync, &run_shared, &run_node] { if !path.exists() { return Err(AssetsError::MissingScript { path: path.clone() }); } @@ -227,7 +222,6 @@ fn validate_scripts(root: &Path) -> Result { run_cfgsync = %run_cfgsync.display(), run_shared = %run_shared.display(), run_node = %run_node.display(), - run_executor = %run_executor.display(), "validated runner scripts exist" ); @@ -235,7 +229,6 @@ fn validate_scripts(root: &Path) -> Result { run_cfgsync, run_shared, run_node, - run_executor, }) } @@ -316,8 +309,7 @@ struct HelmValues { #[serde(rename = "imagePullPolicy")] image_pull_policy: String, cfgsync: CfgsyncValues, - validators: NodeGroup, - executors: NodeGroup, + nodes: NodeGroup, } #[derive(Serialize)] @@ -348,26 +340,23 @@ fn build_values(topology: &GeneratedTopology) -> HelmValues { let image_pull_policy = tf_env::nomos_testnet_image_pull_policy().unwrap_or_else(|| "IfNotPresent".into()); debug!(pol_mode, "rendering Helm values for k8s stack"); - let validators = build_node_group("validator", topology.validators(), &pol_mode); - let executors = build_node_group("executor", topology.executors(), &pol_mode); + let nodes = build_node_group(topology.nodes(), &pol_mode); HelmValues { image_pull_policy, cfgsync, - validators, - executors, + nodes, } } fn build_node_group( - kind: &'static str, nodes: &[testing_framework_core::topology::generation::GeneratedNodeConfig], pol_mode: &str, ) -> NodeGroup { let node_values = nodes .iter() .enumerate() - .map(|(index, node)| build_node_values(kind, index, node, pol_mode)) + .map(|(index, node)| build_node_values(index, node, pol_mode)) .collect(); NodeGroup { @@ -377,7 +366,6 @@ fn build_node_group( } fn build_node_values( - kind: &'static str, index: usize, node: &testing_framework_core::topology::generation::GeneratedNodeConfig, pol_mode: &str, @@ -399,8 +387,7 @@ fn build_node_values( .port() .to_string(), ); - env.insert("CFG_HOST_KIND".into(), kind.to_string()); - env.insert("CFG_HOST_IDENTIFIER".into(), format!("{kind}-{index}")); + env.insert("CFG_HOST_IDENTIFIER".into(), format!("node-{index}")); NodeValues { api_port: node.general.api_config.address.port(), diff --git a/testing-framework/deployers/k8s/src/infrastructure/cluster.rs b/testing-framework/deployers/k8s/src/infrastructure/cluster.rs index 96d2809..6ffdf7b 100644 --- a/testing-framework/deployers/k8s/src/infrastructure/cluster.rs +++ b/testing-framework/deployers/k8s/src/infrastructure/cluster.rs @@ -4,7 +4,7 @@ use kube::Client; use reqwest::Url; use testing_framework_core::{ nodes::ApiClient, - scenario::{CleanupGuard, NodeClients, http_probe::NodeRole}, + scenario::{CleanupGuard, NodeClients}, topology::{generation::GeneratedTopology, readiness::ReadinessError}, }; use tracing::{debug, info}; @@ -21,8 +21,7 @@ use crate::{ #[derive(Default)] pub struct PortSpecs { - pub validators: Vec, - pub executors: Vec, + pub nodes: Vec, } /// Holds k8s namespace, Helm release, port forwards, and cleanup guard. @@ -31,12 +30,9 @@ pub struct ClusterEnvironment { namespace: String, release: String, cleanup: Option, - validator_host: String, - executor_host: String, - validator_api_ports: Vec, - validator_testing_ports: Vec, - executor_api_ports: Vec, - executor_testing_ports: Vec, + node_host: String, + node_api_ports: Vec, + node_testing_ports: Vec, port_forwards: Vec, } @@ -55,22 +51,17 @@ impl ClusterEnvironment { ports: &ClusterPorts, port_forwards: Vec, ) -> Self { - let validator_api_ports = ports.validators.iter().map(|ports| ports.api).collect(); - let validator_testing_ports = ports.validators.iter().map(|ports| ports.testing).collect(); - let executor_api_ports = ports.executors.iter().map(|ports| ports.api).collect(); - let executor_testing_ports = ports.executors.iter().map(|ports| ports.testing).collect(); + let node_api_ports = ports.nodes.iter().map(|ports| ports.api).collect(); + let node_testing_ports = ports.nodes.iter().map(|ports| ports.testing).collect(); Self { client, namespace, release, cleanup: Some(cleanup), - validator_host: ports.validator_host.clone(), - executor_host: ports.executor_host.clone(), - validator_api_ports, - validator_testing_ports, - executor_api_ports, - executor_testing_ports, + node_host: ports.node_host.clone(), + node_api_ports, + node_testing_ports, port_forwards, } } @@ -108,24 +99,17 @@ impl ClusterEnvironment { &self.release } - pub fn validator_ports(&self) -> (&[u16], &[u16]) { - (&self.validator_api_ports, &self.validator_testing_ports) - } - - pub fn executor_ports(&self) -> (&[u16], &[u16]) { - (&self.executor_api_ports, &self.executor_testing_ports) + pub fn node_ports(&self) -> (&[u16], &[u16]) { + (&self.node_api_ports, &self.node_testing_ports) } } #[derive(Debug, thiserror::Error)] /// Failures while building node clients against forwarded ports. pub enum NodeClientError { - #[error( - "failed to build {endpoint} client URL for {role} port {port}: {source}", - role = role.label() - )] + #[error("failed to build {endpoint} client URL for {role} port {port}: {source}")] Endpoint { - role: NodeRole, + role: &'static str, endpoint: &'static str, port: u16, #[source] @@ -136,12 +120,9 @@ pub enum NodeClientError { #[derive(Debug, thiserror::Error)] /// Readiness check failures for the remote cluster endpoints. pub enum RemoteReadinessError { - #[error( - "failed to build readiness URL for {role} port {port}: {source}", - role = role.label() - )] + #[error("failed to build readiness URL for {role} port {port}: {source}")] Endpoint { - role: NodeRole, + role: &'static str, port: u16, #[source] source: ParseError, @@ -154,16 +135,8 @@ pub enum RemoteReadinessError { } pub fn collect_port_specs(descriptors: &GeneratedTopology) -> PortSpecs { - let validators = descriptors - .validators() - .iter() - .map(|node| NodeConfigPorts { - api: node.general.api_config.address.port(), - testing: node.general.api_config.testing_http_address.port(), - }) - .collect(); - let executors = descriptors - .executors() + let nodes = descriptors + .nodes() .iter() .map(|node| NodeConfigPorts { api: node.general.api_config.address.port(), @@ -171,57 +144,27 @@ pub fn collect_port_specs(descriptors: &GeneratedTopology) -> PortSpecs { }) .collect(); - let specs = PortSpecs { - validators, - executors, - }; + let specs = PortSpecs { nodes }; - debug!( - validators = specs.validators.len(), - executors = specs.executors.len(), - "collected k8s port specs" - ); + debug!(nodes = specs.nodes.len(), "collected k8s port specs"); specs } pub fn build_node_clients(cluster: &ClusterEnvironment) -> Result { - let validators = cluster - .validator_api_ports + let nodes = cluster + .node_api_ports .iter() .copied() - .zip(cluster.validator_testing_ports.iter().copied()) + .zip(cluster.node_testing_ports.iter().copied()) .map(|(api_port, testing_port)| { - api_client_from_ports( - &cluster.validator_host, - NodeRole::Validator, - api_port, - testing_port, - ) - }) - .collect::, _>>()?; - let executors = cluster - .executor_api_ports - .iter() - .copied() - .zip(cluster.executor_testing_ports.iter().copied()) - .map(|(api_port, testing_port)| { - api_client_from_ports( - &cluster.executor_host, - NodeRole::Executor, - api_port, - testing_port, - ) + api_client_from_ports(&cluster.node_host, api_port, testing_port) }) .collect::, _>>()?; - debug!( - validators = validators.len(), - executors = executors.len(), - "built k8s node clients" - ); + debug!(nodes = nodes.len(), "built k8s node clients"); - Ok(NodeClients::new(validators, executors)) + Ok(NodeClients::new(nodes)) } pub async fn ensure_cluster_readiness( @@ -229,33 +172,18 @@ pub async fn ensure_cluster_readiness( cluster: &ClusterEnvironment, ) -> Result<(), RemoteReadinessError> { info!("waiting for remote readiness (API + membership)"); - let (validator_api, validator_testing) = cluster.validator_ports(); - let (executor_api, executor_testing) = cluster.executor_ports(); + let (node_api, node_testing) = cluster.node_ports(); - let validator_urls = - readiness_urls(validator_api, NodeRole::Validator, &cluster.validator_host)?; - let executor_urls = readiness_urls(executor_api, NodeRole::Executor, &cluster.executor_host)?; - let validator_membership_urls = readiness_urls( - validator_testing, - NodeRole::Validator, - &cluster.validator_host, - )?; - let executor_membership_urls = - readiness_urls(executor_testing, NodeRole::Executor, &cluster.executor_host)?; + let node_urls = readiness_urls(node_api, "node", &cluster.node_host)?; + let membership_urls = readiness_urls(node_testing, "node", &cluster.node_host)?; descriptors - .wait_remote_readiness( - &validator_urls, - &executor_urls, - Some(&validator_membership_urls), - Some(&executor_membership_urls), - ) + .wait_remote_readiness(&node_urls, Some(&membership_urls)) .await .map_err(|source| RemoteReadinessError::Remote { source })?; info!( - validator_api_ports = ?validator_api, - executor_api_ports = ?executor_api, + node_api_ports = ?node_api, "k8s remote readiness confirmed" ); @@ -283,16 +211,14 @@ pub async fn install_stack( assets: &RunnerAssets, namespace: &str, release: &str, - validators: usize, - executors: usize, + nodes: usize, ) -> Result { tracing::info!( release = %release, namespace = %namespace, "installing helm release" ); - crate::infrastructure::helm::install_release(assets, release, namespace, validators, executors) - .await?; + crate::infrastructure::helm::install_release(assets, release, namespace, nodes).await?; tracing::info!(release = %release, "helm install succeeded"); let preserve = env::var("K8S_RUNNER_PRESERVE").is_ok(); @@ -312,25 +238,15 @@ pub async fn wait_for_ports_or_cleanup( cleanup_guard: &mut Option, ) -> Result { info!( - validators = specs.validators.len(), - executors = specs.executors.len(), + nodes = specs.nodes.len(), %namespace, %release, "waiting for cluster port-forwards" ); - match wait_for_cluster_ready( - client, - namespace, - release, - &specs.validators, - &specs.executors, - ) - .await - { + match wait_for_cluster_ready(client, namespace, release, &specs.nodes).await { Ok(ports) => { info!( - validator_ports = ?ports.ports.validators, - executor_ports = ?ports.ports.executors, + node_ports = ?ports.ports.nodes, "cluster port-forwards established" ); Ok(ports) @@ -358,7 +274,7 @@ async fn cleanup_pending(client: &Client, namespace: &str, guard: &mut Option Result, RemoteReadinessError> { ports @@ -368,7 +284,7 @@ fn readiness_urls( .collect() } -fn readiness_url(host: &str, role: NodeRole, port: u16) -> Result { +fn readiness_url(host: &str, role: &'static str, port: u16) -> Result { cluster_host_url(host, port).map_err(|source| RemoteReadinessError::Endpoint { role, port, @@ -382,13 +298,12 @@ fn cluster_host_url(host: &str, port: u16) -> Result { fn api_client_from_ports( host: &str, - role: NodeRole, api_port: u16, testing_port: u16, ) -> Result { let base_endpoint = cluster_host_url(host, api_port).map_err(|source| NodeClientError::Endpoint { - role, + role: "node", endpoint: "api", port: api_port, source, @@ -396,7 +311,7 @@ fn api_client_from_ports( let testing_endpoint = Some( cluster_host_url(host, testing_port).map_err(|source| NodeClientError::Endpoint { - role, + role: "node", endpoint: "testing", port: testing_port, source, diff --git a/testing-framework/deployers/k8s/src/infrastructure/helm.rs b/testing-framework/deployers/k8s/src/infrastructure/helm.rs index e4ed23b..4fdf062 100644 --- a/testing-framework/deployers/k8s/src/infrastructure/helm.rs +++ b/testing-framework/deployers/k8s/src/infrastructure/helm.rs @@ -31,15 +31,13 @@ pub async fn install_release( assets: &RunnerAssets, release: &str, namespace: &str, - validators: usize, - executors: usize, + nodes: usize, ) -> Result<(), HelmError> { let kzg = resolve_kzg_install_args(assets)?; info!( release, namespace, - validators, - executors, + nodes, image = %assets.image, cfgsync_port = cfgsync_port_value(), kzg_mode = ?assets.kzg_mode, @@ -49,9 +47,7 @@ pub async fn install_release( ); let command = format!("helm install {release}"); - let cmd = build_install_command( - assets, release, namespace, validators, executors, &kzg, &command, - ); + let cmd = build_install_command(assets, release, namespace, nodes, &kzg, &command); let output = run_helm_command(cmd, &command).await?; maybe_log_install_output(&command, &output); @@ -101,8 +97,7 @@ fn build_install_command( assets: &RunnerAssets, release: &str, namespace: &str, - validators: usize, - executors: usize, + nodes: usize, kzg: &KzgInstallArgs<'_>, command: &str, ) -> Command { @@ -119,9 +114,7 @@ fn build_install_command( .arg("--set") .arg(format!("image={}", assets.image)) .arg("--set") - .arg(format!("validators.count={validators}")) - .arg("--set") - .arg(format!("executors.count={executors}")) + .arg(format!("nodes.count={nodes}")) .arg("--set") .arg(format!("cfgsync.port={}", cfgsync_port_value())) .arg("-f") @@ -145,11 +138,6 @@ fn build_install_command( "scripts.runNomosSh={}", assets.run_nomos_script.display() )) - .arg("--set-file") - .arg(format!( - "scripts.runNomosExecutorSh={}", - assets.run_nomos_executor_script.display() - )) .stdout(Stdio::piped()) .stderr(Stdio::piped()); diff --git a/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs b/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs index e72f9c0..8ea4134 100644 --- a/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs +++ b/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs @@ -7,15 +7,14 @@ pub async fn spawn_block_feed_with( node_clients: &NodeClients, ) -> Result<(BlockFeed, BlockFeedTask), K8sRunnerError> { debug!( - validators = node_clients.validator_clients().len(), - executors = node_clients.executor_clients().len(), + nodes = node_clients.node_clients().len(), "selecting node client for block feed" ); let block_source_client = node_clients - .validator_clients() - .into_iter() - .next() + .node_clients() + .first() + .cloned() .or_else(|| node_clients.any_client()) .ok_or(K8sRunnerError::BlockFeedMissing)?; diff --git a/testing-framework/deployers/k8s/src/lifecycle/wait/http_probe.rs b/testing-framework/deployers/k8s/src/lifecycle/wait/http_probe.rs index 0715305..9608f2a 100644 --- a/testing-framework/deployers/k8s/src/lifecycle/wait/http_probe.rs +++ b/testing-framework/deployers/k8s/src/lifecycle/wait/http_probe.rs @@ -1,11 +1,11 @@ -use testing_framework_core::scenario::http_probe::{self, HttpReadinessError, NodeRole}; +use testing_framework_core::scenario::http_probe::{self, HttpReadinessError}; use super::{ClusterWaitError, http_poll_interval, node_http_probe_timeout, node_http_timeout}; use crate::host::node_host; pub async fn wait_for_node_http_nodeport( ports: &[u16], - role: NodeRole, + role: &'static str, ) -> Result<(), ClusterWaitError> { let host = node_host(); wait_for_node_http_on_host(ports, role, &host, node_http_probe_timeout()).await @@ -15,14 +15,14 @@ const LOCALHOST: &str = "127.0.0.1"; pub async fn wait_for_node_http_port_forward( ports: &[u16], - role: NodeRole, + role: &'static str, ) -> Result<(), ClusterWaitError> { wait_for_node_http_on_host(ports, role, LOCALHOST, node_http_timeout()).await } async fn wait_for_node_http_on_host( ports: &[u16], - role: NodeRole, + role: &'static str, host: &str, timeout: std::time::Duration, ) -> Result<(), ClusterWaitError> { diff --git a/testing-framework/deployers/k8s/src/lifecycle/wait/mod.rs b/testing-framework/deployers/k8s/src/lifecycle/wait/mod.rs index 0c97ffa..584fe2f 100644 --- a/testing-framework/deployers/k8s/src/lifecycle/wait/mod.rs +++ b/testing-framework/deployers/k8s/src/lifecycle/wait/mod.rs @@ -1,7 +1,6 @@ use std::{env, sync::LazyLock, time::Duration}; use kube::Error as KubeError; -use testing_framework_core::scenario::http_probe::NodeRole; use thiserror::Error; mod deployment; @@ -41,10 +40,8 @@ pub struct HostPort { /// All port assignments for the cluster. #[derive(Debug)] pub struct ClusterPorts { - pub validators: Vec, - pub executors: Vec, - pub validator_host: String, - pub executor_host: String, + pub nodes: Vec, + pub node_host: String, } /// Success result from waiting for the cluster: host ports and forward handles. @@ -77,14 +74,11 @@ pub enum ClusterWaitError { }, #[error("service {service} did not allocate a node port for {port}")] NodePortUnavailable { service: String, port: u16 }, - #[error("cluster must have at least one validator")] - MissingValidator, - #[error( - "timeout waiting for {role} HTTP endpoint on port {port} after {timeout:?}", - role = role.label() - )] + #[error("cluster must have at least one node")] + MissingNode, + #[error("timeout waiting for {role} HTTP endpoint on port {port} after {timeout:?}")] NodeHttpTimeout { - role: NodeRole, + role: &'static str, port: u16, timeout: Duration, }, diff --git a/testing-framework/deployers/k8s/src/lifecycle/wait/orchestrator.rs b/testing-framework/deployers/k8s/src/lifecycle/wait/orchestrator.rs index 02fc01c..f926e1a 100644 --- a/testing-framework/deployers/k8s/src/lifecycle/wait/orchestrator.rs +++ b/testing-framework/deployers/k8s/src/lifecycle/wait/orchestrator.rs @@ -1,5 +1,4 @@ use kube::Client; -use testing_framework_core::scenario::http_probe::NodeRole; use super::{ClusterPorts, ClusterReady, ClusterWaitError, NodeConfigPorts}; use crate::lifecycle::wait::{ @@ -13,42 +12,38 @@ pub async fn wait_for_cluster_ready( client: &Client, namespace: &str, release: &str, - validator_ports: &[NodeConfigPorts], - executor_ports: &[NodeConfigPorts], + node_ports: &[NodeConfigPorts], ) -> Result { - if validator_ports.is_empty() { - return Err(ClusterWaitError::MissingValidator); + if node_ports.is_empty() { + return Err(ClusterWaitError::MissingNode); } - let mut validator_allocations = Vec::with_capacity(validator_ports.len()); - let mut validator_host = crate::host::node_host(); + let mut node_allocations = Vec::with_capacity(node_ports.len()); + let mut node_host = crate::host::node_host(); - for (index, ports) in validator_ports.iter().enumerate() { - let name = format!("{release}-validator-{index}"); + for (index, ports) in node_ports.iter().enumerate() { + let name = format!("{release}-node-{index}"); wait_for_deployment_ready(client, namespace, &name).await?; let allocation = discover_node_ports(client, namespace, &name, *ports).await?; - validator_allocations.push(allocation); + node_allocations.push(allocation); } let mut port_forwards: Vec = Vec::new(); - let validator_api_ports: Vec = validator_allocations - .iter() - .map(|ports| ports.api) - .collect(); - if wait_for_node_http_nodeport(&validator_api_ports, NodeRole::Validator) + let node_api_ports: Vec = node_allocations.iter().map(|ports| ports.api).collect(); + if wait_for_node_http_nodeport(&node_api_ports, "node") .await .is_err() { - validator_allocations.clear(); - validator_host = "127.0.0.1".to_owned(); + node_allocations.clear(); + node_host = "127.0.0.1".to_owned(); let namespace = namespace.to_owned(); let release = release.to_owned(); - let ports = validator_ports.to_vec(); + let ports = node_ports.to_vec(); let (forwards, allocations) = tokio::task::spawn_blocking(move || { let mut allocations = Vec::with_capacity(ports.len()); let forwards = - port_forward_group(&namespace, &release, "validator", &ports, &mut allocations)?; + port_forward_group(&namespace, &release, "node", &ports, &mut allocations)?; Ok::<_, ClusterWaitError>((forwards, allocations)) }) .await @@ -56,83 +51,19 @@ pub async fn wait_for_cluster_ready( source: source.into(), })??; port_forwards = forwards; - validator_allocations = allocations; - let validator_api_ports: Vec = validator_allocations - .iter() - .map(|ports| ports.api) - .collect(); - if let Err(err) = - wait_for_node_http_port_forward(&validator_api_ports, NodeRole::Validator).await - { + node_allocations = allocations; + let node_api_ports: Vec = node_allocations.iter().map(|ports| ports.api).collect(); + if let Err(err) = wait_for_node_http_port_forward(&node_api_ports, "node").await { kill_port_forwards(&mut port_forwards); return Err(err); } } - let mut executor_allocations = Vec::with_capacity(executor_ports.len()); - let mut executor_host = crate::host::node_host(); - for (index, ports) in executor_ports.iter().enumerate() { - let name = format!("{release}-executor-{index}"); - wait_for_deployment_ready(client, namespace, &name).await?; - let allocation = discover_node_ports(client, namespace, &name, *ports).await?; - executor_allocations.push(allocation); - } - - let executor_api_ports: Vec = executor_allocations.iter().map(|ports| ports.api).collect(); - if !executor_allocations.is_empty() - && wait_for_node_http_nodeport(&executor_api_ports, NodeRole::Executor) - .await - .is_err() - { - executor_allocations.clear(); - executor_host = "127.0.0.1".to_owned(); - let namespace = namespace.to_owned(); - let release = release.to_owned(); - let ports = executor_ports.to_vec(); - let (forwards, allocations) = match tokio::task::spawn_blocking(move || { - let mut allocations = Vec::with_capacity(ports.len()); - let forwards = - port_forward_group(&namespace, &release, "executor", &ports, &mut allocations)?; - Ok::<_, ClusterWaitError>((forwards, allocations)) - }) - .await - { - Ok(result) => result?, - Err(source) => { - return Err(cleanup_port_forwards( - &mut port_forwards, - ClusterWaitError::PortForwardTask { - source: source.into(), - }, - )); - } - }; - port_forwards.extend(forwards); - executor_allocations = allocations; - let executor_api_ports: Vec = - executor_allocations.iter().map(|ports| ports.api).collect(); - if let Err(err) = - wait_for_node_http_port_forward(&executor_api_ports, NodeRole::Executor).await - { - return Err(cleanup_port_forwards(&mut port_forwards, err)); - } - } - Ok(ClusterReady { ports: ClusterPorts { - validators: validator_allocations, - executors: executor_allocations, - validator_host, - executor_host, + nodes: node_allocations, + node_host, }, port_forwards, }) } - -fn cleanup_port_forwards( - port_forwards: &mut Vec, - error: ClusterWaitError, -) -> ClusterWaitError { - kill_port_forwards(port_forwards); - error -} diff --git a/testing-framework/deployers/local/Cargo.toml b/testing-framework/deployers/local/Cargo.toml index 03b714f..46e9b56 100644 --- a/testing-framework/deployers/local/Cargo.toml +++ b/testing-framework/deployers/local/Cargo.toml @@ -13,15 +13,14 @@ version = "0.1.0" workspace = true [dependencies] -async-trait = "0.1" -logos-blockchain-executor = { workspace = true } -nomos-libp2p = { workspace = true } -nomos-network = { workspace = true } -nomos-node = { workspace = true } -nomos-utils = { workspace = true } -rand = { workspace = true } -testing-framework-config = { workspace = true } -testing-framework-core = { path = "../../core" } -thiserror = { workspace = true } -tokio = { workspace = true } -tracing = { workspace = true } +async-trait = "0.1" +nomos-libp2p = { workspace = true } +nomos-network = { workspace = true } +nomos-node = { workspace = true } +nomos-utils = { workspace = true } +rand = { workspace = true } +testing-framework-config = { workspace = true } +testing-framework-core = { path = "../../core" } +thiserror = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } diff --git a/testing-framework/deployers/local/src/manual/mod.rs b/testing-framework/deployers/local/src/manual/mod.rs index 621c93d..f935065 100644 --- a/testing-framework/deployers/local/src/manual/mod.rs +++ b/testing-framework/deployers/local/src/manual/mod.rs @@ -49,34 +49,19 @@ impl LocalManualCluster { self.nodes.node_client(name) } - pub async fn start_validator(&self, name: &str) -> Result { + pub async fn start_node(&self, name: &str) -> Result { Ok(self .nodes - .start_validator_with(name, StartNodeOptions::default()) + .start_node_with(name, StartNodeOptions::default()) .await?) } - pub async fn start_executor(&self, name: &str) -> Result { - Ok(self - .nodes - .start_executor_with(name, StartNodeOptions::default()) - .await?) - } - - pub async fn start_validator_with( + pub async fn start_node_with( &self, name: &str, options: StartNodeOptions, ) -> Result { - Ok(self.nodes.start_validator_with(name, options).await?) - } - - pub async fn start_executor_with( - &self, - name: &str, - options: StartNodeOptions, - ) -> Result { - Ok(self.nodes.start_executor_with(name, options).await?) + Ok(self.nodes.start_node_with(name, options).await?) } pub fn stop_all(&self) { @@ -109,22 +94,12 @@ impl Drop for LocalManualCluster { #[async_trait::async_trait] impl ManualClusterHandle for LocalManualCluster { - async fn start_validator_with( + async fn start_node_with( &self, name: &str, options: StartNodeOptions, ) -> Result { - self.start_validator_with(name, options) - .await - .map_err(|err| err.into()) - } - - async fn start_executor_with( - &self, - name: &str, - options: StartNodeOptions, - ) -> Result { - self.start_executor_with(name, options) + self.start_node_with(name, options) .await .map_err(|err| err.into()) } diff --git a/testing-framework/deployers/local/src/node_control/config.rs b/testing-framework/deployers/local/src/node_control/config.rs index 0afa369..d2f1df5 100644 --- a/testing-framework/deployers/local/src/node_control/config.rs +++ b/testing-framework/deployers/local/src/node_control/config.rs @@ -13,7 +13,7 @@ use testing_framework_core::{ topology::{ config::TopologyConfig, configs::GeneralConfig, - generation::{GeneratedNodeConfig, GeneratedTopology, NodeRole}, + generation::{GeneratedNodeConfig, GeneratedTopology}, }, }; @@ -23,13 +23,12 @@ pub(super) fn build_general_config_for( descriptors: &GeneratedTopology, base_consensus: &consensus::GeneralConsensusConfig, base_time: &GeneralTimeConfig, - role: NodeRole, index: usize, peer_ports_by_name: &HashMap, options: &StartNodeOptions, peer_ports: &[u16], ) -> Result<(GeneralConfig, u16), LocalDynamicError> { - if let Some(node) = descriptor_for(descriptors, role, index) { + if let Some(node) = descriptor_for(descriptors, index) { let mut config = node.general.clone(); let initial_peers = resolve_initial_peers( peer_ports_by_name, @@ -68,15 +67,8 @@ pub(super) fn build_general_config_for( Ok((general_config, network_port)) } -fn descriptor_for( - descriptors: &GeneratedTopology, - role: NodeRole, - index: usize, -) -> Option<&GeneratedNodeConfig> { - match role { - NodeRole::Validator => descriptors.validators().get(index), - NodeRole::Executor => descriptors.executors().get(index), - } +fn descriptor_for(descriptors: &GeneratedTopology, index: usize) -> Option<&GeneratedNodeConfig> { + descriptors.nodes().get(index) } fn resolve_peer_names( diff --git a/testing-framework/deployers/local/src/node_control/mod.rs b/testing-framework/deployers/local/src/node_control/mod.rs index c191516..7bb0acc 100644 --- a/testing-framework/deployers/local/src/node_control/mod.rs +++ b/testing-framework/deployers/local/src/node_control/mod.rs @@ -3,18 +3,16 @@ use std::{ sync::Mutex, }; -use logos_blockchain_executor::config::Config as ExecutorConfig; -use nomos_node::Config as ValidatorConfig; +use nomos_node::Config as NodeConfig; use testing_framework_config::topology::configs::{consensus, time}; use testing_framework_core::{ nodes::{ ApiClient, - executor::{Executor, create_executor_config}, - validator::{Validator, create_validator_config}, + node::{Node, create_node_config}, }, scenario::{DynError, NodeControlHandle, StartNodeOptions, StartedNode}, topology::{ - generation::{GeneratedTopology, NodeRole, find_expected_peer_counts}, + generation::{GeneratedTopology, find_expected_peer_counts}, utils::multiaddr_port, }, }; @@ -56,8 +54,7 @@ pub struct LocalDynamicNodes { #[derive(Clone, Default)] pub struct LocalDynamicSeed { - pub validator_count: usize, - pub executor_count: usize, + pub node_count: usize, pub peer_ports: Vec, pub peer_ports_by_name: HashMap, } @@ -67,24 +64,18 @@ impl LocalDynamicSeed { pub fn from_topology(descriptors: &GeneratedTopology) -> Self { let peer_ports = descriptors .nodes() + .iter() .map(|node| node.network_port()) .collect::>(); let peer_ports_by_name = descriptors - .validators() + .nodes() .iter() - .map(|node| (format!("validator-{}", node.index()), node.network_port())) - .chain( - descriptors - .executors() - .iter() - .map(|node| (format!("executor-{}", node.index()), node.network_port())), - ) + .map(|node| (format!("node-{}", node.index()), node.network_port())) .collect(); Self { - validator_count: descriptors.validators().len(), - executor_count: descriptors.executors().len(), + node_count: descriptors.nodes().len(), peer_ports, peer_ports_by_name, } @@ -108,22 +99,19 @@ impl LocalDynamicNodes { seed: LocalDynamicSeed, ) -> Self { let base_node = descriptors - .validators() + .nodes() .first() - .or_else(|| descriptors.executors().first()) .expect("generated topology must include at least one node"); let base_consensus = base_node.general.consensus_config.clone(); let base_time = base_node.general.time_config.clone(); let state = LocalDynamicState { - validator_count: seed.validator_count, - executor_count: seed.executor_count, + node_count: seed.node_count, peer_ports: seed.peer_ports.clone(), peer_ports_by_name: seed.peer_ports_by_name.clone(), clients_by_name: HashMap::new(), - validators: Vec::new(), - executors: Vec::new(), + nodes: Vec::new(), }; Self { @@ -152,32 +140,22 @@ impl LocalDynamicNodes { .lock() .unwrap_or_else(|poisoned| poisoned.into_inner()); - state.validators.clear(); - state.executors.clear(); + state.nodes.clear(); state.peer_ports.clone_from(&self.seed.peer_ports); state .peer_ports_by_name .clone_from(&self.seed.peer_ports_by_name); state.clients_by_name.clear(); - state.validator_count = self.seed.validator_count; - state.executor_count = self.seed.executor_count; + state.node_count = self.seed.node_count; self.node_clients.clear(); } - pub async fn start_validator_with( + pub async fn start_node_with( &self, name: &str, options: StartNodeOptions, ) -> Result { - self.start_node(NodeRole::Validator, name, options).await - } - - pub async fn start_executor_with( - &self, - name: &str, - options: StartNodeOptions, - ) -> Result { - self.start_node(NodeRole::Executor, name, options).await + self.start_node(name, options).await } pub(crate) fn readiness_nodes(&self) -> Vec { @@ -187,19 +165,13 @@ impl LocalDynamicNodes { .unwrap_or_else(|poisoned| poisoned.into_inner()); let listen_ports = state - .validators + .nodes .iter() .map(|node| node.config().network.backend.swarm.port) - .chain( - state - .executors - .iter() - .map(|node| node.config().network.backend.swarm.port), - ) .collect::>(); let initial_peer_ports = state - .validators + .nodes .iter() .map(|node| { node.config() @@ -210,48 +182,24 @@ impl LocalDynamicNodes { .filter_map(multiaddr_port) .collect::>() }) - .chain(state.executors.iter().map(|node| { - node.config() - .network - .backend - .initial_peers - .iter() - .filter_map(multiaddr_port) - .collect::>() - })) .collect::>(); let expected_peer_counts = find_expected_peer_counts(&listen_ports, &initial_peer_ports); state - .validators + .nodes .iter() .enumerate() .map(|(idx, node)| ReadinessNode { - label: format!( - "validator#{idx}@{}", - node.config().network.backend.swarm.port - ), + label: format!("node#{idx}@{}", node.config().network.backend.swarm.port), expected_peers: expected_peer_counts.get(idx).copied(), api: node.api().clone(), }) - .chain(state.executors.iter().enumerate().map(|(idx, node)| { - let global_idx = state.validators.len() + idx; - ReadinessNode { - label: format!( - "executor#{idx}@{}", - node.config().network.backend.swarm.port - ), - expected_peers: expected_peer_counts.get(global_idx).copied(), - api: node.api().clone(), - } - })) .collect::>() } async fn start_node( &self, - role: NodeRole, name: &str, options: StartNodeOptions, ) -> Result { @@ -261,15 +209,11 @@ impl LocalDynamicNodes { .lock() .unwrap_or_else(|poisoned| poisoned.into_inner()); - let (index, role_label) = match role { - NodeRole::Validator => (state.validator_count, "validator"), - NodeRole::Executor => (state.executor_count, "executor"), - }; - + let index = state.node_count; let label = if name.trim().is_empty() { - format!("{role_label}-{index}") + format!("node-{index}") } else { - format!("{role_label}-{name}") + format!("node-{name}") }; if state.peer_ports_by_name.contains_key(&label) { @@ -290,75 +234,42 @@ impl LocalDynamicNodes { &self.descriptors, &self.base_consensus, &self.base_time, - role, index, &peer_ports_by_name, &options, &peer_ports, )?; - let api_client = match role { - NodeRole::Validator => { - let config = create_validator_config(general_config); - self.spawn_and_register_validator(&node_name, network_port, config) - .await? - } - NodeRole::Executor => { - let config = create_executor_config(general_config); - self.spawn_and_register_executor(&node_name, network_port, config) - .await? - } - }; + let config = create_node_config(general_config); + let api_client = self + .spawn_and_register_node(&node_name, network_port, config) + .await?; Ok(StartedNode { name: node_name, - role, api: api_client, }) } - async fn spawn_and_register_validator( + async fn spawn_and_register_node( &self, node_name: &str, network_port: u16, - config: ValidatorConfig, + config: NodeConfig, ) -> Result { - let node = Validator::spawn(config, node_name) + let node = Node::spawn(config, node_name) .await .map_err(|source| LocalDynamicError::Spawn { source })?; let client = node.api().clone(); - self.node_clients.add_validator(client.clone()); + self.node_clients.add_node(client.clone()); let mut state = self .state .lock() .unwrap_or_else(|poisoned| poisoned.into_inner()); - state.register_validator(node_name, network_port, client.clone(), node); - - Ok(client) - } - - async fn spawn_and_register_executor( - &self, - node_name: &str, - network_port: u16, - config: ExecutorConfig, - ) -> Result { - let node = Executor::spawn(config, node_name) - .await - .map_err(|source| LocalDynamicError::Spawn { source })?; - let client = node.api().clone(); - - self.node_clients.add_executor(client.clone()); - - let mut state = self - .state - .lock() - .unwrap_or_else(|poisoned| poisoned.into_inner()); - - state.register_executor(node_name, network_port, client.clone(), node); + state.register_node(node_name, network_port, client.clone(), node); Ok(client) } @@ -366,42 +277,22 @@ impl LocalDynamicNodes { #[async_trait::async_trait] impl NodeControlHandle for LocalDynamicNodes { - async fn restart_validator(&self, _index: usize) -> Result<(), DynError> { - Err("local deployer does not support restart_validator".into()) + async fn restart_node(&self, _index: usize) -> Result<(), DynError> { + Err("local deployer does not support restart_node".into()) } - async fn restart_executor(&self, _index: usize) -> Result<(), DynError> { - Err("local deployer does not support restart_executor".into()) - } - - async fn start_validator(&self, name: &str) -> Result { - self.start_validator_with(name, StartNodeOptions::default()) + async fn start_node(&self, name: &str) -> Result { + self.start_node_with(name, StartNodeOptions::default()) .await .map_err(|err| err.into()) } - async fn start_executor(&self, name: &str) -> Result { - self.start_executor_with(name, StartNodeOptions::default()) - .await - .map_err(|err| err.into()) - } - - async fn start_validator_with( + async fn start_node_with( &self, name: &str, options: StartNodeOptions, ) -> Result { - self.start_validator_with(name, options) - .await - .map_err(|err| err.into()) - } - - async fn start_executor_with( - &self, - name: &str, - options: StartNodeOptions, - ) -> Result { - self.start_executor_with(name, options) + self.start_node_with(name, options) .await .map_err(|err| err.into()) } diff --git a/testing-framework/deployers/local/src/node_control/state.rs b/testing-framework/deployers/local/src/node_control/state.rs index 738cbc7..4eb03f8 100644 --- a/testing-framework/deployers/local/src/node_control/state.rs +++ b/testing-framework/deployers/local/src/node_control/state.rs @@ -1,15 +1,13 @@ use std::collections::HashMap; -use testing_framework_core::nodes::{ApiClient, executor::Executor, validator::Validator}; +use testing_framework_core::nodes::{ApiClient, node::Node}; pub(crate) struct LocalDynamicState { - pub(crate) validator_count: usize, - pub(crate) executor_count: usize, + pub(crate) node_count: usize, pub(crate) peer_ports: Vec, pub(crate) peer_ports_by_name: HashMap, pub(crate) clients_by_name: HashMap, - pub(crate) validators: Vec, - pub(crate) executors: Vec, + pub(crate) nodes: Vec, } impl LocalDynamicState { @@ -20,27 +18,15 @@ impl LocalDynamicState { self.clients_by_name.insert(node_name.to_string(), client); } - pub(super) fn register_validator( + pub(super) fn register_node( &mut self, node_name: &str, network_port: u16, client: ApiClient, - node: Validator, + node: Node, ) { self.register_common(node_name, network_port, client); - self.validator_count += 1; - self.validators.push(node); - } - - pub(super) fn register_executor( - &mut self, - node_name: &str, - network_port: u16, - client: ApiClient, - node: Executor, - ) { - self.register_common(node_name, network_port, client); - self.executor_count += 1; - self.executors.push(node); + self.node_count += 1; + self.nodes.push(node); } } diff --git a/testing-framework/deployers/local/src/runner.rs b/testing-framework/deployers/local/src/runner.rs index 4e08aaa..00bdc10 100644 --- a/testing-framework/deployers/local/src/runner.rs +++ b/testing-framework/deployers/local/src/runner.rs @@ -1,10 +1,13 @@ +use std::sync::Arc; + use async_trait::async_trait; use testing_framework_core::{ scenario::{ - BlockFeed, BlockFeedTask, Deployer, DynError, Metrics, NodeClients, RunContext, Runner, - Scenario, ScenarioError, spawn_block_feed, + BlockFeed, BlockFeedTask, Deployer, DynError, Metrics, NodeClients, NodeControlCapability, + RunContext, Runner, Scenario, ScenarioError, spawn_block_feed, }, topology::{ + config::TopologyConfig, deployment::{SpawnTopologyError, Topology}, readiness::ReadinessError, }, @@ -12,8 +15,9 @@ use testing_framework_core::{ use thiserror::Error; use tracing::{debug, info}; -/// Spawns validators and executors as local processes, reusing the existing -/// integration harness. +use crate::{LocalDynamicNodes, LocalDynamicSeed, LocalManualCluster, ManualClusterError}; + +/// Spawns nodes as local processes, reusing the existing integration harness. #[derive(Clone)] pub struct LocalDeployer {} @@ -59,8 +63,7 @@ impl Deployer<()> for LocalDeployer { async fn deploy(&self, scenario: &Scenario<()>) -> Result { info!( - validators = scenario.topology().validators().len(), - executors = scenario.topology().executors().len(), + nodes = scenario.topology().nodes().len(), "starting local deployment" ); let topology = Self::prepare_topology(scenario).await?; @@ -82,6 +85,43 @@ impl Deployer<()> for LocalDeployer { } } +#[async_trait] +impl Deployer for LocalDeployer { + type Error = LocalDeployerError; + + async fn deploy( + &self, + scenario: &Scenario, + ) -> Result { + info!( + nodes = scenario.topology().nodes().len(), + "starting local deployment with node control" + ); + let topology = Self::prepare_topology(scenario).await?; + let node_clients = NodeClients::from_topology(scenario.topology(), &topology); + let seed = LocalDynamicSeed::from_topology(scenario.topology()); + let node_control = Arc::new(LocalDynamicNodes::new_with_seed( + scenario.topology().clone(), + node_clients.clone(), + seed, + )); + + let (block_feed, block_feed_guard) = spawn_block_feed_with(&node_clients).await?; + + let context = RunContext::new( + scenario.topology().clone(), + Some(topology), + node_clients, + scenario.duration(), + Metrics::empty(), + block_feed, + Some(node_control), + ); + + Ok(Runner::new(context, Some(Box::new(block_feed_guard)))) + } +} + impl LocalDeployer { #[must_use] /// Construct a local deployer. @@ -89,13 +129,18 @@ impl LocalDeployer { Self::default() } - async fn prepare_topology(scenario: &Scenario<()>) -> Result { + pub fn manual_cluster( + &self, + config: TopologyConfig, + ) -> Result { + LocalManualCluster::from_config(config) + } + + async fn prepare_topology( + scenario: &Scenario, + ) -> Result { let descriptors = scenario.topology(); - info!( - validators = descriptors.validators().len(), - executors = descriptors.executors().len(), - "spawning local validators/executors" - ); + info!(nodes = descriptors.nodes().len(), "spawning local nodes"); let topology = descriptors .clone() .spawn_local() @@ -128,14 +173,13 @@ async fn spawn_block_feed_with( node_clients: &NodeClients, ) -> Result<(BlockFeed, BlockFeedTask), LocalDeployerError> { debug!( - validators = node_clients.validator_clients().len(), - executors = node_clients.executor_clients().len(), - "selecting validator client for local block feed" + nodes = node_clients.node_clients().len(), + "selecting node client for local block feed" ); - let Some(block_source_client) = node_clients.random_validator().cloned() else { + let Some(block_source_client) = node_clients.random_node() else { return Err(LocalDeployerError::WorkloadFailed { - source: "block feed requires at least one validator".into(), + source: "block feed requires at least one node".into(), }); }; diff --git a/testing-framework/tools/cfgsync_tf/Cargo.toml b/testing-framework/tools/cfgsync_tf/Cargo.toml index 47f8c44..acfb2c5 100644 --- a/testing-framework/tools/cfgsync_tf/Cargo.toml +++ b/testing-framework/tools/cfgsync_tf/Cargo.toml @@ -19,7 +19,6 @@ clap = { default-features = false, version = "4" } groth16 = { workspace = true } hex = { workspace = true } key-management-system-service = { workspace = true } -logos-blockchain-executor = { workspace = true } nomos-core = { workspace = true } nomos-da-network-core = { workspace = true } nomos-libp2p = { workspace = true } diff --git a/testing-framework/tools/cfgsync_tf/src/bin/cfgsync-client.rs b/testing-framework/tools/cfgsync_tf/src/bin/cfgsync-client.rs index 4f312eb..edf8785 100644 --- a/testing-framework/tools/cfgsync_tf/src/bin/cfgsync-client.rs +++ b/testing-framework/tools/cfgsync_tf/src/bin/cfgsync-client.rs @@ -10,9 +10,8 @@ use cfgsync_tf::{ client::{FetchedConfig, get_config}, server::ClientIp, }; -use logos_blockchain_executor::config::Config as ExecutorConfig; use nomos_libp2p::PeerId; -use nomos_node::Config as ValidatorConfig; +use nomos_node::Config as NodeConfig; use serde::{Serialize, de::DeserializeOwned}; use subnetworks_assignations::{MembershipCreator, MembershipHandler, SubnetworkId}; use testing_framework_config::constants::cfgsync_port as default_cfgsync_port; @@ -97,8 +96,6 @@ async fn main() { let identifier = env::var("CFG_HOST_IDENTIFIER").unwrap_or_else(|_| "unidentified-node".to_owned()); - let host_kind = env::var("CFG_HOST_KIND").unwrap_or_else(|_| "validator".to_owned()); - let network_port = env::var("CFG_NETWORK_PORT") .ok() .and_then(|v| v.parse().ok()); @@ -119,37 +116,17 @@ async fn main() { testing_http_port, }; - let node_config_endpoint = match host_kind.as_str() { - "executor" => format!("{server_addr}/executor"), - _ => format!("{server_addr}/validator"), - }; - - let config_result = match host_kind.as_str() { - "executor" => { - pull_to_file::( - payload, - &node_config_endpoint, - &config_file_path, - |config, assignations| { - config.da_network.membership = - apply_da_assignations(&config.da_network.membership, assignations); - }, - ) - .await - } - _ => { - pull_to_file::( - payload, - &node_config_endpoint, - &config_file_path, - |config, assignations| { - config.da_network.membership = - apply_da_assignations(&config.da_network.membership, assignations); - }, - ) - .await - } - }; + let node_config_endpoint = format!("{server_addr}/node"); + let config_result = pull_to_file::( + payload, + &node_config_endpoint, + &config_file_path, + |config, assignations| { + config.da_network.membership = + apply_da_assignations(&config.da_network.membership, assignations); + }, + ) + .await; // Handle error if the config request fails if let Err(err) = config_result { diff --git a/testing-framework/tools/cfgsync_tf/src/config/builder.rs b/testing-framework/tools/cfgsync_tf/src/config/builder.rs index 1e50cb2..42e94df 100644 --- a/testing-framework/tools/cfgsync_tf/src/config/builder.rs +++ b/testing-framework/tools/cfgsync_tf/src/config/builder.rs @@ -24,7 +24,7 @@ use crate::{ tracing::update_tracing_identifier, validation::{ValidationError, validate_inputs}, }, - host::{Host, HostKind, sort_hosts}, + host::{Host, sort_hosts}, network::rewrite_initial_peers, }; @@ -177,9 +177,7 @@ pub fn try_create_node_configs( message: source.to_string(), } })?; - if matches!(host.kind, HostKind::Validator) { - da_config.policy_settings.min_dispersal_peers = 0; - } + da_config.policy_settings.min_dispersal_peers = 0; let mut network_config = network_configs[i].clone(); network_config.backend.swarm.host = Ipv4Addr::UNSPECIFIED; diff --git a/testing-framework/tools/cfgsync_tf/src/host.rs b/testing-framework/tools/cfgsync_tf/src/host.rs index 76c2f68..39ac082 100644 --- a/testing-framework/tools/cfgsync_tf/src/host.rs +++ b/testing-framework/tools/cfgsync_tf/src/host.rs @@ -5,15 +5,8 @@ use testing_framework_config::constants::{ DEFAULT_LIBP2P_NETWORK_PORT, }; -#[derive(Copy, Clone, Eq, PartialEq, Hash)] -pub enum HostKind { - Validator, - Executor, -} - #[derive(Eq, PartialEq, Hash, Clone)] pub struct Host { - pub kind: HostKind, pub ip: Ipv4Addr, pub identifier: String, pub network_port: u16, @@ -33,9 +26,8 @@ pub struct PortOverrides { } impl Host { - fn from_parts(kind: HostKind, ip: Ipv4Addr, identifier: String, ports: PortOverrides) -> Self { + fn from_parts(ip: Ipv4Addr, identifier: String, ports: PortOverrides) -> Self { Self { - kind, ip, identifier, network_port: ports.network_port.unwrap_or(DEFAULT_LIBP2P_NETWORK_PORT), @@ -47,13 +39,8 @@ impl Host { } #[must_use] - pub fn validator_from_ip(ip: Ipv4Addr, identifier: String, ports: PortOverrides) -> Self { - Self::from_parts(HostKind::Validator, ip, identifier, ports) - } - - #[must_use] - pub fn executor_from_ip(ip: Ipv4Addr, identifier: String, ports: PortOverrides) -> Self { - Self::from_parts(HostKind::Executor, ip, identifier, ports) + pub fn node_from_ip(ip: Ipv4Addr, identifier: String, ports: PortOverrides) -> Self { + Self::from_parts(ip, identifier, ports) } } @@ -66,11 +53,7 @@ pub fn sort_hosts(mut hosts: Vec) -> Vec { .next() .and_then(|raw| raw.parse::().ok()) .unwrap_or(0); - let kind = match host.kind { - HostKind::Validator => 0, - HostKind::Executor => 1, - }; - (kind, index) + index }); hosts } diff --git a/testing-framework/tools/cfgsync_tf/src/server.rs b/testing-framework/tools/cfgsync_tf/src/server.rs index 55aa399..16e78b3 100644 --- a/testing-framework/tools/cfgsync_tf/src/server.rs +++ b/testing-framework/tools/cfgsync_tf/src/server.rs @@ -24,7 +24,7 @@ use serde_json::{Value, json, to_value}; use serde_with::serde_as; use subnetworks_assignations::MembershipHandler; use testing_framework_config::{ - nodes::{executor::create_executor_config, validator::create_validator_config}, + nodes::node::create_node_config, topology::configs::{consensus::ConsensusParams, da::DaParams, wallet::WalletConfig}, }; use tokio::sync::oneshot::channel; @@ -151,7 +151,7 @@ pub struct ClientIp { pub testing_http_port: Option, } -async fn validator_config( +async fn node_config( State(config_repo): State>, Json(payload): Json, ) -> impl IntoResponse { @@ -174,77 +174,20 @@ async fn validator_config( let (reply_tx, reply_rx) = channel(); config_repo - .register(Host::validator_from_ip(ip, identifier, ports), reply_tx) + .register(Host::node_from_ip(ip, identifier, ports), reply_tx) .await; (reply_rx.await).map_or_else( |_| (StatusCode::INTERNAL_SERVER_ERROR, "Error receiving config").into_response(), |config_response| match config_response { RepoResponse::Config(config) => { - let config = create_validator_config(*config); + let config = create_node_config(*config); let mut value = match to_value(&config) { Ok(value) => value, Err(err) => { return ( StatusCode::INTERNAL_SERVER_ERROR, - format!("failed to serialize validator config: {err}"), - ) - .into_response(); - } - }; - - inject_defaults(&mut value); - override_api_ports(&mut value, &ports); - inject_da_assignations(&mut value, &config.da_network.membership); - override_min_session_members(&mut value); - - (StatusCode::OK, Json(value)).into_response() - } - RepoResponse::Timeout => (StatusCode::REQUEST_TIMEOUT).into_response(), - RepoResponse::Error(message) => { - (StatusCode::INTERNAL_SERVER_ERROR, message).into_response() - } - }, - ) -} - -async fn executor_config( - State(config_repo): State>, - Json(payload): Json, -) -> impl IntoResponse { - let ClientIp { - ip, - identifier, - network_port, - da_port, - blend_port, - api_port, - testing_http_port, - } = payload; - let ports = PortOverrides { - network_port, - da_network_port: da_port, - blend_port, - api_port, - testing_http_port, - }; - - let (reply_tx, reply_rx) = channel(); - config_repo - .register(Host::executor_from_ip(ip, identifier, ports), reply_tx) - .await; - - (reply_rx.await).map_or_else( - |_| (StatusCode::INTERNAL_SERVER_ERROR, "Error receiving config").into_response(), - |config_response| match config_response { - RepoResponse::Config(config) => { - let config = create_executor_config(*config); - let mut value = match to_value(&config) { - Ok(value) => value, - Err(err) => { - return ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("failed to serialize executor config: {err}"), + format!("failed to serialize node config: {err}"), ) .into_response(); } @@ -267,8 +210,7 @@ async fn executor_config( pub fn cfgsync_app(config_repo: Arc) -> Router { Router::new() - .route("/validator", post(validator_config)) - .route("/executor", post(executor_config)) + .route("/node", post(node_config)) .with_state(config_repo) } diff --git a/testing-framework/workflows/src/builder/mod.rs b/testing-framework/workflows/src/builder/mod.rs index 9762fa2..9408757 100644 --- a/testing-framework/workflows/src/builder/mod.rs +++ b/testing-framework/workflows/src/builder/mod.rs @@ -530,8 +530,7 @@ impl ChaosBuilder { min_delay: DEFAULT_CHAOS_MIN_DELAY, max_delay: DEFAULT_CHAOS_MAX_DELAY, target_cooldown: DEFAULT_CHAOS_TARGET_COOLDOWN, - include_validators: true, - include_executors: true, + include_nodes: true, } } } @@ -541,8 +540,7 @@ pub struct ChaosRestartBuilder { min_delay: Duration, max_delay: Duration, target_cooldown: Duration, - include_validators: bool, - include_executors: bool, + include_nodes: bool, } impl ChaosRestartBuilder { @@ -582,16 +580,9 @@ impl ChaosRestartBuilder { } #[must_use] - /// Include validators in the restart target set. - pub const fn include_validators(mut self, enabled: bool) -> Self { - self.include_validators = enabled; - self - } - - #[must_use] - /// Include executors in the restart target set. - pub const fn include_executors(mut self, enabled: bool) -> Self { - self.include_executors = enabled; + /// Include nodes in the restart target set. + pub const fn include_nodes(mut self, enabled: bool) -> Self { + self.include_nodes = enabled; self } @@ -614,18 +605,16 @@ impl ChaosRestartBuilder { ); self.target_cooldown = self.min_delay; } - if !self.include_validators && !self.include_executors { - tracing::warn!("chaos restart requires at least one node group; enabling all targets"); - self.include_validators = true; - self.include_executors = true; + if !self.include_nodes { + tracing::warn!("chaos restart requires at least one node; enabling all targets"); + self.include_nodes = true; } let workload = RandomRestartWorkload::new( self.min_delay, self.max_delay, self.target_cooldown, - self.include_validators, - self.include_executors, + self.include_nodes, ); self.builder = self.builder.with_workload(workload); self.builder diff --git a/testing-framework/workflows/src/expectations/consensus_liveness.rs b/testing-framework/workflows/src/expectations/consensus_liveness.rs index 571320e..085349f 100644 --- a/testing-framework/workflows/src/expectations/consensus_liveness.rs +++ b/testing-framework/workflows/src/expectations/consensus_liveness.rs @@ -67,7 +67,7 @@ enum ConsensusLivenessIssue { #[derive(Debug, Error)] enum ConsensusLivenessError { - #[error("consensus liveness requires at least one validator or executor")] + #[error("consensus liveness requires at least one node")] MissingParticipants, #[error("consensus liveness violated (target={target}):\n{details}")] Violations { diff --git a/testing-framework/workflows/src/workloads/chaos.rs b/testing-framework/workflows/src/workloads/chaos.rs index 7a3142f..f8953ad 100644 --- a/testing-framework/workflows/src/workloads/chaos.rs +++ b/testing-framework/workflows/src/workloads/chaos.rs @@ -8,14 +8,13 @@ use tracing::info; const MIN_DELAY_SPREAD_FALLBACK: Duration = Duration::from_millis(1); -/// Randomly restarts validators and executors during a run to introduce chaos. +/// Randomly restarts nodes during a run to introduce chaos. #[derive(Debug)] pub struct RandomRestartWorkload { min_delay: Duration, max_delay: Duration, target_cooldown: Duration, - include_validators: bool, - include_executors: bool, + include_nodes: bool, } impl RandomRestartWorkload { @@ -23,39 +22,32 @@ impl RandomRestartWorkload { /// /// `min_delay`/`max_delay` bound the sleep between restart attempts, while /// `target_cooldown` prevents repeatedly restarting the same node too - /// quickly. Validators or executors can be selectively included. + /// quickly. Nodes can be selectively included. #[must_use] pub const fn new( min_delay: Duration, max_delay: Duration, target_cooldown: Duration, - include_validators: bool, - include_executors: bool, + include_nodes: bool, ) -> Self { Self { min_delay, max_delay, target_cooldown, - include_validators, - include_executors, + include_nodes, } } - fn targets(&self, ctx: &RunContext) -> Vec { + fn targets(&self, ctx: &RunContext) -> Vec { let mut targets = Vec::new(); - let validator_count = ctx.descriptors().validators().len(); - if self.include_validators { - if validator_count > 1 { - for index in 0..validator_count { - targets.push(Target::Validator(index)); + let node_count = ctx.descriptors().nodes().len(); + if self.include_nodes { + if node_count > 1 { + for index in 0..node_count { + targets.push(index); } - } else if validator_count == 1 { - info!("chaos restart skipping validators: only one validator configured"); - } - } - if self.include_executors { - for index in 0..ctx.descriptors().executors().len() { - targets.push(Target::Executor(index)); + } else if node_count == 1 { + info!("chaos restart skipping nodes: only one node configured"); } } targets @@ -79,7 +71,7 @@ impl RandomRestartWorkload { delay } - fn initialize_cooldowns(&self, targets: &[Target]) -> HashMap { + fn initialize_cooldowns(&self, targets: &[usize]) -> HashMap { let now = Instant::now(); let ready = now.checked_sub(self.target_cooldown).unwrap_or(now); targets @@ -91,9 +83,9 @@ impl RandomRestartWorkload { async fn pick_target( &self, - targets: &[Target], - cooldowns: &HashMap, - ) -> Result { + targets: &[usize], + cooldowns: &HashMap, + ) -> Result { if targets.is_empty() { return Err("chaos restart workload has no eligible targets".into()); } @@ -117,7 +109,7 @@ impl RandomRestartWorkload { } } - let available: Vec = targets + let available: Vec = targets .iter() .copied() .filter(|target| cooldowns.get(target).is_none_or(|ready| *ready <= now)) @@ -154,8 +146,7 @@ impl Workload for RandomRestartWorkload { tracing::info!( config = ?self, - validators = ctx.descriptors().validators().len(), - executors = ctx.descriptors().executors().len(), + nodes = ctx.descriptors().nodes().len(), target_count = targets.len(), "starting chaos restart workload" ); @@ -166,30 +157,13 @@ impl Workload for RandomRestartWorkload { sleep(self.random_delay()).await; let target = self.pick_target(&targets, &cooldowns).await?; - match target { - Target::Validator(index) => { - tracing::info!(index, "chaos restarting validator"); - handle - .restart_validator(index) - .await - .map_err(|err| format!("validator restart failed: {err}"))? - } - Target::Executor(index) => { - tracing::info!(index, "chaos restarting executor"); - handle - .restart_executor(index) - .await - .map_err(|err| format!("executor restart failed: {err}"))? - } - } + tracing::info!(index = target, "chaos restarting node"); + handle + .restart_node(target) + .await + .map_err(|err| format!("node restart failed: {err}"))?; cooldowns.insert(target, Instant::now() + self.target_cooldown); } } } - -#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] -enum Target { - Validator(usize), - Executor(usize), -} diff --git a/testing-framework/workflows/src/workloads/transaction/workload.rs b/testing-framework/workflows/src/workloads/transaction/workload.rs index 4f8c1e2..da6e077 100644 --- a/testing-framework/workflows/src/workloads/transaction/workload.rs +++ b/testing-framework/workflows/src/workloads/transaction/workload.rs @@ -73,9 +73,8 @@ impl ScenarioWorkload for Workload { } let reference_node = descriptors - .validators() + .nodes() .first() - .or_else(|| descriptors.executors().first()) .ok_or("transaction workload requires at least one node in the topology")?; let utxo_map = wallet_utxo_map(reference_node); diff --git a/testing-framework/workflows/src/workloads/util.rs b/testing-framework/workflows/src/workloads/util.rs index 0a48d4e..761f6ab 100644 --- a/testing-framework/workflows/src/workloads/util.rs +++ b/testing-framework/workflows/src/workloads/util.rs @@ -42,19 +42,10 @@ pub async fn submit_transaction_via_cluster( tx: Arc, ) -> Result<(), DynError> { let tx_hash = tx.hash(); - debug!( - ?tx_hash, - "submitting transaction via cluster (validators first)" - ); + debug!(?tx_hash, "submitting transaction via cluster"); let node_clients = ctx.node_clients(); - let mut validator_clients = node_clients.validator_clients(); - let mut executor_clients = node_clients.executor_clients(); - validator_clients.shuffle(&mut thread_rng()); - executor_clients.shuffle(&mut thread_rng()); - - let clients = validator_clients.into_iter().chain(executor_clients); - let mut clients: Vec<_> = clients.collect(); + let mut clients = node_clients.node_clients(); let mut last_err = None; for attempt in 0..SUBMIT_RETRIES {