diff --git a/Cargo.Bazel.Fuzzing.json.lock b/Cargo.Bazel.Fuzzing.json.lock index 69b1933e477..8fb8fc65acd 100644 --- a/Cargo.Bazel.Fuzzing.json.lock +++ b/Cargo.Bazel.Fuzzing.json.lock @@ -1,5 +1,5 @@ { - "checksum": "12261e4e43785de1ae9b245dee18085d41c7b97556016ba5e1b71191acea6117", + "checksum": "83fe54506d70571bc78b225d938b614a57ef3cec26747b3b0b49650297ead5b3", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -5616,6 +5616,12 @@ ], "selects": {} }, + "crate_features": { + "common": [ + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -6050,6 +6056,8 @@ "common": [ "alloc", "std" + "alloc", + "std" ], "selects": {} }, @@ -6992,14 +7000,18 @@ ], "license_file": null }, + "bitcoin 0.32.5": { "bitcoin 0.32.5": { "name": "bitcoin", "version": "0.32.5", + "version": "0.32.5", "package_url": "https://github.com/rust-bitcoin/rust-bitcoin/", "repository": { "Http": { "url": "https://static.crates.io/crates/bitcoin/0.32.5/download", "sha256": "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" + "url": "https://static.crates.io/crates/bitcoin/0.32.5/download", + "sha256": "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" } }, "targets": [ @@ -7045,6 +7057,18 @@ ], "selects": {} }, + "crate_features": { + "common": [ + "actual-serde", + "default", + "rand", + "rand-std", + "secp-recovery", + "serde", + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -7057,6 +7081,7 @@ "target": "bech32" }, { + "id": "bitcoin 0.32.5", "id": "bitcoin 0.32.5", "target": "build_script_build" }, @@ -7093,6 +7118,11 @@ "id": "secp256k1 0.29.0", "target": "secp256k1" }, + { + "id": "serde 1.0.217", + "target": "serde", + "alias": "actual_serde" + }, { "id": "serde 1.0.217", "target": "serde", @@ -7124,6 +7154,7 @@ "selects": {} }, "version": "0.32.5" + "version": "0.32.5" }, "build_script_attrs": { "compile_data_glob": [ @@ -7186,6 +7217,9 @@ "default", "serde", "std" + "default", + "serde", + "std" ], "selects": {} }, @@ -7195,6 +7229,10 @@ "id": "bitcoin-internals 0.3.0", "target": "build_script_build" }, + { + "id": "serde 1.0.217", + "target": "serde" + }, { "id": "serde 1.0.217", "target": "serde" @@ -7252,6 +7290,8 @@ "common": [ "alloc", "std" + "alloc", + "std" ], "selects": {} }, @@ -7373,6 +7413,9 @@ "alloc", "serde", "std" + "alloc", + "serde", + "std" ], "selects": {} }, @@ -7383,6 +7426,10 @@ "target": "bitcoin_internals", "alias": "internals" }, + { + "id": "serde 1.0.217", + "target": "serde" + }, { "id": "serde 1.0.217", "target": "serde" @@ -7549,6 +7596,9 @@ "io", "serde", "std" + "io", + "serde", + "std" ], "selects": {} }, @@ -7563,6 +7613,10 @@ "target": "hex_conservative", "alias": "hex" }, + { + "id": "serde 1.0.217", + "target": "serde" + }, { "id": "serde 1.0.217", "target": "serde" @@ -7579,14 +7633,18 @@ ], "license_file": null }, + "bitcoincore-rpc 0.19.0": { "bitcoincore-rpc 0.19.0": { "name": "bitcoincore-rpc", "version": "0.19.0", + "version": "0.19.0", "package_url": "https://github.com/rust-bitcoin/rust-bitcoincore-rpc/", "repository": { "Http": { "url": "https://static.crates.io/crates/bitcoincore-rpc/0.19.0/download", "sha256": "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" + "url": "https://static.crates.io/crates/bitcoincore-rpc/0.19.0/download", + "sha256": "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" } }, "targets": [ @@ -7615,13 +7673,22 @@ ], "selects": {} }, + "crate_features": { + "common": [ + "default", + "rand" + ], + "selects": {} + }, "deps": { "common": [ { + "id": "bitcoincore-rpc-json 0.19.0", "id": "bitcoincore-rpc-json 0.19.0", "target": "bitcoincore_rpc_json" }, { + "id": "jsonrpc 0.18.0", "id": "jsonrpc 0.18.0", "target": "jsonrpc" }, @@ -7642,6 +7709,8 @@ }, "edition": "2018", "version": "0.19.0" + "edition": "2018", + "version": "0.19.0" }, "license": "CC0-1.0", "license_ids": [ @@ -7649,14 +7718,18 @@ ], "license_file": "LICENSE" }, + "bitcoincore-rpc-json 0.19.0": { "bitcoincore-rpc-json 0.19.0": { "name": "bitcoincore-rpc-json", "version": "0.19.0", + "version": "0.19.0", "package_url": "https://github.com/rust-bitcoin/rust-bitcoincore-rpc/", "repository": { "Http": { "url": "https://static.crates.io/crates/bitcoincore-rpc-json/0.19.0/download", "sha256": "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" + "url": "https://static.crates.io/crates/bitcoincore-rpc-json/0.19.0/download", + "sha256": "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" } }, "targets": [ @@ -7685,9 +7758,17 @@ ], "selects": {} }, + "crate_features": { + "common": [ + "default", + "rand" + ], + "selects": {} + }, "deps": { "common": [ { + "id": "bitcoin 0.32.5", "id": "bitcoin 0.32.5", "target": "bitcoin" }, @@ -7704,6 +7785,8 @@ }, "edition": "2021", "version": "0.19.0" + "edition": "2021", + "version": "0.19.0" }, "license": "CC0-1.0", "license_ids": [ @@ -18517,12 +18600,17 @@ "id": "bitcoin 0.28.2", "target": "bitcoin", "alias": "bitcoin_0_28" + "target": "bitcoin", + "alias": "bitcoin_0_28" }, { "id": "bitcoin 0.32.5", "target": "bitcoin" + "id": "bitcoin 0.32.5", + "target": "bitcoin" }, { + "id": "bitcoincore-rpc 0.19.0", "id": "bitcoincore-rpc 0.19.0", "target": "bitcoincore_rpc" }, @@ -27421,6 +27509,8 @@ "common": [ "alloc", "std" + "alloc", + "std" ], "selects": {} }, @@ -36386,11 +36476,16 @@ "license_ids": [], "license_file": "LICENSE" }, + "jsonrpc 0.13.0": { "jsonrpc 0.13.0": { "name": "jsonrpc", "version": "0.13.0", + "version": "0.13.0", "package_url": "https://github.com/apoelstra/rust-jsonrpc/", "repository": { + "Http": { + "url": "https://static.crates.io/crates/jsonrpc/0.13.0/download", + "sha256": "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" "Http": { "url": "https://static.crates.io/crates/jsonrpc/0.13.0/download", "sha256": "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" @@ -36443,6 +36538,7 @@ }, "edition": "2018", "version": "0.13.0" + "version": "0.13.0" }, "license": "CC0-1.0", "license_ids": [ @@ -36450,14 +36546,18 @@ ], "license_file": "LICENSE" }, + "jsonrpc 0.18.0": { "jsonrpc 0.18.0": { "name": "jsonrpc", "version": "0.18.0", + "version": "0.18.0", "package_url": "https://github.com/apoelstra/rust-jsonrpc/", "repository": { "Http": { "url": "https://static.crates.io/crates/jsonrpc/0.18.0/download", "sha256": "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" + "url": "https://static.crates.io/crates/jsonrpc/0.18.0/download", + "sha256": "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" } }, "targets": [ @@ -36485,6 +36585,8 @@ "default", "minreq", "minreq_http", + "minreq", + "minreq_http", "simple_http", "simple_tcp" ], @@ -36500,6 +36602,10 @@ "id": "minreq 2.13.0", "target": "minreq" }, + { + "id": "minreq 2.13.0", + "target": "minreq" + }, { "id": "serde 1.0.217", "target": "serde" @@ -36513,6 +36619,7 @@ }, "edition": "2018", "version": "0.18.0" + "version": "0.18.0" }, "license": "CC0-1.0", "license_ids": [ @@ -42061,6 +42168,93 @@ ], "license_file": null }, + "minreq 2.13.0": { + "name": "minreq", + "version": "2.13.0", + "package_url": "https://github.com/neonmoe/minreq", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/minreq/2.13.0/download", + "sha256": "36a8e50e917e18a37d500d27d40b7bc7d127e71c0c94fb2d83f43b4afd308390" + } + }, + "targets": [ + { + "Library": { + "crate_name": "minreq", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "minreq", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "json-using-serde", + "serde", + "serde_json" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "log 0.4.20", + "target": "log" + }, + { + "id": "minreq 2.13.0", + "target": "build_script_build" + }, + { + "id": "serde 1.0.217", + "target": "serde" + }, + { + "id": "serde_json 1.0.132", + "target": "serde_json" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "2.13.0" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "ISC", + "license_ids": [ + "ISC" + ], + "license_file": null + }, "mio 0.8.10": { "name": "mio", "version": "0.8.10", @@ -63985,6 +64179,12 @@ "recovery", "serde", "std" + "hashes", + "rand", + "rand-std", + "recovery", + "serde", + "std" ], "selects": {} }, @@ -63999,10 +64199,18 @@ "id": "rand 0.8.5", "target": "rand" }, + { + "id": "rand 0.8.5", + "target": "rand" + }, { "id": "secp256k1-sys 0.10.0", "target": "secp256k1_sys" }, + { + "id": "serde 1.0.217", + "target": "serde" + }, { "id": "serde 1.0.217", "target": "serde" @@ -64234,6 +64442,9 @@ "alloc", "recovery", "std" + "alloc", + "recovery", + "std" ], "selects": {} }, @@ -87765,6 +87976,8 @@ "bitcoin 0.28.2", "bitcoin 0.32.5", "bitcoincore-rpc 0.19.0", + "bitcoin 0.32.5", + "bitcoincore-rpc 0.19.0", "bitcoind 0.32.0", "bitflags 1.3.2", "bs58 0.5.0", @@ -88082,4 +88295,11 @@ "source": "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" } ] + "unused_patches": [ + { + "name": "jsonrpc", + "version": "0.12.1", + "source": "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" + } + ] } diff --git a/Cargo.lock b/Cargo.lock index 431e8abd5cb..af83262f8ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -301,6 +301,7 @@ dependencies = [ "cfg-if 1.0.0", "http 1.2.0", "indexmap 2.7.1", + "indexmap 2.7.1", "schemars", "serde", "serde_json", @@ -1235,6 +1236,7 @@ dependencies = [ "hex_lit", "secp256k1 0.29.1", "serde", + "serde", ] [[package]] @@ -1245,6 +1247,9 @@ checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" dependencies = [ "serde", ] +dependencies = [ + "serde", +] [[package]] name = "bitcoin-io" @@ -1266,6 +1271,7 @@ checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2" dependencies = [ "bitcoin-internals", "serde", + "serde", ] [[package]] @@ -1293,16 +1299,20 @@ dependencies = [ "bitcoin-io", "hex-conservative", "serde", + "serde", ] [[package]] name = "bitcoincore-rpc" version = "0.19.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" +checksum = "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" dependencies = [ "bitcoincore-rpc-json", "jsonrpc 0.18.0", + "jsonrpc 0.18.0", "log", "serde", "serde_json", @@ -1311,9 +1321,12 @@ dependencies = [ [[package]] name = "bitcoincore-rpc-json" version = "0.19.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" +checksum = "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" dependencies = [ + "bitcoin 0.32.5", "bitcoin 0.32.5", "serde", "serde_json", @@ -1390,8 +1403,10 @@ dependencies = [ [[package]] name = "borsh" version = "1.5.5" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" +checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" dependencies = [ "borsh-derive", "cfg_aliases", @@ -1400,8 +1415,10 @@ dependencies = [ [[package]] name = "borsh-derive" version = "1.5.5" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" +checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" dependencies = [ "once_cell", "proc-macro-crate", @@ -1435,8 +1452,10 @@ dependencies = [ [[package]] name = "brotli-decompressor" version = "4.0.2" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" +checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1714,6 +1733,7 @@ dependencies = [ "anyhow", "bytes", "clap 4.5.27", + "clap 4.5.27", "futures-util", "http 1.2.0", "http-body 1.0.1", @@ -1953,6 +1973,7 @@ dependencies = [ "certificate_orchestrator_interface", "chacha20poly1305", "clap 4.5.27", + "clap 4.5.27", "cloudflare 0.12.0 (git+https://github.com/dfinity/cloudflare-rs.git?rev=a6538a036926bd756986c9c0a5de356daef48881)", "flate2", "futures", @@ -1961,6 +1982,7 @@ dependencies = [ "ic-http-certification", "ic-response-verification", "ic-utils 0.39.3", + "ic-utils 0.39.3", "idna 1.0.3", "instant-acme", "leb128", @@ -2163,8 +2185,10 @@ dependencies = [ [[package]] name = "clap" version = "4.5.27" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" +checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" dependencies = [ "clap_builder", "clap_derive 4.5.24", @@ -2173,8 +2197,10 @@ dependencies = [ [[package]] name = "clap_builder" version = "4.5.27" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" dependencies = [ "anstream", "anstyle", @@ -2381,6 +2407,7 @@ version = "1.0.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "config_types", "ic-types", "macaddr", @@ -2613,6 +2640,7 @@ dependencies = [ "cpufeatures", "hex", "proptest 1.6.0", + "proptest 1.6.0", "serde", ] @@ -2844,6 +2872,7 @@ dependencies = [ "cast", "ciborium", "clap 4.5.27", + "clap 4.5.27", "criterion-plot", "futures", "is-terminal", @@ -3396,6 +3425,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "config_types", "ic-crypto-sha2", "macaddr", @@ -3408,6 +3438,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "libc", "tar", ] @@ -3523,6 +3554,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "walkdir", ] @@ -4130,6 +4162,7 @@ dependencies = [ "ic-types-test-utils", "ic-universal-canister", "ic-utils 0.39.3", + "ic-utils 0.39.3", "lazy_static", "rand 0.8.5", "rand_chacha 0.3.1", @@ -4588,6 +4621,7 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ "fallible-iterator 0.3.0", "indexmap 2.7.1", + "indexmap 2.7.1", "stable_deref_trait", ] @@ -4634,6 +4668,7 @@ version = "1.0.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "config", "indoc", "itertools 0.12.1", @@ -4655,6 +4690,7 @@ dependencies = [ "futures-util", "http 0.2.12", "indexmap 2.7.1", + "indexmap 2.7.1", "slab", "tokio", "tokio-util", @@ -4674,6 +4710,7 @@ dependencies = [ "futures-sink", "http 1.2.0", "indexmap 2.7.1", + "indexmap 2.7.1", "slab", "tokio", "tokio-util", @@ -4971,6 +5008,7 @@ version = "1.0.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "config", "config_types", "deterministic_ips", @@ -5071,6 +5109,7 @@ version = "0.9.0" dependencies = [ "axum", "clap 4.5.27", + "clap 4.5.27", "hyper 1.5.2", "hyper-util", "rustls 0.23.21", @@ -5331,6 +5370,7 @@ dependencies = [ "candid", "chrono", "clap 4.5.27", + "clap 4.5.27", "cycles-minting-canister", "futures", "hex", @@ -5375,6 +5415,7 @@ dependencies = [ "ic-sns-wasm", "ic-types", "indexmap 2.7.1", + "indexmap 2.7.1", "itertools 0.12.1", "maplit", "pocket-ic", @@ -5401,8 +5442,10 @@ dependencies = [ [[package]] name = "ic-agent" version = "0.39.3" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "820d65a05258f2fdff326c65561b1ddc7ec54e5d43a4b1203b25eb83075c83d4" +checksum = "820d65a05258f2fdff326c65561b1ddc7ec54e5d43a4b1203b25eb83075c83d4" dependencies = [ "arc-swap", "async-channel 1.9.0", @@ -5510,6 +5553,7 @@ dependencies = [ "bincode", "byteorder", "clap 4.5.27", + "clap 4.5.27", "criterion", "ic-config", "ic-crypto-test-utils-canister-threshold-sigs", @@ -5553,6 +5597,7 @@ dependencies = [ "anyhow", "chrono", "clap 4.5.27", + "clap 4.5.27", "ic-config", "ic-crypto-utils-threshold-sig-der", "ic-logger", @@ -5591,6 +5636,7 @@ dependencies = [ "ic-test-utilities-compare-dirs", "phantom_newtype", "proptest 1.6.0", + "proptest 1.6.0", "proptest-derive", "prost 0.13.4", "serde", @@ -5614,6 +5660,7 @@ version = "0.9.0" dependencies = [ "bech32 0.9.1", "bitcoin 0.32.5", + "bitcoin 0.32.5", "candid", "candid_parser", "hex", @@ -5647,6 +5694,7 @@ dependencies = [ "bytes", "chacha20poly1305", "clap 4.5.27", + "clap 4.5.27", "clap_derive 4.5.24", "cloudflare 0.12.0 (git+https://github.com/cloudflare/cloudflare-rs.git?rev=f14720e42184ee176a97676e85ef2d2d85bc3aae)", "derive-new", @@ -5711,6 +5759,7 @@ dependencies = [ "bytes", "candid", "clap 4.5.27", + "clap 4.5.27", "criterion", "dashmap 6.1.0", "ethnum", @@ -5875,6 +5924,7 @@ dependencies = [ "ic-system-test-driver", "ic-types", "ic-utils 0.39.3", + "ic-utils 0.39.3", "slog", "url", ] @@ -5883,10 +5933,12 @@ dependencies = [ name = "ic-btc-adapter" version = "0.9.0" dependencies = [ + "bitcoin 0.32.5", "bitcoin 0.32.5", "bitcoincore-rpc", "bitcoind", "clap 4.5.27", + "clap 4.5.27", "criterion", "futures", "hashlink", @@ -5950,6 +6002,7 @@ dependencies = [ name = "ic-btc-adapter-test-utils" version = "0.9.0" dependencies = [ + "bitcoin 0.32.5", "bitcoin 0.32.5", "flate2", "hex", @@ -5983,6 +6036,7 @@ dependencies = [ "ic-universal-canister", "pocket-ic", "proptest 1.6.0", + "proptest 1.6.0", "scraper", "serde", "serde_json", @@ -6020,6 +6074,7 @@ dependencies = [ "mockall", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "slog", "thiserror 2.0.11", @@ -6061,10 +6116,13 @@ dependencies = [ name = "ic-btc-validation" version = "0.9.0" dependencies = [ + "bitcoin 0.32.5", "bitcoin 0.32.5", "csv", "hex", + "primitive-types", "proptest 0.9.6", + "rstest", ] [[package]] @@ -6268,6 +6326,7 @@ dependencies = [ "maplit", "phantom_newtype", "proptest 1.6.0", + "proptest 1.6.0", "serde", "serde_bytes", "serde_cbor", @@ -6288,6 +6347,7 @@ dependencies = [ "itertools 0.12.1", "leb128", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "scoped_threadpool", @@ -6654,6 +6714,7 @@ dependencies = [ "mockall", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", "ripemd", "scopeguard", "serde", @@ -6707,6 +6768,7 @@ dependencies = [ "num-traits", "phantom_newtype", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "rlp", "scopeguard", @@ -6765,6 +6827,7 @@ dependencies = [ "ic-types", "json5", "proptest 1.6.0", + "proptest 1.6.0", "proptest-derive", "serde", "tempfile", @@ -6830,6 +6893,7 @@ dependencies = [ "phantom_newtype", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -6967,6 +7031,7 @@ dependencies = [ "async-trait", "bincode", "clap 4.5.27", + "clap 4.5.27", "criterion", "hex", "ic-adapter-metrics-server", @@ -7040,6 +7105,7 @@ dependencies = [ "mockall", "parking_lot 0.12.3", "proptest 1.6.0", + "proptest 1.6.0", "proptest-derive", "prost 0.13.4", "rand 0.8.5", @@ -7220,6 +7286,7 @@ dependencies = [ "ic-types", "num-bigint 0.4.6", "proptest 1.6.0", + "proptest 1.6.0", "proptest-derive", "rand 0.8.5", "rand_chacha 0.3.1", @@ -7379,6 +7446,7 @@ dependencies = [ "num_cpus", "parking_lot 0.12.3", "proptest 1.6.0", + "proptest 1.6.0", "proptest-derive", "prost 0.13.4", "rand 0.8.5", @@ -7423,6 +7491,7 @@ dependencies = [ "ic-types", "paste", "proptest 1.6.0", + "proptest 1.6.0", "strum", ] @@ -7485,6 +7554,7 @@ dependencies = [ "ic-protobuf", "ic-types", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "serde", @@ -7538,6 +7608,7 @@ dependencies = [ "lazy_static", "parking_lot 0.12.3", "proptest 1.6.0", + "proptest 1.6.0", "proptest-derive", "rand 0.8.5", "rand_chacha 0.3.1", @@ -8071,6 +8142,7 @@ dependencies = [ "ic-protobuf", "maplit", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "serde", @@ -8087,6 +8159,7 @@ dependencies = [ "ic-crypto-test-utils-reproducible-rng", "ic-crypto-tree-hash", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "thiserror 2.0.11", ] @@ -8240,6 +8313,7 @@ dependencies = [ name = "ic-drun" version = "0.9.0" dependencies = [ + "clap 4.5.27", "clap 4.5.27", "futures", "hex", @@ -8286,6 +8360,7 @@ dependencies = [ "candid", "canister-test", "clap 4.5.27", + "clap 4.5.27", "criterion", "embedders_bench", "ic-base-types", @@ -8324,6 +8399,7 @@ dependencies = [ "pretty_assertions", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "rayon", "rustc-demangle", "serde", @@ -8361,6 +8437,7 @@ dependencies = [ "minicbor", "minicbor-derive", "proptest 1.6.0", + "proptest 1.6.0", "serde", "serde_json", ] @@ -8430,6 +8507,7 @@ dependencies = [ "phantom_newtype", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "regex", "scoped_threadpool", @@ -8465,6 +8543,7 @@ dependencies = [ "assert_cmd", "assert_matches", "clap 4.5.27", + "clap 4.5.27", "ic-crypto-test-utils-reproducible-rng", "ic-sys", "maplit", @@ -8589,6 +8668,7 @@ dependencies = [ "pretty_assertions", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "reqwest 0.12.12", @@ -8666,6 +8746,7 @@ dependencies = [ "ic-http-certification", "ic-response-verification", "ic-utils 0.39.3", + "ic-utils 0.39.3", "thiserror 1.0.69", ] @@ -8697,6 +8778,7 @@ dependencies = [ "byte-unit", "bytes", "clap 4.5.27", + "clap 4.5.27", "futures", "http 1.2.0", "http-body-util", @@ -8789,6 +8871,7 @@ dependencies = [ "mockall", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "slog", @@ -8885,6 +8968,7 @@ dependencies = [ "candid", "ciborium", "clap 4.5.27", + "clap 4.5.27", "futures", "hex", "ic-agent", @@ -8905,6 +8989,7 @@ dependencies = [ "ic-sys", "ic-test-utilities-load-wasm", "ic-utils 0.39.3", + "ic-utils 0.39.3", "icrc-ledger-agent", "icrc-ledger-types", "indicatif", @@ -8914,6 +8999,7 @@ dependencies = [ "once_cell", "pocket-ic", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "reqwest 0.12.12", "rolling-file", @@ -8942,6 +9028,7 @@ dependencies = [ "anyhow", "candid", "clap 4.5.27", + "clap 4.5.27", "hex", "ic-agent", "ic-crypto-ed25519", @@ -9002,6 +9089,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "serde", "serde_bytes", @@ -9067,6 +9155,7 @@ dependencies = [ "icrc-ledger-types", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", "scopeguard", "serde", "serde_bytes", @@ -9112,6 +9201,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", "serde", "serde_bytes", ] @@ -9132,6 +9222,7 @@ dependencies = [ "icrc-ledger-types", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "rosetta-core", @@ -9154,6 +9245,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", "serde", ] @@ -9168,6 +9260,7 @@ dependencies = [ "minicbor", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", "serde", ] @@ -9218,6 +9311,7 @@ dependencies = [ "pprof", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "slog", "tokio", @@ -9241,6 +9335,7 @@ dependencies = [ "ic-wasm-types", "phantom_newtype", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "serde", "strum", @@ -9344,6 +9439,7 @@ dependencies = [ "icp-ledger", "on_wire", "proptest 1.6.0", + "proptest 1.6.0", "reqwest 0.12.12", "rusqlite", "serde", @@ -9392,6 +9488,7 @@ dependencies = [ "minicbor", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", "serde", "serde_bytes", ] @@ -9439,6 +9536,7 @@ dependencies = [ "num-traits", "paste", "proptest 1.6.0", + "proptest 1.6.0", "scopeguard", "scraper", "serde", @@ -9468,6 +9566,7 @@ dependencies = [ "icrc-ledger-types", "paste", "proptest 1.6.0", + "proptest 1.6.0", ] [[package]] @@ -9506,6 +9605,7 @@ dependencies = [ "icrc1-test-suite", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", ] [[package]] @@ -9585,6 +9685,7 @@ dependencies = [ "candid", "candid_parser", "clap 4.5.27", + "clap 4.5.27", "futures", "hex", "maplit", @@ -9702,6 +9803,7 @@ dependencies = [ "pretty_assertions", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "random-traffic-test", @@ -9752,6 +9854,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", ] [[package]] @@ -9856,6 +9959,7 @@ dependencies = [ "num-traits", "priority-queue", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rust_decimal", "serde", @@ -10190,6 +10294,7 @@ dependencies = [ "ic-nervous-system-common", "lazy_static", "proptest 1.6.0", + "proptest 1.6.0", "rust_decimal", "rust_decimal_macros", "serde", @@ -10330,6 +10435,7 @@ dependencies = [ "pretty_assertions", "prometheus-parse", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -10535,6 +10641,7 @@ dependencies = [ "candid", "canister-test", "clap 4.5.27", + "clap 4.5.27", "ic-base-types", "ic-canister-client", "ic-interfaces-registry", @@ -10558,6 +10665,7 @@ dependencies = [ name = "ic-nns-inspector" version = "0.1.0" dependencies = [ + "clap 4.5.27", "clap 4.5.27", "csv", "hex", @@ -10843,6 +10951,7 @@ dependencies = [ "assert_matches", "base64 0.13.1", "clap 4.5.27", + "clap 4.5.27", "fs_extra", "ic-config", "ic-crypto-node-key-generation", @@ -10991,6 +11100,7 @@ version = "0.9.0" dependencies = [ "base64 0.13.1", "clap 4.5.27", + "clap 4.5.27", "futures", "hex", "ic-artifact-pool", @@ -11041,6 +11151,7 @@ dependencies = [ "anyhow", "base64 0.13.1", "clap 4.5.27", + "clap 4.5.27", "ic-base-types", "ic-crypto-sha2", "ic-crypto-utils-threshold-sig-der", @@ -11282,6 +11393,7 @@ dependencies = [ name = "ic-registry-replicator" version = "0.9.0" dependencies = [ + "clap 4.5.27", "clap 4.5.27", "ic-config", "ic-crypto-utils-threshold-sig-der", @@ -11368,6 +11480,7 @@ version = "0.9.0" dependencies = [ "candid", "clap 4.5.27", + "clap 4.5.27", "hex", "ic-artifact-pool", "ic-canister-client", @@ -11422,6 +11535,7 @@ dependencies = [ "assert_cmd", "canister-test", "clap 4.5.27", + "clap 4.5.27", "criterion", "hex", "ic-artifact-pool", @@ -11617,6 +11731,7 @@ dependencies = [ "phantom_newtype", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -11678,6 +11793,7 @@ dependencies = [ "base64 0.13.1", "candid", "clap 4.5.27", + "clap 4.5.27", "dfn_candid", "dfn_protobuf", "futures", @@ -11719,6 +11835,7 @@ dependencies = [ "pocket-ic", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -11848,7 +11965,6 @@ dependencies = [ "anyhow", "base64 0.13.1", "candid", - "candid-utils", "clap 4.5.27", "futures", "hex", @@ -11892,6 +12008,7 @@ dependencies = [ "candid", "candid_parser", "clap 4.5.27", + "clap 4.5.27", "comparable", "futures", "hex", @@ -11944,6 +12061,7 @@ dependencies = [ "num-traits", "pretty_assertions", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "prost-build 0.13.4", "rand 0.8.5", @@ -11967,6 +12085,7 @@ dependencies = [ "bytes", "candid", "clap 4.5.27", + "clap 4.5.27", "comparable", "ic-base-types", "ic-nervous-system-proto", @@ -12130,6 +12249,7 @@ dependencies = [ "pretty-bytes", "pretty_assertions", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "rust_decimal", @@ -12225,6 +12345,7 @@ dependencies = [ "maplit", "pretty_assertions", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rust_decimal", "rust_decimal_macros", @@ -12382,6 +12503,7 @@ version = "0.9.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "ic-config", "ic-logger", "ic-management-canister-types", @@ -12422,6 +12544,7 @@ dependencies = [ "libc", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "scoped_threadpool", "slog", @@ -12434,6 +12557,7 @@ dependencies = [ "candid", "ciborium", "clap 4.5.27", + "clap 4.5.27", "hex", "ic-artifact-pool", "ic-base-types", @@ -12488,6 +12612,7 @@ dependencies = [ "ic-xnet-payload-builder", "maplit", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "rcgen", "serde", @@ -12554,6 +12679,7 @@ dependencies = [ "parking_lot 0.12.3", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -12605,6 +12731,7 @@ dependencies = [ name = "ic-state-tool" version = "0.9.0" dependencies = [ + "clap 4.5.27", "clap 4.5.27", "hex", "ic-config", @@ -12630,6 +12757,7 @@ dependencies = [ name = "ic-subnet-splitting" version = "0.9.0" dependencies = [ + "clap 4.5.27", "clap 4.5.27", "hex", "ic-agent", @@ -12727,6 +12855,7 @@ dependencies = [ "canister-test", "chrono", "clap 4.5.27", + "clap 4.5.27", "config_types", "crossbeam-channel", "cycles-minting-canister", @@ -12805,6 +12934,7 @@ dependencies = [ "ic-types-test-utils", "ic-universal-canister", "ic-utils 0.39.3", + "ic-utils 0.39.3", "ic-wasm-types", "icp-ledger", "icrc-ledger-types", @@ -12825,6 +12955,7 @@ dependencies = [ "pem 1.1.1", "phantom_newtype", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -12949,6 +13080,7 @@ dependencies = [ "parking_lot 0.12.3", "rand 0.8.5", "rusty-fork 0.3.0", + "rusty-fork 0.3.0", "serde", "serde_cbor", "slog", @@ -13129,6 +13261,7 @@ dependencies = [ "ic-wasm-types", "mockall", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "strum", @@ -13280,8 +13413,10 @@ dependencies = [ [[package]] name = "ic-transport-types" version = "0.39.3" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "979ee7bee5a67150a4c090fb012c93c294a528b4a867bad9a15cc6d01cb4227f" +checksum = "979ee7bee5a67150a4c090fb012c93c294a528b4a867bad9a15cc6d01cb4227f" dependencies = [ "candid", "hex", @@ -13327,11 +13462,13 @@ dependencies = [ "phantom_newtype", "pretty_assertions", "proptest 1.6.0", + "proptest 1.6.0", "proptest-derive", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "rusty-fork 0.3.0", + "rusty-fork 0.3.0", "serde", "serde_bytes", "serde_cbor", @@ -13350,6 +13487,7 @@ dependencies = [ "ic-protobuf", "ic-types", "proptest 1.6.0", + "proptest 1.6.0", "strum", ] @@ -13381,8 +13519,10 @@ dependencies = [ [[package]] name = "ic-utils" version = "0.39.3" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd4274ab690a646a4fb4105428617e9c622255903aad34183bdc892ad8a7cc48" +checksum = "cd4274ab690a646a4fb4105428617e9c622255903aad34183bdc892ad8a7cc48" dependencies = [ "async-trait", "candid", @@ -13411,6 +13551,7 @@ dependencies = [ "ic-types", "lru", "proptest 1.6.0", + "proptest 1.6.0", ] [[package]] @@ -13592,6 +13733,7 @@ dependencies = [ "anyhow", "candid", "clap 4.5.27", + "clap 4.5.27", "libflate", "rustc-demangle", "serde", @@ -13632,6 +13774,7 @@ dependencies = [ "candid", "chrono", "clap 4.5.27", + "clap 4.5.27", "console 0.11.3", "futures", "hex", @@ -13722,6 +13865,7 @@ dependencies = [ "nix 0.24.3", "prometheus", "proptest 1.6.0", + "proptest 1.6.0", "rand 0.8.5", "reqwest 0.12.12", "slog", @@ -14003,6 +14147,7 @@ dependencies = [ name = "icp-config" version = "0.9.0" dependencies = [ + "clap 4.5.27", "clap 4.5.27", "eyre", "ic-config", @@ -14049,6 +14194,7 @@ dependencies = [ "on_wire", "pocket-ic", "proptest 1.6.0", + "proptest 1.6.0", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -14095,6 +14241,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", ] [[package]] @@ -14147,6 +14294,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "proptest 1.6.0", + "proptest 1.6.0", "serde", "serde_bytes", "sha2 0.10.8", @@ -14408,8 +14556,10 @@ dependencies = [ [[package]] name = "indexmap" version = "2.7.1" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -14443,6 +14593,7 @@ checksum = "232929e1d75fe899576a3d5c7416ad0d88dbfbb3c3d6aa00873a7408a50ddb88" dependencies = [ "ahash 0.8.11", "indexmap 2.7.1", + "indexmap 2.7.1", "is-terminal", "itoa", "log", @@ -14461,11 +14612,13 @@ checksum = "692eda1cc790750b9f5a5e3921ef9c117fd5498b97cfacbc910693e5b29002dc" dependencies = [ "ahash 0.8.11", "clap 4.5.27", + "clap 4.5.27", "crossbeam-channel", "crossbeam-utils", "dashmap 6.1.0", "env_logger", "indexmap 2.7.1", + "indexmap 2.7.1", "itoa", "log", "num-format", @@ -14481,6 +14634,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "partition_tools", "tempfile", "tokio", @@ -14562,8 +14716,10 @@ dependencies = [ [[package]] name = "ipnet" version = "2.11.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" dependencies = [ "serde", ] @@ -14580,12 +14736,15 @@ dependencies = [ [[package]] name = "is-terminal" version = "0.4.14" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f187290c0ed3dfe3f7c85bedddd320949b68fc86ca0ceb71adfb05b3dc3af2a" +checksum = "3f187290c0ed3dfe3f7c85bedddd320949b68fc86ca0ceb71adfb05b3dc3af2a" dependencies = [ "hermit-abi 0.4.0", "libc", "windows-sys 0.59.0", + "windows-sys 0.59.0", ] [[package]] @@ -14727,6 +14886,9 @@ name = "jsonrpc" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" dependencies = [ "base64 0.13.1", "serde", @@ -14736,11 +14898,14 @@ dependencies = [ [[package]] name = "jsonrpc" version = "0.18.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" +checksum = "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" dependencies = [ "base64 0.13.1", "minreq", + "minreq", "serde", "serde_json", ] @@ -14932,6 +15097,7 @@ checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" name = "launch-single-vm" version = "0.1.0" dependencies = [ + "clap 4.5.27", "clap 4.5.27", "ic-prep", "ic-registry-subnet-type", @@ -15031,6 +15197,7 @@ dependencies = [ "num-traits", "on_wire", "proptest 1.6.0", + "proptest 1.6.0", "serde", "serde_bytes", "serde_cbor", @@ -15617,6 +15784,7 @@ dependencies = [ "libc", "nix 0.24.3", "proptest 1.6.0", + "proptest 1.6.0", "slog", "tempfile", ] @@ -15654,6 +15822,7 @@ dependencies = [ "ic-system-test-driver", "ic-types", "ic-utils 0.39.3", + "ic-utils 0.39.3", "itertools 0.12.1", "rand 0.8.5", "rand_chacha 0.3.1", @@ -15741,6 +15910,17 @@ dependencies = [ "serde_json", ] +[[package]] +name = "minreq" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36a8e50e917e18a37d500d27d40b7bc7d127e71c0c94fb2d83f43b4afd308390" +dependencies = [ + "log", + "serde", + "serde_json", +] + [[package]] name = "mio" version = "0.8.11" @@ -15977,6 +16157,7 @@ dependencies = [ "ic-test-utilities-types", "ic-types", "ic-utils 0.39.3", + "ic-utils 0.39.3", "proxy_canister", "rand 0.8.5", "rand_chacha 0.3.1", @@ -15999,6 +16180,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "serde", "serde_json", ] @@ -16364,6 +16546,7 @@ dependencies = [ "crc32fast", "hashbrown 0.15.2", "indexmap 2.7.1", + "indexmap 2.7.1", "memchr", ] @@ -16630,6 +16813,7 @@ dependencies = [ "backoff", "candid", "clap 4.5.27", + "clap 4.5.27", "env-file-reader", "exec", "get_if_addrs", @@ -17021,6 +17205,7 @@ checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap 2.7.1", + "indexmap 2.7.1", ] [[package]] @@ -17290,10 +17475,12 @@ dependencies = [ "backoff", "base64 0.13.1", "bitcoin 0.32.5", + "bitcoin 0.32.5", "bitcoincore-rpc", "bytes", "candid", "clap 4.5.27", + "clap 4.5.27", "ctrlc", "flate2", "form_urlencoded", @@ -17343,6 +17530,7 @@ dependencies = [ "ic-test-utilities-registry", "ic-types", "ic-utils 0.39.3", + "ic-utils 0.39.3", "ic-utils-thread", "ic-validator-ingress-message", "itertools 0.12.1", @@ -17723,6 +17911,26 @@ dependencies = [ "tempfile", ] +[[package]] +name = "proptest" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c477819b845fe023d33583ebf10c9f62518c8d79a0960ba5c36d6ac8a55a5b" +dependencies = [ + "bit-set 0.5.3", + "bitflags 1.3.2", + "byteorder", + "lazy_static", + "num-traits", + "quick-error", + "rand 0.6.5", + "rand_chacha 0.1.1", + "rand_xorshift 0.1.1", + "regex-syntax 0.6.29", + "rusty-fork 0.2.2", + "tempfile", +] + [[package]] name = "proptest" version = "1.6.0" @@ -17739,6 +17947,7 @@ dependencies = [ "rand_xorshift 0.3.0", "regex-syntax 0.8.5", "rusty-fork 0.3.0", + "rusty-fork 0.3.0", "tempfile", "unarray", ] @@ -18251,6 +18460,7 @@ dependencies = [ "anyhow", "candid", "clap 4.5.27", + "clap 4.5.27", "ic-agent", "k256", "rate-limits-api", @@ -18877,6 +19087,7 @@ dependencies = [ "icrc-ledger-types", "num-bigint 0.4.6", "proptest 1.6.0", + "proptest 1.6.0", "serde", "serde_bytes", "serde_json", @@ -19124,8 +19335,10 @@ dependencies = [ [[package]] name = "rustix" version = "0.38.44" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags 2.8.0", "errno 0.3.10", @@ -19321,6 +19534,18 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "rusty-fork" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dd93264e10c577503e926bd1430193eeb5d21b059148910082245309b424fae" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "rusty-fork" version = "0.3.0" @@ -19389,6 +19614,7 @@ checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "indexmap 2.7.1", + "indexmap 2.7.1", "schemars_derive", "serde", "serde_json", @@ -19517,8 +19743,10 @@ checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ "bitcoin_hashes 0.14.0", "rand 0.8.5", + "rand 0.8.5", "secp256k1-sys 0.10.1", "serde", + "serde", ] [[package]] @@ -19617,8 +19845,10 @@ dependencies = [ [[package]] name = "semver" version = "1.0.25" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" dependencies = [ "serde", ] @@ -19708,8 +19938,10 @@ dependencies = [ [[package]] name = "serde_json" version = "1.0.137" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" dependencies = [ "itoa", "memchr", @@ -19852,6 +20084,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ + "indexmap 2.7.1", "indexmap 2.7.1", "itoa", "ryu", @@ -19874,6 +20107,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "indoc", "linux_kernel_command_line", "partition_tools", @@ -19888,6 +20122,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "config", "partition_tools", "serde", @@ -19904,6 +20139,7 @@ version = "1.0.0" dependencies = [ "anyhow", "clap 4.5.27", + "clap 4.5.27", "config", "config_types", "deterministic_ips", @@ -20020,8 +20256,10 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "similar" version = "2.7.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "simple_asn1" @@ -20225,6 +20463,7 @@ dependencies = [ "ic-types", "ic-universal-canister", "ic-utils 0.39.3", + "ic-utils 0.39.3", "ic_consensus_system_test_utils", "icp-ledger", "icrc-ledger-agent", @@ -20547,8 +20786,10 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "symbolic-common" version = "12.13.3" +version = "12.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13a4dfe4bbeef59c1f32fc7524ae7c95b9e1de5e79a43ce1604e181081d71b0c" +checksum = "13a4dfe4bbeef59c1f32fc7524ae7c95b9e1de5e79a43ce1604e181081d71b0c" dependencies = [ "debugid", "memmap2", @@ -20559,8 +20800,10 @@ dependencies = [ [[package]] name = "symbolic-demangle" version = "12.13.3" +version = "12.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cf6a95abff97de4d7ff3473f33cacd38f1ddccad5c1feab435d6760300e3b6" +checksum = "98cf6a95abff97de4d7ff3473f33cacd38f1ddccad5c1feab435d6760300e3b6" dependencies = [ "rustc-demangle", "symbolic-common", @@ -20665,6 +20908,7 @@ dependencies = [ "async-trait", "axum", "clap 4.5.27", + "clap 4.5.27", "http 1.2.0", "itertools 0.12.1", "reqwest 0.12.12", @@ -21317,6 +21561,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ + "indexmap 2.7.1", "indexmap 2.7.1", "toml_datetime", "winnow", @@ -21396,6 +21641,7 @@ dependencies = [ "futures-util", "hdrhistogram", "indexmap 2.7.1", + "indexmap 2.7.1", "pin-project-lite", "slab", "sync_wrapper 1.0.2", @@ -21661,6 +21907,7 @@ dependencies = [ "leb128", "maplit", "proptest 1.6.0", + "proptest 1.6.0", "proptest-derive", "serde", ] @@ -21967,8 +22214,10 @@ dependencies = [ [[package]] name = "uuid" version = "1.12.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" +checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" dependencies = [ "getrandom", "serde", @@ -22025,6 +22274,7 @@ dependencies = [ name = "vsock_guest" version = "1.0.0" dependencies = [ + "clap 4.5.27", "clap 4.5.27", "vsock_lib", ] @@ -22255,11 +22505,14 @@ dependencies = [ [[package]] name = "wasm-encoder" version = "0.224.0" +version = "0.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7249cf8cb0c6b9cb42bce90c0a5feb276fbf963fa385ff3d818ab3d90818ed6" +checksum = "b7249cf8cb0c6b9cb42bce90c0a5feb276fbf963fa385ff3d818ab3d90818ed6" dependencies = [ "leb128", "wasmparser 0.224.0", + "wasmparser 0.224.0", ] [[package]] @@ -22285,6 +22538,7 @@ dependencies = [ "bitflags 2.8.0", "hashbrown 0.14.5", "indexmap 2.7.1", + "indexmap 2.7.1", "semver", "serde", ] @@ -22299,6 +22553,7 @@ dependencies = [ "bitflags 2.8.0", "hashbrown 0.14.5", "indexmap 2.7.1", + "indexmap 2.7.1", "semver", "serde", ] @@ -22312,6 +22567,7 @@ dependencies = [ "bitflags 2.8.0", "hashbrown 0.15.2", "indexmap 2.7.1", + "indexmap 2.7.1", "semver", "serde", ] @@ -22319,11 +22575,14 @@ dependencies = [ [[package]] name = "wasmparser" version = "0.224.0" +version = "0.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65881a664fdd43646b647bb27bf186ab09c05bf56779d40aed4c6dce47d423f5" +checksum = "65881a664fdd43646b647bb27bf186ab09c05bf56779d40aed4c6dce47d423f5" dependencies = [ "bitflags 2.8.0", "indexmap 2.7.1", + "indexmap 2.7.1", "semver", ] @@ -22362,6 +22621,7 @@ dependencies = [ "cfg-if 1.0.0", "hashbrown 0.14.5", "indexmap 2.7.1", + "indexmap 2.7.1", "libc", "libm", "log", @@ -22459,6 +22719,7 @@ dependencies = [ "cranelift-entity", "gimli 0.31.1", "indexmap 2.7.1", + "indexmap 2.7.1", "log", "object", "postcard", @@ -22541,6 +22802,7 @@ dependencies = [ "anyhow", "heck 0.5.0", "indexmap 2.7.1", + "indexmap 2.7.1", "wit-parser", ] @@ -22560,23 +22822,29 @@ dependencies = [ [[package]] name = "wast" version = "224.0.0" +version = "224.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d722a51e62b669d17e5a9f6bc8ec210178b37d869114355aa46989686c5c6391" +checksum = "d722a51e62b669d17e5a9f6bc8ec210178b37d869114355aa46989686c5c6391" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width 0.2.0", "wasm-encoder 0.224.0", + "wasm-encoder 0.224.0", ] [[package]] name = "wat" version = "1.224.0" +version = "1.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71dece6a7dd5bcbcf8d256606c7fb3faa36286d46bf3f98185407719a5ceede2" +checksum = "71dece6a7dd5bcbcf8d256606c7fb3faa36286d46bf3f98185407719a5ceede2" dependencies = [ "wast 224.0.0", + "wast 224.0.0", ] [[package]] @@ -22985,6 +23253,7 @@ dependencies = [ "anyhow", "id-arena", "indexmap 2.7.1", + "indexmap 2.7.1", "log", "semver", "serde", @@ -23290,3 +23559,8 @@ dependencies = [ name = "jsonrpc" version = "0.12.1" source = "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" + +[[patch.unused]] +name = "jsonrpc" +version = "0.12.1" +source = "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" diff --git a/ic-os/components/ic/ic-btc-adapter/generate-btc-adapter-config.sh b/ic-os/components/ic/ic-btc-adapter/generate-btc-adapter-config.sh index 888415ff806..7fec33968a1 100755 --- a/ic-os/components/ic/ic-btc-adapter/generate-btc-adapter-config.sh +++ b/ic-os/components/ic/ic-btc-adapter/generate-btc-adapter-config.sh @@ -69,11 +69,9 @@ if [ "${SOCKS_FILE}" != "" -a -e "${SOCKS_FILE}" ]; then read_socks_proxy "${SOCKS_FILE}" fi -BITCOIN_NETWORK='"testnet"' -DNS_SEEDS='"testnet-seed.bitcoin.jonasschnelli.ch", - "seed.tbtc.petertodd.org", - "seed.testnet.bitcoin.sprovoost.nl", - "testnet-seed.bluematt.me"' +BITCOIN_NETWORK='"testnet4"' +DNS_SEEDS='"seed.testnet4.bitcoin.sprovoost.nl", + "seed.testnet4.wiz.biz"' if [ "$MAINNET" = true ]; then BITCOIN_NETWORK='"bitcoin"' diff --git a/rs/bitcoin/adapter/src/blockchainmanager.rs b/rs/bitcoin/adapter/src/blockchainmanager.rs index 56e7a0eca2e..56e758aafe4 100644 --- a/rs/bitcoin/adapter/src/blockchainmanager.rs +++ b/rs/bitcoin/adapter/src/blockchainmanager.rs @@ -430,7 +430,7 @@ impl BlockchainManager { }; let time_taken = request.sent_at.map(|i| i.elapsed()).unwrap_or_default(); - trace!( + info!( self.logger, "Received block message from {} : Took {:?}sec. Block {:?}", addr, @@ -439,7 +439,10 @@ impl BlockchainManager { ); match self.blockchain.lock().unwrap().add_block(block.clone()) { - Ok(()) => Ok(()), + Ok(()) => { + info!(self.logger, "Added block: {}", block_hash); + Ok(()) + }, Err(err) => { warn!( self.logger, @@ -535,6 +538,13 @@ impl BlockchainManager { } } + // Remove the requests that have timed out. + // If they are not removed, then all peers could be fully saturated and we can't send any requests. + for block_hash in retry_queue.iter() { + info!(self.logger, "Retrying getdata request for block: {}", block_hash); + self.getdata_request_info.remove(block_hash); + } + // If nothing to be synced, then there is nothing to do at this point. if retry_queue.is_empty() && self.block_sync_queue.is_empty() { return; @@ -543,7 +553,7 @@ impl BlockchainManager { let block_cache_size = self.blockchain.lock().unwrap().get_block_cache_size(); if block_cache_size >= BLOCK_CACHE_THRESHOLD_BYTES { - debug!( + info!( self.logger, "Cache Size: {}, Max Size: {}", block_cache_size, BLOCK_CACHE_THRESHOLD_BYTES ); @@ -567,7 +577,9 @@ impl BlockchainManager { }); // For each peer, select a random subset of the inventory and send a "getdata" request for it. + info!(self.logger, "sync_blocks: retry queue size: {}, sync queue {}:", retry_queue.len(), self.block_sync_queue.len()); for peer in peer_info { + info!(self.logger, "trying from peer: {}, requests: {}", peer.socket, requests_per_peer.get(&peer.socket).unwrap_or(&0)); // Calculate number of inventory that can be sent in 'getdata' request to the peer. let requests_sent_to_peer = requests_per_peer.get(&peer.socket).unwrap_or(&0); let num_requests_to_be_sent = @@ -589,10 +601,10 @@ impl BlockchainManager { } if selected_inventory.is_empty() { - break; + continue; } - trace!( + info!( self.logger, "Sending getdata to {} : Inventory {:?}", peer.socket, @@ -753,20 +765,20 @@ impl BlockchainManager { } } +// Prioritizes elements in sync_queue (as elements in retry_queue are vety likely bad blocks). fn get_next_block_hash_to_sync( is_cache_full: bool, retry_queue: &mut LinkedHashSet, sync_queue: &mut LinkedHashSet, ) -> Option { - if !retry_queue.is_empty() { - return retry_queue.pop_front(); - } - if is_cache_full { return None; } - sync_queue.pop_front() + if !sync_queue.is_empty() { + return sync_queue.pop_front(); + } + retry_queue.pop_front() } #[cfg(test)] diff --git a/rs/bitcoin/adapter/src/config.rs b/rs/bitcoin/adapter/src/config.rs index 3082e41e734..9b34cd3f690 100644 --- a/rs/bitcoin/adapter/src/config.rs +++ b/rs/bitcoin/adapter/src/config.rs @@ -62,9 +62,11 @@ pub(crate) fn address_limits(network: Network) -> (usize, usize) { match network { Network::Bitcoin => (500, 2000), Network::Testnet => (100, 1000), + //TODO(mihailjianu): revisit these values + Network::Testnet4 => (100, 1000), Network::Signet => (1, 1), Network::Regtest => (1, 1), - other => unreachable!("Unsupported network: {:?}", other), + _ => (500, 2000), } } @@ -74,6 +76,7 @@ impl Config { match self.network { Network::Bitcoin => 8333, Network::Testnet => 18333, + Network::Testnet4 => 48333, _ => 8333, } } diff --git a/rs/bitcoin/adapter/src/get_successors_handler.rs b/rs/bitcoin/adapter/src/get_successors_handler.rs index d3ddc79e9ea..9fb04bbb3b6 100644 --- a/rs/bitcoin/adapter/src/get_successors_handler.rs +++ b/rs/bitcoin/adapter/src/get_successors_handler.rs @@ -19,7 +19,7 @@ use crate::{ // // NOTE: Should be = the `MAX_RESPONSE_SIZE` defined in `replicated_state/bitcoin.rs` // for pagination on the replica side to work as expected. -const MAX_RESPONSE_SIZE: usize = 2_000_000; +const MAX_RESPONSE_SIZE: usize = 1_000_000; // Max number of next block headers that can be returned in the `GetSuccessorsResponse`. const MAX_NEXT_BLOCK_HEADERS_LENGTH: usize = 100; @@ -30,6 +30,12 @@ const MAX_BLOCKS_LENGTH: usize = 100; const BLOCK_HEADER_SIZE: usize = 80; +// The maximum number of get blocks requests that can be in-flight at any given time. +// The number of blokcs outside of hte main chain easily exceeds 100 currently. +// Setting this to 100 would prevent the adapter from making progress, +// as it gets stuck on these blocks, whose requests timeout indefinitely. +const MAX_IN_FLIGHT_BLOCKS: usize = 1000; + // The maximum number of bytes the `next` field in a response can take. const MAX_NEXT_BYTES: usize = MAX_NEXT_BLOCK_HEADERS_LENGTH * BLOCK_HEADER_SIZE; @@ -96,7 +102,7 @@ impl GetSuccessorsHandler { .processed_block_hashes .observe(request.processed_block_hashes.len() as f64); - let response = { + let (blocks, next) = { let state = self.state.lock().unwrap(); let anchor_height = state .get_cached_header(&request.anchor) @@ -115,17 +121,24 @@ impl GetSuccessorsHandler { &request.processed_block_hashes, &blocks, ); - GetSuccessorsResponse { blocks, next } + (blocks, next) + }; + //extract the first MAX_NEXT_BLOCK_HEADERS_LENGTH and return them to the caller + let response_next = &next[..next.len().min(MAX_NEXT_BLOCK_HEADERS_LENGTH)]; + let response = GetSuccessorsResponse { + blocks, + next: response_next.to_vec(), }; + self.metrics .response_blocks .observe(response.blocks.len() as f64); - if !response.next.is_empty() { + if !next.is_empty() { // TODO: better handling of full channel as the receivers are never closed. self.blockchain_manager_tx .try_send(BlockchainManagerRequest::EnqueueNewBlocksToDownload( - response.next.clone(), + next.clone(), )) .ok(); } @@ -219,7 +232,7 @@ fn get_next_headers( let mut next_headers = vec![]; while let Some(block_hash) = queue.pop_front() { - if next_headers.len() >= MAX_NEXT_BLOCK_HEADERS_LENGTH { + if next_headers.len() >= MAX_IN_FLIGHT_BLOCKS { break; } @@ -237,7 +250,7 @@ fn get_next_headers( fn are_multiple_blocks_allowed(network: Network, anchor_height: BlockHeight) -> bool { match network { Network::Bitcoin => anchor_height <= MAINNET_MAX_MULTI_BLOCK_ANCHOR_HEIGHT, - Network::Testnet | Network::Signet | Network::Regtest => true, + Network::Testnet | Network::Signet | Network::Regtest | Network::Testnet4 => true, other => unreachable!("Unsupported network: {:?}", other), } } diff --git a/rs/bitcoin/adapter/src/rpc_server.rs b/rs/bitcoin/adapter/src/rpc_server.rs index 50827394cdb..f6a0bdf8462 100644 --- a/rs/bitcoin/adapter/src/rpc_server.rs +++ b/rs/bitcoin/adapter/src/rpc_server.rs @@ -12,7 +12,7 @@ use ic_btc_service::{ BtcServiceSendTransactionRequest, BtcServiceSendTransactionResponse, }; use ic_http_endpoints_async_utils::{incoming_from_nth_systemd_socket, incoming_from_path}; -use ic_logger::{debug, ReplicaLogger}; +use ic_logger::{debug, info, ReplicaLogger}; use ic_metrics::MetricsRegistry; use std::convert::{TryFrom, TryInto}; use std::sync::{Arc, Mutex}; @@ -89,14 +89,14 @@ impl BtcService for BtcServiceImpl { .start_timer(); let _ = self.last_received_tx.send(Some(Instant::now())); let inner = request.into_inner(); - debug!(self.logger, "Received GetSuccessorsRequest: {:?}", inner); + info!(self.logger, "Received GetSuccessorsRequest: {:?}", inner); let request = inner.try_into()?; match BtcServiceGetSuccessorsResponse::try_from( self.get_successors_handler.get_successors(request).await?, ) { Ok(res) => { - debug!(self.logger, "Sending GetSuccessorsResponse: {:?}", res); + info!(self.logger, "Sending GetSuccessorsResponse: {:?}", res); Ok(Response::new(res)) } Err(err) => Err(err), diff --git a/rs/bitcoin/validation/BUILD.bazel b/rs/bitcoin/validation/BUILD.bazel index 259fa9534cf..b54cfbdc888 100644 --- a/rs/bitcoin/validation/BUILD.bazel +++ b/rs/bitcoin/validation/BUILD.bazel @@ -14,6 +14,7 @@ DEV_DEPENDENCIES = [ "@crate_index//:csv", "@crate_index//:hex", "@crate_index//:proptest", + "@crate_index//:rstest", ] MACRO_DEV_DEPENDENCIES = [] diff --git a/rs/bitcoin/validation/Cargo.toml b/rs/bitcoin/validation/Cargo.toml index 752eea92d36..e0f27a008b8 100644 --- a/rs/bitcoin/validation/Cargo.toml +++ b/rs/bitcoin/validation/Cargo.toml @@ -15,3 +15,4 @@ hex = { workspace = true } [dev-dependencies] csv = "1.1" proptest = "0.9.4" +rstest = { workspace = true } diff --git a/rs/bitcoin/validation/src/constants.rs b/rs/bitcoin/validation/src/constants.rs index 5a632b27808..618a657c1eb 100644 --- a/rs/bitcoin/validation/src/constants.rs +++ b/rs/bitcoin/validation/src/constants.rs @@ -57,11 +57,18 @@ const TESTNET: &[(BlockHeight, &str)] = &[ (546, "000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70") ]; +/// Bitcoin testnet checkpoints +#[rustfmt::skip] +const TESTNET4: &[(BlockHeight, &str)] = &[ + (64000, "000000000deb369dca3115f66e208733066f44c8cc177edd4b5f86869e6355b5") +]; + /// Returns the maximum difficulty target depending on the network pub fn max_target(network: &Network) -> Target { match network { Network::Bitcoin => Target::MAX_ATTAINABLE_MAINNET, Network::Testnet => Target::MAX_ATTAINABLE_TESTNET, + Network::Testnet4 => Target::MAX_ATTAINABLE_TESTNET, Network::Regtest => Target::MAX_ATTAINABLE_REGTEST, Network::Signet => Target::MAX_ATTAINABLE_SIGNET, &other => unreachable!("Unsupported network: {:?}", other), @@ -72,7 +79,7 @@ pub fn max_target(network: &Network) -> Target { /// readjusted in the network after a fixed time interval. pub fn no_pow_retargeting(network: &Network) -> bool { match network { - Network::Bitcoin | Network::Testnet | Network::Signet => false, + Network::Bitcoin | Network::Testnet | Network::Signet | Network::Testnet4 => false, Network::Regtest => true, &other => unreachable!("Unsupported network: {:?}", other), } @@ -83,6 +90,7 @@ pub fn pow_limit_bits(network: &Network) -> CompactTarget { CompactTarget::from_consensus(match network { Network::Bitcoin => 0x1d00ffff, Network::Testnet => 0x1d00ffff, + Network::Testnet4 => 0x1d00ffff, Network::Regtest => 0x207fffff, Network::Signet => 0x1e0377ae, &other => unreachable!("Unsupported network: {:?}", other), @@ -94,7 +102,7 @@ pub fn checkpoints(network: &Network) -> HashMap { let points = match network { Network::Bitcoin => BITCOIN, Network::Testnet => TESTNET, - Network::Testnet4 => &[], + Network::Testnet4 => TESTNET4, Network::Signet => &[], Network::Regtest => &[], _ => &[], @@ -114,7 +122,7 @@ pub fn latest_checkpoint_height(network: &Network, current_height: BlockHeight) let points = match network { Network::Bitcoin => BITCOIN, Network::Testnet => TESTNET, - Network::Testnet4 => &[], + Network::Testnet4 => TESTNET4, Network::Signet => &[], Network::Regtest => &[], _ => &[], diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index ef7769ebaf4..c7166c9afdb 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -91,7 +91,11 @@ pub fn validate_header( if let Err(err) = header.validate_pow(Target::from_compact(compact_target)) { match err { ValidationError::BadProofOfWork => println!("bad proof of work"), - ValidationError::BadTarget => println!("bad target"), + ValidationError::BadTarget => println!( + "bad target {:?}, {:?}", + Target::from_compact(compact_target), + header.target() + ), _ => {} }; return Err(ValidateHeaderError::InvalidPoWForComputedTarget); @@ -164,7 +168,7 @@ fn get_next_compact_target( timestamp: u32, ) -> CompactTarget { match network { - Network::Testnet | Network::Regtest => { + Network::Testnet | Network::Regtest | Network::Testnet4 => { if (prev_height + 1) % DIFFICULTY_ADJUSTMENT_INTERVAL != 0 { // This if statements is reached only for Regtest and Testnet networks // Here is the quote from "https://en.bitcoin.it/wiki/Testnet" @@ -206,8 +210,9 @@ fn find_next_difficulty_in_chain( ) -> CompactTarget { // This is the maximum difficulty target for the network let pow_limit_bits = pow_limit_bits(network); + match network { - Network::Testnet | Network::Regtest => { + Network::Testnet | Network::Regtest | Network::Testnet4 => { let mut current_header = *prev_header; let mut current_height = prev_height; let mut current_hash = current_header.block_hash(); @@ -282,7 +287,20 @@ fn compute_next_difficulty( let actual_interval = std::cmp::max((prev_header.time as i64) - (last_adjustment_time as i64), 0) as u64; - CompactTarget::from_next_work_required(prev_header.bits, actual_interval, *network) + //TODO: ideally from_next_work_required works by itself + // On Testnet networks, prev_header.bits could be different than last_adjustment_header.bits + // if prev_header took more than 20 minutes to be created. + // Testnet3 (mistakenly) uses the temporary difficulty drop of prev_header to calculate + // the difficulty of th next epoch; this results in the whole epoch having a very low difficulty, + // and therefore likely blockstorms. + // Testnet4 uses the last_adjustment_header.bits to calculate the next epoch's difficulty, making it + // more stable. + //TODO(mihailjianu): add a test for testnet4. + let previous_difficulty = match network { + Network::Testnet4 => last_adjustment_header.bits, + _ => prev_header.bits, + }; + CompactTarget::from_next_work_required(previous_difficulty, actual_interval, *network) } #[cfg(test)] @@ -295,6 +313,8 @@ mod test { }; use csv::Reader; + use rstest::rstest; + use super::*; use crate::constants::test::{ MAINNET_HEADER_586656, MAINNET_HEADER_705600, MAINNET_HEADER_705601, MAINNET_HEADER_705602, @@ -559,9 +579,49 @@ mod test { } #[test] - fn test_compute_next_difficulty_for_backdated_blocks() { + fn test_compute_next_difficulty_for_temporary_difficulty_drops_testnet4() { + // Arrange + let network = Network::Testnet4; + let chain_length = DIFFICULTY_ADJUSTMENT_INTERVAL - 1; // To trigger the difficulty adjustment. + let genesis_difficulty = CompactTarget::from_consensus(473956288); + + // Create the genesis header and initialize the header store with 2014 blocks + let genesis_header = genesis_header(genesis_difficulty); + let mut store = SimpleHeaderStore::new(genesis_header, 0); + let mut last_header = genesis_header; + for _ in 1..(chain_length - 1) { + let new_header = BlockHeader { + prev_blockhash: last_header.block_hash(), + time: last_header.time + 1, + ..last_header + }; + store.add(new_header); + last_header = new_header; + } + // Add the last header in the epoch, which has the lowest difficulty, or highest possible target. + // This can happen if the block is created more than 20 minutes after the previous block. + let last_header_in_epoch = BlockHeader { + prev_blockhash: last_header.block_hash(), + time: last_header.time + 1, + bits: max_target(&network).to_compact_lossy(), + ..last_header + }; + store.add(last_header_in_epoch); + + // Act. + let difficulty = + compute_next_difficulty(&network, &store, &last_header_in_epoch, chain_length); + + // Assert. + // Note: testnet3 would produce 473956288, as it depends on the previous header's difficulty. + assert_eq!(difficulty, CompactTarget::from_consensus(470810608)); + } + + #[rstest] + #[case(Network::Testnet)] + #[case(Network::Testnet4)] + fn test_compute_next_difficulty_for_backdated_blocks(#[case] network: Network) { // Arrange: Set up the test network and parameters - let network = Network::Testnet; let chain_length = DIFFICULTY_ADJUSTMENT_INTERVAL - 1; // To trigger the difficulty adjustment. let genesis_difficulty = CompactTarget::from_consensus(486604799); diff --git a/rs/replicated_state/src/bitcoin.rs b/rs/replicated_state/src/bitcoin.rs index 88f7445f7d1..196927c9d8b 100644 --- a/rs/replicated_state/src/bitcoin.rs +++ b/rs/replicated_state/src/bitcoin.rs @@ -12,12 +12,12 @@ use ic_types::{ use std::cmp::min; // The maximum size a response can have without applying pagination. -// This number is slightly less than the maximum payload size a canister can send (2MiB) -// to leave a small buffer for the additional space that candid encoding may need. +// This number is less than the maximum payload size a canister can send (2MiB) +// because serialization could take more than 50ms which is the current timeout limit in consensus. // // NOTE: This constant should be = the `MAX_RESPONSE_SIZE` defined in the bitcoin adapter's // `get_successors_handler.rs`. -const MAX_RESPONSE_SIZE: usize = 2_000_000; +const MAX_RESPONSE_SIZE: usize = 1_000_000; /// Pushes a response from the Bitcoin Adapter into the state. pub fn push_response(