diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d933e10..50ea06d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,6 +33,12 @@ repos: - id: cargo-machete - repo: local hooks: + - id: node-rev-sync + name: node rev sync + language: system + entry: sh scripts/checks/check-node-rev-sync.sh + pass_filenames: false + files: ^(versions\.env|Cargo\.toml)$ - id: cargo-hack-check language: script name: cargo hack check diff --git a/Cargo.lock b/Cargo.lock index 49db93e..844e836 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2894,8 +2894,6 @@ dependencies = [ "cfgsync-runtime", "kube", "logos-blockchain-http-api-common", - "logos-blockchain-tracing", - "logos-blockchain-tracing-service", "reqwest", "serde", "serde_yaml", @@ -3418,7 +3416,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "logos-blockchain-api-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "bytes", @@ -3445,7 +3443,7 @@ dependencies = [ [[package]] name = "logos-blockchain-blend" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "logos-blockchain-blend-crypto", "logos-blockchain-blend-message", @@ -3457,7 +3455,7 @@ dependencies = [ [[package]] name = "logos-blockchain-blend-crypto" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "blake2", "logos-blockchain-groth16", @@ -3471,7 +3469,7 @@ dependencies = [ [[package]] name = "logos-blockchain-blend-message" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "blake2", "derivative", @@ -3493,7 +3491,7 @@ dependencies = [ [[package]] name = "logos-blockchain-blend-network" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "either", "futures", @@ -3511,10 +3509,11 @@ dependencies = [ [[package]] name = "logos-blockchain-blend-proofs" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "ed25519-dalek", "generic-array 1.3.5", + "hex", "logos-blockchain-blend-crypto", "logos-blockchain-groth16", "logos-blockchain-pol", @@ -3528,7 +3527,7 @@ dependencies = [ [[package]] name = "logos-blockchain-blend-scheduling" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "derivative", @@ -3552,11 +3551,12 @@ dependencies = [ [[package]] name = "logos-blockchain-blend-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "fork_stream", "futures", + "hex", "libp2p", "libp2p-stream", "logos-blockchain-blend", @@ -3587,7 +3587,7 @@ dependencies = [ [[package]] name = "logos-blockchain-chain-broadcast-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "derivative", @@ -3603,7 +3603,7 @@ dependencies = [ [[package]] name = "logos-blockchain-chain-leader-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "futures", @@ -3631,7 +3631,7 @@ dependencies = [ [[package]] name = "logos-blockchain-chain-network-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "futures", @@ -3659,7 +3659,7 @@ dependencies = [ [[package]] name = "logos-blockchain-chain-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "bytes", @@ -3689,7 +3689,7 @@ dependencies = [ [[package]] name = "logos-blockchain-chain-service-common" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "logos-blockchain-core", "serde", @@ -3698,7 +3698,7 @@ dependencies = [ [[package]] name = "logos-blockchain-circuits-prover" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "logos-blockchain-circuits-utils", "tempfile", @@ -3707,7 +3707,7 @@ dependencies = [ [[package]] name = "logos-blockchain-circuits-utils" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "dirs", ] @@ -3715,7 +3715,7 @@ dependencies = [ [[package]] name = "logos-blockchain-common-http-client" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "futures", "hex", @@ -3735,7 +3735,7 @@ dependencies = [ [[package]] name = "logos-blockchain-core" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "ark-ff 0.4.2", "bincode", @@ -3765,7 +3765,7 @@ dependencies = [ [[package]] name = "logos-blockchain-cryptarchia-engine" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "cfg_eval", "logos-blockchain-pol", @@ -3781,7 +3781,7 @@ dependencies = [ [[package]] name = "logos-blockchain-cryptarchia-sync" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "bytes", "futures", @@ -3800,7 +3800,7 @@ dependencies = [ [[package]] name = "logos-blockchain-groth16" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "ark-bn254 0.4.0", "ark-ec 0.4.2", @@ -3818,7 +3818,7 @@ dependencies = [ [[package]] name = "logos-blockchain-http-api-common" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "axum", "logos-blockchain-core", @@ -3832,12 +3832,13 @@ dependencies = [ [[package]] name = "logos-blockchain-key-management-system-keys" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "bytes", "ed25519-dalek", "generic-array 1.3.5", + "hex", "logos-blockchain-groth16", "logos-blockchain-key-management-system-macros", "logos-blockchain-poseidon2", @@ -3857,7 +3858,7 @@ dependencies = [ [[package]] name = "logos-blockchain-key-management-system-macros" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "proc-macro2", "quote", @@ -3867,7 +3868,7 @@ dependencies = [ [[package]] name = "logos-blockchain-key-management-system-operators" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "logos-blockchain-blend-proofs", @@ -3883,7 +3884,7 @@ dependencies = [ [[package]] name = "logos-blockchain-key-management-system-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "log", @@ -3899,7 +3900,7 @@ dependencies = [ [[package]] name = "logos-blockchain-ledger" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "derivative", "logos-blockchain-blend-crypto", @@ -3923,7 +3924,7 @@ dependencies = [ [[package]] name = "logos-blockchain-libp2p" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "backon", @@ -3952,7 +3953,7 @@ dependencies = [ [[package]] name = "logos-blockchain-network-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "futures", @@ -3971,7 +3972,7 @@ dependencies = [ [[package]] name = "logos-blockchain-node" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "axum", @@ -4033,7 +4034,7 @@ dependencies = [ [[package]] name = "logos-blockchain-poc" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "logos-blockchain-circuits-prover", "logos-blockchain-circuits-utils", @@ -4049,7 +4050,7 @@ dependencies = [ [[package]] name = "logos-blockchain-pol" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "astro-float", "logos-blockchain-circuits-prover", @@ -4068,7 +4069,7 @@ dependencies = [ [[package]] name = "logos-blockchain-poq" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "logos-blockchain-circuits-prover", "logos-blockchain-circuits-utils", @@ -4085,7 +4086,7 @@ dependencies = [ [[package]] name = "logos-blockchain-poseidon2" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "ark-bn254 0.4.0", "ark-ff 0.4.2", @@ -4096,7 +4097,7 @@ dependencies = [ [[package]] name = "logos-blockchain-sdp-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "futures", @@ -4112,7 +4113,7 @@ dependencies = [ [[package]] name = "logos-blockchain-services-utils" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "futures", @@ -4127,7 +4128,7 @@ dependencies = [ [[package]] name = "logos-blockchain-storage-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "bytes", @@ -4145,7 +4146,7 @@ dependencies = [ [[package]] name = "logos-blockchain-system-sig-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-ctrlc", "async-trait", @@ -4156,7 +4157,7 @@ dependencies = [ [[package]] name = "logos-blockchain-time-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "cfg_eval", @@ -4178,7 +4179,7 @@ dependencies = [ [[package]] name = "logos-blockchain-tracing" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "opentelemetry", "opentelemetry-appender-tracing", @@ -4201,12 +4202,13 @@ dependencies = [ [[package]] name = "logos-blockchain-tracing-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "logos-blockchain-tracing", "overwatch", "serde", + "time", "tracing", "tracing-appender", "tracing-subscriber 0.3.22", @@ -4215,7 +4217,7 @@ dependencies = [ [[package]] name = "logos-blockchain-tui-zone" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "clap", "hex", @@ -4232,7 +4234,7 @@ dependencies = [ [[package]] name = "logos-blockchain-tx-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "futures", @@ -4254,7 +4256,7 @@ dependencies = [ [[package]] name = "logos-blockchain-utils" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "blake2", @@ -4271,7 +4273,7 @@ dependencies = [ [[package]] name = "logos-blockchain-utxotree" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "ark-ff 0.4.2", "logos-blockchain-groth16", @@ -4285,7 +4287,7 @@ dependencies = [ [[package]] name = "logos-blockchain-wallet" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "logos-blockchain-core", "logos-blockchain-key-management-system-keys", @@ -4300,7 +4302,7 @@ dependencies = [ [[package]] name = "logos-blockchain-wallet-service" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "async-trait", "bytes", @@ -4325,7 +4327,7 @@ dependencies = [ [[package]] name = "logos-blockchain-witness-generator" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "tempfile", ] @@ -4333,7 +4335,7 @@ dependencies = [ [[package]] name = "logos-blockchain-zksign" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "logos-blockchain-circuits-prover", "logos-blockchain-circuits-utils", @@ -4350,7 +4352,7 @@ dependencies = [ [[package]] name = "logos-blockchain-zone-sdk" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "futures", "logos-blockchain-common-http-client", @@ -6595,7 +6597,7 @@ dependencies = [ [[package]] name = "testing_framework" version = "0.1.0" -source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=41ea1e3082526bb271e655cddb95a5b448e7de20#41ea1e3082526bb271e655cddb95a5b448e7de20" +source = "git+https://github.com/logos-blockchain/logos-blockchain.git?rev=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667#5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 1fcc636..9e32eb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ all = "allow" # Local testing framework crates cfgsync-core = { default-features = false, path = "testing-framework/tools/cfgsync-core" } lb-ext = { default-features = false, path = "logos/runtime/ext" } -lb-framework = { default-features = false, package = "testing_framework", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } +lb-framework = { default-features = false, package = "testing_framework", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } lb-workloads = { default-features = false, path = "logos/runtime/workloads" } testing-framework-core = { default-features = false, path = "testing-framework/core" } testing-framework-env = { default-features = false, path = "logos/runtime/env" } @@ -42,44 +42,44 @@ testing-framework-runner-k8s = { default-features = false, path = "testing-f testing-framework-runner-local = { default-features = false, path = "testing-framework/deployers/local" } # Logos dependencies (from logos-blockchain master @ deccbb2d2) -broadcast-service = { default-features = false, package = "logos-blockchain-chain-broadcast-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } +broadcast-service = { default-features = false, package = "logos-blockchain-chain-broadcast-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } cfgsync_runtime = { default-features = false, package = "cfgsync-runtime", path = "testing-framework/tools/cfgsync-runtime" } chain-leader = { default-features = false, features = [ "pol-dev-mode", -], package = "logos-blockchain-chain-leader-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -chain-network = { default-features = false, package = "logos-blockchain-chain-network-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -chain-service = { default-features = false, package = "logos-blockchain-chain-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -common-http-client = { default-features = false, package = "logos-blockchain-common-http-client", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -cryptarchia-engine = { default-features = false, package = "logos-blockchain-cryptarchia-engine", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -cryptarchia-sync = { default-features = false, package = "logos-blockchain-cryptarchia-sync", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -groth16 = { default-features = false, package = "logos-blockchain-groth16", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -key-management-system-service = { default-features = false, package = "logos-blockchain-key-management-system-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-api = { default-features = false, package = "logos-blockchain-api-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-blend-message = { default-features = false, package = "logos-blockchain-blend-message", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-blend-service = { default-features = false, package = "logos-blockchain-blend-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-core = { default-features = false, package = "logos-blockchain-core", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-http-api-common = { default-features = false, package = "logos-blockchain-http-api-common", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-ledger = { default-features = false, package = "logos-blockchain-ledger", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-libp2p = { default-features = false, package = "logos-blockchain-libp2p", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-network = { default-features = false, package = "logos-blockchain-network-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } +], package = "logos-blockchain-chain-leader-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +chain-network = { default-features = false, package = "logos-blockchain-chain-network-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +chain-service = { default-features = false, package = "logos-blockchain-chain-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +common-http-client = { default-features = false, package = "logos-blockchain-common-http-client", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +cryptarchia-engine = { default-features = false, package = "logos-blockchain-cryptarchia-engine", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +cryptarchia-sync = { default-features = false, package = "logos-blockchain-cryptarchia-sync", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +groth16 = { default-features = false, package = "logos-blockchain-groth16", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +key-management-system-service = { default-features = false, package = "logos-blockchain-key-management-system-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-api = { default-features = false, package = "logos-blockchain-api-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-blend-message = { default-features = false, package = "logos-blockchain-blend-message", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-blend-service = { default-features = false, package = "logos-blockchain-blend-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-core = { default-features = false, package = "logos-blockchain-core", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-http-api-common = { default-features = false, package = "logos-blockchain-http-api-common", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-ledger = { default-features = false, package = "logos-blockchain-ledger", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-libp2p = { default-features = false, package = "logos-blockchain-libp2p", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-network = { default-features = false, package = "logos-blockchain-network-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } nomos-node = { default-features = false, features = [ "testing", -], package = "logos-blockchain-node", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-sdp = { default-features = false, package = "logos-blockchain-sdp-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-time = { default-features = false, package = "logos-blockchain-time-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-tracing = { default-features = false, package = "logos-blockchain-tracing", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-tracing-service = { default-features = false, package = "logos-blockchain-tracing-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-utils = { default-features = false, package = "logos-blockchain-utils", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -nomos-wallet = { default-features = false, package = "logos-blockchain-wallet-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -poc = { default-features = false, package = "logos-blockchain-poc", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -pol = { default-features = false, package = "logos-blockchain-pol", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -tx-service = { default-features = false, package = "logos-blockchain-tx-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -wallet = { default-features = false, package = "logos-blockchain-wallet", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -zksign = { default-features = false, package = "logos-blockchain-zksign", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } +], package = "logos-blockchain-node", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-sdp = { default-features = false, package = "logos-blockchain-sdp-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-time = { default-features = false, package = "logos-blockchain-time-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-tracing = { default-features = false, package = "logos-blockchain-tracing", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-tracing-service = { default-features = false, package = "logos-blockchain-tracing-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-utils = { default-features = false, package = "logos-blockchain-utils", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +nomos-wallet = { default-features = false, package = "logos-blockchain-wallet-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +poc = { default-features = false, package = "logos-blockchain-poc", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +pol = { default-features = false, package = "logos-blockchain-pol", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +tx-service = { default-features = false, package = "logos-blockchain-tx-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +wallet = { default-features = false, package = "logos-blockchain-wallet", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +zksign = { default-features = false, package = "logos-blockchain-zksign", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } # lb_* aliases (nomos-node repo naming) -lb_http_api_common = { default-features = false, package = "logos-blockchain-http-api-common", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -lb_tracing = { default-features = false, package = "logos-blockchain-tracing", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } -lb_tracing_service = { default-features = false, package = "logos-blockchain-tracing-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "41ea1e3082526bb271e655cddb95a5b448e7de20" } +lb_http_api_common = { default-features = false, package = "logos-blockchain-http-api-common", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +lb_tracing = { default-features = false, package = "logos-blockchain-tracing", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } +lb_tracing_service = { default-features = false, package = "logos-blockchain-tracing-service", git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667" } # External crates async-trait = { default-features = false, version = "0.1" } bytes = { default-features = false, version = "1.3" } @@ -107,3 +107,8 @@ uuid = { default-features = false, version = "1", features = ["v4 testing-framework-core = { path = "testing-framework/core" } testing-framework-env = { path = "logos/runtime/env" } testing-framework-runner-local = { path = "testing-framework/deployers/local" } + +[patch."https://github.com/logos-blockchain/logos-blockchain.git"] +testing-framework-core = { path = "testing-framework/core" } +testing-framework-env = { path = "logos/runtime/env" } +testing-framework-runner-local = { path = "testing-framework/deployers/local" } diff --git a/logos/examples/tests/expectation_fail_fast_capture.rs b/logos/examples/tests/expectation_fail_fast_capture.rs new file mode 100644 index 0000000..0b0be89 --- /dev/null +++ b/logos/examples/tests/expectation_fail_fast_capture.rs @@ -0,0 +1,65 @@ +use std::time::Duration; + +use anyhow::{Result, anyhow}; +use async_trait::async_trait; +use lb_framework::{CoreBuilderExt as _, LbcEnv, LbcLocalDeployer, ScenarioBuilder}; +use testing_framework_core::scenario::{ + Deployer, DynError, Expectation, RunContext, ScenarioError, +}; +use tracing_subscriber::fmt::try_init; + +const FAIL_AFTER_CHECKS: usize = 2; + +struct FailFastDuringCaptureExpectation { + checks: usize, +} + +impl Default for FailFastDuringCaptureExpectation { + fn default() -> Self { + Self { checks: 0 } + } +} + +#[async_trait] +impl Expectation for FailFastDuringCaptureExpectation { + fn name(&self) -> &str { + "fail_fast_during_capture" + } + + async fn check_during_capture(&mut self, _ctx: &RunContext) -> Result<(), DynError> { + self.checks += 1; + if self.checks >= FAIL_AFTER_CHECKS { + return Err(format!( + "intentional fail-fast trigger after {} capture checks", + self.checks + ) + .into()); + } + + Ok(()) + } + + async fn evaluate(&mut self, _ctx: &RunContext) -> Result<(), DynError> { + Ok(()) + } +} + +#[tokio::test] +#[ignore = "requires local node binary and open ports"] +async fn expectation_can_fail_fast_during_capture() -> Result<()> { + let _ = try_init(); + + let mut scenario = ScenarioBuilder::deployment_with(|topology| topology.with_node_count(1)) + .with_run_duration(Duration::from_secs(30)) + .with_expectation(FailFastDuringCaptureExpectation::default()) + .build()?; + + let deployer = LbcLocalDeployer::default(); + let runner = deployer.deploy(&scenario).await?; + + match runner.run(&mut scenario).await { + Err(ScenarioError::ExpectationFailedDuringCapture(_)) => Ok(()), + Err(other) => Err(anyhow!("unexpected scenario error: {other}")), + Ok(_) => Err(anyhow!("expected fail-fast capture error, run succeeded")), + } +} diff --git a/logos/infra/assets/stack/cfgsync.yaml b/logos/infra/assets/stack/cfgsync.yaml deleted file mode 100644 index 23852a4..0000000 --- a/logos/infra/assets/stack/cfgsync.yaml +++ /dev/null @@ -1,51 +0,0 @@ -port: 4400 -n_hosts: 4 -timeout: 10 -global_params_path: "/etc/logos/global_params" -# Optional: serve prebuilt configs from a bundle file. -# bundle_path: cfgsync.bundle.yaml - -# ConsensusConfig related parameters -security_param: 10 -active_slot_coeff: 0.9 -wallet: - accounts: [] - -# DaConfig related parameters -subnetwork_size: 2 -dispersal_factor: 2 -num_samples: 1 -num_subnets: 2 -old_blobs_check_interval: "5.0" -blobs_validity_duration: "60.0" -min_dispersal_peers: 1 -min_replication_peers: 1 -monitor_failure_time_window: "5.0" -balancer_interval: "5.0" -# Dispersal mempool publish strategy -mempool_publish_strategy: !SampleSubnetworks - sample_threshold: 2 - timeout: "2.0" - cooldown: "0.0001" - -replication_settings: - seen_message_cache_size: 204800 - seen_message_ttl: "900.0" -retry_shares_limit: 5 -retry_commitments_limit: 5 - -# Tracing -tracing_settings: - # Default to stdout so `docker logs` / `kubectl logs` shows node output. - # Switch to `!File` if you want per-node log files inside the container/pod. - logger: Stdout - # Disable OTLP traces to remove DNS errors; metrics stay enabled below. - tracing: None - filter: !EnvFilter - filters: - nomos: debug - cryptarchia: debug - logos_blockchain_chain_leader_service: debug - metrics: None - console: None - level: DEBUG diff --git a/logos/infra/assets/stack/scripts/run_logos.sh b/logos/infra/assets/stack/scripts/run_logos.sh index 229bcf2..06edebb 100755 --- a/logos/infra/assets/stack/scripts/run_logos.sh +++ b/logos/infra/assets/stack/scripts/run_logos.sh @@ -64,7 +64,7 @@ export CFG_FILE_PATH="/config.yaml" \ CFG_HOST_KIND="${CFG_HOST_KIND:-$role}" \ CFG_HOST_IDENTIFIER="${CFG_HOST_IDENTIFIER:-$host_identifier_default}" \ LOGOS_BLOCKCHAIN_TIME_BACKEND="${LOGOS_BLOCKCHAIN_TIME_BACKEND:-monotonic}" \ - LOG_LEVEL="${LOG_LEVEL:-INFO}"``" + LOG_LEVEL="${LOG_LEVEL:-INFO}" # Ensure recovery directory exists to avoid early crashes in services that # persist state. diff --git a/logos/runtime/ext/Cargo.toml b/logos/runtime/ext/Cargo.toml index 585e5d9..16b4f1d 100644 --- a/logos/runtime/ext/Cargo.toml +++ b/logos/runtime/ext/Cargo.toml @@ -17,8 +17,6 @@ testing-framework-runner-local = { workspace = true } # Logos / Nomos deps lb_http_api_common = { workspace = true } -lb_tracing = { workspace = true } -lb_tracing_service = { workspace = true } # External anyhow = "1" diff --git a/logos/runtime/ext/src/cfgsync/mod.rs b/logos/runtime/ext/src/cfgsync/mod.rs index 8271705..47c2842 100644 --- a/logos/runtime/ext/src/cfgsync/mod.rs +++ b/logos/runtime/ext/src/cfgsync/mod.rs @@ -1,16 +1,14 @@ -mod template; - -use std::path::Path; - use anyhow::Result; pub(crate) use cfgsync_runtime::render::CfgsyncOutputPaths; use cfgsync_runtime::{ bundle::build_cfgsync_bundle_with_hostnames, - render::{RenderedCfgsync, apply_timeout_floor, ensure_bundle_path, write_rendered_cfgsync}, + render::{ + CfgsyncConfigOverrides, RenderedCfgsync, ensure_bundle_path, + render_cfgsync_yaml_from_template, write_rendered_cfgsync, + }, }; -use lb_tracing::metrics::otlp::OtlpMetricsConfig; -use lb_tracing_service::MetricsLayer; use reqwest::Url; +use serde_yaml::{Mapping, Value}; use testing_framework_core::cfgsync::CfgsyncEnv; pub(crate) struct CfgsyncRenderOptions { @@ -21,16 +19,14 @@ pub(crate) struct CfgsyncRenderOptions { } pub(crate) fn render_cfgsync_from_template( - template_path: &Path, topology: &E::Deployment, hostnames: &[String], options: CfgsyncRenderOptions, ) -> Result { - let mut cfg = template::load_cfgsync_template(template_path)?; - apply_render_options::(&mut cfg, topology, options); - + let cfg = build_cfgsync_server_config(); + let overrides = build_overrides::(topology, options); + let config_yaml = render_cfgsync_yaml_from_template(cfg, &overrides)?; let bundle = build_cfgsync_bundle_with_hostnames::(topology, hostnames)?; - let config_yaml = serde_yaml::to_string(&cfg)?; let bundle_yaml = serde_yaml::to_string(&bundle)?; Ok(RenderedCfgsync { @@ -39,8 +35,22 @@ pub(crate) fn render_cfgsync_from_template( }) } +fn build_cfgsync_server_config() -> Value { + let mut root = Mapping::new(); + root.insert( + Value::String("port".to_string()), + Value::Number(4400_u64.into()), + ); + + root.insert( + Value::String("bundle_path".to_string()), + Value::String("cfgsync.bundle.yaml".to_string()), + ); + + Value::Mapping(root) +} + pub(crate) fn render_and_write_cfgsync_from_template( - template_path: &Path, topology: &E::Deployment, hostnames: &[String], mut options: CfgsyncRenderOptions, @@ -48,16 +58,16 @@ pub(crate) fn render_and_write_cfgsync_from_template( ) -> Result { ensure_bundle_path(&mut options.bundle_path, output.bundle_path); - let rendered = render_cfgsync_from_template::(template_path, topology, hostnames, options)?; + let rendered = render_cfgsync_from_template::(topology, hostnames, options)?; write_rendered_cfgsync(&rendered, output)?; + Ok(rendered) } -fn apply_render_options( - cfg: &mut template::CfgSyncConfig, +fn build_overrides( topology: &E::Deployment, options: CfgsyncRenderOptions, -) { +) -> CfgsyncConfigOverrides { let CfgsyncRenderOptions { port, bundle_path, @@ -65,21 +75,11 @@ fn apply_render_options( metrics_otlp_ingest_url, } = options; - if let Some(port) = port { - cfg.port = port; - } - - cfg.n_hosts = E::nodes(topology).len(); - cfg.bundle_path = bundle_path; - apply_metrics_endpoint(cfg, metrics_otlp_ingest_url); - apply_timeout_floor(&mut cfg.timeout, min_timeout_secs); -} - -fn apply_metrics_endpoint(cfg: &mut template::CfgSyncConfig, endpoint: Option) { - if let Some(endpoint) = endpoint { - cfg.tracing_settings.metrics = MetricsLayer::Otlp(OtlpMetricsConfig { - endpoint, - host_identifier: "node".into(), - }); + CfgsyncConfigOverrides { + port, + n_hosts: Some(E::nodes(topology).len()), + timeout_floor_secs: min_timeout_secs, + bundle_path, + metrics_otlp_ingest_url: metrics_otlp_ingest_url.map(|url| url.to_string()), } } diff --git a/logos/runtime/ext/src/cfgsync/template.rs b/logos/runtime/ext/src/cfgsync/template.rs deleted file mode 100644 index 4812101..0000000 --- a/logos/runtime/ext/src/cfgsync/template.rs +++ /dev/null @@ -1,26 +0,0 @@ -use std::{fs::File, path::Path}; - -use anyhow::{Context as _, Result}; -use lb_tracing_service::TracingSettings; -use serde::{Deserialize, Serialize}; -use tracing::debug; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CfgSyncConfig { - pub port: u16, - #[serde(default)] - pub n_hosts: usize, - pub timeout: u64, - #[serde(default)] - #[serde(skip_serializing_if = "Option::is_none")] - pub bundle_path: Option, - #[serde(default)] - pub tracing_settings: TracingSettings, -} - -pub fn load_cfgsync_template(path: &Path) -> Result { - debug!(path = %path.display(), "loading cfgsync template"); - let file = File::open(path) - .with_context(|| format!("opening cfgsync template at {}", path.display()))?; - serde_yaml::from_reader(file).context("parsing cfgsync template") -} diff --git a/logos/runtime/ext/src/compose_env.rs b/logos/runtime/ext/src/compose_env.rs index f2a2290..4fa3018 100644 --- a/logos/runtime/ext/src/compose_env.rs +++ b/logos/runtime/ext/src/compose_env.rs @@ -120,8 +120,8 @@ impl ComposeDeployEnv for LbcExtEnv { let bundle_path = cfgsync_bundle_path(path); let hostnames = topology_hostnames(topology); let options = cfgsync_render_options(port, metrics_otlp_ingest_url); + render_and_write_cfgsync_from_template::( - path, topology, &hostnames, options, diff --git a/logos/runtime/ext/src/k8s_env.rs b/logos/runtime/ext/src/k8s_env.rs index 667b83c..15b2dc9 100644 --- a/logos/runtime/ext/src/k8s_env.rs +++ b/logos/runtime/ext/src/k8s_env.rs @@ -183,7 +183,7 @@ pub fn prepare_assets( let tempdir = create_assets_tempdir()?; let (cfgsync_file, cfgsync_yaml, bundle_yaml) = - render_and_write_cfgsync(&root, topology, metrics_otlp_ingest_url, &tempdir)?; + render_and_write_cfgsync(topology, metrics_otlp_ingest_url, &tempdir)?; let scripts = validate_scripts(&root)?; let chart_path = helm_chart_path()?; let values_file = render_and_write_values(topology, &tempdir, &cfgsync_yaml, &bundle_yaml)?; @@ -346,7 +346,6 @@ fn create_assets_tempdir() -> Result { } fn render_and_write_cfgsync( - root: &Path, topology: &DeploymentPlan, metrics_otlp_ingest_url: Option<&Url>, tempdir: &TempDir, @@ -354,12 +353,12 @@ fn render_and_write_cfgsync( let cfgsync_file = tempdir.path().join("cfgsync.yaml"); let bundle_file = tempdir.path().join("cfgsync.bundle.yaml"); let (cfgsync_yaml, bundle_yaml) = render_cfgsync_config( - root, topology, metrics_otlp_ingest_url, &cfgsync_file, &bundle_file, )?; + Ok((cfgsync_file, cfgsync_yaml, bundle_yaml)) } @@ -378,17 +377,13 @@ fn testnet_image() -> String { } fn render_cfgsync_config( - root: &Path, topology: &DeploymentPlan, metrics_otlp_ingest_url: Option<&Url>, cfgsync_file: &Path, bundle_file: &Path, ) -> Result<(String, String), AssetsError> { - let cfgsync_template_path = cfgsync_template_path(root); - debug!(path = %cfgsync_template_path.display(), "loading cfgsync template"); let hostnames = k8s_node_hostnames(topology); let rendered = render_and_write_cfgsync_from_template::( - &cfgsync_template_path, topology, &hostnames, CfgsyncRenderOptions { @@ -407,10 +402,6 @@ fn render_cfgsync_config( Ok((rendered.config_yaml, rendered.bundle_yaml)) } -fn cfgsync_template_path(root: &Path) -> PathBuf { - stack_assets_root(root).join("cfgsync.yaml") -} - fn k8s_node_hostnames(topology: &DeploymentPlan) -> Vec { topology .nodes() @@ -517,15 +508,6 @@ pub fn workspace_root() -> AnyhowResult { )) } -fn stack_assets_root(root: &Path) -> PathBuf { - if let Some(override_dir) = assets_override_dir(root) - && override_dir.exists() - { - return override_dir; - } - root.join(DEFAULT_ASSETS_STACK_DIR) -} - fn stack_scripts_root(root: &Path) -> PathBuf { if let Some(scripts) = override_scripts_dir(root) && scripts.exists() diff --git a/logos/runtime/ext/src/lib.rs b/logos/runtime/ext/src/lib.rs index 49a7b8c..177823b 100644 --- a/logos/runtime/ext/src/lib.rs +++ b/logos/runtime/ext/src/lib.rs @@ -12,7 +12,8 @@ pub use scenario::{ ScenarioBuilderWith, }; use testing_framework_core::scenario::{ - Application, DynError, ExternalNodeSource, FeedRuntime, RunContext, StartNodeOptions, + Application, DynError, ExternalNodeSource, FeedRuntime, NodeClients, RunContext, + StartNodeOptions, }; use testing_framework_runner_local::{ BuiltNodeConfig, LocalDeployerEnv, NodeConfigEntry, @@ -48,9 +49,12 @@ impl Application for LbcExtEnv { } async fn prepare_feed( - client: Self::NodeClient, + node_clients: NodeClients, ) -> Result<(::Feed, Self::FeedRuntime), DynError> { - ::prepare_feed(client).await + let clients = node_clients.snapshot(); + let upstream_clients = NodeClients::::new(clients); + + ::prepare_feed(upstream_clients).await } } @@ -60,6 +64,10 @@ impl LbcBlockFeedEnv for LbcExtEnv { fn block_feed_subscription(ctx: &RunContext) -> broadcast::Receiver> { ctx.feed().subscribe() } + + fn block_feed(ctx: &RunContext) -> BlockFeed { + ctx.feed() + } } #[async_trait] diff --git a/scripts/checks/check-node-rev-sync.sh b/scripts/checks/check-node-rev-sync.sh new file mode 100644 index 0000000..db46e87 --- /dev/null +++ b/scripts/checks/check-node-rev-sync.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env sh +set -eu + +repo_root="$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)" +versions_env="${repo_root}/versions.env" +cargo_toml="${repo_root}/Cargo.toml" +logos_git='https://github.com/logos-blockchain/logos-blockchain.git' + +env_rev="$(grep -E '^LOGOS_BLOCKCHAIN_NODE_REV=[0-9a-f]{40}$' "$versions_env" | head -n1 | cut -d= -f2 || true)" +if [ -z "$env_rev" ]; then + echo "node-rev-sync check failed: LOGOS_BLOCKCHAIN_NODE_REV is missing or invalid in versions.env" >&2 + exit 1 +fi + +cargo_revs="$( + grep -oE "git *= *\"${logos_git}\" *, *rev *= *\"[0-9a-f]{40}\"" "$cargo_toml" \ + | sed -E 's/.*rev *= *"([0-9a-f]{40})"/\1/' \ + | sort -u +)" + +if [ -z "$cargo_revs" ]; then + echo "node-rev-sync check failed: no logos-blockchain git rev found in Cargo.toml" >&2 + exit 1 +fi + +rev_count="$(printf '%s\n' "$cargo_revs" | wc -l | tr -d ' ')" +if [ "$rev_count" -ne 1 ]; then + echo "node-rev-sync check failed: multiple logos-blockchain revs found in Cargo.toml:" >&2 + printf ' %s\n' "$cargo_revs" >&2 + exit 1 +fi + +cargo_rev="$(printf '%s\n' "$cargo_revs")" +if [ "$env_rev" != "$cargo_rev" ]; then + echo "node-rev-sync check failed:" >&2 + echo " versions.env LOGOS_BLOCKCHAIN_NODE_REV: $env_rev" >&2 + echo " Cargo.toml logos-blockchain rev: $cargo_rev" >&2 + echo " Fix: set LOGOS_BLOCKCHAIN_NODE_REV to match Cargo.toml." >&2 + exit 1 +fi diff --git a/testing-framework/core/src/env.rs b/testing-framework/core/src/env.rs index e7ad9d6..139f53b 100644 --- a/testing-framework/core/src/env.rs +++ b/testing-framework/core/src/env.rs @@ -3,7 +3,7 @@ use std::io; use async_trait::async_trait; use crate::{ - scenario::{DynError, ExternalNodeSource, FeedRuntime}, + scenario::{DynError, ExternalNodeSource, FeedRuntime, NodeClients}, topology::DeploymentDescriptor, }; @@ -26,6 +26,8 @@ pub trait Application: Send + Sync + 'static { } async fn prepare_feed( - client: Self::NodeClient, - ) -> Result<(::Feed, Self::FeedRuntime), DynError>; + node_clients: NodeClients, + ) -> Result<(::Feed, Self::FeedRuntime), DynError> + where + Self: Sized; } diff --git a/testing-framework/core/src/scenario/expectation.rs b/testing-framework/core/src/scenario/expectation.rs index c304582..f70f011 100644 --- a/testing-framework/core/src/scenario/expectation.rs +++ b/testing-framework/core/src/scenario/expectation.rs @@ -19,5 +19,12 @@ pub trait Expectation: Send + Sync { Ok(()) } + /// Optional periodic check used by fail-fast expectation mode. + /// + /// Default is a no-op so existing expectations stay end-of-run only. + async fn check_during_capture(&mut self, _ctx: &RunContext) -> Result<(), DynError> { + Ok(()) + } + async fn evaluate(&mut self, ctx: &RunContext) -> Result<(), DynError>; } diff --git a/testing-framework/core/src/scenario/runtime/deployer.rs b/testing-framework/core/src/scenario/runtime/deployer.rs index 0151327..d6ee181 100644 --- a/testing-framework/core/src/scenario/runtime/deployer.rs +++ b/testing-framework/core/src/scenario/runtime/deployer.rs @@ -10,6 +10,8 @@ pub enum ScenarioError { Workload(#[source] DynError), #[error("expectation capture failed: {0}")] ExpectationCapture(#[source] DynError), + #[error("expectation failed during capture: {0}")] + ExpectationFailedDuringCapture(#[source] DynError), #[error("expectations failed:\n{0}")] Expectations(#[source] DynError), } diff --git a/testing-framework/core/src/scenario/runtime/mod.rs b/testing-framework/core/src/scenario/runtime/mod.rs index 9f5f415..7e0804f 100644 --- a/testing-framework/core/src/scenario/runtime/mod.rs +++ b/testing-framework/core/src/scenario/runtime/mod.rs @@ -64,9 +64,9 @@ impl CleanupGuard for FeedHandle { /// Spawn a background task that drives the environment-provided feed. pub async fn spawn_feed( - client: E::NodeClient, + node_clients: NodeClients, ) -> Result<(::Feed, FeedHandle), DynError> { - let (feed, worker) = E::prepare_feed(client).await?; + let (feed, worker) = E::prepare_feed(node_clients).await?; let handle = tokio::spawn(async move { Box::new(worker).run().await; diff --git a/testing-framework/core/src/scenario/runtime/runner.rs b/testing-framework/core/src/scenario/runtime/runner.rs index c1502d0..bcc453b 100644 --- a/testing-framework/core/src/scenario/runtime/runner.rs +++ b/testing-framework/core/src/scenario/runtime/runner.rs @@ -1,14 +1,15 @@ use std::{any::Any, future::Future, panic::AssertUnwindSafe, sync::Arc, time::Duration}; -use futures::{FutureExt as _, future}; +use futures::FutureExt as _; use tokio::{ task::{JoinError, JoinSet}, - time::{sleep, timeout}, + time::{Interval, interval, sleep}, }; +use tracing::{debug, info, warn}; use super::deployer::ScenarioError; use crate::scenario::{ - Application, DynError, Expectation, Scenario, + Application, DynError, Expectation, Scenario, Workload, runtime::context::{CleanupGuard, RunContext, RunHandle}, }; @@ -17,6 +18,7 @@ type WorkloadOutcome = Result<(), DynError>; const MIN_NODE_CONTROL_COOLDOWN: Duration = Duration::from_secs(30); const DEFAULT_BLOCK_FEED_SETTLE_WAIT: Duration = Duration::from_secs(1); const MIN_BLOCK_FEED_SETTLE_WAIT: Duration = Duration::from_secs(2); +const EXPECTATION_CAPTURE_CHECK_INTERVAL: Duration = Duration::from_secs(1); const UNKNOWN_PANIC: &str = ""; /// Represents a fully prepared environment capable of executing a scenario. @@ -60,6 +62,16 @@ impl Runner { Caps: Send + Sync, { let context = self.context(); + let run_duration = scenario.duration(); + let workloads = scenario.workloads().to_vec(); + let expectation_count = scenario.expectations().len(); + + info!( + run_secs = run_duration.as_secs(), + workloads = workloads.len(), + expectations = expectation_count, + "runner starting scenario execution" + ); self.run_step(Self::prepare_expectations( scenario.expectations_mut(), @@ -67,8 +79,13 @@ impl Runner { )) .await?; - self.run_step(Self::run_workloads(Arc::clone(&context), scenario)) - .await?; + self.run_step(Self::run_workload_phase( + Arc::clone(&context), + &workloads, + run_duration, + scenario.expectations_mut(), + )) + .await?; Self::settle_before_expectations(context.as_ref()).await; @@ -78,6 +95,8 @@ impl Runner { )) .await?; + info!("runner finished scenario execution"); + Ok(self.into_run_handle()) } @@ -108,32 +127,46 @@ impl Runner { Ok(()) } - async fn run_workloads( + async fn run_workload_phase( context: Arc>, - scenario: &Scenario, - ) -> Result<(), ScenarioError> - where - Caps: Send + Sync, - { - if scenario.workloads().is_empty() { - return idle_until_duration(scenario.duration()).await; + workloads: &[Arc>], + duration: Duration, + expectations: &mut [Box>], + ) -> Result<(), ScenarioError> { + info!( + workloads = workloads.len(), + run_secs = duration.as_secs(), + "runner workload phase started" + ); + + if workloads.is_empty() { + Self::run_idle_window_with_capture_checks(duration, expectations, context.as_ref()) + .await?; + + info!("runner workload phase completed (idle)"); + + return Ok(()); } - let mut workloads = Self::spawn_workloads(scenario, Arc::clone(&context)); - Self::run_workload_window(&mut workloads, scenario.duration()).await?; + let mut running = Self::spawn_workloads(workloads, Arc::clone(&context)); + + Self::run_window_until_timeout(&mut running, duration, expectations, context.as_ref()) + .await?; if let Some(cooldown) = nonzero_cooldown(Self::cooldown_duration(context.as_ref())) { - Self::run_workload_window(&mut workloads, cooldown).await?; + info!( + cooldown_secs = cooldown.as_secs(), + "runner cooldown window started" + ); + + Self::run_window_until_timeout(&mut running, cooldown, expectations, context.as_ref()) + .await?; } - Self::drain_workloads(&mut workloads).await - } + Self::drain_workloads(&mut running).await?; + + info!("runner workload phase completed"); - async fn run_workload_window( - workloads: &mut JoinSet, - duration: Duration, - ) -> Result<(), ScenarioError> { - let _completed = Self::drive_until_timer(workloads, duration).await?; Ok(()) } @@ -203,19 +236,16 @@ impl Runner { } /// Spawn each workload in its own task. - fn spawn_workloads( - scenario: &Scenario, + fn spawn_workloads( + workloads: &[Arc>], context: Arc>, - ) -> JoinSet - where - Caps: Send + Sync, - { - let mut workloads = JoinSet::new(); - for workload in scenario.workloads() { + ) -> JoinSet { + let mut running = JoinSet::new(); + for workload in workloads { let workload = Arc::clone(workload); let ctx = Arc::clone(&context); - workloads.spawn(async move { + running.spawn(async move { // Convert panics into workload errors so the runner can report // them instead of aborting the process. let outcome = AssertUnwindSafe(async { workload.start(ctx.as_ref()).await }) @@ -228,29 +258,87 @@ impl Runner { }); } - workloads + running } /// Drive workload tasks until timeout or failure. - async fn drive_until_timer( + async fn run_window_until_timeout( workloads: &mut JoinSet, duration: Duration, - ) -> Result { - let run_future = async { - while let Some(result) = workloads.join_next().await { - Self::map_join_result(result)?; + expectations: &mut [Box>], + context: &RunContext, + ) -> Result<(), ScenarioError> { + if duration.is_zero() { + return Ok(()); + } + + let timer = sleep(duration); + tokio::pin!(timer); + let mut capture_tick = capture_check_interval(); + + loop { + tokio::select! { + _ = &mut timer => return Ok(()), + _ = capture_tick.tick() => { + Self::run_capture_checks(expectations, context).await?; + } + result = workloads.join_next(), if !workloads.is_empty() => { + let Some(result) = result else { + return Ok(()); + }; + + Self::map_join_result(result)?; + + if workloads.is_empty() { + return Ok(()); + } + } } + } + } - Ok(()) - }; + async fn run_capture_checks( + expectations: &mut [Box>], + context: &RunContext, + ) -> Result<(), ScenarioError> { + let expectation_count = expectations.len(); - match timeout(duration, run_future).await { - Ok(result) => { - result?; - Ok(true) + for expectation in expectations { + if let Err(source) = expectation.check_during_capture(context).await { + warn!(expectation = expectation.name(), %source, "expectation failed during capture"); + + return Err(capture_check_failure(expectation.name(), source)); } + } - Err(_) => Ok(false), + debug!( + expectations = expectation_count, + "expectation capture check pass" + ); + + Ok(()) + } + + async fn run_idle_window_with_capture_checks( + duration: Duration, + expectations: &mut [Box>], + context: &RunContext, + ) -> Result<(), ScenarioError> { + if duration.is_zero() { + return Ok(()); + } + + let timer = sleep(duration); + tokio::pin!(timer); + let mut capture_tick = capture_check_interval(); + + loop { + tokio::select! { + _ = &mut timer => return Ok(()), + _ = capture_tick.tick() => { + Self::run_capture_checks(expectations, context).await?; + } + } } } @@ -274,19 +362,14 @@ impl Runner { } } -async fn idle_until_duration(duration: Duration) -> Result<(), ScenarioError> { - if duration.is_zero() { - return Ok(()); - } - - let _ = timeout(duration, async { future::pending::<()>().await }).await; - Ok(()) -} - fn nonzero_cooldown(cooldown: Option) -> Option { cooldown.filter(|duration| !duration.is_zero()) } +fn capture_check_interval() -> Interval { + interval(EXPECTATION_CAPTURE_CHECK_INTERVAL) +} + fn panic_message(panic: Box) -> String { panic .downcast_ref::<&str>() @@ -295,6 +378,10 @@ fn panic_message(panic: Box) -> String { .unwrap_or_else(|| UNKNOWN_PANIC.to_owned()) } +fn capture_check_failure(expectation: &str, source: DynError) -> ScenarioError { + ScenarioError::ExpectationFailedDuringCapture(format!("{expectation}: {source}").into()) +} + fn expectation_failure_summary(failures: Vec<(String, DynError)>) -> String { failures .into_iter() diff --git a/testing-framework/deployers/compose/src/lifecycle/block_feed.rs b/testing-framework/deployers/compose/src/lifecycle/block_feed.rs index 3898d2b..ff72aae 100644 --- a/testing-framework/deployers/compose/src/lifecycle/block_feed.rs +++ b/testing-framework/deployers/compose/src/lifecycle/block_feed.rs @@ -20,16 +20,14 @@ async fn spawn_block_feed_with( ), ComposeRunnerError, > { - debug!( - nodes = node_clients.len(), - "selecting node client for block feed" - ); + let node_count = node_clients.len(); + debug!(nodes = node_count, "starting compose block feed"); - let block_source_client = node_clients - .random_client() - .ok_or(ComposeRunnerError::BlockFeedMissing)?; + if node_count == 0 { + return Err(ComposeRunnerError::BlockFeedMissing); + } - spawn_feed::(block_source_client) + spawn_feed::(node_clients.clone()) .await .map_err(|source| ComposeRunnerError::BlockFeed { source }) } diff --git a/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs b/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs index 554a7fd..d50351e 100644 --- a/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs +++ b/testing-framework/deployers/k8s/src/lifecycle/block_feed.rs @@ -14,17 +14,15 @@ pub async fn spawn_block_feed_with( ), K8sRunnerError, > { - debug!( - nodes = node_clients.len(), - "selecting node client for block feed" - ); + let node_count = node_clients.len(); + debug!(nodes = node_count, "starting k8s block feed"); - let block_source_client = node_clients - .random_client() - .ok_or(K8sRunnerError::BlockFeedMissing)?; + if node_count == 0 { + return Err(K8sRunnerError::BlockFeedMissing); + } info!("starting block feed"); - spawn_feed::(block_source_client) + spawn_feed::(node_clients.clone()) .await .map_err(|source| K8sRunnerError::BlockFeed { source }) } diff --git a/testing-framework/deployers/local/src/deployer/orchestrator.rs b/testing-framework/deployers/local/src/deployer/orchestrator.rs index a365348..28cc01f 100644 --- a/testing-framework/deployers/local/src/deployer/orchestrator.rs +++ b/testing-framework/deployers/local/src/deployer/orchestrator.rs @@ -135,9 +135,9 @@ impl From for ProcessDeployerError { fn from(value: ScenarioError) -> Self { match value { ScenarioError::Workload(source) => Self::WorkloadFailed { source }, - ScenarioError::ExpectationCapture(source) | ScenarioError::Expectations(source) => { - Self::ExpectationsFailed { source } - } + ScenarioError::ExpectationCapture(source) + | ScenarioError::ExpectationFailedDuringCapture(source) + | ScenarioError::Expectations(source) => Self::ExpectationsFailed { source }, } } } @@ -444,20 +444,18 @@ fn keep_tempdir(policy: DeploymentPolicy) -> bool { async fn spawn_feed_with( node_clients: &NodeClients, ) -> Result<(::Feed, FeedHandle), ProcessDeployerError> { - debug!( - nodes = node_clients.len(), - "selecting node client for local feed" - ); + let node_count = node_clients.len(); + debug!(nodes = node_count, "starting local feed"); - let Some(block_source_client) = node_clients.random_client() else { + if node_count == 0 { return Err(ProcessDeployerError::WorkloadFailed { source: "feed requires at least one node".into(), }); - }; + } info!("starting feed"); - spawn_feed::(block_source_client) + spawn_feed::(node_clients.clone()) .await .map_err(workload_error) } diff --git a/testing-framework/deployers/local/src/env.rs b/testing-framework/deployers/local/src/env.rs index 701cc23..2af7d06 100644 --- a/testing-framework/deployers/local/src/env.rs +++ b/testing-framework/deployers/local/src/env.rs @@ -112,7 +112,7 @@ mod tests { use async_trait::async_trait; use testing_framework_core::{ - scenario::{Application, DynError, Feed, FeedRuntime}, + scenario::{Application, DynError, Feed, FeedRuntime, NodeClients}, topology::DeploymentDescriptor, }; @@ -160,7 +160,7 @@ mod tests { type FeedRuntime = DummyFeedRuntime; async fn prepare_feed( - _client: Self::NodeClient, + _node_clients: NodeClients, ) -> Result<(::Feed, Self::FeedRuntime), DynError> { Ok((DummyFeed, DummyFeedRuntime)) diff --git a/testing-framework/tools/cfgsync-runtime/src/render.rs b/testing-framework/tools/cfgsync-runtime/src/render.rs index 105e6ca..0f59b5c 100644 --- a/testing-framework/tools/cfgsync-runtime/src/render.rs +++ b/testing-framework/tools/cfgsync-runtime/src/render.rs @@ -1,6 +1,7 @@ use std::{fs, path::Path}; -use anyhow::Result; +use anyhow::{Context as _, Result}; +use serde_yaml::{Mapping, Value}; #[derive(Debug, Clone)] pub struct RenderedCfgsync { @@ -42,3 +43,100 @@ pub fn write_rendered_cfgsync( fs::write(output.bundle_path, &rendered.bundle_yaml)?; Ok(()) } + +#[derive(Debug, Clone, Default)] +pub struct CfgsyncConfigOverrides { + pub port: Option, + pub n_hosts: Option, + pub timeout_floor_secs: Option, + pub bundle_path: Option, + pub metrics_otlp_ingest_url: Option, +} + +pub fn load_cfgsync_template_yaml(path: &Path) -> Result { + let file = fs::File::open(path) + .with_context(|| format!("opening cfgsync template at {}", path.display()))?; + serde_yaml::from_reader(file).context("parsing cfgsync template") +} + +pub fn render_cfgsync_yaml_from_template( + mut template: Value, + overrides: &CfgsyncConfigOverrides, +) -> Result { + apply_cfgsync_overrides(&mut template, overrides)?; + serde_yaml::to_string(&template).context("serializing rendered cfgsync config") +} + +pub fn apply_cfgsync_overrides( + template: &mut Value, + overrides: &CfgsyncConfigOverrides, +) -> Result<()> { + let root = mapping_mut(template)?; + + if let Some(port) = overrides.port { + root.insert( + Value::String("port".to_string()), + serde_yaml::to_value(port)?, + ); + } + + if let Some(n_hosts) = overrides.n_hosts { + root.insert( + Value::String("n_hosts".to_string()), + serde_yaml::to_value(n_hosts)?, + ); + } + + if let Some(bundle_path) = &overrides.bundle_path { + root.insert( + Value::String("bundle_path".to_string()), + Value::String(bundle_path.clone()), + ); + } + + if let Some(timeout_floor_secs) = overrides.timeout_floor_secs { + let timeout_key = Value::String("timeout".to_string()); + let timeout_value = root + .get(&timeout_key) + .and_then(Value::as_u64) + .unwrap_or(timeout_floor_secs) + .max(timeout_floor_secs); + root.insert(timeout_key, serde_yaml::to_value(timeout_value)?); + } + + if let Some(endpoint) = &overrides.metrics_otlp_ingest_url { + let tracing_settings = nested_mapping_mut(root, "tracing_settings"); + tracing_settings.insert( + Value::String("metrics".to_string()), + parse_otlp_metrics_layer(endpoint)?, + ); + } + + Ok(()) +} + +fn mapping_mut(value: &mut Value) -> Result<&mut Mapping> { + value + .as_mapping_mut() + .context("cfgsync template root must be a YAML map") +} + +fn nested_mapping_mut<'a>(mapping: &'a mut Mapping, key: &str) -> &'a mut Mapping { + let key = Value::String(key.to_string()); + let entry = mapping + .entry(key) + .or_insert_with(|| Value::Mapping(Mapping::new())); + + if !entry.is_mapping() { + *entry = Value::Mapping(Mapping::new()); + } + + entry + .as_mapping_mut() + .expect("mapping entry should always be a mapping") +} + +fn parse_otlp_metrics_layer(endpoint: &str) -> Result { + let yaml = format!("!Otlp\nendpoint: \"{endpoint}\"\nhost_identifier: \"node\"\n"); + serde_yaml::from_str(&yaml).context("building metrics OTLP layer") +} diff --git a/versions.env b/versions.env index bd56449..6763fb2 100644 --- a/versions.env +++ b/versions.env @@ -1,7 +1,7 @@ VERSION=v0.4.1 LOGOS_BLOCKCHAIN_BUNDLE_VERSION=v4 # Pinned logos-blockchain-node revision used for CI builds and binary bundles. -LOGOS_BLOCKCHAIN_NODE_REV=41ea1e3082526bb271e655cddb95a5b448e7de20 +LOGOS_BLOCKCHAIN_NODE_REV=5ebe88a6e89ec6d7dd89e123c46f6b26dd1e4667 # Local logos-blockchain-node checkout override. # LOGOS_BLOCKCHAIN_NODE_PATH=