From f2d1fcbd81985afe2c01772da8b551978f0f6dd5 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Fri, 22 Nov 2024 09:18:32 +0000 Subject: [PATCH 01/50] upgrade a few things --- Cargo.lock | 178 +++-- Cargo.toml | 2 +- rs/bitcoin/adapter/Cargo.toml | 1 + rs/bitcoin/adapter/benches/e2e.rs | 2 +- rs/bitcoin/adapter/src/addressbook.rs | 3 +- rs/bitcoin/adapter/src/blockchainmanager.rs | 6 +- rs/bitcoin/adapter/src/blockchainstate.rs | 17 +- rs/bitcoin/adapter/src/connection.rs | 2 +- rs/bitcoin/adapter/src/connectionmanager.rs | 8 +- .../adapter/src/get_successors_handler.rs | 2 +- rs/bitcoin/adapter/src/lib.rs | 3 +- rs/bitcoin/adapter/src/router.rs | 2 +- rs/bitcoin/adapter/src/stream.rs | 4 +- rs/bitcoin/adapter/src/transaction_store.rs | 4 +- rs/bitcoin/adapter/test_utils/src/bitcoind.rs | 7 +- rs/bitcoin/adapter/test_utils/src/lib.rs | 2 +- rs/bitcoin/validation/BUILD.bazel | 1 + rs/bitcoin/validation/Cargo.toml | 2 + rs/bitcoin/validation/src/constants.rs | 176 +---- rs/bitcoin/validation/src/header.rs | 643 ++++++++++-------- rs/bitcoin/validation/src/lib.rs | 7 +- ...deserialize_bitcoin_raw_network_message.rs | 2 +- 22 files changed, 512 insertions(+), 562 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c8464030e1..e37e6e80250 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1186,9 +1186,9 @@ dependencies = [ [[package]] name = "bitcoin" -version = "0.32.3" +version = "0.32.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0032b0e8ead7074cda7fc4f034409607e3f03a6f71d66ade8a307f79b4d99e73" +checksum = "788902099d47c8682efe6a7afb01c8d58b9794ba66c06affd81c3d6b560743eb" dependencies = [ "base58ck", "bech32 0.11.0", @@ -2541,7 +2541,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "hex", - "proptest", + "proptest 1.5.0", "serde", ] @@ -5555,7 +5555,7 @@ dependencies = [ "ic-protobuf", "ic-test-utilities-compare-dirs", "phantom_newtype", - "proptest", + "proptest 1.5.0", "proptest-derive", "prost 0.13.3", "serde", @@ -5578,7 +5578,7 @@ name = "ic-bitcoin-canister-mock" version = "0.9.0" dependencies = [ "bech32 0.9.1", - "bitcoin 0.28.2", + "bitcoin 0.32.4", "candid", "candid_parser", "hex", @@ -5839,7 +5839,7 @@ dependencies = [ name = "ic-btc-adapter" version = "0.9.0" dependencies = [ - "bitcoin 0.28.2", + "bitcoin 0.32.4", "bitcoincore-rpc", "bitcoind", "clap 4.5.20", @@ -5863,6 +5863,7 @@ dependencies = [ "ic-metrics", "ic-test-utilities-logger", "parking_lot 0.12.3", + "primitive-types", "prometheus", "prost 0.13.3", "rand 0.8.5", @@ -5905,7 +5906,7 @@ dependencies = [ name = "ic-btc-adapter-test-utils" version = "0.9.0" dependencies = [ - "bitcoin 0.28.2", + "bitcoin 0.32.4", "flate2", "hex", "rand 0.8.5", @@ -5941,7 +5942,7 @@ dependencies = [ "ic-types", "mockall", "prometheus", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "slog", "thiserror", @@ -5964,7 +5965,7 @@ version = "0.9.0" dependencies = [ "askama", "base64 0.13.1", - "bitcoin 0.32.3", + "bitcoin 0.32.4", "candid", "candid_parser", "ciborium", @@ -6021,8 +6022,10 @@ dependencies = [ name = "ic-btc-validation" version = "0.1.0" dependencies = [ - "bitcoin 0.28.2", + "bitcoin 0.32.4", "csv", + "primitive-types", + "proptest 0.9.6", ] [[package]] @@ -6225,7 +6228,7 @@ dependencies = [ "leb128", "maplit", "phantom_newtype", - "proptest", + "proptest 1.5.0", "serde", "serde_bytes", "serde_cbor", @@ -6245,7 +6248,7 @@ dependencies = [ "ic-crypto-tree-hash-test-utils", "itertools 0.12.1", "leb128", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "rand_chacha 0.3.1", "scoped_threadpool", @@ -6544,7 +6547,7 @@ dependencies = [ "assert_matches", "async-trait", "bech32 0.9.1", - "bitcoin 0.28.2", + "bitcoin 0.32.4", "bs58", "candid", "candid_parser", @@ -6583,7 +6586,7 @@ dependencies = [ "minicbor-derive", "mockall", "num-traits", - "proptest", + "proptest 1.5.0", "ripemd", "scopeguard", "serde", @@ -6635,7 +6638,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "phantom_newtype", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "rlp", "scopeguard", @@ -6693,7 +6696,7 @@ dependencies = [ "ic-sys", "ic-types", "json5", - "proptest", + "proptest 1.5.0", "proptest-derive", "serde", "tempfile", @@ -6757,7 +6760,7 @@ dependencies = [ "num-traits", "phantom_newtype", "prometheus", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "rand_chacha 0.3.1", @@ -6937,7 +6940,7 @@ dependencies = [ "maplit", "mockall", "parking_lot 0.12.3", - "proptest", + "proptest 1.5.0", "proptest-derive", "prost 0.13.3", "rand 0.8.5", @@ -7117,7 +7120,7 @@ dependencies = [ "ic-protobuf", "ic-types", "num-bigint 0.4.6", - "proptest", + "proptest 1.5.0", "proptest-derive", "rand 0.8.5", "rand_chacha 0.3.1", @@ -7275,7 +7278,7 @@ dependencies = [ "mockall", "num_cpus", "parking_lot 0.12.3", - "proptest", + "proptest 1.5.0", "proptest-derive", "prost 0.13.3", "rand 0.8.5", @@ -7319,7 +7322,7 @@ dependencies = [ "ic-protobuf", "ic-types", "paste", - "proptest", + "proptest 1.5.0", "strum", ] @@ -7381,7 +7384,7 @@ dependencies = [ "ic-crypto-test-utils-reproducible-rng", "ic-protobuf", "ic-types", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "rand_chacha 0.3.1", "serde", @@ -7434,7 +7437,7 @@ dependencies = [ "ic-types", "lazy_static", "parking_lot 0.12.3", - "proptest", + "proptest 1.5.0", "proptest-derive", "rand 0.8.5", "rand_chacha 0.3.1", @@ -7965,7 +7968,7 @@ dependencies = [ "ic-crypto-tree-hash-test-utils", "ic-protobuf", "maplit", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "serde", @@ -7981,7 +7984,7 @@ dependencies = [ "assert_matches", "ic-crypto-test-utils-reproducible-rng", "ic-crypto-tree-hash", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "thiserror", ] @@ -8215,7 +8218,7 @@ dependencies = [ "num-traits", "pretty_assertions", "prometheus", - "proptest", + "proptest 1.5.0", "rayon", "rustc-demangle", "serde", @@ -8251,7 +8254,7 @@ dependencies = [ "ic-sha3 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "minicbor", "minicbor-derive", - "proptest", + "proptest 1.5.0", "serde", "serde_json", ] @@ -8320,7 +8323,7 @@ dependencies = [ "num-traits", "phantom_newtype", "prometheus", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "scoped_threadpool", "serde", @@ -8457,7 +8460,7 @@ dependencies = [ "mockall", "pretty_assertions", "prometheus", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "reqwest 0.12.9", @@ -8656,7 +8659,7 @@ dependencies = [ "ic-types", "mockall", "prometheus", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "rand_chacha 0.3.1", "slog", @@ -8781,7 +8784,7 @@ dependencies = [ "num-traits", "once_cell", "pocket-ic", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "reqwest 0.12.9", "rolling-file", @@ -8869,7 +8872,7 @@ dependencies = [ "leb128", "num-bigint 0.4.6", "num-traits", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "serde", "serde_bytes", @@ -8982,7 +8985,7 @@ dependencies = [ "ic-test-utilities-load-wasm", "icrc-ledger-types", "num-traits", - "proptest", + "proptest 1.5.0", "scopeguard", "serde", "serde_json", @@ -9022,7 +9025,7 @@ dependencies = [ "ic-types", "icrc-ledger-types", "num-traits", - "proptest", + "proptest 1.5.0", "scopeguard", "serde", "serde_bytes", @@ -9064,7 +9067,7 @@ dependencies = [ "leb128", "num-bigint 0.4.6", "num-traits", - "proptest", + "proptest 1.5.0", "serde", "serde_bytes", ] @@ -9084,7 +9087,7 @@ dependencies = [ "ic-types", "icrc-ledger-types", "num-traits", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "rand_chacha 0.3.1", "rosetta-core", @@ -9104,7 +9107,7 @@ dependencies = [ "ic-stable-structures", "num-bigint 0.4.6", "num-traits", - "proptest", + "proptest 1.5.0", "serde", ] @@ -9117,7 +9120,7 @@ dependencies = [ "ic-ledger-core", "ic-stable-structures", "num-traits", - "proptest", + "proptest 1.5.0", "serde", ] @@ -9167,7 +9170,7 @@ dependencies = [ "ic-validator", "pprof", "prometheus", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "slog", "tokio", @@ -9190,7 +9193,7 @@ dependencies = [ "ic-types", "ic-wasm-types", "phantom_newtype", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "serde", "strum", @@ -9293,7 +9296,7 @@ dependencies = [ "ic-types", "icp-ledger", "on_wire", - "proptest", + "proptest 1.5.0", "rusqlite", "serde", "tokio", @@ -9339,7 +9342,7 @@ dependencies = [ "ic-ledger-hash-of", "ic-stable-structures", "num-traits", - "proptest", + "proptest 1.5.0", "serde", "serde_bytes", ] @@ -9386,7 +9389,7 @@ dependencies = [ "mockall", "num-traits", "paste", - "proptest", + "proptest 1.5.0", "scopeguard", "scraper", "serde", @@ -9414,7 +9417,7 @@ dependencies = [ "ic-universal-canister", "icrc-ledger-types", "paste", - "proptest", + "proptest 1.5.0", ] [[package]] @@ -9449,7 +9452,7 @@ dependencies = [ "icrc1-test-env", "icrc1-test-suite", "num-traits", - "proptest", + "proptest 1.5.0", ] [[package]] @@ -9645,7 +9648,7 @@ dependencies = [ "mockall", "pretty_assertions", "prometheus", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "rand_chacha 0.3.1", "random-traffic-test", @@ -9787,7 +9790,7 @@ dependencies = [ "mockall", "num-traits", "priority-queue", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rust_decimal", "serde", @@ -10095,7 +10098,7 @@ dependencies = [ "assert_matches", "ic-nervous-system-common", "lazy_static", - "proptest", + "proptest 1.5.0", "rust_decimal", "rust_decimal_macros", "serde", @@ -10234,7 +10237,7 @@ dependencies = [ "on_wire", "pretty_assertions", "prometheus-parse", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "rand_chacha 0.3.1", @@ -11482,7 +11485,7 @@ dependencies = [ "nix 0.24.3", "phantom_newtype", "prometheus", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "rand_chacha 0.3.1", @@ -11585,7 +11588,7 @@ dependencies = [ "on_wire", "pocket-ic", "prometheus", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "rand_chacha 0.3.1", @@ -11838,7 +11841,7 @@ dependencies = [ "maplit", "num-traits", "pretty_assertions", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "prost-build 0.13.3", "rand 0.8.5", @@ -12023,7 +12026,7 @@ dependencies = [ "on_wire", "pretty-bytes", "pretty_assertions", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "rust_decimal", @@ -12118,7 +12121,7 @@ dependencies = [ "lazy_static", "maplit", "pretty_assertions", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rust_decimal", "rust_decimal_macros", @@ -12315,7 +12318,7 @@ dependencies = [ "itertools 0.12.1", "libc", "prometheus", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "scoped_threadpool", "slog", @@ -12381,7 +12384,7 @@ dependencies = [ "ic-universal-canister", "ic-xnet-payload-builder", "maplit", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "rcgen", "serde", @@ -12447,7 +12450,7 @@ dependencies = [ "nix 0.24.3", "parking_lot 0.12.3", "prometheus", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "rand_chacha 0.3.1", @@ -12715,7 +12718,7 @@ dependencies = [ "once_cell", "pem 1.1.1", "phantom_newtype", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "rand_chacha 0.3.1", @@ -12838,7 +12841,7 @@ dependencies = [ "nix 0.24.3", "parking_lot 0.12.3", "rand 0.8.5", - "rusty-fork", + "rusty-fork 0.3.0", "serde", "serde_cbor", "slog", @@ -13017,7 +13020,7 @@ dependencies = [ "ic-types", "ic-wasm-types", "mockall", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "rand_chacha 0.3.1", "strum", @@ -13190,12 +13193,12 @@ dependencies = [ "once_cell", "phantom_newtype", "pretty_assertions", - "proptest", + "proptest 1.5.0", "proptest-derive", "prost 0.13.3", "rand 0.8.5", "rand_chacha 0.3.1", - "rusty-fork", + "rusty-fork 0.3.0", "serde", "serde_bytes", "serde_cbor", @@ -13213,7 +13216,7 @@ version = "0.9.0" dependencies = [ "ic-protobuf", "ic-types", - "proptest", + "proptest 1.5.0", "strum", ] @@ -13580,7 +13583,7 @@ dependencies = [ "mockall", "nix 0.24.3", "prometheus", - "proptest", + "proptest 1.5.0", "rand 0.8.5", "reqwest 0.12.9", "slog", @@ -13900,7 +13903,7 @@ dependencies = [ "maplit", "on_wire", "pocket-ic", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "rand 0.8.5", "rand_chacha 0.3.1", @@ -13984,7 +13987,7 @@ dependencies = [ "itertools 0.12.1", "num-bigint 0.4.6", "num-traits", - "proptest", + "proptest 1.5.0", "serde", "serde_bytes", "sha2 0.10.8", @@ -15387,7 +15390,7 @@ dependencies = [ "lazy_static", "libc", "nix 0.24.3", - "proptest", + "proptest 1.5.0", "slog", "tempfile", ] @@ -17441,6 +17444,26 @@ dependencies = [ "regex", ] +[[package]] +name = "proptest" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c477819b845fe023d33583ebf10c9f62518c8d79a0960ba5c36d6ac8a55a5b" +dependencies = [ + "bit-set", + "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.5.0" @@ -17456,7 +17479,7 @@ dependencies = [ "rand_chacha 0.3.1", "rand_xorshift 0.3.0", "regex-syntax 0.8.5", - "rusty-fork", + "rusty-fork 0.3.0", "tempfile", "unarray", ] @@ -18538,7 +18561,7 @@ dependencies = [ "icp-ledger", "icrc-ledger-types", "num-bigint 0.4.6", - "proptest", + "proptest 1.5.0", "serde", "serde_bytes", "serde_json", @@ -18898,6 +18921,18 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +[[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" @@ -19094,6 +19129,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ "bitcoin_hashes 0.14.0", + "rand 0.8.5", "secp256k1-sys 0.10.1", ] @@ -20603,7 +20639,7 @@ dependencies = [ "openssh-keys", "pem 1.1.1", "phantom_newtype", - "proptest", + "proptest 1.5.0", "prost 0.13.3", "quickcheck", "rand 0.8.5", @@ -21361,7 +21397,7 @@ dependencies = [ "ic-crypto-tree-hash", "leb128", "maplit", - "proptest", + "proptest 1.5.0", "proptest-derive", "serde", ] diff --git a/Cargo.toml b/Cargo.toml index a7be3a74227..81ddb481cec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -505,7 +505,7 @@ axum = "0.7.7" backoff = "0.4" base64 = { version = "0.13.1" } bincode = "1.3.3" -bitcoin = { version = "0.28.2", features = ["default", "use-serde", "rand"] } +bitcoin = { version = "0.32.4", features = ["default", "rand"] } # build-info and build-info-build MUST be kept in sync! build-info = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7" } build-info-build = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7", default-features = false } diff --git a/rs/bitcoin/adapter/Cargo.toml b/rs/bitcoin/adapter/Cargo.toml index 97e93ea5b2a..4aaf9a4b4f6 100644 --- a/rs/bitcoin/adapter/Cargo.toml +++ b/rs/bitcoin/adapter/Cargo.toml @@ -22,6 +22,7 @@ ic-config = { path = "../../config" } ic-logger = { path = "../../monitoring/logger" } ic-metrics = { path = "../../monitoring/metrics" } parking_lot = { workspace = true } +primitive-types = "0.12" prometheus = { workspace = true } prost = { workspace = true } rand = { workspace = true } diff --git a/rs/bitcoin/adapter/benches/e2e.rs b/rs/bitcoin/adapter/benches/e2e.rs index cb4070648b6..047a71f753f 100644 --- a/rs/bitcoin/adapter/benches/e2e.rs +++ b/rs/bitcoin/adapter/benches/e2e.rs @@ -1,4 +1,4 @@ -use bitcoin::{Block, BlockHash, BlockHeader, Network}; +use bitcoin::{Block, BlockHash, block::Header as BlockHeader, Network}; use criterion::{criterion_group, criterion_main, Criterion}; use ic_btc_adapter::config::IncomingSource; use ic_btc_adapter::start_server; diff --git a/rs/bitcoin/adapter/src/addressbook.rs b/rs/bitcoin/adapter/src/addressbook.rs index eb67a39402f..370c109647f 100644 --- a/rs/bitcoin/adapter/src/addressbook.rs +++ b/rs/bitcoin/adapter/src/addressbook.rs @@ -1,5 +1,6 @@ use crate::config::Config; -use bitcoin::network::{constants::ServiceFlags, Address}; +use bitcoin::p2p::Address; +use bitcoin::p2p::ServiceFlags; use ic_logger::{info, ReplicaLogger}; use rand::{ prelude::{IteratorRandom, SliceRandom, StdRng}, diff --git a/rs/bitcoin/adapter/src/blockchainmanager.rs b/rs/bitcoin/adapter/src/blockchainmanager.rs index ccc3ffc2063..71ba3e515d6 100644 --- a/rs/bitcoin/adapter/src/blockchainmanager.rs +++ b/rs/bitcoin/adapter/src/blockchainmanager.rs @@ -5,11 +5,11 @@ use crate::{ Channel, Command, ProcessBitcoinNetworkMessageError, }; use bitcoin::{ - network::{ + p2p::{ message::{NetworkMessage, MAX_INV_SIZE}, message_blockdata::{GetHeadersMessage, Inventory}, }, - Block, BlockHash, BlockHeader, + Block, BlockHash, block::Header as BlockHeader, }; use hashlink::{LinkedHashMap, LinkedHashSet}; use ic_btc_validation::ValidateHeaderError; @@ -778,7 +778,7 @@ pub mod test { use bitcoin::consensus::deserialize; use bitcoin::Network; use bitcoin::{ - network::message::NetworkMessage, network::message_blockdata::Inventory, BlockHash, + p2p::message::NetworkMessage, network::message_blockdata::Inventory, BlockHash, }; use hex::FromHex; use ic_btc_adapter_test_utils::{ diff --git a/rs/bitcoin/adapter/src/blockchainstate.rs b/rs/bitcoin/adapter/src/blockchainstate.rs index 1bda79b46ad..badcae3860c 100644 --- a/rs/bitcoin/adapter/src/blockchainstate.rs +++ b/rs/bitcoin/adapter/src/blockchainstate.rs @@ -1,14 +1,14 @@ //! The module is responsible for keeping track of the blockchain state. //! use crate::{common::BlockHeight, config::Config, metrics::BlockchainStateMetrics}; -use bitcoin::{blockdata::constants::genesis_block, Block, BlockHash, BlockHeader, Network}; +use bitcoin::{blockdata::constants::genesis_block, Block, BlockHash, block::Header as BlockHeader, Network}; use ic_btc_validation::{validate_header, HeaderStore, ValidateHeaderError}; use ic_metrics::MetricsRegistry; use std::collections::HashMap; use thiserror::Error; /// This field contains the datatype used to store "work" of a Bitcoin blockchain -pub type Work = bitcoin::util::uint::Uint256; +pub type Work = primitive_types::U256; /// Contains the necessary information about a tip. #[derive(Clone, Debug)] @@ -333,12 +333,19 @@ impl BlockchainState { } impl HeaderStore for BlockchainState { - fn get_header(&self, hash: &BlockHash) -> Option<(BlockHeader, BlockHeight)> { + fn get_with_block_hash(&self, hash: &BlockHash) -> Option { self.get_cached_header(hash) - .map(|cached| (cached.header, cached.height)) + .map(|cached| cached.header) } - fn get_height(&self) -> BlockHeight { + fn get_with_height(&self, height: u32) -> Option { + self.header_cache + .values() + .find(|cached| cached.height == height) + .map(|cached| cached.header) + } + + fn height(&self) -> BlockHeight { self.get_active_chain_tip().height } diff --git a/rs/bitcoin/adapter/src/connection.rs b/rs/bitcoin/adapter/src/connection.rs index d5cc54493b9..3fabee72f98 100644 --- a/rs/bitcoin/adapter/src/connection.rs +++ b/rs/bitcoin/adapter/src/connection.rs @@ -1,5 +1,5 @@ use crate::addressbook::AddressEntry; -use bitcoin::network::message::NetworkMessage; +use bitcoin::p2p::message::NetworkMessage; use std::time::{Duration, SystemTime}; use thiserror::Error; use tokio::{sync::mpsc::UnboundedSender, task::JoinHandle}; diff --git a/rs/bitcoin/adapter/src/connectionmanager.rs b/rs/bitcoin/adapter/src/connectionmanager.rs index 91b5d605ba7..868a51aad31 100644 --- a/rs/bitcoin/adapter/src/connectionmanager.rs +++ b/rs/bitcoin/adapter/src/connectionmanager.rs @@ -4,8 +4,9 @@ use std::{ time::{Duration, SystemTime, UNIX_EPOCH}, }; -use bitcoin::network::{ - constants::ServiceFlags, +use bitcoin::p2p::ServiceFlags; + +use bitcoin::p2p::{ message::{CommandString, NetworkMessage}, message_network::VersionMessage, Address, @@ -693,7 +694,8 @@ fn connection_limits(address_book: &AddressBook) -> (usize, usize) { mod test { use super::*; use crate::config::test::ConfigBuilder; - use bitcoin::{network::constants::ServiceFlags, Network}; + use bitcoin::Network; + use bitcoin::p2p::ServiceFlags; use ic_logger::replica_logger::no_op_logger; use ic_metrics::MetricsRegistry; use std::str::FromStr; diff --git a/rs/bitcoin/adapter/src/get_successors_handler.rs b/rs/bitcoin/adapter/src/get_successors_handler.rs index a9c1a137f11..5b9da89f689 100644 --- a/rs/bitcoin/adapter/src/get_successors_handler.rs +++ b/rs/bitcoin/adapter/src/get_successors_handler.rs @@ -3,7 +3,7 @@ use std::{ sync::{Arc, Mutex}, }; -use bitcoin::{Block, BlockHash, BlockHeader, Network}; +use bitcoin::{Block, BlockHash, block::Header as BlockHeader, Network}; use ic_metrics::MetricsRegistry; use tokio::sync::mpsc::Sender; use tonic::Status; diff --git a/rs/bitcoin/adapter/src/lib.rs b/rs/bitcoin/adapter/src/lib.rs index 245217f5cb0..e6039b7d361 100644 --- a/rs/bitcoin/adapter/src/lib.rs +++ b/rs/bitcoin/adapter/src/lib.rs @@ -4,7 +4,8 @@ //! and publish transactions. Moreover, it interacts with the Bitcoin system //! component to provide blocks and collect outgoing transactions. -use bitcoin::{network::message::NetworkMessage, BlockHash, BlockHeader}; +use bitcoin::{BlockHash, block::Header as BlockHeader}; +use bitcoin::p2p::message::NetworkMessage; use ic_logger::ReplicaLogger; use ic_metrics::MetricsRegistry; use std::{ diff --git a/rs/bitcoin/adapter/src/router.rs b/rs/bitcoin/adapter/src/router.rs index a4f10ad02da..a74d1b61fa8 100644 --- a/rs/bitcoin/adapter/src/router.rs +++ b/rs/bitcoin/adapter/src/router.rs @@ -7,7 +7,7 @@ use crate::{ Channel, ProcessBitcoinNetworkMessage, ProcessBitcoinNetworkMessageError, ProcessEvent, TransactionManagerRequest, }; -use bitcoin::network::message::NetworkMessage; +use bitcoin::p2p::message::NetworkMessage; use ic_logger::ReplicaLogger; use ic_metrics::MetricsRegistry; use std::net::SocketAddr; diff --git a/rs/bitcoin/adapter/src/stream.rs b/rs/bitcoin/adapter/src/stream.rs index 7aab1e945ca..db81831fcc8 100644 --- a/rs/bitcoin/adapter/src/stream.rs +++ b/rs/bitcoin/adapter/src/stream.rs @@ -1,7 +1,7 @@ use bitcoin::{ consensus::serialize, - network::message::RawNetworkMessage, - {consensus::encode, network::message::NetworkMessage}, + p2p::message::RawNetworkMessage, + {consensus::encode, p2p::message::NetworkMessage}, }; use futures::TryFutureExt; use http::Uri; diff --git a/rs/bitcoin/adapter/src/transaction_store.rs b/rs/bitcoin/adapter/src/transaction_store.rs index e25d1274c04..72f15a27644 100644 --- a/rs/bitcoin/adapter/src/transaction_store.rs +++ b/rs/bitcoin/adapter/src/transaction_store.rs @@ -4,8 +4,8 @@ use std::{time::Duration, time::SystemTime}; use bitcoin::consensus::deserialize; use bitcoin::{ - blockdata::transaction::Transaction, hash_types::Txid, network::message::NetworkMessage, - network::message_blockdata::Inventory, + blockdata::transaction::Transaction, hash_types::Txid, p2p::message::NetworkMessage, + p2p::message_blockdata::Inventory, }; use hashlink::LinkedHashMap; use ic_logger::{debug, info, trace, ReplicaLogger}; diff --git a/rs/bitcoin/adapter/test_utils/src/bitcoind.rs b/rs/bitcoin/adapter/test_utils/src/bitcoind.rs index da9c0c83365..f152e094c3d 100644 --- a/rs/bitcoin/adapter/test_utils/src/bitcoind.rs +++ b/rs/bitcoin/adapter/test_utils/src/bitcoind.rs @@ -5,15 +5,16 @@ use std::{ sync::Arc, }; +use bitcoin::p2p::ServiceFlags; + use bitcoin::{ consensus::{deserialize_partial, encode, serialize}, - network::{ - constants::ServiceFlags, + p2p::{ message::{NetworkMessage, RawNetworkMessage}, message_blockdata::{GetHeadersMessage, Inventory}, message_network::VersionMessage, }, - Block, BlockHash, BlockHeader, + Block, BlockHash, block::Header as BlockHeader, }; use tokio::{ io::{AsyncReadExt, AsyncWriteExt}, diff --git a/rs/bitcoin/adapter/test_utils/src/lib.rs b/rs/bitcoin/adapter/test_utils/src/lib.rs index 17c4c81ed9f..60d6f924566 100644 --- a/rs/bitcoin/adapter/test_utils/src/lib.rs +++ b/rs/bitcoin/adapter/test_utils/src/lib.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use bitcoin::{ - consensus::deserialize, util::uint::Uint256, Block, BlockHash, BlockHeader, Transaction, + consensus::deserialize, util::uint::Uint256, Block, BlockHash, block::Header as BlockHeader, Transaction, TxMerkleNode, }; use hex::FromHex; diff --git a/rs/bitcoin/validation/BUILD.bazel b/rs/bitcoin/validation/BUILD.bazel index 259fa9534cf..f414ee74a8a 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//:primitive-types", ] MACRO_DEV_DEPENDENCIES = [] diff --git a/rs/bitcoin/validation/Cargo.toml b/rs/bitcoin/validation/Cargo.toml index 60923edfde2..ea6ac0594b2 100644 --- a/rs/bitcoin/validation/Cargo.toml +++ b/rs/bitcoin/validation/Cargo.toml @@ -7,6 +7,8 @@ edition = "2021" [dependencies] bitcoin = { workspace = true } +primitive-types = "0.12" [dev-dependencies] csv = "1.1" +proptest = "0.9.4" diff --git a/rs/bitcoin/validation/src/constants.rs b/rs/bitcoin/validation/src/constants.rs index 432e752b4d7..3f2e4e762e1 100644 --- a/rs/bitcoin/validation/src/constants.rs +++ b/rs/bitcoin/validation/src/constants.rs @@ -1,6 +1,4 @@ -use std::collections::HashMap; - -use bitcoin::{hashes::hex::FromHex, util::uint::Uint256, BlockHash, Network}; +use bitcoin::{CompactTarget, Network, Target}; use crate::BlockHeight; @@ -10,92 +8,14 @@ pub const DIFFICULTY_ADJUSTMENT_INTERVAL: BlockHeight = 6 * 24 * 14; /// Needed to help test check for the 20 minute testnet/regtest rule pub const TEN_MINUTES: u32 = 60 * 10; -/// Represents approximately the number of blocks that will be created within one year. -/// -/// This number is determine by the following formula. A year approximately has 356.25 days. Assuming the -/// Bitcoin network produces a new block every 10 minutes on average, `6 * 24 * 365.25 = 52,596`. -pub const BLOCKS_IN_ONE_YEAR: BlockHeight = 52_596; - -/// Bitcoin mainnet checkpoints -#[rustfmt::skip] -const BITCOIN: &[(BlockHeight, &str)] = &[ - (11_111, "0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d",), - (33_333, "000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6",), - (74_000, "0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20",), - (105_000, "00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97",), - (134_444, "00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe",), - (168_000, "000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763",), - (193_000, "000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317",), - (210_000, "000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e",), - (216_116, "00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e",), - (225_430, "00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932",), - (250_000, "000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214",), - (279_000, "0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40",), - (295_000, "00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983",), - (393_216, "00000000000000000390df7d2bdc06b9fcb260b39e3fb15b4bc9f62572553924"), - (421_888, "000000000000000004b232ad9492d0729d7f9d6737399ffcdaac1c8160db5ef6"), - (438_784, "0000000000000000040d6ef667d7a52caf93d8e0d1e40fd7155c787b42667179"), - (451_840, "0000000000000000029103c8ade7786e7379623465c72d71d84624eb9c159bea"), - (469_766, "000000000000000000130b2bd812c6a7ae9c02a74fc111806b1dd11e8975da45"), - (481_824, "0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893"), - (514_048, "00000000000000000022fe630be397a62c58972bb81f0a2d1ae8c968511a4659"), - (553_472, "0000000000000000000e06b6698a4f65ab9915f24b23ca2f9d1abf30cc3e9173"), - (571_392, "00000000000000000019c18b43077775fc299a6646ab0e9dbbd5770bf6ca392d"), - (596_000, "0000000000000000000706f93dc673ca366c810f317e7cfe8d951c0107b65223"), - (601_723, "000000000000000000009837f74796532b21d8ccf7def3dcfcb45aa92cd86b9e"), - (617_056, "0000000000000000000ca51b293fb2be2fbaf1acc76dcbbbff7e4d7796380b9e"), - (632_549, "00000000000000000001bae1b2b73ec3fde475c1ed7fdd382c2c49860ec19920"), - (643_700, "00000000000000000002959e9b44507120453344794df09bd1276eb325ed7110"), - (667_811, "00000000000000000007888a9d01313d69d6335df46ea33e875ee6832670c596"), - (688_888, "0000000000000000000e1e3bd783ce0de7b0cdabf2034723595dbcd5a28cf831"), - (704_256, "0000000000000000000465f5acfcd603337994261a4d67a647cb49866c98b538"), -]; - -/// Bitcoin testnet checkpoints -#[rustfmt::skip] -const TESTNET: &[(BlockHeight, &str)] = &[ - (546, "000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70") -]; - -/// Bitcoin mainnet maximum target value -const BITCOIN_MAX_TARGET: Uint256 = Uint256([ - 0x0000000000000000, - 0x0000000000000000, - 0x0000000000000000, - 0x00000000ffff0000, -]); - -/// Bitcoin testnet maximum target value -const TESTNET_MAX_TARGET: Uint256 = Uint256([ - 0x0000000000000000, - 0x0000000000000000, - 0x0000000000000000, - 0x00000000ffff0000, -]); - -/// Bitcoin regtest maximum target value -const REGTEST_MAX_TARGET: Uint256 = Uint256([ - 0x0000000000000000, - 0x0000000000000000, - 0x0000000000000000, - 0x7fffff0000000000, -]); - -/// Bitcoin signet maximum target value -const SIGNET_MAX_TARGET: Uint256 = Uint256([ - 0x0000000000000000u64, - 0x0000000000000000u64, - 0x0000000000000000u64, - 0x00000377ae000000u64, -]); - /// Returns the maximum difficulty target depending on the network -pub fn max_target(network: &Network) -> Uint256 { +pub fn max_target(network: &Network) -> Target { match network { - Network::Bitcoin => BITCOIN_MAX_TARGET, - Network::Testnet => TESTNET_MAX_TARGET, - Network::Regtest => REGTEST_MAX_TARGET, - Network::Signet => SIGNET_MAX_TARGET, + Network::Bitcoin => Target::MAX_ATTAINABLE_MAINNET, + Network::Testnet => Target::MAX_ATTAINABLE_TESTNET, + Network::Regtest => Target::MAX_ATTAINABLE_REGTEST, + Network::Signet => Target::MAX_ATTAINABLE_SIGNET, + _ => unreachable!(), } } @@ -105,75 +25,23 @@ pub fn no_pow_retargeting(network: &Network) -> bool { match network { Network::Bitcoin | Network::Testnet | Network::Signet => false, Network::Regtest => true, + _ => unreachable!(), } } /// Returns the PoW limit bits of the bitcoin network -pub fn pow_limit_bits(network: &Network) -> u32 { - match network { +pub fn pow_limit_bits(network: &Network) -> CompactTarget { + CompactTarget::from_consensus(match network { Network::Bitcoin => 0x1d00ffff, Network::Testnet => 0x1d00ffff, Network::Regtest => 0x207fffff, Network::Signet => 0x1e0377ae, - } -} - -/// Checkpoints used to validate blocks at certain heights. -pub fn checkpoints(network: &Network) -> HashMap { - let points = match network { - Network::Bitcoin => BITCOIN, - Network::Testnet => TESTNET, - Network::Signet => &[], - Network::Regtest => &[], - }; - points - .iter() - .cloned() - .map(|(height, hash)| { - let hash = BlockHash::from_hex(hash).expect("Programmer error: invalid hash"); - (height, hash) - }) - .collect() -} - -pub fn latest_checkpoint_height(network: &Network, current_height: BlockHeight) -> BlockHeight { - let points = match network { - Network::Bitcoin => BITCOIN, - Network::Testnet => TESTNET, - Network::Signet => &[], - Network::Regtest => &[], - }; - - points - .iter() - .rev() - .find(|(height, _)| *height <= current_height) - .map_or(0, |(height, _)| *height) -} - -pub fn last_checkpoint(network: &Network) -> Option { - let points = match network { - Network::Bitcoin => BITCOIN, - Network::Testnet => TESTNET, - Network::Signet => &[], - Network::Regtest => &[], - }; - - points.last().map(|(height, _)| *height) + _ => unreachable!(), + }) } #[cfg(test)] pub mod test { - - use super::*; - - /// Mainnet 00000000bcb3c8ff4e3e243ad47832d75bb81e922efdc05be63f2696c5dfad09 - pub const MAINNET_HEADER_11109: &str = "0100000027e37046713f768e57bd9c613f70657048320cab3e016c6ad437dadd00000000a12e0863a26054892799db694b8ccd9f44ad062b4d6ef09d2be12e994d50649b9ca2e649ffff001d2823bacb"; - /// Mainnet 00000000deaa3a36d8531844fd1cb11faff6a1171d5228d42131d1b302c56271 - pub const MAINNET_HEADER_11110: &str = "0100000009addfc596263fe65bc0fd2e921eb85bd73278d43a243e4effc8b3bc0000000006413a83ca2d3fbf6b1ac332976043152e0093f17e29fef68c3eb736d379d7365aa3e649ffff001da44e7f02"; - /// Mainnet 0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d - pub const MAINNET_HEADER_11111: &str = "010000007162c502b3d13121d428521d17a1f6af1fb11cfd441853d8363aaade000000007adf7b53a9dc840a210766054aa8a1b2076fd30dadcc3f757c23318a8c8be55213a4e649ffff001d05d9428b"; - /// Mainnet 000000000000000000063108ecc1f03f7fd1481eb20f97307d532a612bc97f04 pub const MAINNET_HEADER_586656: &str ="00008020cff0e07ab39db0f31d4ded81ba2339173155b9c57839110000000000000000007a2d75dce5981ec421a54df706d3d407f66dc9170f1e0d6e48ed1e8a1cad7724e9ed365d083a1f17bc43b10a"; /// Mainnet 0000000000000000000d37dfef7fe1c7bd22c893dbe4a94272c8cf556e40be99 @@ -187,22 +55,4 @@ pub mod test { pub const TESTNET_HEADER_2132555: &str = "004000200e1ff99438666c67c649def743fb82117537c2017bcc6ad617000000000000007fa40cf82bf224909e3174281a57af2eb3a4a2a961d33f50ec0772c1221c9e61ddfdc061ffff001a64526636"; /// Testnet 00000000383cd7fff4692410ccd9bd6201790043bb41b93bacb21e9b85620767 pub const TESTNET_HEADER_2132556: &str = "00000020974f55e77dff100bc252a01aa7b00d16736c6e04a091b03be200000000000000c44f2d69fc200c4a2211885000b6b67512f42c1bec550f3754e103b6c4046e05a202c161ffff001d09ec1bc4"; - - #[test] - fn test_latest_checkpoint_height() { - let height = latest_checkpoint_height(&Network::Bitcoin, 1_000_000); - assert_eq!(height, 704_256); - - let height = latest_checkpoint_height(&Network::Bitcoin, 40_000); - assert_eq!(height, 33_333); - - let height = latest_checkpoint_height(&Network::Testnet, 1_000_000); - assert_eq!(height, 546); - } - - #[test] - fn test_last_checkpoint() { - assert_eq!(last_checkpoint(&Network::Bitcoin), Some(704_256)); - assert_eq!(last_checkpoint(&Network::Regtest), None); - } -} +} \ No newline at end of file diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index b17d0ba47d7..0dfbda91b35 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -1,21 +1,26 @@ -use bitcoin::{util::uint::Uint256, BlockHash, BlockHeader, Network}; +use bitcoin::{ + block::Header as BlockHeader, block::ValidationError, BlockHash, CompactTarget, Network, Target, +}; use crate::{ constants::{ - checkpoints, last_checkpoint, latest_checkpoint_height, max_target, no_pow_retargeting, - pow_limit_bits, BLOCKS_IN_ONE_YEAR, DIFFICULTY_ADJUSTMENT_INTERVAL, TEN_MINUTES, + max_target, no_pow_retargeting, pow_limit_bits, DIFFICULTY_ADJUSTMENT_INTERVAL, TEN_MINUTES, }, BlockHeight, }; /// An error thrown when trying to validate a header. -#[derive(Debug)] +#[derive(Debug, PartialEq)] pub enum ValidateHeaderError { /// Used when the timestamp in the header is lower than /// the median of timestamps of past 11 headers. HeaderIsOld, - /// Used when the header doesn't match with a checkpoint. - DoesNotMatchCheckpoint, + /// Used when the timestamp in the header is more than 2 hours + /// from the current time. + HeaderIsTooFarInFuture { + block_time: u64, + max_allowed_time: u64, + }, /// Used when the PoW in the header is invalid as per the target mentioned /// in the header. InvalidPoWForHeaderTarget, @@ -25,20 +30,29 @@ pub enum ValidateHeaderError { /// Used when the target in the header is greater than the max possible /// value. TargetDifficultyAboveMax, - /// The next height is less than the tip height - 52_596 (one year worth of blocks). - HeightTooLow, /// Used when the predecessor of the input header is not found in the /// HeaderStore. PrevHeaderNotFound, } +const ONE_HOUR: u64 = 3_600; + pub trait HeaderStore { - /// Retrieves the header from the store. - fn get_header(&self, hash: &BlockHash) -> Option<(BlockHeader, BlockHeight)>; - /// Retrieves the current height of the block chain. - fn get_height(&self) -> BlockHeight; - /// Retrieves the initial hash the store starts from. - fn get_initial_hash(&self) -> BlockHash; + /// Returns the header with the given block hash. + fn get_with_block_hash(&self, hash: &BlockHash) -> Option; + + /// Returns the header at the given height. + fn get_with_height(&self, height: u32) -> Option; + + /// Returns the height of the tip that the new header will extend. + fn height(&self) -> u32; + + /// Returns the initial hash the store starts from. + fn get_initial_hash(&self) -> BlockHash { + self.get_with_height(0) + .expect("genesis block header not found") + .block_hash() + } } /// Validates a header. If a failure occurs, a @@ -47,41 +61,32 @@ pub fn validate_header( network: &Network, store: &impl HeaderStore, header: &BlockHeader, + current_time: u64, ) -> Result<(), ValidateHeaderError> { - let chain_height = store.get_height(); - let (prev_header, prev_height) = match store.get_header(&header.prev_blockhash) { + let prev_height = store.height(); + let prev_header = match store.get_with_block_hash(&header.prev_blockhash) { Some(result) => result, None => { return Err(ValidateHeaderError::PrevHeaderNotFound); } }; - if !is_header_within_one_year_of_tip(prev_height, chain_height) { - return Err(ValidateHeaderError::HeightTooLow); - } - - if !is_timestamp_valid(store, header) { - return Err(ValidateHeaderError::HeaderIsOld); - } - - if !is_checkpoint_valid(network, prev_height, header, chain_height) { - return Err(ValidateHeaderError::DoesNotMatchCheckpoint); - } + is_timestamp_valid(store, header, current_time)?; let header_target = header.target(); if header_target > max_target(network) { return Err(ValidateHeaderError::TargetDifficultyAboveMax); } - if header.validate_pow(&header_target).is_err() { + if header.validate_pow(header_target).is_err() { return Err(ValidateHeaderError::InvalidPoWForHeaderTarget); } - let target = get_next_target(network, store, &prev_header, prev_height, header); - if let Err(err) = header.validate_pow(&target) { + let target = get_next_target(network, store, &prev_header, prev_height, header.time); + if let Err(err) = header.validate_pow(Target::from_compact(target)) { match err { - bitcoin::Error::BlockBadProofOfWork => println!("bad proof of work"), - bitcoin::Error::BlockBadTarget => println!("bad target"), + ValidationError::BadProofOfWork => println!("bad proof of work"), + ValidationError::BadTarget => println!("bad target"), _ => {} }; return Err(ValidateHeaderError::InvalidPoWForComputedTarget); @@ -90,57 +95,37 @@ pub fn validate_header( Ok(()) } -/// Checks if block height is higher than the last checkpoint height. -/// By beeing beyond the last checkpoint we are sure that we store the correct chain up to the height -/// of the last checkpoint. -pub fn is_beyond_last_checkpoint(network: &Network, height: BlockHeight) -> bool { - match last_checkpoint(network) { - Some(last) => last <= height, - None => true, - } -} +fn timestamp_is_less_than_2h_in_future( + block_time: u64, + current_time: u64, +) -> Result<(), ValidateHeaderError> { + let max_allowed_time = current_time + 2 * ONE_HOUR; -/// This validates the header against the network's checkpoints. -/// 1. If the next header is at a checkpoint height, the checkpoint is compared to the next header's block hash. -/// 2. If the header is not the same height, the function then compares the height to the latest checkpoint. -/// If the next header's height is less than the last checkpoint's height, the header is invalid. -fn is_checkpoint_valid( - network: &Network, - prev_height: BlockHeight, - header: &BlockHeader, - chain_height: BlockHeight, -) -> bool { - let checkpoints = checkpoints(network); - let next_height = prev_height.saturating_add(1); - if let Some(next_hash) = checkpoints.get(&next_height) { - return *next_hash == header.block_hash(); + if block_time > max_allowed_time { + return Err(ValidateHeaderError::HeaderIsTooFarInFuture { + block_time, + max_allowed_time, + }); } - let checkpoint_height = latest_checkpoint_height(network, chain_height); - next_height > checkpoint_height -} - -/// This validates that the header has a height that is within 1 year of the tip height. -fn is_header_within_one_year_of_tip(prev_height: BlockHeight, chain_height: BlockHeight) -> bool { - // perhaps checked_add would be preferable here, if the next height would cause an overflow, - // we should know about it instead of being swallowed. - let header_height = prev_height - .checked_add(1) - .expect("next height causes an overflow"); - - let height_one_year_ago = chain_height.saturating_sub(BLOCKS_IN_ONE_YEAR); - header_height >= height_one_year_ago + Ok(()) } /// Validates if a header's timestamp is valid. /// Bitcoin Protocol Rules wiki https://en.bitcoin.it/wiki/Protocol_rules says, /// "Reject if timestamp is the median time of the last 11 blocks or before" -fn is_timestamp_valid(store: &impl HeaderStore, header: &BlockHeader) -> bool { +/// "Block timestamp must not be more than two hours in the future" +fn is_timestamp_valid( + store: &impl HeaderStore, + header: &BlockHeader, + current_time: u64, +) -> Result<(), ValidateHeaderError> { + timestamp_is_less_than_2h_in_future(header.time as u64, current_time)?; let mut times = vec![]; let mut current_header = *header; let initial_hash = store.get_initial_hash(); for _ in 0..11 { - if let Some((prev_header, _)) = store.get_header(¤t_header.prev_blockhash) { + if let Some(prev_header) = store.get_with_block_hash(¤t_header.prev_blockhash) { times.push(prev_header.time); if current_header.prev_blockhash == initial_hash { break; @@ -151,22 +136,22 @@ fn is_timestamp_valid(store: &impl HeaderStore, header: &BlockHeader) -> bool { times.sort_unstable(); let median = times[times.len() / 2]; - header.time > median + if header.time <= median { + return Err(ValidateHeaderError::HeaderIsOld); + } + + Ok(()) } -/// Gets the next target by doing the following: -/// * If the network allows blocks to have the max target (testnet & regtest), -/// the next difficulty is searched for unless the header's timestamp is -/// greater than 20 minutes from the previous header's timestamp. -/// * If the network does not allow blocks with the max target, the next -/// difficulty is computed and then cast into the next target. +// Returns the next required target at the given timestamp. +// The target is the number that a block hash must be below for it to be accepted. fn get_next_target( network: &Network, store: &impl HeaderStore, prev_header: &BlockHeader, prev_height: BlockHeight, - header: &BlockHeader, -) -> Uint256 { + timestamp: u32, +) -> CompactTarget { match network { Network::Testnet | Network::Regtest => { if (prev_height + 1) % DIFFICULTY_ADJUSTMENT_INTERVAL != 0 { @@ -175,32 +160,23 @@ fn get_next_target( // "If no block has been found in 20 minutes, the difficulty automatically // resets back to the minimum for a single block, after which it // returns to its previous value." - if header.time > prev_header.time + TEN_MINUTES * 2 { + if timestamp > prev_header.time + TEN_MINUTES * 2 { //If no block has been found in 20 minutes, then use the maximum difficulty // target - max_target(network) + max_target(network).to_compact_lossy() } else { //If the block has been found within 20 minutes, then use the previous // difficulty target that is not equal to the maximum difficulty target - BlockHeader::u256_from_compact_target(find_next_difficulty_in_chain( - network, - store, - prev_header, - prev_height, - )) + find_next_difficulty_in_chain(network, store, prev_header, prev_height) } } else { - BlockHeader::u256_from_compact_target(compute_next_difficulty( - network, - store, - prev_header, - prev_height, - )) + compute_next_difficulty(network, store, prev_header, prev_height) } } - Network::Bitcoin | Network::Signet => BlockHeader::u256_from_compact_target( - compute_next_difficulty(network, store, prev_header, prev_height), - ), + Network::Bitcoin | Network::Signet => { + compute_next_difficulty(network, store, prev_header, prev_height) + } + _ => unreachable!(), } } @@ -216,36 +192,44 @@ fn find_next_difficulty_in_chain( store: &impl HeaderStore, prev_header: &BlockHeader, prev_height: BlockHeight, -) -> u32 { +) -> CompactTarget { // This is the maximum difficulty target for the network let pow_limit_bits = pow_limit_bits(network); match network { Network::Testnet | Network::Regtest => { let mut current_header = *prev_header; let mut current_height = prev_height; - let mut current_hash = prev_header.block_hash(); + let mut current_hash = current_header.block_hash(); let initial_header_hash = store.get_initial_hash(); // Keep traversing the blockchain backwards from the recent block to initial // header hash. - while current_hash != initial_header_hash { + loop { + // Check if non-limit PoW found or it's time to adjust difficulty. if current_header.bits != pow_limit_bits || current_height % DIFFICULTY_ADJUSTMENT_INTERVAL == 0 { return current_header.bits; } - // Traverse to the previous header - let header_info = store - .get_header(¤t_header.prev_blockhash) + // Stop if we reach the initial header. + if current_hash == initial_header_hash { + break; + } + + // Traverse to the previous header. + let prev_blockhash = current_header.prev_blockhash; + current_header = store + .get_with_block_hash(&prev_blockhash) .expect("previous header should be in the header store"); - current_header = header_info.0; - current_height = header_info.1; - current_hash = current_header.prev_blockhash; + // Update the current height and hash. + current_height -= 1; + current_hash = prev_blockhash; } pow_limit_bits } Network::Bitcoin | Network::Signet => pow_limit_bits, + _ => unreachable!(), } } @@ -256,25 +240,28 @@ fn compute_next_difficulty( store: &impl HeaderStore, prev_header: &BlockHeader, prev_height: BlockHeight, -) -> u32 { +) -> CompactTarget { + use primitive_types::U256; // Difficulty is adjusted only once in every interval of 2 weeks (2016 blocks) // If an interval boundary is not reached, then previous difficulty target is // returned Regtest network doesn't adjust PoW difficult levels. For // regtest, simply return the previous difficulty target - if (prev_height + 1) % DIFFICULTY_ADJUSTMENT_INTERVAL != 0 || no_pow_retargeting(network) { + let height = prev_height + 1; + if height % DIFFICULTY_ADJUSTMENT_INTERVAL != 0 || no_pow_retargeting(network) { return prev_header.bits; } - // Computing the last header with height multiple of 2016 - let mut current_header = *prev_header; - for _i in 0..(DIFFICULTY_ADJUSTMENT_INTERVAL - 1) { - if let Some((header, _)) = store.get_header(¤t_header.prev_blockhash) { - current_header = header; - } - } - // last_adjustment_header is the last header with height multiple of 2016 - let last_adjustment_header = current_header; + // Computing the `last_adjustment_header`. + // `last_adjustment_header` is the last header with height multiple of 2016 + let last_adjustment_height = if height < DIFFICULTY_ADJUSTMENT_INTERVAL { + 0 + } else { + height - DIFFICULTY_ADJUSTMENT_INTERVAL + }; + let last_adjustment_header = store + .get_with_height(last_adjustment_height) + .expect("Last adjustment header must exist"); let last_adjustment_time = last_adjustment_header.time; // Computing the time interval between the last adjustment header time and @@ -283,32 +270,28 @@ fn compute_next_difficulty( // actual_interval will deviate slightly from 2 weeks. Our goal is to // readjust the difficulty target so that the expected time taken for the next // 2016 blocks is again 2 weeks. - let actual_interval = (prev_header.time as i64) - (last_adjustment_time as i64); + let actual_interval = prev_header.time - last_adjustment_time; + let mut adjusted_interval = actual_interval; // The target_adjustment_interval_time is 2 weeks of time expressed in seconds - let target_adjustment_interval_time: i64 = - (DIFFICULTY_ADJUSTMENT_INTERVAL * TEN_MINUTES) as i64; + let target_adjustment_interval_time: u32 = DIFFICULTY_ADJUSTMENT_INTERVAL * TEN_MINUTES; //Number of seconds in 2 weeks // Adjusting the actual_interval to [0.5 week, 8 week] range in case the // actual_interval deviates too much from the expected 2 weeks. - let adjusted_interval = actual_interval.clamp( - target_adjustment_interval_time / 4, - target_adjustment_interval_time * 4, - ) as u32; + adjusted_interval = u32::max(adjusted_interval, target_adjustment_interval_time / 4); + adjusted_interval = u32::min(adjusted_interval, target_adjustment_interval_time * 4); // Computing new difficulty target. // new difficulty target = old difficult target * (adjusted_interval / // 2_weeks); - let mut target = prev_header.target(); - target = target.mul_u32(adjusted_interval); - target = target / Uint256::from_u64(target_adjustment_interval_time as u64).unwrap(); + let mut target = U256::from_big_endian(&prev_header.target().to_be_bytes()); + target *= U256::from(adjusted_interval); + target /= U256::from(target_adjustment_interval_time); + let target = Target::from_be_bytes(target.into()); // Adjusting the newly computed difficulty target so that it doesn't exceed the // max_difficulty_target limit - target = Uint256::min(target, max_target(network)); - - // Converting the target (Uint256) into a 32 bit representation used by Bitcoin - BlockHeader::compact_target_from_u256(&target) + target.min(max_target(network)).to_compact_lossy() } #[cfg(test)] @@ -316,16 +299,20 @@ mod test { use std::{collections::HashMap, path::PathBuf, str::FromStr}; - use bitcoin::{consensus::deserialize, hashes::hex::FromHex, TxMerkleNode}; + use bitcoin::{ + block::Version, consensus::deserialize, hashes::hex::FromHex, hashes::Hash, TxMerkleNode, + }; use csv::Reader; + use proptest::prelude::*; use super::*; use crate::constants::test::{ - MAINNET_HEADER_11109, MAINNET_HEADER_11110, MAINNET_HEADER_11111, MAINNET_HEADER_586656, - MAINNET_HEADER_705600, MAINNET_HEADER_705601, MAINNET_HEADER_705602, + MAINNET_HEADER_586656, MAINNET_HEADER_705600, MAINNET_HEADER_705601, MAINNET_HEADER_705602, TESTNET_HEADER_2132555, TESTNET_HEADER_2132556, }; + const MOCK_CURRENT_TIME: u64 = 2_634_590_600; + #[derive(Clone)] struct StoredHeader { header: BlockHeader, @@ -335,12 +322,14 @@ mod test { struct SimpleHeaderStore { headers: HashMap, height: BlockHeight, + tip_hash: BlockHash, initial_hash: BlockHash, } impl SimpleHeaderStore { fn new(initial_header: BlockHeader, height: BlockHeight) -> Self { let initial_hash = initial_header.block_hash(); + let tip_hash = initial_header.block_hash(); let mut headers = HashMap::new(); headers.insert( initial_hash, @@ -353,6 +342,7 @@ mod test { Self { headers, height, + tip_hash, initial_hash, } } @@ -369,17 +359,25 @@ mod test { self.height = stored_header.height; self.headers.insert(header.block_hash(), stored_header); + self.tip_hash = header.block_hash(); } } impl HeaderStore for SimpleHeaderStore { - fn get_header(&self, hash: &BlockHash) -> Option<(BlockHeader, BlockHeight)> { - self.headers - .get(hash) - .map(|stored| (stored.header, stored.height)) + fn get_with_block_hash(&self, hash: &BlockHash) -> Option { + self.headers.get(hash).map(|stored| stored.header) + } + + fn get_with_height(&self, height: u32) -> Option { + let blocks_to_traverse = self.height - height; + let mut header = self.headers.get(&self.tip_hash).unwrap().header; + for _ in 0..blocks_to_traverse { + header = self.headers.get(&header.prev_blockhash).unwrap().header; + } + Some(header) } - fn get_height(&self) -> BlockHeight { + fn height(&self) -> u32 { self.height } @@ -395,8 +393,6 @@ mod test { /// This function reads `num_headers` headers from `tests/data/headers.csv` /// and returns them. - /// This function reads `num_headers` headers from `blockchain_headers.csv` - /// and returns them. fn get_bitcoin_headers() -> Vec { let rdr = Reader::from_path( PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()) @@ -408,11 +404,15 @@ mod test { for result in rdr.records() { let record = result.unwrap(); let header = BlockHeader { - version: i32::from_str_radix(record.get(0).unwrap(), 16).unwrap(), + version: Version::from_consensus( + i32::from_str_radix(record.get(0).unwrap(), 16).unwrap(), + ), prev_blockhash: BlockHash::from_str(record.get(1).unwrap()).unwrap(), merkle_root: TxMerkleNode::from_str(record.get(2).unwrap()).unwrap(), time: u32::from_str_radix(record.get(3).unwrap(), 16).unwrap(), - bits: u32::from_str_radix(record.get(4).unwrap(), 16).unwrap(), + bits: CompactTarget::from_consensus( + u32::from_str_radix(record.get(4).unwrap(), 16).unwrap(), + ), nonce: u32::from_str_radix(record.get(5).unwrap(), 16).unwrap(), }; headers.push(header); @@ -420,23 +420,12 @@ mod test { headers } - fn genesis_header(bits: u32) -> BlockHeader { - BlockHeader { - version: 1, - prev_blockhash: Default::default(), - merkle_root: Default::default(), - time: 1296688602, - bits, - nonce: 0, - } - } - #[test] fn test_simple_mainnet() { let header_705600 = deserialize_header(MAINNET_HEADER_705600); let header_705601 = deserialize_header(MAINNET_HEADER_705601); let store = SimpleHeaderStore::new(header_705600, 705_600); - let result = validate_header(&Network::Bitcoin, &store, &header_705601); + let result = validate_header(&Network::Bitcoin, &store, &header_705601, MOCK_CURRENT_TIME); assert!(result.is_ok()); } @@ -445,7 +434,12 @@ mod test { let header_2132555 = deserialize_header(TESTNET_HEADER_2132555); let header_2132556 = deserialize_header(TESTNET_HEADER_2132556); let store = SimpleHeaderStore::new(header_2132555, 2_132_555); - let result = validate_header(&Network::Testnet, &store, &header_2132556); + let result = validate_header( + &Network::Testnet, + &store, + &header_2132556, + MOCK_CURRENT_TIME, + ); assert!(result.is_ok()); } @@ -455,7 +449,7 @@ mod test { let mut store = SimpleHeaderStore::new(header_586656, 586_656); let headers = get_bitcoin_headers(); for (i, header) in headers.iter().enumerate() { - let result = validate_header(&Network::Bitcoin, &store, header); + let result = validate_header(&Network::Bitcoin, &store, header, MOCK_CURRENT_TIME); assert!( result.is_ok(), "Failed to validate header on line {}: {:?}", @@ -466,6 +460,48 @@ mod test { } } + #[test] + fn test_timestamp_is_less_than_2h_in_future() { + // Time is represented as the number of seconds after 01.01.1970 00:00. + // Hence, if block time is 10 seconds after that time, + // 'timestamp_is_less_than_2h_in_future' should return true. + + assert!(timestamp_is_less_than_2h_in_future(10, MOCK_CURRENT_TIME).is_ok()); + + assert!(timestamp_is_less_than_2h_in_future( + MOCK_CURRENT_TIME - ONE_HOUR, + MOCK_CURRENT_TIME + ) + .is_ok()); + + assert!(timestamp_is_less_than_2h_in_future(MOCK_CURRENT_TIME, MOCK_CURRENT_TIME).is_ok()); + + assert!(timestamp_is_less_than_2h_in_future( + MOCK_CURRENT_TIME + ONE_HOUR, + MOCK_CURRENT_TIME + ) + .is_ok()); + + assert!(timestamp_is_less_than_2h_in_future( + MOCK_CURRENT_TIME + 2 * ONE_HOUR - 5, + MOCK_CURRENT_TIME + ) + .is_ok()); + + // 'timestamp_is_less_than_2h_in_future' should return false + // because the time is more than 2 hours from the current time. + assert_eq!( + timestamp_is_less_than_2h_in_future( + MOCK_CURRENT_TIME + 2 * ONE_HOUR + 10, + MOCK_CURRENT_TIME + ), + Err(ValidateHeaderError::HeaderIsTooFarInFuture { + block_time: MOCK_CURRENT_TIME + 2 * ONE_HOUR + 10, + max_allowed_time: MOCK_CURRENT_TIME + 2 * ONE_HOUR + }) + ); + } + #[test] fn test_is_timestamp_valid() { let header_705600 = deserialize_header(MAINNET_HEADER_705600); @@ -476,114 +512,63 @@ mod test { store.add(header_705602); let mut header = BlockHeader { - version: 0x20800004, - prev_blockhash: BlockHash::from_hex( + version: Version::from_consensus(0x20800004), + prev_blockhash: BlockHash::from_str( "00000000000000000001eea12c0de75000c2546da22f7bf42d805c1d2769b6ef", ) .unwrap(), - merkle_root: TxMerkleNode::from_hex( + merkle_root: TxMerkleNode::from_str( "c120ff2ae1363593a0b92e0d281ec341a0cc989b4ee836dc3405c9f4215242a6", ) .unwrap(), time: 1634590600, - bits: 0x170e0408, + bits: CompactTarget::from_consensus(0x170e0408), nonce: 0xb48e8b0a, }; - assert!(is_timestamp_valid(&store, &header)); + assert!(is_timestamp_valid(&store, &header, MOCK_CURRENT_TIME).is_ok()); // Monday, October 18, 2021 20:26:40 header.time = 1634588800; - assert!(!is_timestamp_valid(&store, &header)); - - let result = validate_header(&Network::Bitcoin, &store, &header); - assert!(matches!(result, Err(ValidateHeaderError::HeaderIsOld))); - } - - #[test] - fn test_is_header_valid_missing_prev_header() { - let header_705600 = deserialize_header(MAINNET_HEADER_705600); - let header_705602 = deserialize_header(MAINNET_HEADER_705602); - let store = SimpleHeaderStore::new(header_705600, 705_600); - let result = validate_header(&Network::Bitcoin, &store, &header_705602); assert!(matches!( - result, - Err(ValidateHeaderError::PrevHeaderNotFound) - )); - } - - #[test] - fn test_is_header_valid_checkpoint_valid_at_height() { - let network = Network::Bitcoin; - let header_11110 = deserialize_header(MAINNET_HEADER_11110); - let mut header_11111 = deserialize_header(MAINNET_HEADER_11111); - let store = SimpleHeaderStore::new(header_11110, 11110); - let (_, prev_height) = store.get_header(&header_11111.prev_blockhash).unwrap(); - - assert!(is_checkpoint_valid( - &network, - prev_height, - &header_11111, - store.get_height() + is_timestamp_valid(&store, &header, MOCK_CURRENT_TIME), + Err(ValidateHeaderError::HeaderIsOld) )); - // Change time to slightly modify the block hash to make it invalid for the - // checkpoint. - header_11111.time -= 1; + let result = validate_header(&Network::Bitcoin, &store, &header, MOCK_CURRENT_TIME); + assert!(matches!(result, Err(ValidateHeaderError::HeaderIsOld))); - let result = validate_header(&network, &store, &header_11111); - assert!(matches!( - result, - Err(ValidateHeaderError::DoesNotMatchCheckpoint) - )); - } + header.time = (MOCK_CURRENT_TIME - ONE_HOUR) as u32; - #[test] - fn test_is_header_valid_checkpoint_valid_detect_fork_around_11111() { - let network = Network::Bitcoin; - let header_11109 = deserialize_header(MAINNET_HEADER_11109); - let header_11110 = deserialize_header(MAINNET_HEADER_11110); - let header_11111 = deserialize_header(MAINNET_HEADER_11111); - // Make a header for height 11110 that would cause a fork. - let mut bad_header_11110 = header_11110; - bad_header_11110.time -= 1; - - let mut store = SimpleHeaderStore::new(header_11109, 11109); - store.add(header_11110); - - let (_, prev_height) = store.get_header(&header_11111.prev_blockhash).unwrap(); - - assert!(is_checkpoint_valid( - &network, - prev_height, - &header_11111, - store.get_height() - )); + assert!(is_timestamp_valid(&store, &header, MOCK_CURRENT_TIME).is_ok()); - store.add(header_11111); + header.time = (MOCK_CURRENT_TIME + 2 * ONE_HOUR + 10) as u32; + assert_eq!( + is_timestamp_valid(&store, &header, MOCK_CURRENT_TIME), + Err(ValidateHeaderError::HeaderIsTooFarInFuture { + block_time: header.time as u64, + max_allowed_time: MOCK_CURRENT_TIME + 2 * ONE_HOUR + }) + ); - // This should return false as bad_header_11110 is a fork. - let (_, prev_height) = store.get_header(&header_11111.prev_blockhash).unwrap(); - assert!(!is_checkpoint_valid( - &network, - prev_height, - &bad_header_11110, - store.get_height() - )); + let result = validate_header(&Network::Bitcoin, &store, &header, MOCK_CURRENT_TIME); + assert_eq!( + result, + Err(ValidateHeaderError::HeaderIsTooFarInFuture { + block_time: header.time as u64, + max_allowed_time: MOCK_CURRENT_TIME + 2 * ONE_HOUR, + }) + ); } #[test] - fn test_is_header_valid_checkpoint_valid_detect_fork_around_705600() { - let network = Network::Bitcoin; + fn test_is_header_valid_missing_prev_header() { let header_705600 = deserialize_header(MAINNET_HEADER_705600); - let header_705601 = deserialize_header(MAINNET_HEADER_705601); + let header_705602 = deserialize_header(MAINNET_HEADER_705602); let store = SimpleHeaderStore::new(header_705600, 705_600); - let (_, prev_height) = store.get_header(&header_705601.prev_blockhash).unwrap(); - - assert!(is_checkpoint_valid( - &network, - prev_height, - &header_705601, - store.get_height() + let result = validate_header(&Network::Bitcoin, &store, &header_705602, MOCK_CURRENT_TIME); + assert!(matches!( + result, + Err(ValidateHeaderError::PrevHeaderNotFound) )); } @@ -593,7 +578,7 @@ mod test { let mut header = deserialize_header(MAINNET_HEADER_705601); header.bits = pow_limit_bits(&Network::Bitcoin); let store = SimpleHeaderStore::new(header_705600, 705_600); - let result = validate_header(&Network::Bitcoin, &store, &header); + let result = validate_header(&Network::Bitcoin, &store, &header, MOCK_CURRENT_TIME); assert!(matches!( result, Err(ValidateHeaderError::InvalidPoWForHeaderTarget) @@ -602,10 +587,16 @@ mod test { #[test] fn test_is_header_valid_invalid_computed_target() { - let header_705600 = deserialize_header(MAINNET_HEADER_705600); - let header = deserialize_header(MAINNET_HEADER_705601); - let store = SimpleHeaderStore::new(header_705600, 705_600); - let result = validate_header(&Network::Regtest, &store, &header); + let pow_bitcoin = pow_limit_bits(&Network::Bitcoin); + let pow_regtest = pow_limit_bits(&Network::Regtest); + let h0 = genesis_header(pow_bitcoin); + let h1 = next_block_header(h0, pow_regtest); + let h2 = next_block_header(h1, pow_regtest); + let h3 = next_block_header(h2, pow_regtest); + let mut store = SimpleHeaderStore::new(h0, 0); + store.add(h1); + store.add(h2); + let result = validate_header(&Network::Regtest, &store, &h3, MOCK_CURRENT_TIME); assert!(matches!( result, Err(ValidateHeaderError::InvalidPoWForComputedTarget) @@ -618,76 +609,134 @@ mod test { let mut header = deserialize_header(MAINNET_HEADER_705601); header.bits = pow_limit_bits(&Network::Regtest); let store = SimpleHeaderStore::new(header_705600, 705_600); - let result = validate_header(&Network::Bitcoin, &store, &header); + let result = validate_header(&Network::Bitcoin, &store, &header, MOCK_CURRENT_TIME); assert!(matches!( result, Err(ValidateHeaderError::TargetDifficultyAboveMax) )); } - #[test] - fn test_is_header_within_one_year_of_tip_next_height_is_above_the_minimum() { - assert!( - is_header_within_one_year_of_tip(700_000, 650_000), - "next height is above the one year minimum" - ); - assert!( - is_header_within_one_year_of_tip(700_000, 750_000), - "next height is within the one year range" - ); - assert!( - !is_header_within_one_year_of_tip(700_000, 800_000), - "next height is below the one year minimum" - ); + fn test_next_targets(network: Network, headers_path: &str, up_to_height: usize) { + use bitcoin::consensus::Decodable; + use std::io::BufRead; + let file = std::fs::File::open( + PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()).join(headers_path), + ) + .unwrap(); + + let rdr = std::io::BufReader::new(file); + + println!("Loading headers..."); + let mut headers = vec![]; + for line in rdr.lines() { + let header = line.unwrap(); + let header = hex::decode(header.trim()).unwrap(); + let header = BlockHeader::consensus_decode(&mut header.as_slice()).unwrap(); + headers.push(header); + } + + println!("Creating header store..."); + let mut store = SimpleHeaderStore::new(headers[0], 0); + for header in headers[1..].iter() { + store.add(*header); + } + + println!("Verifying next targets..."); + proptest!(|(i in 0..up_to_height)| { + // Compute what the target of the next header should be. + let expected_next_target = + get_next_target(&network, &store, &headers[i], i as u32, headers[i + 1].time); + + // Assert that the expected next target matches the next header's target. + assert_eq!( + expected_next_target, + headers[i + 1].bits + ); + }); } #[test] - #[should_panic(expected = "next height causes an overflow")] - fn test_is_header_within_one_year_of_tip_should_panic_as_next_height_is_too_high() { - is_header_within_one_year_of_tip(BlockHeight::MAX, 0); + fn mainnet_next_targets() { + test_next_targets( + Network::Bitcoin, + "tests/data/block_headers_mainnet.csv", + 700_000, + ); } #[test] - fn test_is_header_within_one_year_of_tip_chain_height_is_less_than_one_year() { - assert!( - is_header_within_one_year_of_tip(1, 0), - "chain height is less than one year" - ); - assert!( - is_header_within_one_year_of_tip(1, BLOCKS_IN_ONE_YEAR + 2), - "chain height difference is exactly one year" - ); - assert!( - !is_header_within_one_year_of_tip(1, BLOCKS_IN_ONE_YEAR + 3), - "chain height difference is one year + 1 block" + fn testnet_next_targets() { + test_next_targets( + Network::Testnet, + "tests/data/block_headers_testnet.csv", + 2_400_000, ); } - #[test] - fn test_compute_next_difficulty_for_backdated_blocks() { - // 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 = 486604799; - - // Create the genesis header and initialize the header store - let genesis_header = genesis_header(genesis_difficulty); - let mut store = SimpleHeaderStore::new(genesis_header, 0); - let mut last_header = genesis_header; + fn genesis_header(bits: CompactTarget) -> BlockHeader { + BlockHeader { + version: Version::ONE, + prev_blockhash: Hash::all_zeros(), + merkle_root: Hash::all_zeros(), + time: 1296688602, + bits, + nonce: 0, + } + } + + fn next_block_header(prev: BlockHeader, bits: CompactTarget) -> BlockHeader { + BlockHeader { + prev_blockhash: prev.block_hash(), + time: prev.time + TEN_MINUTES, + bits, + ..prev + } + } + + /// Creates a chain of headers with the given length and + /// proof of work for the first header. + fn create_chain( + network: &Network, + initial_pow: CompactTarget, + chain_length: u32, + ) -> (SimpleHeaderStore, BlockHeader) { + let pow_limit = pow_limit_bits(network); + let h0 = genesis_header(initial_pow); + let mut store = SimpleHeaderStore::new(h0, 0); + let mut last_header = h0; + for _ in 1..chain_length { - let new_header = BlockHeader { - prev_blockhash: last_header.block_hash(), - time: last_header.time - 1, // Each new block is 1 second earlier - ..last_header - }; + let new_header = next_block_header(last_header, pow_limit); store.add(new_header); last_header = new_header; } - // Act. - let difficulty = compute_next_difficulty(&network, &store, &last_header, chain_length); + (store, last_header) + } - // Assert. - assert_eq!(difficulty, 473956288); + #[test] + fn test_next_target_regtest() { + // This test checks the chain of headers of different lengths + // with non-limit PoW in the first block header and PoW limit + // in all the other headers. + // Expect difficulty to be equal to the non-limit PoW. + + // Arrange. + let network = Network::Regtest; + let expected_pow = CompactTarget::from_consensus(7); // Some non-limit PoW, the actual value is not important. + for chain_length in 1..10 { + let (store, last_header) = create_chain(&network, expected_pow, chain_length); + assert_eq!(store.height() + 1, chain_length); + // Act. + let target = get_next_target( + &network, + &store, + &last_header, + chain_length - 1, + last_header.time + TEN_MINUTES, + ); + // Assert. + assert_eq!(target, expected_pow); + } } -} +} \ No newline at end of file diff --git a/rs/bitcoin/validation/src/lib.rs b/rs/bitcoin/validation/src/lib.rs index 99843cea939..d8597e1f788 100644 --- a/rs/bitcoin/validation/src/lib.rs +++ b/rs/bitcoin/validation/src/lib.rs @@ -1,8 +1,7 @@ mod constants; mod header; -pub use crate::header::{ - is_beyond_last_checkpoint, validate_header, HeaderStore, ValidateHeaderError, -}; +pub use crate::constants::max_target; +pub use crate::header::{validate_header, HeaderStore, ValidateHeaderError}; -type BlockHeight = u32; +type BlockHeight = u32; \ No newline at end of file diff --git a/rs/fuzzers/bitcoin/fuzz_targets/deserialize_bitcoin_raw_network_message.rs b/rs/fuzzers/bitcoin/fuzz_targets/deserialize_bitcoin_raw_network_message.rs index a7b0e1d2499..d86fe821233 100644 --- a/rs/fuzzers/bitcoin/fuzz_targets/deserialize_bitcoin_raw_network_message.rs +++ b/rs/fuzzers/bitcoin/fuzz_targets/deserialize_bitcoin_raw_network_message.rs @@ -1,6 +1,6 @@ #![no_main] use bitcoin::consensus::encode::deserialize; -use bitcoin::network::message::RawNetworkMessage; +use bitcoin::p2p::message::RawNetworkMessage; use libfuzzer_sys::fuzz_target; fuzz_target!(|data: &[u8]| { From 09d9688a65ff739a2b91508f99e58e1f37340236 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Fri, 29 Nov 2024 10:16:12 +0000 Subject: [PATCH 02/50] more cahnges --- rs/bitcoin/adapter/src/stream.rs | 43 ++++++++++++++++---------------- rs/bitcoin/validation/Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/rs/bitcoin/adapter/src/stream.rs b/rs/bitcoin/adapter/src/stream.rs index db81831fcc8..484b9092df5 100644 --- a/rs/bitcoin/adapter/src/stream.rs +++ b/rs/bitcoin/adapter/src/stream.rs @@ -1,6 +1,7 @@ use bitcoin::{ consensus::serialize, p2p::message::RawNetworkMessage, + p2p::Magic, {consensus::encode, p2p::message::NetworkMessage}, }; use futures::TryFutureExt; @@ -116,7 +117,7 @@ pub struct Stream { read_half: OwnedReadHalf, write_half: OwnedWriteHalf, /// This field is used to provide the magic value to the raw network message. - /// The magic number is used to identity the type of Bitcoin network being accessed. + /// The magic number is used to identify the type of Bitcoin network being accessed. magic: u32, /// This field contains the receiver used to intake messages that are to be /// sent to the connected node. @@ -248,7 +249,7 @@ impl Stream { // and then re-wrap it into a StreamError. Err(err) => { return Err(match err { - encode::Error::Io(err) => StreamError::Io(err), + encode::Error::Io(err) => StreamError::Io(err.into()), err => StreamError::Encode(err), }); } @@ -265,12 +266,9 @@ impl Stream { /// This function is used to write a network message to the connected Bitcoin /// node. async fn write_message(&mut self, network_message: NetworkMessage) -> StreamResult<()> { - let raw_network_message = RawNetworkMessage { - magic: self.magic, - payload: network_message, - }; + let raw_network_message = RawNetworkMessage::new(Magic::from_bytes(self.magic.to_be_bytes()), network_message); let bytes = serialize(&raw_network_message); - self.write_half + self.write_half .write_all(bytes.as_slice()) .await .map_err(StreamError::Io)?; @@ -290,7 +288,7 @@ impl Stream { let raw_message = self.read_message()?; let result = self .network_message_sender - .send((self.address, raw_message.payload)) + .send((self.address, raw_message.payload().clone())) .await; if result.is_err() { return Err(StreamError::UnableToReceiveMessages); @@ -411,10 +409,10 @@ pub mod test { // Send message that exceeds size limit. tokio::spawn(async move { let (mut socket, _addr) = listener.accept().await.unwrap(); - let addr = RawNetworkMessage { - magic: network.magic(), - payload: NetworkMessage::Alert(vec![0; MAX_RAW_MESSAGE_SIZE + 10]), - }; + let addr = RawNetworkMessage::new( + network.magic(), + NetworkMessage::Alert(vec![0; MAX_RAW_MESSAGE_SIZE + 10]), + ); let mut buf = Vec::new(); let raw_addr = addr.consensus_encode(&mut buf).unwrap(); socket.write_all(&buf[..raw_addr]).await.unwrap(); @@ -492,18 +490,19 @@ pub mod test { ); // Large messgage just below limit. - let payload_large = RawNetworkMessage { - magic: network.magic(), - payload: NetworkMessage::Alert(vec![0; MAX_RAW_MESSAGE_SIZE - 30]), - }; + let payload_large = RawNetworkMessage::new( + //TODO(mihailjianu): check byte order + network.magic(), + NetworkMessage::Alert(vec![0; MAX_RAW_MESSAGE_SIZE - 30]) + ); let mut buf_large = Vec::new(); let _ = payload_large.consensus_encode(&mut buf_large).unwrap(); // Message that crosses the boundary limit. - let payload_small = RawNetworkMessage { - magic: network.magic(), - payload: NetworkMessage::Alert(vec![0; 31 + STREAM_BUFFER_SIZE]), - }; + let payload_small = RawNetworkMessage::new( + network.magic(), + NetworkMessage::Alert(vec![0; 31 + STREAM_BUFFER_SIZE]), + ); let mut buf_small = Vec::new(); let _ = payload_small.consensus_encode(&mut buf_small).unwrap(); @@ -515,11 +514,11 @@ pub mod test { assert_eq!( net_rx.recv().await.unwrap(), - (address, payload_large.payload) + (address, payload_large.payload()) ); assert_eq!( net_rx.recv().await.unwrap(), - (address, payload_small.payload) + (address, payload_small.payload()) ); } } diff --git a/rs/bitcoin/validation/Cargo.toml b/rs/bitcoin/validation/Cargo.toml index ea6ac0594b2..24b29a587e2 100644 --- a/rs/bitcoin/validation/Cargo.toml +++ b/rs/bitcoin/validation/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bitcoin = { workspace = true } +bitcoin = "0.32.4" primitive-types = "0.12" [dev-dependencies] From d5586a0fc5ebf9020dea7404ca84b1a3f961e50f Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Wed, 4 Dec 2024 15:05:23 +0000 Subject: [PATCH 03/50] update x --- rs/bitcoin/adapter/src/blockchainmanager.rs | 23 ++- rs/bitcoin/adapter/src/blockchainstate.rs | 5 +- rs/bitcoin/validation/src/header.rs | 166 +------------------- 3 files changed, 19 insertions(+), 175 deletions(-) diff --git a/rs/bitcoin/adapter/src/blockchainmanager.rs b/rs/bitcoin/adapter/src/blockchainmanager.rs index 71ba3e515d6..057d31795d1 100644 --- a/rs/bitcoin/adapter/src/blockchainmanager.rs +++ b/rs/bitcoin/adapter/src/blockchainmanager.rs @@ -5,11 +5,10 @@ use crate::{ Channel, Command, ProcessBitcoinNetworkMessageError, }; use bitcoin::{ - p2p::{ + block::Header as BlockHeader, hashes::Hash as _, p2p::{ message::{NetworkMessage, MAX_INV_SIZE}, message_blockdata::{GetHeadersMessage, Inventory}, - }, - Block, BlockHash, block::Header as BlockHeader, + }, Block, BlockHash }; use hashlink::{LinkedHashMap, LinkedHashSet}; use ic_btc_validation::ValidateHeaderError; @@ -389,7 +388,7 @@ impl BlockchainManager { if headers.len() < MAX_HEADERS_SIZE { None } else { - Some((vec![last.header.block_hash()], BlockHash::default())) + Some((vec![last.header.block_hash()], BlockHash::all_zeros())) } } else { None @@ -472,7 +471,7 @@ impl BlockchainManager { tip: initial_hash, }, ); - let locators = (locator_hashes, BlockHash::default()); + let locators = (locator_hashes, BlockHash::all_zeros()); self.send_getheaders(channel, addr, locators); } @@ -687,7 +686,7 @@ impl BlockchainManager { if !self.getheaders_requests.contains_key(&addr) && self.catchup_headers.contains(&addr) { let locators = self.blockchain.lock().unwrap().locator_hashes(); - self.send_getheaders(channel, &addr, (locators, BlockHash::default())); + self.send_getheaders(channel, &addr, (locators, BlockHash::all_zeros())); self.catchup_headers.remove(&addr); } } @@ -815,7 +814,7 @@ pub mod test { assert_eq!(channel.command_count(), 1); - let locators = (vec![genesis_hash], BlockHash::default()); + let locators = (vec![genesis_hash], BlockHash::all_zeros()); blockchain_manager.send_getheaders(&mut channel, &addr, locators.clone()); assert!(blockchain_manager.getheaders_requests.contains_key(&addr)); let request = blockchain_manager.getheaders_requests.get(&addr).unwrap(); @@ -824,7 +823,7 @@ pub mod test { let command = channel.pop_front().expect("command not found"); assert!(matches!(command.address, Some(address) if address == addr)); assert!( - matches!(&command.message, NetworkMessage::GetHeaders(GetHeadersMessage { version: _, locator_hashes: _, stop_hash }) if *stop_hash == BlockHash::default()) + matches!(&command.message, NetworkMessage::GetHeaders(GetHeadersMessage { version: _, locator_hashes: _, stop_hash }) if *stop_hash == BlockHash::all_zeros()) ); assert!( matches!(&command.message, NetworkMessage::GetHeaders(GetHeadersMessage { version, locator_hashes: _, stop_hash: _ }) if *version == MINIMUM_VERSION_NUMBER) @@ -894,7 +893,7 @@ pub mod test { _ => GetHeadersMessage { version: 0, locator_hashes: vec![], - stop_hash: BlockHash::default(), + stop_hash: BlockHash::all_zeros(), }, }; assert_eq!( @@ -904,7 +903,7 @@ pub mod test { ); assert_eq!( get_headers_message.stop_hash, - BlockHash::default(), + BlockHash::all_zeros(), "Didn't send the right stop hash for initial syncing" ); @@ -932,7 +931,7 @@ pub mod test { _ => GetHeadersMessage { version: 0, locator_hashes: vec![], - stop_hash: BlockHash::default(), + stop_hash: BlockHash::all_zeros(), }, }; assert_eq!( @@ -941,7 +940,7 @@ pub mod test { ); assert_eq!( get_headers_message.stop_hash, - BlockHash::default(), + BlockHash::all_zeros(), "Didn't send the right stop hash for initial syncing" ); } diff --git a/rs/bitcoin/adapter/src/blockchainstate.rs b/rs/bitcoin/adapter/src/blockchainstate.rs index badcae3860c..a7846bf337b 100644 --- a/rs/bitcoin/adapter/src/blockchainstate.rs +++ b/rs/bitcoin/adapter/src/blockchainstate.rs @@ -7,8 +7,7 @@ use ic_metrics::MetricsRegistry; use std::collections::HashMap; use thiserror::Error; -/// This field contains the datatype used to store "work" of a Bitcoin blockchain -pub type Work = primitive_types::U256; +use bitcoin::Work; /// Contains the necessary information about a tip. #[derive(Clone, Debug)] @@ -545,7 +544,7 @@ mod test { let initial_header = state.genesis(); let mut chain = generate_headers(initial_header.block_hash(), initial_header.time, 16, &[]); let last_header = chain.get_mut(10).unwrap(); - last_header.prev_blockhash = BlockHash::default(); + last_header.prev_blockhash = BlockHash::all_zeros(); let chain_hashes: Vec = chain.iter().map(|header| header.block_hash()).collect(); let last_hash = chain_hashes[10]; diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index 0dfbda91b35..3a337ffa3ae 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -35,8 +35,6 @@ pub enum ValidateHeaderError { PrevHeaderNotFound, } -const ONE_HOUR: u64 = 3_600; - pub trait HeaderStore { /// Returns the header with the given block hash. fn get_with_block_hash(&self, hash: &BlockHash) -> Option; @@ -61,7 +59,6 @@ pub fn validate_header( network: &Network, store: &impl HeaderStore, header: &BlockHeader, - current_time: u64, ) -> Result<(), ValidateHeaderError> { let prev_height = store.height(); let prev_header = match store.get_with_block_hash(&header.prev_blockhash) { @@ -71,8 +68,6 @@ pub fn validate_header( } }; - is_timestamp_valid(store, header, current_time)?; - let header_target = header.target(); if header_target > max_target(network) { return Err(ValidateHeaderError::TargetDifficultyAboveMax); @@ -95,54 +90,6 @@ pub fn validate_header( Ok(()) } -fn timestamp_is_less_than_2h_in_future( - block_time: u64, - current_time: u64, -) -> Result<(), ValidateHeaderError> { - let max_allowed_time = current_time + 2 * ONE_HOUR; - - if block_time > max_allowed_time { - return Err(ValidateHeaderError::HeaderIsTooFarInFuture { - block_time, - max_allowed_time, - }); - } - - Ok(()) -} - -/// Validates if a header's timestamp is valid. -/// Bitcoin Protocol Rules wiki https://en.bitcoin.it/wiki/Protocol_rules says, -/// "Reject if timestamp is the median time of the last 11 blocks or before" -/// "Block timestamp must not be more than two hours in the future" -fn is_timestamp_valid( - store: &impl HeaderStore, - header: &BlockHeader, - current_time: u64, -) -> Result<(), ValidateHeaderError> { - timestamp_is_less_than_2h_in_future(header.time as u64, current_time)?; - let mut times = vec![]; - let mut current_header = *header; - let initial_hash = store.get_initial_hash(); - for _ in 0..11 { - if let Some(prev_header) = store.get_with_block_hash(¤t_header.prev_blockhash) { - times.push(prev_header.time); - if current_header.prev_blockhash == initial_hash { - break; - } - current_header = prev_header; - } - } - - times.sort_unstable(); - let median = times[times.len() / 2]; - if header.time <= median { - return Err(ValidateHeaderError::HeaderIsOld); - } - - Ok(()) -} - // Returns the next required target at the given timestamp. // The target is the number that a block hash must be below for it to be accepted. fn get_next_target( @@ -425,7 +372,7 @@ mod test { let header_705600 = deserialize_header(MAINNET_HEADER_705600); let header_705601 = deserialize_header(MAINNET_HEADER_705601); let store = SimpleHeaderStore::new(header_705600, 705_600); - let result = validate_header(&Network::Bitcoin, &store, &header_705601, MOCK_CURRENT_TIME); + let result = validate_header(&Network::Bitcoin, &store, &header_705601); assert!(result.is_ok()); } @@ -438,7 +385,6 @@ mod test { &Network::Testnet, &store, &header_2132556, - MOCK_CURRENT_TIME, ); assert!(result.is_ok()); } @@ -449,7 +395,7 @@ mod test { let mut store = SimpleHeaderStore::new(header_586656, 586_656); let headers = get_bitcoin_headers(); for (i, header) in headers.iter().enumerate() { - let result = validate_header(&Network::Bitcoin, &store, header, MOCK_CURRENT_TIME); + let result = validate_header(&Network::Bitcoin, &store, header); assert!( result.is_ok(), "Failed to validate header on line {}: {:?}", @@ -460,112 +406,12 @@ mod test { } } - #[test] - fn test_timestamp_is_less_than_2h_in_future() { - // Time is represented as the number of seconds after 01.01.1970 00:00. - // Hence, if block time is 10 seconds after that time, - // 'timestamp_is_less_than_2h_in_future' should return true. - - assert!(timestamp_is_less_than_2h_in_future(10, MOCK_CURRENT_TIME).is_ok()); - - assert!(timestamp_is_less_than_2h_in_future( - MOCK_CURRENT_TIME - ONE_HOUR, - MOCK_CURRENT_TIME - ) - .is_ok()); - - assert!(timestamp_is_less_than_2h_in_future(MOCK_CURRENT_TIME, MOCK_CURRENT_TIME).is_ok()); - - assert!(timestamp_is_less_than_2h_in_future( - MOCK_CURRENT_TIME + ONE_HOUR, - MOCK_CURRENT_TIME - ) - .is_ok()); - - assert!(timestamp_is_less_than_2h_in_future( - MOCK_CURRENT_TIME + 2 * ONE_HOUR - 5, - MOCK_CURRENT_TIME - ) - .is_ok()); - - // 'timestamp_is_less_than_2h_in_future' should return false - // because the time is more than 2 hours from the current time. - assert_eq!( - timestamp_is_less_than_2h_in_future( - MOCK_CURRENT_TIME + 2 * ONE_HOUR + 10, - MOCK_CURRENT_TIME - ), - Err(ValidateHeaderError::HeaderIsTooFarInFuture { - block_time: MOCK_CURRENT_TIME + 2 * ONE_HOUR + 10, - max_allowed_time: MOCK_CURRENT_TIME + 2 * ONE_HOUR - }) - ); - } - - #[test] - fn test_is_timestamp_valid() { - let header_705600 = deserialize_header(MAINNET_HEADER_705600); - let header_705601 = deserialize_header(MAINNET_HEADER_705601); - let header_705602 = deserialize_header(MAINNET_HEADER_705602); - let mut store = SimpleHeaderStore::new(header_705600, 705_600); - store.add(header_705601); - store.add(header_705602); - - let mut header = BlockHeader { - version: Version::from_consensus(0x20800004), - prev_blockhash: BlockHash::from_str( - "00000000000000000001eea12c0de75000c2546da22f7bf42d805c1d2769b6ef", - ) - .unwrap(), - merkle_root: TxMerkleNode::from_str( - "c120ff2ae1363593a0b92e0d281ec341a0cc989b4ee836dc3405c9f4215242a6", - ) - .unwrap(), - time: 1634590600, - bits: CompactTarget::from_consensus(0x170e0408), - nonce: 0xb48e8b0a, - }; - assert!(is_timestamp_valid(&store, &header, MOCK_CURRENT_TIME).is_ok()); - - // Monday, October 18, 2021 20:26:40 - header.time = 1634588800; - assert!(matches!( - is_timestamp_valid(&store, &header, MOCK_CURRENT_TIME), - Err(ValidateHeaderError::HeaderIsOld) - )); - - let result = validate_header(&Network::Bitcoin, &store, &header, MOCK_CURRENT_TIME); - assert!(matches!(result, Err(ValidateHeaderError::HeaderIsOld))); - - header.time = (MOCK_CURRENT_TIME - ONE_HOUR) as u32; - - assert!(is_timestamp_valid(&store, &header, MOCK_CURRENT_TIME).is_ok()); - - header.time = (MOCK_CURRENT_TIME + 2 * ONE_HOUR + 10) as u32; - assert_eq!( - is_timestamp_valid(&store, &header, MOCK_CURRENT_TIME), - Err(ValidateHeaderError::HeaderIsTooFarInFuture { - block_time: header.time as u64, - max_allowed_time: MOCK_CURRENT_TIME + 2 * ONE_HOUR - }) - ); - - let result = validate_header(&Network::Bitcoin, &store, &header, MOCK_CURRENT_TIME); - assert_eq!( - result, - Err(ValidateHeaderError::HeaderIsTooFarInFuture { - block_time: header.time as u64, - max_allowed_time: MOCK_CURRENT_TIME + 2 * ONE_HOUR, - }) - ); - } - #[test] fn test_is_header_valid_missing_prev_header() { let header_705600 = deserialize_header(MAINNET_HEADER_705600); let header_705602 = deserialize_header(MAINNET_HEADER_705602); let store = SimpleHeaderStore::new(header_705600, 705_600); - let result = validate_header(&Network::Bitcoin, &store, &header_705602, MOCK_CURRENT_TIME); + let result = validate_header(&Network::Bitcoin, &store, &header_705602); assert!(matches!( result, Err(ValidateHeaderError::PrevHeaderNotFound) @@ -578,7 +424,7 @@ mod test { let mut header = deserialize_header(MAINNET_HEADER_705601); header.bits = pow_limit_bits(&Network::Bitcoin); let store = SimpleHeaderStore::new(header_705600, 705_600); - let result = validate_header(&Network::Bitcoin, &store, &header, MOCK_CURRENT_TIME); + let result = validate_header(&Network::Bitcoin, &store, &header); assert!(matches!( result, Err(ValidateHeaderError::InvalidPoWForHeaderTarget) @@ -596,7 +442,7 @@ mod test { let mut store = SimpleHeaderStore::new(h0, 0); store.add(h1); store.add(h2); - let result = validate_header(&Network::Regtest, &store, &h3, MOCK_CURRENT_TIME); + let result = validate_header(&Network::Regtest, &store, &h3); assert!(matches!( result, Err(ValidateHeaderError::InvalidPoWForComputedTarget) @@ -609,7 +455,7 @@ mod test { let mut header = deserialize_header(MAINNET_HEADER_705601); header.bits = pow_limit_bits(&Network::Regtest); let store = SimpleHeaderStore::new(header_705600, 705_600); - let result = validate_header(&Network::Bitcoin, &store, &header, MOCK_CURRENT_TIME); + let result = validate_header(&Network::Bitcoin, &store, &header); assert!(matches!( result, Err(ValidateHeaderError::TargetDifficultyAboveMax) From 012d9fad3b4feccf0c716e0b854d8f2b2a4b493d Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Thu, 5 Dec 2024 09:01:46 +0000 Subject: [PATCH 04/50] more upgrades --- Cargo.lock | 7 +++++++ Cargo.toml | 2 +- rs/bitcoin/adapter/src/blockchainstate.rs | 2 +- rs/bitcoin/adapter/src/config.rs | 1 + rs/bitcoin/adapter/src/connectionmanager.rs | 4 ++-- rs/bitcoin/adapter/src/get_successors_handler.rs | 1 + rs/bitcoin/adapter/src/stream.rs | 6 +++--- rs/bitcoin/validation/src/constants.rs | 8 ++++---- rs/bitcoin/validation/src/header.rs | 4 ++-- 9 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e37e6e80250..482d5d62f65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1199,6 +1199,7 @@ dependencies = [ "hex-conservative", "hex_lit", "secp256k1 0.29.1", + "serde", ] [[package]] @@ -1206,6 +1207,9 @@ name = "bitcoin-internals" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" +dependencies = [ + "serde", +] [[package]] name = "bitcoin-io" @@ -1226,6 +1230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2" dependencies = [ "bitcoin-internals", + "serde", ] [[package]] @@ -1255,6 +1260,7 @@ checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" dependencies = [ "bitcoin-io", "hex-conservative", + "serde", ] [[package]] @@ -19131,6 +19137,7 @@ dependencies = [ "bitcoin_hashes 0.14.0", "rand 0.8.5", "secp256k1-sys 0.10.1", + "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 81ddb481cec..b4ebafc31b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -505,7 +505,7 @@ axum = "0.7.7" backoff = "0.4" base64 = { version = "0.13.1" } bincode = "1.3.3" -bitcoin = { version = "0.32.4", features = ["default", "rand"] } +bitcoin = { version = "0.32.4", features = ["default", "rand", "serde"] } # build-info and build-info-build MUST be kept in sync! build-info = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7" } build-info-build = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7", default-features = false } diff --git a/rs/bitcoin/adapter/src/blockchainstate.rs b/rs/bitcoin/adapter/src/blockchainstate.rs index a7846bf337b..44341666b71 100644 --- a/rs/bitcoin/adapter/src/blockchainstate.rs +++ b/rs/bitcoin/adapter/src/blockchainstate.rs @@ -327,7 +327,7 @@ impl BlockchainState { /// Returns the current size of the block cache. pub fn get_block_cache_size(&self) -> usize { - self.block_cache.values().fold(0, |sum, b| b.size() + sum) + self.block_cache.values().fold(0, |sum, b| b.total_size() + sum) } } diff --git a/rs/bitcoin/adapter/src/config.rs b/rs/bitcoin/adapter/src/config.rs index 9c69afd12f4..dd1750ab6cc 100644 --- a/rs/bitcoin/adapter/src/config.rs +++ b/rs/bitcoin/adapter/src/config.rs @@ -64,6 +64,7 @@ pub(crate) fn address_limits(network: Network) -> (usize, usize) { Network::Testnet => (100, 1000), Network::Signet => (1, 1), Network::Regtest => (1, 1), + &other => unreachable!("Unsupported network: {:?}", other), } } diff --git a/rs/bitcoin/adapter/src/connectionmanager.rs b/rs/bitcoin/adapter/src/connectionmanager.rs index 868a51aad31..318ef11c4ab 100644 --- a/rs/bitcoin/adapter/src/connectionmanager.rs +++ b/rs/bitcoin/adapter/src/connectionmanager.rs @@ -9,7 +9,7 @@ use bitcoin::p2p::ServiceFlags; use bitcoin::p2p::{ message::{CommandString, NetworkMessage}, message_network::VersionMessage, - Address, + Address, Magic, }; use ic_logger::{error, info, trace, warn, ReplicaLogger}; use rand::prelude::*; @@ -82,7 +82,7 @@ pub struct ConnectionManager { logger: ReplicaLogger, /// This field is used to provide the magic value to the raw network message. /// The magic number is used to identity the type of Bitcoin network being accessed. - magic: u32, + magic: Magic, /// This field contains the number of connections the connection manager can manage at one time. max_connections: usize, /// This field contains the number of connections the connection manager must have in order to send messages. diff --git a/rs/bitcoin/adapter/src/get_successors_handler.rs b/rs/bitcoin/adapter/src/get_successors_handler.rs index 5b9da89f689..e37dfdc6e01 100644 --- a/rs/bitcoin/adapter/src/get_successors_handler.rs +++ b/rs/bitcoin/adapter/src/get_successors_handler.rs @@ -238,6 +238,7 @@ fn are_multiple_blocks_allowed(network: Network, anchor_height: BlockHeight) -> match network { Network::Bitcoin => anchor_height <= MAINNET_MAX_MULTI_BLOCK_ANCHOR_HEIGHT, Network::Testnet | Network::Signet | Network::Regtest => true, + &other => unreachable!("Unsupported network: {:?}", other), } } diff --git a/rs/bitcoin/adapter/src/stream.rs b/rs/bitcoin/adapter/src/stream.rs index 484b9092df5..dac0c23e031 100644 --- a/rs/bitcoin/adapter/src/stream.rs +++ b/rs/bitcoin/adapter/src/stream.rs @@ -70,7 +70,7 @@ pub struct StreamConfig { pub logger: ReplicaLogger, /// This field is used to provide the magic value to the raw network message. /// The magic number is used to identity the type of Bitcoin network being accessed. - pub magic: u32, + pub magic: Magic, /// This field is used to receive network messages to send out to the connected /// BTC node. pub network_message_receiver: UnboundedReceiver, @@ -118,7 +118,7 @@ pub struct Stream { write_half: OwnedWriteHalf, /// This field is used to provide the magic value to the raw network message. /// The magic number is used to identify the type of Bitcoin network being accessed. - magic: u32, + magic: Magic, /// This field contains the receiver used to intake messages that are to be /// sent to the connected node. network_message_receiver: UnboundedReceiver, @@ -266,7 +266,7 @@ impl Stream { /// This function is used to write a network message to the connected Bitcoin /// node. async fn write_message(&mut self, network_message: NetworkMessage) -> StreamResult<()> { - let raw_network_message = RawNetworkMessage::new(Magic::from_bytes(self.magic.to_be_bytes()), network_message); + let raw_network_message = RawNetworkMessage::new(self.magic, network_message); let bytes = serialize(&raw_network_message); self.write_half .write_all(bytes.as_slice()) diff --git a/rs/bitcoin/validation/src/constants.rs b/rs/bitcoin/validation/src/constants.rs index 3f2e4e762e1..435a8fdbddb 100644 --- a/rs/bitcoin/validation/src/constants.rs +++ b/rs/bitcoin/validation/src/constants.rs @@ -12,10 +12,10 @@ pub const TEN_MINUTES: u32 = 60 * 10; 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, - _ => unreachable!(), + &other => unreachable!("Unsupported network: {:?}", other), } } @@ -25,7 +25,7 @@ pub fn no_pow_retargeting(network: &Network) -> bool { match network { Network::Bitcoin | Network::Testnet | Network::Signet => false, Network::Regtest => true, - _ => unreachable!(), + &other => unreachable!("Unsupported network: {:?}", other), } } @@ -36,7 +36,7 @@ pub fn pow_limit_bits(network: &Network) -> CompactTarget { Network::Testnet => 0x1d00ffff, Network::Regtest => 0x207fffff, Network::Signet => 0x1e0377ae, - _ => unreachable!(), + &other => unreachable!("Unsupported network: {:?}", other), }) } diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index 3a337ffa3ae..bbb66adcffe 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -123,7 +123,7 @@ fn get_next_target( Network::Bitcoin | Network::Signet => { compute_next_difficulty(network, store, prev_header, prev_height) } - _ => unreachable!(), + &other => unreachable!("Unsupported network: {:?}", other), } } @@ -176,7 +176,7 @@ fn find_next_difficulty_in_chain( pow_limit_bits } Network::Bitcoin | Network::Signet => pow_limit_bits, - _ => unreachable!(), + &other => unreachable!("Unsupported network: {:?}", other), } } From 458cbdda188608e96d45d3ee0a8c63ea2a0f5b6f Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Thu, 5 Dec 2024 10:03:38 +0000 Subject: [PATCH 05/50] cargo adapter works --- rs/bitcoin/adapter/src/config.rs | 2 +- .../adapter/src/get_successors_handler.rs | 5 +-- rs/bitcoin/adapter/src/stream.rs | 3 +- rs/bitcoin/adapter/src/transaction_store.rs | 34 +++++++++---------- rs/bitcoin/adapter/tests/adapter_test.rs | 2 +- 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/rs/bitcoin/adapter/src/config.rs b/rs/bitcoin/adapter/src/config.rs index dd1750ab6cc..3082e41e734 100644 --- a/rs/bitcoin/adapter/src/config.rs +++ b/rs/bitcoin/adapter/src/config.rs @@ -64,7 +64,7 @@ pub(crate) fn address_limits(network: Network) -> (usize, usize) { Network::Testnet => (100, 1000), Network::Signet => (1, 1), Network::Regtest => (1, 1), - &other => unreachable!("Unsupported network: {:?}", other), + other => unreachable!("Unsupported network: {:?}", other), } } diff --git a/rs/bitcoin/adapter/src/get_successors_handler.rs b/rs/bitcoin/adapter/src/get_successors_handler.rs index e37dfdc6e01..397667edb07 100644 --- a/rs/bitcoin/adapter/src/get_successors_handler.rs +++ b/rs/bitcoin/adapter/src/get_successors_handler.rs @@ -168,7 +168,8 @@ fn get_successor_blocks( // Retrieve the block from the cache. match state.get_block(block_hash) { Some(block) => { - let block_size = block.size(); + //TODO(mihailjianu): think this through. + let block_size = block.total_size(); if response_block_size == 0 || (response_block_size + block_size <= MAX_BLOCKS_BYTES && successor_blocks.len() < MAX_BLOCKS_LENGTH @@ -238,7 +239,7 @@ fn are_multiple_blocks_allowed(network: Network, anchor_height: BlockHeight) -> match network { Network::Bitcoin => anchor_height <= MAINNET_MAX_MULTI_BLOCK_ANCHOR_HEIGHT, Network::Testnet | Network::Signet | Network::Regtest => true, - &other => unreachable!("Unsupported network: {:?}", other), + other => unreachable!("Unsupported network: {:?}", other), } } diff --git a/rs/bitcoin/adapter/src/stream.rs b/rs/bitcoin/adapter/src/stream.rs index dac0c23e031..85f24463318 100644 --- a/rs/bitcoin/adapter/src/stream.rs +++ b/rs/bitcoin/adapter/src/stream.rs @@ -4,6 +4,7 @@ use bitcoin::{ p2p::Magic, {consensus::encode, p2p::message::NetworkMessage}, }; +use bitcoin::io as bitcoin_io; use futures::TryFutureExt; use http::Uri; use ic_logger::{debug, error, info, ReplicaLogger}; @@ -229,7 +230,7 @@ impl Stream { // If the read successfully received bytes, then the bytes are added to the // unparsed buffer to attempt another deserialize call. If no bytes found, // return the unexpected end-of-file error. - Err(encode::Error::Io(ref err)) if err.kind() == io::ErrorKind::UnexpectedEof => { + Err(encode::Error::Io(ref err)) if err.kind() == bitcoin_io::ErrorKind::UnexpectedEof => { let count = self .read_half .try_read(&mut self.data) diff --git a/rs/bitcoin/adapter/src/transaction_store.rs b/rs/bitcoin/adapter/src/transaction_store.rs index 72f15a27644..192b2e3d13a 100644 --- a/rs/bitcoin/adapter/src/transaction_store.rs +++ b/rs/bitcoin/adapter/src/transaction_store.rs @@ -86,7 +86,7 @@ impl TransactionStore { .txn_ops .with_label_values(&["insert", "enqueued"]) .inc(); - let txid = transaction.txid(); + let txid = transaction.compute_txid(); trace!(self.logger, "Received {} from the system component", txid); // If hashmap has `TX_CACHE_SIZE` values we remove the oldest transaction in the cache. if self.transactions.len() == TX_CACHE_SIZE { @@ -245,7 +245,7 @@ mod test { let info = manager .transactions - .get_mut(&transaction.txid()) + .get_mut(&transaction.compute_txid()) .expect("transaction should be map"); info.ttl = SystemTime::now() - Duration::from_secs(TX_CACHE_TIMEOUT_PERIOD_SECS); manager.advertise_txids(&mut channel); @@ -264,12 +264,12 @@ mod test { let mut manager = make_transaction_manager(); let transaction = get_transaction(); let raw_tx = serialize(&transaction); - let txid = transaction.txid(); + let txid = transaction.compute_txid(); manager.enqueue_transaction(&raw_tx); assert_eq!(manager.transactions.len(), 1); let info = manager .transactions - .get(&transaction.txid()) + .get(&transaction.compute_txid()) .expect("transaction should be map"); assert!(info.advertised.is_empty()); // Initial broadcast @@ -317,7 +317,7 @@ mod test { manager.enqueue_transaction(&raw_tx); } assert_eq!(manager.transactions.len(), TX_CACHE_SIZE); - assert!(manager.transactions.get(&first_tx.txid()).is_none()); + assert!(manager.transactions.get(&first_tx.compute_txid()).is_none()); } /// This function tests that we don't readvertise transactions that were already advertised. @@ -344,7 +344,7 @@ mod test { .process_bitcoin_network_message( &mut channel, address, - &NetworkMessage::GetData(vec![Inventory::Transaction(transaction.txid())]), + &NetworkMessage::GetData(vec![Inventory::Transaction(transaction.compute_txid())]), ) .unwrap(); // Send transaction @@ -357,7 +357,7 @@ mod test { assert_eq!( manager .transactions - .get(&transaction.txid()) + .get(&transaction.compute_txid()) .unwrap() .advertised .len(), @@ -366,7 +366,7 @@ mod test { assert_eq!( manager .transactions - .get(&transaction.txid()) + .get(&transaction.compute_txid()) .unwrap() .advertised .get(&address), @@ -402,7 +402,7 @@ mod test { .process_bitcoin_network_message( &mut channel, address1, - &NetworkMessage::GetData(vec![Inventory::Transaction(transaction.txid())]), + &NetworkMessage::GetData(vec![Inventory::Transaction(transaction.compute_txid())]), ) .unwrap(); // Send transaction to peer 1 @@ -441,7 +441,7 @@ mod test { .process_bitcoin_network_message( &mut channel, address1, - &NetworkMessage::GetData(vec![Inventory::Transaction(transaction.txid())]), + &NetworkMessage::GetData(vec![Inventory::Transaction(transaction.compute_txid())]), ) .unwrap(); channel.pop_front().unwrap(); @@ -461,7 +461,7 @@ mod test { channel.pop_front().unwrap(), Command { address: Some(address2), - message: NetworkMessage::Inv(vec![Inventory::Transaction(transaction.txid())]) + message: NetworkMessage::Inv(vec![Inventory::Transaction(transaction.compute_txid())]) } ); } @@ -479,7 +479,7 @@ mod test { let mut manager = make_transaction_manager(); let transaction = get_transaction(); let raw_tx = serialize(&transaction); - let txid = transaction.txid(); + let txid = transaction.compute_txid(); manager.enqueue_transaction(&raw_tx); assert_eq!(manager.transactions.len(), 1); manager @@ -491,7 +491,7 @@ mod test { .ok(); assert_eq!(channel.command_count(), 1); let command = channel.pop_front().unwrap(); - assert!(matches!(command.message, NetworkMessage::Tx(t) if t.txid() == txid)); + assert!(matches!(command.message, NetworkMessage::Tx(t) if t.compute_txid() == txid)); } /// This function tests the `TransactionStore::process_bitcoin_network_message(...)` method. @@ -511,7 +511,7 @@ mod test { let mut transaction = get_transaction(); // Alter transaction such that we get a different `txid` transaction.lock_time = i.try_into().unwrap(); - let txid = transaction.txid(); + let txid = transaction.compute_txid(); inventory.push(Inventory::Transaction(txid)); } manager @@ -536,7 +536,7 @@ mod test { let mut manager = make_transaction_manager(); let transaction = get_transaction(); let raw_tx = serialize(&transaction); - let txid = transaction.txid(); + let txid = transaction.compute_txid(); manager.enqueue_transaction(&raw_tx); manager.advertise_txids(&mut channel); manager @@ -561,12 +561,12 @@ mod test { ); let command = channel.pop_front().unwrap(); - assert!(matches!(command.message, NetworkMessage::Tx(t) if t.txid() == txid)); + assert!(matches!(command.message, NetworkMessage::Tx(t) if t.compute_txid() == txid)); manager.enqueue_transaction(&raw_tx); let info = manager .transactions - .get_mut(&transaction.txid()) + .get_mut(&transaction.compute_txid()) .expect("transaction should be in the map"); info.ttl = SystemTime::now() - Duration::from_secs(TX_CACHE_TIMEOUT_PERIOD_SECS); manager.advertise_txids(&mut channel); diff --git a/rs/bitcoin/adapter/tests/adapter_test.rs b/rs/bitcoin/adapter/tests/adapter_test.rs index 0192a8d99e3..d069432210a 100644 --- a/rs/bitcoin/adapter/tests/adapter_test.rs +++ b/rs/bitcoin/adapter/tests/adapter_test.rs @@ -709,7 +709,7 @@ fn test_receives_new_3rd_party_txs() { let blocks = sync_until_end_block(&adapter_client, &alice_client, 101, &mut vec![], 15); assert_eq!(blocks.len(), 1); - assert!(blocks[0].txdata.iter().any(|tx| tx.txid() == txid)); + assert!(blocks[0].txdata.iter().any(|tx| tx.compute_txid() == txid)); } /// Ensures the client (replica) can send a transaction (1 BTC from Alice to Bob) using the gRPC service. From 43b18b640642607c54ea391745e74779078462d5 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Thu, 5 Dec 2024 15:19:11 +0000 Subject: [PATCH 06/50] bazel adapter works --- Cargo.Bazel.json.lock | 398 ++++++++++++++---- Cargo.Bazel.toml.lock | 59 ++- Cargo.lock | 58 ++- Cargo.toml | 1 + bazel/external_crates.bzl | 12 +- rs/bitcoin/adapter/Cargo.toml | 2 +- rs/bitcoin/adapter/src/blockchainmanager.rs | 3 +- rs/bitcoin/adapter/src/blockchainstate.rs | 16 +- rs/bitcoin/adapter/src/stream.rs | 4 +- rs/bitcoin/adapter/src/stress_test.rs | 6 +- rs/bitcoin/adapter/src/transaction_store.rs | 14 +- rs/bitcoin/adapter/test_utils/src/bitcoind.rs | 49 ++- rs/bitcoin/adapter/test_utils/src/lib.rs | 27 +- rs/bitcoin/adapter/tests/adapter_test.rs | 24 +- rs/bitcoin/kyt/BUILD.bazel | 4 +- rs/bitcoin/kyt/Cargo.toml | 2 +- rs/bitcoin/validation/BUILD.bazel | 2 +- rs/bitcoin/validation/Cargo.toml | 3 +- rs/bitcoin/validation/src/header.rs | 42 +- 19 files changed, 512 insertions(+), 214 deletions(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index f3efc0d6ce8..c36989adc33 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "b61894d7da504d745642b2993d05928f240c7fdf4887db6ae02522a9f6e34804", + "checksum": "93d34416a8eeb74a348063085b337ce6aefa244543c56a833f7a36a797acc410", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -5443,6 +5443,12 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -5875,7 +5881,8 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "std" ], "selects": {} }, @@ -6615,9 +6622,7 @@ "default", "rand", "secp-recovery", - "serde", - "std", - "use-serde" + "std" ], "selects": {} }, @@ -6634,10 +6639,6 @@ { "id": "secp256k1 0.22.2", "target": "secp256k1" - }, - { - "id": "serde 1.0.214", - "target": "serde" } ], "selects": {} @@ -6755,14 +6756,14 @@ ], "license_file": null }, - "bitcoin 0.32.2": { + "bitcoin 0.32.5": { "name": "bitcoin", - "version": "0.32.2", + "version": "0.32.5", "package_url": "https://github.com/rust-bitcoin/rust-bitcoin/", "repository": { "Http": { - "url": "https://static.crates.io/crates/bitcoin/0.32.2/download", - "sha256": "ea507acc1cd80fc084ace38544bbcf7ced7c2aa65b653b102de0ce718df668f6" + "url": "https://static.crates.io/crates/bitcoin/0.32.5/download", + "sha256": "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" } }, "targets": [ @@ -6796,6 +6797,18 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "actual-serde", + "default", + "rand", + "rand-std", + "secp-recovery", + "serde", + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -6808,7 +6821,7 @@ "target": "bech32" }, { - "id": "bitcoin 0.32.2", + "id": "bitcoin 0.32.5", "target": "build_script_build" }, { @@ -6843,12 +6856,17 @@ { "id": "secp256k1 0.29.0", "target": "secp256k1" + }, + { + "id": "serde 1.0.214", + "target": "serde", + "alias": "actual_serde" } ], "selects": {} }, "edition": "2021", - "version": "0.32.2" + "version": "0.32.5" }, "build_script_attrs": { "compile_data_glob": [ @@ -6908,7 +6926,9 @@ "crate_features": { "common": [ "alloc", - "default" + "default", + "serde", + "std" ], "selects": {} }, @@ -6917,6 +6937,10 @@ { "id": "bitcoin-internals 0.3.0", "target": "build_script_build" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -6969,7 +6993,8 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "std" ], "selects": {} }, @@ -7088,7 +7113,9 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "serde", + "std" ], "selects": {} }, @@ -7098,6 +7125,10 @@ "id": "bitcoin-internals 0.3.0", "target": "bitcoin_internals", "alias": "internals" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -7142,20 +7173,10 @@ ], "crate_features": { "common": [ - "serde", "std" ], "selects": {} }, - "deps": { - "common": [ - { - "id": "serde 1.0.214", - "target": "serde" - } - ], - "selects": {} - }, "edition": "2015", "version": "0.10.0" }, @@ -7258,7 +7279,9 @@ "common": [ "alloc", "bitcoin-io", - "io" + "io", + "serde", + "std" ], "selects": {} }, @@ -7272,6 +7295,10 @@ "id": "hex-conservative 0.2.1", "target": "hex_conservative", "alias": "hex" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -7285,14 +7312,14 @@ ], "license_file": null }, - "bitcoincore-rpc 0.15.0": { + "bitcoincore-rpc 0.19.0": { "name": "bitcoincore-rpc", - "version": "0.15.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.15.0/download", - "sha256": "dd0e67dbf7a9971e7f4276f6089e9e814ce0f624a03216b7d92d00351ae7fb3e" + "url": "https://static.crates.io/crates/bitcoincore-rpc/0.19.0/download", + "sha256": "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" } }, "targets": [ @@ -7314,14 +7341,21 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "default", + "rand" + ], + "selects": {} + }, "deps": { "common": [ { - "id": "bitcoincore-rpc-json 0.15.0", + "id": "bitcoincore-rpc-json 0.19.0", "target": "bitcoincore_rpc_json" }, { - "id": "jsonrpc 0.12.1", + "id": "jsonrpc 0.18.0", "target": "jsonrpc" }, { @@ -7339,8 +7373,8 @@ ], "selects": {} }, - "edition": "2015", - "version": "0.15.0" + "edition": "2018", + "version": "0.19.0" }, "license": "CC0-1.0", "license_ids": [ @@ -7348,14 +7382,14 @@ ], "license_file": "LICENSE" }, - "bitcoincore-rpc-json 0.15.0": { + "bitcoincore-rpc-json 0.19.0": { "name": "bitcoincore-rpc-json", - "version": "0.15.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.15.0/download", - "sha256": "2e2ae16202721ba8c3409045681fac790a5ddc791f05731a2df22c0c6bffc0f1" + "url": "https://static.crates.io/crates/bitcoincore-rpc-json/0.19.0/download", + "sha256": "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" } }, "targets": [ @@ -7377,10 +7411,17 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "default", + "rand" + ], + "selects": {} + }, "deps": { "common": [ { - "id": "bitcoin 0.28.2", + "id": "bitcoin 0.32.5", "target": "bitcoin" }, { @@ -7394,8 +7435,8 @@ ], "selects": {} }, - "edition": "2015", - "version": "0.15.0" + "edition": "2021", + "version": "0.19.0" }, "license": "CC0-1.0", "license_ids": [ @@ -18209,16 +18250,11 @@ "target": "bit_vec" }, { - "id": "bitcoin 0.28.2", + "id": "bitcoin 0.32.5", "target": "bitcoin" }, { - "id": "bitcoin 0.32.2", - "target": "bitcoin", - "alias": "bitcoin_0_32" - }, - { - "id": "bitcoincore-rpc 0.15.0", + "id": "bitcoincore-rpc 0.19.0", "target": "bitcoincore_rpc" }, { @@ -26748,7 +26784,8 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "std" ], "selects": {} }, @@ -36289,16 +36326,14 @@ "license_ids": [], "license_file": "LICENSE" }, - "jsonrpc 0.12.1": { + "jsonrpc 0.13.0": { "name": "jsonrpc", - "version": "0.12.1", + "version": "0.13.0", "package_url": "https://github.com/apoelstra/rust-jsonrpc/", "repository": { - "Git": { - "remote": "https://github.com/apoelstra/rust-jsonrpc", - "commitish": { - "Rev": "e42044d8e0896317488dfbd65eb5563d76e937fe" - } + "Http": { + "url": "https://static.crates.io/crates/jsonrpc/0.13.0/download", + "sha256": "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" } }, "targets": [ @@ -36347,7 +36382,7 @@ "selects": {} }, "edition": "2018", - "version": "0.12.1" + "version": "0.13.0" }, "license": "CC0-1.0", "license_ids": [ @@ -36355,14 +36390,14 @@ ], "license_file": "LICENSE" }, - "jsonrpc 0.13.0": { + "jsonrpc 0.18.0": { "name": "jsonrpc", - "version": "0.13.0", + "version": "0.18.0", "package_url": "https://github.com/apoelstra/rust-jsonrpc/", "repository": { "Http": { - "url": "https://static.crates.io/crates/jsonrpc/0.13.0/download", - "sha256": "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" + "url": "https://static.crates.io/crates/jsonrpc/0.18.0/download", + "sha256": "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" } }, "targets": [ @@ -36388,6 +36423,8 @@ "common": [ "base64", "default", + "minreq", + "minreq_http", "simple_http", "simple_tcp" ], @@ -36399,6 +36436,10 @@ "id": "base64 0.13.1", "target": "base64" }, + { + "id": "minreq 2.13.0", + "target": "minreq" + }, { "id": "serde 1.0.214", "target": "serde" @@ -36411,7 +36452,7 @@ "selects": {} }, "edition": "2018", - "version": "0.13.0" + "version": "0.18.0" }, "license": "CC0-1.0", "license_ids": [ @@ -41402,6 +41443,93 @@ ], "license_file": "LICENSE" }, + "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.214", + "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", @@ -53211,6 +53339,12 @@ "target": "libc" } ], + "aarch64-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "aarch64-unknown-linux-gnu": [ { "id": "libc 0.2.158", @@ -53259,6 +53393,12 @@ "target": "libc" } ], + "i686-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "i686-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -53307,6 +53447,12 @@ "target": "libc" } ], + "x86_64-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -60272,6 +60418,11 @@ "time", "use-libc-auxv" ], + "aarch64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "aarch64-unknown-linux-gnu": [ "default", "event", @@ -60364,6 +60515,11 @@ "time", "use-libc-auxv" ], + "i686-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "i686-unknown-freebsd": [ "default", "event", @@ -60478,6 +60634,11 @@ "time", "use-libc-auxv" ], + "x86_64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "x86_64-unknown-freebsd": [ "default", "event", @@ -60593,6 +60754,32 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "aarch64-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "aarch64-unknown-nixos-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "aarch64-unknown-nto-qnx710": [ @@ -60606,6 +60793,17 @@ "target": "libc" } ], + "arm-unknown-linux-gnueabi": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "armv7-linux-androideabi": [ { "id": "errno 0.3.8", @@ -60678,6 +60876,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "i686-unknown-freebsd": [ @@ -60691,6 +60893,17 @@ "target": "libc" } ], + "i686-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "powerpc-unknown-linux-gnu": [ { "id": "errno 0.3.8", @@ -60828,6 +61041,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "x86_64-unknown-freebsd": [ @@ -60841,6 +61058,28 @@ "target": "libc" } ], + "x86_64-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "x86_64-unknown-nixos-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-none": [ { "id": "errno 0.3.8", @@ -63068,7 +63307,6 @@ "rand", "rand-std", "recovery", - "serde", "std" ], "selects": {} @@ -63082,10 +63320,6 @@ { "id": "secp256k1-sys 0.5.2", "target": "secp256k1_sys" - }, - { - "id": "serde 1.0.214", - "target": "serde" } ], "selects": {} @@ -63202,7 +63436,12 @@ "crate_features": { "common": [ "alloc", - "hashes" + "hashes", + "rand", + "rand-std", + "recovery", + "serde", + "std" ], "selects": {} }, @@ -63213,9 +63452,17 @@ "target": "bitcoin_hashes", "alias": "hashes" }, + { + "id": "rand 0.8.5", + "target": "rand" + }, { "id": "secp256k1-sys 0.10.0", "target": "secp256k1_sys" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -63441,7 +63688,9 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "recovery", + "std" ], "selects": {} }, @@ -86309,9 +86558,8 @@ "bindgen 0.65.1", "bip32 0.5.1", "bit-vec 0.6.3", - "bitcoin 0.28.2", - "bitcoin 0.32.2", - "bitcoincore-rpc 0.15.0", + "bitcoin 0.32.5", + "bitcoincore-rpc 0.19.0", "bitcoind 0.32.0", "bitflags 1.3.2", "bs58 0.5.0", diff --git a/Cargo.Bazel.toml.lock b/Cargo.Bazel.toml.lock index 695791bb3bd..c770560d157 100644 --- a/Cargo.Bazel.toml.lock +++ b/Cargo.Bazel.toml.lock @@ -1157,7 +1157,6 @@ dependencies = [ "bech32 0.8.1", "bitcoin_hashes 0.10.0", "secp256k1 0.22.2", - "serde", ] [[package]] @@ -1176,9 +1175,9 @@ dependencies = [ [[package]] name = "bitcoin" -version = "0.32.2" +version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea507acc1cd80fc084ace38544bbcf7ced7c2aa65b653b102de0ce718df668f6" +checksum = "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" dependencies = [ "base58ck", "bech32 0.11.0", @@ -1189,6 +1188,7 @@ dependencies = [ "hex-conservative", "hex_lit", "secp256k1 0.29.0", + "serde", ] [[package]] @@ -1196,6 +1196,9 @@ name = "bitcoin-internals" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" +dependencies = [ + "serde", +] [[package]] name = "bitcoin-io" @@ -1216,6 +1219,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2" dependencies = [ "bitcoin-internals", + "serde", ] [[package]] @@ -1223,9 +1227,6 @@ name = "bitcoin_hashes" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "006cc91e1a1d99819bc5b8214be3555c1f0611b169f527a1fdc54ed1f2b745b0" -dependencies = [ - "serde", -] [[package]] name = "bitcoin_hashes" @@ -1245,16 +1246,17 @@ checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" dependencies = [ "bitcoin-io", "hex-conservative", + "serde", ] [[package]] name = "bitcoincore-rpc" -version = "0.15.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0e67dbf7a9971e7f4276f6089e9e814ce0f624a03216b7d92d00351ae7fb3e" +checksum = "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" dependencies = [ "bitcoincore-rpc-json", - "jsonrpc 0.12.1", + "jsonrpc 0.18.0", "log", "serde", "serde_json", @@ -1262,11 +1264,11 @@ dependencies = [ [[package]] name = "bitcoincore-rpc-json" -version = "0.15.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e2ae16202721ba8c3409045681fac790a5ddc791f05731a2df22c0c6bffc0f1" +checksum = "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" dependencies = [ - "bitcoin 0.28.2", + "bitcoin 0.32.5", "serde", "serde_json", ] @@ -2972,8 +2974,7 @@ dependencies = [ "bindgen 0.65.1", "bip32", "bit-vec", - "bitcoin 0.28.2", - "bitcoin 0.32.2", + "bitcoin 0.32.5", "bitcoincore-rpc", "bitcoind", "bitflags 1.3.2", @@ -6007,8 +6008,9 @@ dependencies = [ [[package]] name = "jsonrpc" -version = "0.12.1" -source = "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" dependencies = [ "base64 0.13.1", "serde", @@ -6017,11 +6019,12 @@ dependencies = [ [[package]] name = "jsonrpc" -version = "0.13.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" +checksum = "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" dependencies = [ "base64 0.13.1", + "minreq", "serde", "serde_json", ] @@ -6769,6 +6772,17 @@ dependencies = [ "adler", ] +[[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.10" @@ -9759,7 +9773,6 @@ checksum = "295642060261c80709ac034f52fca8e5a9fa2c7d341ded5cdb164b7c33768b2a" dependencies = [ "rand 0.6.5", "secp256k1-sys 0.5.2", - "serde", ] [[package]] @@ -9781,7 +9794,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ "bitcoin_hashes 0.14.0", + "rand 0.8.5", "secp256k1-sys 0.10.0", + "serde", ] [[package]] @@ -13146,3 +13161,9 @@ dependencies = [ "cc", "pkg-config", ] + +[[patch.unused]] +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 482d5d62f65..e26302289ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1269,13 +1269,26 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0e67dbf7a9971e7f4276f6089e9e814ce0f624a03216b7d92d00351ae7fb3e" dependencies = [ - "bitcoincore-rpc-json", + "bitcoincore-rpc-json 0.15.0", "jsonrpc 0.12.1", "log", "serde", "serde_json", ] +[[package]] +name = "bitcoincore-rpc" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" +dependencies = [ + "bitcoincore-rpc-json 0.19.0", + "jsonrpc 0.18.0", + "log", + "serde", + "serde_json", +] + [[package]] name = "bitcoincore-rpc-json" version = "0.15.0" @@ -1287,6 +1300,17 @@ dependencies = [ "serde_json", ] +[[package]] +name = "bitcoincore-rpc-json" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" +dependencies = [ + "bitcoin 0.32.4", + "serde", + "serde_json", +] + [[package]] name = "bitcoind" version = "0.32.0" @@ -4075,7 +4099,7 @@ version = "0.9.0" dependencies = [ "anyhow", "assert_matches", - "bitcoincore-rpc", + "bitcoincore-rpc 0.15.0", "candid", "futures", "ic-agent", @@ -5846,7 +5870,7 @@ name = "ic-btc-adapter" version = "0.9.0" dependencies = [ "bitcoin 0.32.4", - "bitcoincore-rpc", + "bitcoincore-rpc 0.19.0", "bitcoind", "clap 4.5.20", "criterion", @@ -6030,7 +6054,6 @@ version = "0.1.0" dependencies = [ "bitcoin 0.32.4", "csv", - "primitive-types", "proptest 0.9.6", ] @@ -13067,7 +13090,7 @@ version = "0.9.0" dependencies = [ "anyhow", "assert_matches", - "bitcoincore-rpc", + "bitcoincore-rpc 0.15.0", "candid", "canister-test", "dfn_candid", @@ -14589,6 +14612,18 @@ dependencies = [ "serde_json", ] +[[package]] +name = "jsonrpc" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" +dependencies = [ + "base64 0.13.1", + "minreq", + "serde", + "serde_json", +] + [[package]] name = "k256" version = "0.13.4" @@ -15509,6 +15544,17 @@ dependencies = [ "adler2", ] +[[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" @@ -17039,7 +17085,7 @@ dependencies = [ "backoff", "base64 0.13.1", "bitcoin 0.28.2", - "bitcoincore-rpc", + "bitcoincore-rpc 0.15.0", "bytes", "candid", "clap 4.5.20", diff --git a/Cargo.toml b/Cargo.toml index b4ebafc31b1..6440db3368a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -506,6 +506,7 @@ backoff = "0.4" base64 = { version = "0.13.1" } bincode = "1.3.3" bitcoin = { version = "0.32.4", features = ["default", "rand", "serde"] } +bitcoincore-rpc = "0.19.0" # build-info and build-info-build MUST be kept in sync! build-info = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7" } build-info-build = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7", default-features = false } diff --git a/bazel/external_crates.bzl b/bazel/external_crates.bzl index 3e52de141f2..d68055faf45 100644 --- a/bazel/external_crates.bzl +++ b/bazel/external_crates.bzl @@ -264,21 +264,17 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable "bit-vec": crate.spec( version = "^0.6.3", ), - "bitcoin-0-32": crate.spec( - package = "bitcoin", - version = "^0.32.2", - default_features = False, - ), "bitcoin": crate.spec( - version = "^0.28.2", + package = "bitcoin", + version = "^0.32.4", features = [ "default", "rand", - "use-serde", + "serde", ], ), "bitcoincore-rpc": crate.spec( - version = "^0.15.0", + version = "^0.19.0", ), "bitcoind": crate.spec( version = "^0.32.0", diff --git a/rs/bitcoin/adapter/Cargo.toml b/rs/bitcoin/adapter/Cargo.toml index 4aaf9a4b4f6..a7d26bd91cc 100644 --- a/rs/bitcoin/adapter/Cargo.toml +++ b/rs/bitcoin/adapter/Cargo.toml @@ -37,7 +37,7 @@ tonic = { workspace = true } tower = { workspace = true, optional = true } [dev-dependencies] -bitcoincore-rpc = "0.15.0" +bitcoincore-rpc = { workspace = true } bitcoind = "0.32.0" criterion = { workspace = true } ic-btc-adapter-client = { path = "../client" } diff --git a/rs/bitcoin/adapter/src/blockchainmanager.rs b/rs/bitcoin/adapter/src/blockchainmanager.rs index 057d31795d1..39c76e5a317 100644 --- a/rs/bitcoin/adapter/src/blockchainmanager.rs +++ b/rs/bitcoin/adapter/src/blockchainmanager.rs @@ -775,9 +775,10 @@ pub mod test { }; use bitcoin::blockdata::constants::genesis_block; use bitcoin::consensus::deserialize; + //TODO(mihailjianu): check if this is needed. use bitcoin::Network; use bitcoin::{ - p2p::message::NetworkMessage, network::message_blockdata::Inventory, BlockHash, + p2p::message::NetworkMessage, BlockHash, }; use hex::FromHex; use ic_btc_adapter_test_utils::{ diff --git a/rs/bitcoin/adapter/src/blockchainstate.rs b/rs/bitcoin/adapter/src/blockchainstate.rs index 44341666b71..3d963db1a00 100644 --- a/rs/bitcoin/adapter/src/blockchainstate.rs +++ b/rs/bitcoin/adapter/src/blockchainstate.rs @@ -2,6 +2,9 @@ //! use crate::{common::BlockHeight, config::Config, metrics::BlockchainStateMetrics}; use bitcoin::{blockdata::constants::genesis_block, Block, BlockHash, block::Header as BlockHeader, Network}; + +use bitcoin::hashes::Hash; + use ic_btc_validation::{validate_header, HeaderStore, ValidateHeaderError}; use ic_metrics::MetricsRegistry; use std::collections::HashMap; @@ -337,6 +340,8 @@ impl HeaderStore for BlockchainState { .map(|cached| cached.header) } + // TODO: this is terribly innefficient. We should: either have and index for this, or + // rething how this is used. fn get_with_height(&self, height: u32) -> Option { self.header_cache .values() @@ -581,7 +586,7 @@ mod test { assert!(matches!(result, Ok(()))); // Make a block 2's merkle root invalid and try to add the block to the cache. - block_2.header.merkle_root = TxMerkleNode::default(); + block_2.header.merkle_root = TxMerkleNode::all_zeros(); // Block 2's hash will now be changed because of the merkle root change. let block_2_hash = block_2.block_hash(); let result = state.add_block(block_2); @@ -638,7 +643,7 @@ mod test { state.add_block(test_state.block_1.clone()).unwrap(); state.add_block(test_state.block_2.clone()).unwrap(); - let expected_cache_size = test_state.block_1.size() + test_state.block_2.size(); + let expected_cache_size = test_state.block_1.total_size() + test_state.block_2.total_size(); let block_cache_size = state.get_block_cache_size(); assert_eq!(expected_cache_size, block_cache_size); @@ -691,7 +696,7 @@ mod test { /// Test header store `get_header` function. #[test] - fn test_headerstore_get_header() { + fn test_headerstore_get_cached_header() { let config = ConfigBuilder::new().with_network(Network::Regtest).build(); let mut state = BlockchainState::new(&config, &MetricsRegistry::default()); @@ -706,9 +711,10 @@ mod test { if h == 0 { assert_eq!(state.get_initial_hash(), state.genesis().block_hash(),); } else { + let header_node = state.get_cached_header(&header.block_hash()).unwrap(); assert_eq!( - state.get_header(&header.block_hash()).unwrap(), - (chain[h], (h + 1) as u32), + (header_node.header, header_node.height), + (chain[h], (h + 1) as u32) ); } } diff --git a/rs/bitcoin/adapter/src/stream.rs b/rs/bitcoin/adapter/src/stream.rs index 85f24463318..f86913b5a90 100644 --- a/rs/bitcoin/adapter/src/stream.rs +++ b/rs/bitcoin/adapter/src/stream.rs @@ -515,11 +515,11 @@ pub mod test { assert_eq!( net_rx.recv().await.unwrap(), - (address, payload_large.payload()) + (address, payload_large.payload().clone()) ); assert_eq!( net_rx.recv().await.unwrap(), - (address, payload_small.payload()) + (address, payload_small.payload().clone()) ); } } diff --git a/rs/bitcoin/adapter/src/stress_test.rs b/rs/bitcoin/adapter/src/stress_test.rs index 2ea6e3767d4..60cf243e27e 100644 --- a/rs/bitcoin/adapter/src/stress_test.rs +++ b/rs/bitcoin/adapter/src/stress_test.rs @@ -57,8 +57,8 @@ async fn main() { loop { let mut request = tonic::Request::new(BtcServiceGetSuccessorsRequest { - processed_block_hashes: processed_block_hashes.iter().map(|h| h.to_vec()).collect(), - anchor: current_anchor.to_vec(), + processed_block_hashes: processed_block_hashes.iter().map(|h| h[..].to_vec()).collect(), + anchor: current_anchor[..].to_vec(), }); request.set_timeout(request_timeout_ms); @@ -79,7 +79,7 @@ async fn main() { let block_hashes = inner .blocks .iter() - .map(|b| Block::consensus_decode(b.as_slice()).unwrap().block_hash()) + .map(|b| Block::consensus_decode(&mut b.as_slice()).unwrap().block_hash()) .collect::>(); current_anchor = *block_hashes.last().expect("failed to get last block hash"); diff --git a/rs/bitcoin/adapter/src/transaction_store.rs b/rs/bitcoin/adapter/src/transaction_store.rs index 192b2e3d13a..68c0e448ee6 100644 --- a/rs/bitcoin/adapter/src/transaction_store.rs +++ b/rs/bitcoin/adapter/src/transaction_store.rs @@ -203,7 +203,7 @@ mod test { use super::*; use crate::common::test_common::TestChannel; use bitcoin::{ - blockdata::constants::genesis_block, consensus::serialize, Network, Transaction, + absolute::LockTime, blockdata::constants::genesis_block, consensus::serialize, Network, Transaction }; use ic_logger::replica_logger::no_op_logger; use std::str::FromStr; @@ -304,7 +304,7 @@ mod test { // Send one transaction. This transaction should be removed first if we are at capacity. let mut first_tx = get_transaction(); - first_tx.lock_time = u32::MAX; + first_tx.lock_time = LockTime::from_height(u32::MAX).unwrap(); let raw_tx = serialize(&first_tx); manager.enqueue_transaction(&raw_tx); @@ -312,7 +312,7 @@ mod test { // First regtest genesis transaction. let mut transaction = get_transaction(); // Alter transaction such that we get a different `txid` - transaction.lock_time = i.try_into().unwrap(); + transaction.lock_time = LockTime::from_height(i.try_into().unwrap()).unwrap(); let raw_tx = serialize(&transaction); manager.enqueue_transaction(&raw_tx); } @@ -333,7 +333,7 @@ mod test { let mut manager = make_transaction_manager(); let mut transaction = get_transaction(); - transaction.lock_time = 0; + transaction.lock_time = LockTime::ZERO; let raw_tx = serialize(&transaction); manager.enqueue_transaction(&raw_tx); manager.advertise_txids(&mut channel); @@ -388,7 +388,7 @@ mod test { let mut manager = make_transaction_manager(); let mut transaction = get_transaction(); - transaction.lock_time = 0; + transaction.lock_time = LockTime::ZERO; let raw_tx = serialize(&transaction); manager.enqueue_transaction(&raw_tx); manager.advertise_txids(&mut channel); @@ -429,7 +429,7 @@ mod test { // 1. let mut transaction = get_transaction(); - transaction.lock_time = 0; + transaction.lock_time = LockTime::ZERO; let raw_tx = serialize(&transaction); manager.enqueue_transaction(&raw_tx); manager.advertise_txids(&mut channel); @@ -510,7 +510,7 @@ mod test { // First regtest genesis transaction. let mut transaction = get_transaction(); // Alter transaction such that we get a different `txid` - transaction.lock_time = i.try_into().unwrap(); + transaction.lock_time = LockTime::from_height(i.try_into().unwrap()).unwrap(); let txid = transaction.compute_txid(); inventory.push(Inventory::Transaction(txid)); } diff --git a/rs/bitcoin/adapter/test_utils/src/bitcoind.rs b/rs/bitcoin/adapter/test_utils/src/bitcoind.rs index f152e094c3d..53fe6644452 100644 --- a/rs/bitcoin/adapter/test_utils/src/bitcoind.rs +++ b/rs/bitcoin/adapter/test_utils/src/bitcoind.rs @@ -5,7 +5,7 @@ use std::{ sync::Arc, }; -use bitcoin::p2p::ServiceFlags; +use bitcoin::p2p::{Magic, ServiceFlags}; use bitcoin::{ consensus::{deserialize_partial, encode, serialize}, @@ -16,6 +16,9 @@ use bitcoin::{ }, Block, BlockHash, block::Header as BlockHeader, }; + +use bitcoin::io as bitcoin_io; + use tokio::{ io::{AsyncReadExt, AsyncWriteExt}, net::{TcpListener, TcpStream}, @@ -25,10 +28,10 @@ const MINIMUM_PROTOCOL_VERSION: u32 = 70001; async fn write_network_message( socket: &mut TcpStream, - magic: u32, + magic: Magic, payload: NetworkMessage, ) -> io::Result<()> { - let res = RawNetworkMessage { magic, payload }; + let res = RawNetworkMessage::new(magic, payload); let serialized = serialize(&res); socket.write_all(&serialized).await?; socket.flush().await?; @@ -37,8 +40,8 @@ async fn write_network_message( async fn handle_getdata( socket: &mut TcpStream, - msg: Vec, - magic: u32, + msg: &Vec, + magic: Magic, blocks: Arc>, ) -> io::Result<()> { for inv in msg.iter() { @@ -58,11 +61,11 @@ async fn handle_getdata( Ok(()) } -async fn handle_ping(socket: &mut TcpStream, val: u64, magic: u32) -> io::Result<()> { +async fn handle_ping(socket: &mut TcpStream, val: u64, magic: Magic) -> io::Result<()> { write_network_message(socket, magic, NetworkMessage::Pong(val)).await } -async fn handle_version(socket: &mut TcpStream, v: VersionMessage, magic: u32) -> io::Result<()> { +async fn handle_version(socket: &mut TcpStream, v: &VersionMessage, magic: Magic) -> io::Result<()> { if v.version < MINIMUM_PROTOCOL_VERSION { let err = io::Error::new(ErrorKind::Other, "Protocol version too low"); return Err(err); @@ -74,14 +77,14 @@ async fn handle_version(socket: &mut TcpStream, v: VersionMessage, magic: u32) - Ok(()) } -async fn handle_getaddr(socket: &mut TcpStream, magic: u32) -> io::Result<()> { +async fn handle_getaddr(socket: &mut TcpStream, magic: Magic) -> io::Result<()> { write_network_message(socket, magic, NetworkMessage::Addr(vec![])).await } async fn handle_getheaders( socket: &mut TcpStream, - msg: GetHeadersMessage, - magic: u32, + msg: &GetHeadersMessage, + magic: Magic, cached_headers: Arc>, children: Arc>>, ) -> io::Result<()> { @@ -90,18 +93,18 @@ async fn handle_getheaders( let locator = { let mut found = None; - for locator in msg.locator_hashes { - if cached_headers.contains_key(&locator) { - found = Some(locator); + for locator in &msg.locator_hashes { + if cached_headers.contains_key(locator) { + found = Some(locator.clone()); break; } } - found.unwrap_or( + found.unwrap_or_else(|| { // If no locators are found, use the genesis hash. "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" .parse() - .unwrap(), - ) + .unwrap() + }) }; let mut queue = VecDeque::new(); @@ -184,22 +187,22 @@ impl FakeBitcoind { match deserialize_partial::(&unparsed) { Ok((raw, cnt)) => { let handler_result = - match raw.payload { + match raw.payload() { NetworkMessage::Version(v) => { - handle_version(&mut socket, v, raw.magic).await + handle_version(&mut socket, v, *raw.magic()).await } NetworkMessage::Verack => Ok(()), NetworkMessage::GetAddr => { - handle_getaddr(&mut socket, raw.magic).await + handle_getaddr(&mut socket, *raw.magic()).await } NetworkMessage::GetHeaders(msg) => { - handle_getheaders(&mut socket, msg, raw.magic, cached_headers.clone(), children.clone()).await + handle_getheaders(&mut socket, msg, *raw.magic(), cached_headers.clone(), children.clone()).await } NetworkMessage::GetData(msg) => { - handle_getdata(&mut socket, msg, raw.magic, blocks.clone()).await + handle_getdata(&mut socket, msg, *raw.magic(), blocks.clone()).await } NetworkMessage::Ping(val) => { - handle_ping(&mut socket, val, raw.magic).await + handle_ping(&mut socket, *val, *raw.magic()).await } smth => panic!("Unexpected NetworkMessage: {:?}", smth), }; @@ -209,7 +212,7 @@ impl FakeBitcoind { unparsed.drain(..cnt); } Err(encode::Error::Io(ref err)) // Received incomplete message - if err.kind() == std::io::ErrorKind::UnexpectedEof => + if err.kind() == bitcoin_io::ErrorKind::UnexpectedEof => { break } diff --git a/rs/bitcoin/adapter/test_utils/src/lib.rs b/rs/bitcoin/adapter/test_utils/src/lib.rs index 60d6f924566..106bb79aced 100644 --- a/rs/bitcoin/adapter/test_utils/src/lib.rs +++ b/rs/bitcoin/adapter/test_utils/src/lib.rs @@ -1,8 +1,7 @@ use std::collections::HashSet; use bitcoin::{ - consensus::deserialize, util::uint::Uint256, Block, BlockHash, block::Header as BlockHeader, Transaction, - TxMerkleNode, + block::{Header as BlockHeader, Version}, consensus::deserialize, hashes::Hash, Block, BlockHash, Target, Transaction, TxMerkleNode }; use hex::FromHex; use rand::{prelude::StdRng, Rng, SeedableRng}; @@ -21,12 +20,8 @@ pub const BLOCK_2_ENCODED: &str = "010000004860eb18bf1b1620e37e9490fc8a427514416 /// an overflow occurs if bits is set to 0. /// /// https://github.com/bitcoin/bitcoin/blame/master/src/chainparams.cpp#L402 -const TARGET: Uint256 = Uint256([ - 0xffffffffffffffff, - 0xffffffffffffffff, - 0xffffffffffffffff, - 0x7fffffffffffffff, -]); + +const TARGET: Target = Target::MAX_ATTAINABLE_REGTEST; fn decode_block(hex_str: &str) -> Block { let encoded_block_1 = Vec::from_hex(hex_str).expect("failed to covert hex to vec"); @@ -49,11 +44,11 @@ pub fn headers_to_hashes(headers: &[BlockHeader]) -> Vec { fn large_block(prev_blockhash: &BlockHash, prev_time: u32, tx: Transaction) -> Block { let mut block = Block { header: BlockHeader { - version: 1, + version: Version::ONE, prev_blockhash: *prev_blockhash, - merkle_root: TxMerkleNode::default(), + merkle_root: TxMerkleNode::all_zeros(), time: prev_time + gen_time_delta(), - bits: BlockHeader::compact_target_from_u256(&TARGET), + bits: TARGET.to_compact_lossy(), nonce: 0, }, txdata: vec![], @@ -64,7 +59,7 @@ fn large_block(prev_blockhash: &BlockHash, prev_time: u32, tx: Transaction) -> B block.txdata.push(tx.clone()); } - block.header.merkle_root = block.compute_merkle_root().unwrap_or_default(); + block.header.merkle_root = block.compute_merkle_root().unwrap_or(TxMerkleNode::all_zeros()); solve_proof_of_work(&mut block.header); block } @@ -124,11 +119,11 @@ pub fn generate_headers( /// This helper generates a single header with a given previous blockhash. pub fn generate_header(prev_blockhash: BlockHash, prev_time: u32, nonce: u32) -> BlockHeader { let mut header = BlockHeader { - version: 1, + version: Version::ONE, prev_blockhash, - merkle_root: TxMerkleNode::default(), + merkle_root: TxMerkleNode::all_zeros(), time: prev_time + gen_time_delta(), - bits: BlockHeader::compact_target_from_u256(&TARGET), + bits: TARGET.to_compact_lossy(), nonce, }; @@ -145,7 +140,7 @@ fn gen_time_delta() -> u32 { /// This method is used to solve a header's proof of work puzzle. fn solve_proof_of_work(header: &mut BlockHeader) { let target = header.target(); - while header.validate_pow(&target).is_err() { + while header.validate_pow(target).is_err() { header.nonce += 1; } } diff --git a/rs/bitcoin/adapter/tests/adapter_test.rs b/rs/bitcoin/adapter/tests/adapter_test.rs index d069432210a..5fe292045e5 100644 --- a/rs/bitcoin/adapter/tests/adapter_test.rs +++ b/rs/bitcoin/adapter/tests/adapter_test.rs @@ -55,7 +55,7 @@ impl ForkTestData { } } -fn make_get_successors_request( +fn make_get_successors_request( adapter_client: &BitcoinAdapterClient, anchor: Vec, headers: Vec>, @@ -192,7 +192,7 @@ fn start_adapter_and_client( .unwrap(); if let AdapterState::Active = adapter_state { // We send this request to make sure the adapter is not idle. - let _ = make_get_successors_request(&res.0, anchor.to_vec(), vec![]); + let _ = make_get_successors_request(&res.0, anchor[..].to_vec(), vec![]); } res @@ -379,7 +379,7 @@ fn sync_blocks_at_once( } fn get_blackhole_address() -> Address { - Address::from_str("mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn").unwrap() + Address::from_str("mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn").unwrap().assume_checked() } fn create_alice_and_bob_wallets(bitcoind: &BitcoinD) -> (Client, Client, Address, Address) { @@ -401,8 +401,8 @@ fn create_alice_and_bob_wallets(bitcoind: &BitcoinD) -> (Client, Client, Address .create_wallet("bob", None, None, None, None) .unwrap(); - let alice_address = alice_client.get_new_address(None, None).unwrap(); - let bob_address = bob_client.get_new_address(None, None).unwrap(); + let alice_address = alice_client.get_new_address(None, None).unwrap().assume_checked(); + let bob_address = bob_client.get_new_address(None, None).unwrap().assume_checked(); (alice_client, bob_client, alice_address, bob_address) } @@ -411,7 +411,7 @@ fn fund_with_btc(to_fund_client: &Client, to_fund_address: &Address) { let initial_amount = to_fund_client .get_received_by_address(to_fund_address, Some(0)) .unwrap() - .as_btc(); + .to_btc(); to_fund_client .generate_to_address(1, to_fund_address) @@ -526,7 +526,9 @@ fn test_receives_blocks() { assert_eq!(0, client.get_blockchain_info().unwrap().blocks); - let address = client.get_new_address(None, None).unwrap(); + //TODO(mihailjianu): check that "assume_checked" is enough. + + let address = client.get_new_address(None, None).unwrap().assume_checked(); client.generate_to_address(150, &address).unwrap(); @@ -821,13 +823,13 @@ fn test_receives_blocks_from_forks() { wait_for_connection(&client1, 2); wait_for_connection(&client2, 2); - let address1 = client1.get_new_address(None, None).unwrap(); + let address1 = client1.get_new_address(None, None).unwrap().assume_checked(); client1.generate_to_address(25, &address1).unwrap(); wait_for_blocks(&client1, 25); wait_for_blocks(&client2, 25); - let address2 = client2.get_new_address(None, None).unwrap(); + let address2 = client2.get_new_address(None, None).unwrap().assume_checked(); client2.generate_to_address(25, &address2).unwrap(); wait_for_blocks(&client1, 50); @@ -889,7 +891,7 @@ fn test_bfs_order() { wait_for_connection(&client1, 2); wait_for_connection(&client2, 2); - let address1 = client1.get_new_address(None, None).unwrap(); + let address1 = client1.get_new_address(None, None).unwrap().assume_checked(); let shared_blocks = client1.generate_to_address(5, &address1).unwrap(); wait_for_blocks(&client1, 5); @@ -905,7 +907,7 @@ fn test_bfs_order() { let fork1 = client1.generate_to_address(15, &address1).unwrap(); - let address2 = client2.get_new_address(None, None).unwrap(); + let address2 = client2.get_new_address(None, None).unwrap().assume_checked(); let fork2 = client2.generate_to_address(15, &address2).unwrap(); wait_for_blocks(&client1, 20); diff --git a/rs/bitcoin/kyt/BUILD.bazel b/rs/bitcoin/kyt/BUILD.bazel index 11357e91738..ef77fe1a0df 100644 --- a/rs/bitcoin/kyt/BUILD.bazel +++ b/rs/bitcoin/kyt/BUILD.bazel @@ -16,7 +16,7 @@ rust_library( crate_name = "ic_btc_kyt", deps = [ # Keep sorted. - "@crate_index//:bitcoin_0_32", + "@crate_index//:bitcoin", "@crate_index//:candid", "@crate_index//:serde", ], @@ -60,7 +60,7 @@ rust_canister( "//rs/rust_canisters/http_types", "@crate_index//:askama", "@crate_index//:base64", - "@crate_index//:bitcoin_0_32", + "@crate_index//:bitcoin", "@crate_index//:candid", "@crate_index//:candid_parser", "@crate_index//:ciborium", diff --git a/rs/bitcoin/kyt/Cargo.toml b/rs/bitcoin/kyt/Cargo.toml index 81e1aa7a812..7274202c32d 100644 --- a/rs/bitcoin/kyt/Cargo.toml +++ b/rs/bitcoin/kyt/Cargo.toml @@ -13,7 +13,7 @@ path = "src/main.rs" [dependencies] askama = { workspace = true } base64 = { workspace = true } -bitcoin = { version = "0.32.2", default-features = false } +bitcoin = { workspace = true } candid = { workspace = true } ciborium = { workspace = true } futures = { workspace = true } diff --git a/rs/bitcoin/validation/BUILD.bazel b/rs/bitcoin/validation/BUILD.bazel index f414ee74a8a..15551334115 100644 --- a/rs/bitcoin/validation/BUILD.bazel +++ b/rs/bitcoin/validation/BUILD.bazel @@ -13,8 +13,8 @@ DEV_DEPENDENCIES = [ # Keep sorted. "@crate_index//:csv", "@crate_index//:hex", - "@crate_index//:proptest", "@crate_index//:primitive-types", + "@crate_index//:proptest", ] MACRO_DEV_DEPENDENCIES = [] diff --git a/rs/bitcoin/validation/Cargo.toml b/rs/bitcoin/validation/Cargo.toml index 24b29a587e2..6f2031e18dd 100644 --- a/rs/bitcoin/validation/Cargo.toml +++ b/rs/bitcoin/validation/Cargo.toml @@ -6,8 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bitcoin = "0.32.4" -primitive-types = "0.12" +bitcoin = { workspace = true } [dev-dependencies] csv = "1.1" diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index bbb66adcffe..ef8e71be514 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -77,8 +77,8 @@ pub fn validate_header( return Err(ValidateHeaderError::InvalidPoWForHeaderTarget); } - let target = get_next_target(network, store, &prev_header, prev_height, header.time); - if let Err(err) = header.validate_pow(Target::from_compact(target)) { + let compact_target = get_next_compact_target(network, store, &prev_header, prev_height, header.time); + 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"), @@ -92,7 +92,7 @@ pub fn validate_header( // Returns the next required target at the given timestamp. // The target is the number that a block hash must be below for it to be accepted. -fn get_next_target( +fn get_next_compact_target( network: &Network, store: &impl HeaderStore, prev_header: &BlockHeader, @@ -188,7 +188,6 @@ fn compute_next_difficulty( prev_header: &BlockHeader, prev_height: BlockHeight, ) -> CompactTarget { - use primitive_types::U256; // Difficulty is adjusted only once in every interval of 2 weeks (2016 blocks) // If an interval boundary is not reached, then previous difficulty target is // returned Regtest network doesn't adjust PoW difficult levels. For @@ -217,28 +216,9 @@ fn compute_next_difficulty( // actual_interval will deviate slightly from 2 weeks. Our goal is to // readjust the difficulty target so that the expected time taken for the next // 2016 blocks is again 2 weeks. - let actual_interval = prev_header.time - last_adjustment_time; - let mut adjusted_interval = actual_interval; - - // The target_adjustment_interval_time is 2 weeks of time expressed in seconds - let target_adjustment_interval_time: u32 = DIFFICULTY_ADJUSTMENT_INTERVAL * TEN_MINUTES; //Number of seconds in 2 weeks - - // Adjusting the actual_interval to [0.5 week, 8 week] range in case the - // actual_interval deviates too much from the expected 2 weeks. - adjusted_interval = u32::max(adjusted_interval, target_adjustment_interval_time / 4); - adjusted_interval = u32::min(adjusted_interval, target_adjustment_interval_time * 4); - - // Computing new difficulty target. - // new difficulty target = old difficult target * (adjusted_interval / - // 2_weeks); - let mut target = U256::from_big_endian(&prev_header.target().to_be_bytes()); - target *= U256::from(adjusted_interval); - target /= U256::from(target_adjustment_interval_time); - let target = Target::from_be_bytes(target.into()); - - // Adjusting the newly computed difficulty target so that it doesn't exceed the - // max_difficulty_target limit - target.min(max_target(network)).to_compact_lossy() + 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) } #[cfg(test)] @@ -490,12 +470,12 @@ mod test { println!("Verifying next targets..."); proptest!(|(i in 0..up_to_height)| { // Compute what the target of the next header should be. - let expected_next_target = - get_next_target(&network, &store, &headers[i], i as u32, headers[i + 1].time); + let expected_next_compact_target = + get_next_compact_target(&network, &store, &headers[i], i as u32, headers[i + 1].time); // Assert that the expected next target matches the next header's target. assert_eq!( - expected_next_target, + expected_next_compact_target, headers[i + 1].bits ); }); @@ -574,7 +554,7 @@ mod test { let (store, last_header) = create_chain(&network, expected_pow, chain_length); assert_eq!(store.height() + 1, chain_length); // Act. - let target = get_next_target( + let compact_target = get_next_compact_target( &network, &store, &last_header, @@ -582,7 +562,7 @@ mod test { last_header.time + TEN_MINUTES, ); // Assert. - assert_eq!(target, expected_pow); + assert_eq!(compact_target, expected_pow); } } } \ No newline at end of file From 97cb30f79721ad7fe1033e3233b5dcc81e2f7e46 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Fri, 6 Dec 2024 15:56:29 +0000 Subject: [PATCH 07/50] everything works. --- Cargo.Bazel.json.lock | 10 +++++----- Cargo.Bazel.toml.lock | 2 +- Cargo.lock | 9 ++++----- Cargo.toml | 1 + bazel/external_crates.bzl | 4 +++- .../canister_threshold_sig/test_utils/BUILD.bazel | 1 + .../canister_threshold_sig/test_utils/Cargo.toml | 5 ++--- .../canister_threshold_sig/test_utils/src/lib.rs | 14 +++++++++----- rs/pocket_ic_server/Cargo.toml | 4 ++-- .../tests/bitcoin_integration_tests.rs | 4 ++-- 10 files changed, 30 insertions(+), 24 deletions(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index c36989adc33..0d4217f9b28 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "93d34416a8eeb74a348063085b337ce6aefa244543c56a833f7a36a797acc410", + "checksum": "dfd6d9ce9a5bc0687f424e67c754073ee73f5f6773da5a415d2af5d4654beda6", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -19080,7 +19080,7 @@ "target": "scraper" }, { - "id": "secp256k1 0.22.2", + "id": "secp256k1 0.29.0", "target": "secp256k1" }, { @@ -63302,8 +63302,6 @@ ], "crate_features": { "common": [ - "default", - "global-context", "rand", "rand-std", "recovery", @@ -63436,6 +63434,8 @@ "crate_features": { "common": [ "alloc", + "default", + "global-context", "hashes", "rand", "rand-std", @@ -86773,7 +86773,7 @@ "scoped_threadpool 0.1.9", "scopeguard 1.2.0", "scraper 0.17.1", - "secp256k1 0.22.2", + "secp256k1 0.29.0", "semver 1.0.22", "serde 1.0.214", "serde-bytes-repr 0.1.5", diff --git a/Cargo.Bazel.toml.lock b/Cargo.Bazel.toml.lock index c770560d157..e15dd14171a 100644 --- a/Cargo.Bazel.toml.lock +++ b/Cargo.Bazel.toml.lock @@ -3189,7 +3189,7 @@ dependencies = [ "scoped_threadpool", "scopeguard", "scraper", - "secp256k1 0.22.2", + "secp256k1 0.29.0", "semver", "serde", "serde-bytes-repr", diff --git a/Cargo.lock b/Cargo.lock index e26302289ab..ae118742f4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7519,16 +7519,15 @@ name = "ic-crypto-internal-threshold-sig-canister-threshold-sig-test-utils" version = "0.9.0" dependencies = [ "assert_matches", - "bitcoin 0.28.2", + "bitcoin 0.32.4", "ed25519-dalek", - "hex", "ic-crypto-internal-threshold-sig-canister-threshold-sig", "ic-crypto-sha2", "ic-types", "k256", "p256", "rand 0.8.5", - "secp256k1 0.22.2", + "secp256k1 0.29.1", "sha2 0.10.8", ] @@ -17084,8 +17083,8 @@ dependencies = [ "axum-server", "backoff", "base64 0.13.1", - "bitcoin 0.28.2", - "bitcoincore-rpc 0.15.0", + "bitcoin 0.32.4", + "bitcoincore-rpc 0.19.0", "bytes", "candid", "clap 4.5.20", diff --git a/Cargo.toml b/Cargo.toml index 6440db3368a..d21474cf242 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -505,6 +505,7 @@ axum = "0.7.7" backoff = "0.4" base64 = { version = "0.13.1" } bincode = "1.3.3" +#TODO(mihailjianu): consider moving the feature into each crate. bitcoin = { version = "0.32.4", features = ["default", "rand", "serde"] } bitcoincore-rpc = "0.19.0" # build-info and build-info-build MUST be kept in sync! diff --git a/bazel/external_crates.bzl b/bazel/external_crates.bzl index d68055faf45..72dbade4771 100644 --- a/bazel/external_crates.bzl +++ b/bazel/external_crates.bzl @@ -1107,10 +1107,12 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable version = "^0.17.1", ), "secp256k1": crate.spec( - version = "^0.22", + version = "^0.29", features = [ "global-context", "rand-std", + #TODO(mihailjianu): check if/why this is needed. + "serde", ], ), "semver": crate.spec( diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel index f95f0370a6c..4b37b095268 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel @@ -20,6 +20,7 @@ rust_library( "@crate_index//:k256", "@crate_index//:p256", "@crate_index//:rand", + #TODO(mihailjianu): check if this is replacable with ic-secp256k1 "@crate_index//:secp256k1", "@crate_index//:sha2", ], diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml index c5abd4850cc..e4f43931299 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml @@ -9,9 +9,8 @@ documentation.workspace = true [dependencies] assert_matches = { workspace = true } ed25519-dalek = { workspace = true } -bitcoin = { version = "0.28.2" } -hex = "0.4" -secp256k1 = { version = "0.22", features = ["global-context", "rand-std"] } +bitcoin = { workspace = true } +secp256k1 = { version = "0.29", features = ["global-context", "rand-std", "serde"] } ic-crypto-internal-threshold-sig-canister-threshold-sig = { path = ".." } ic-crypto-sha2 = { path = "../../../../../sha2" } ic-types = { path = "../../../../../../types/types" } diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/src/lib.rs b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/src/lib.rs index 7c8457fa6bb..2be4ca51f25 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/src/lib.rs +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/src/lib.rs @@ -50,25 +50,29 @@ pub fn verify_taproot_signature_using_third_party( msg: &[u8], taproot_hash: &[u8], ) -> bool { - use bitcoin::hashes::hex::FromHex; + + use bitcoin::hashes::Hash; if msg.len() != 32 { // The bitcoin Rust library doesn't support arbitrary hash inputs yet // https://github.com/rust-bitcoin/rust-secp256k1/issues/702 return true; } - use bitcoin::schnorr::TapTweak; + use bitcoin::key::TapTweak; use bitcoin::secp256k1::{schnorr::Signature, Message, Secp256k1, XOnlyPublicKey}; - use bitcoin::util::taproot::TapBranchHash; + use bitcoin::TapNodeHash; let secp256k1 = Secp256k1::new(); let pk = XOnlyPublicKey::from_slice(&sec1_pk[1..]).unwrap(); - let tnh = TapBranchHash::from_hex(&hex::encode(taproot_hash)).unwrap(); + //TODO(mihailjianu): check if this is correct. + //TODO(mihailjianu): check if we can reove the hex dependency. + let tnh = TapNodeHash::from_slice(taproot_hash).unwrap(); let dk = pk.tap_tweak(&secp256k1, Some(tnh)).0.to_inner(); - let msg = Message::from_slice(msg).unwrap(); + //TODO(mihailjianu): find a way to not use those. + let msg = Message::from_digest_slice(msg).unwrap(); let sig = Signature::from_slice(sig).unwrap(); sig.verify(&msg, &dk).is_ok() } diff --git a/rs/pocket_ic_server/Cargo.toml b/rs/pocket_ic_server/Cargo.toml index 9ae4e93dfde..e01f1dc9d47 100644 --- a/rs/pocket_ic_server/Cargo.toml +++ b/rs/pocket_ic_server/Cargo.toml @@ -12,7 +12,7 @@ axum-extra = { version = "^0.9", features = ["typed-header"] } axum-server = { version = "0.6.0", features = ["tls-rustls"] } backoff = { workspace = true } base64 = { workspace = true } -bitcoin = { version = "0.28.1", features = ["default", "use-serde", "rand"] } +bitcoin = { workspace = true } bytes = { workspace = true } candid = { workspace = true } clap = { workspace = true } @@ -82,7 +82,7 @@ tracing-subscriber = { workspace = true } wat = { workspace = true } [dev-dependencies] -bitcoincore-rpc = "0.15.0" +bitcoincore-rpc = { workspace = true } ic-btc-interface = { workspace = true } ic-config = { path = "../config" } ic-registry-transport = { path = "../registry/transport" } diff --git a/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs b/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs index 59a97ab7dba..bf70bd76d64 100644 --- a/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs +++ b/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs @@ -141,7 +141,7 @@ rpcauth=ic-btc-integration:cdf2741387f3a12438f69092f0fdad8e$62081498c98bee09a0dc // `n` must be more than 100 (Coinbase maturity rule) so that the reward for the first block can be sent out let mut n = 101; btc_rpc - .generate_to_address(n, &Address::from_str(&bitcoin_address).unwrap()) + .generate_to_address(n, &Address::from_str(&bitcoin_address).unwrap().assume_checked()) .unwrap(); let reward = 50 * 100_000_000; // 50 BTC @@ -175,7 +175,7 @@ rpcauth=ic-btc-integration:cdf2741387f3a12438f69092f0fdad8e$62081498c98bee09a0dc break; } else { btc_rpc - .generate_to_address(1, &Address::from_str(&bitcoin_address).unwrap()) + .generate_to_address(1, &Address::from_str(&bitcoin_address).unwrap().assume_checked()) .unwrap(); n += 1; } From 2e9f3c471c30a71575c464fa0838bebe4789f287 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 9 Dec 2024 17:08:01 +0000 Subject: [PATCH 08/50] make almost everything work --- Cargo.Bazel.json.lock | 55 +++++++++++++++---- Cargo.Bazel.toml.lock | 15 +++-- bazel/external_crates.bzl | 25 ++++++++- .../test_utils/BUILD.bazel | 5 +- .../test_utils/src/lib.rs | 14 ++--- 5 files changed, 87 insertions(+), 27 deletions(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 0d4217f9b28..637e74bb039 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "dfd6d9ce9a5bc0687f424e67c754073ee73f5f6773da5a415d2af5d4654beda6", + "checksum": "c9ad1f2eca99349c1f774d9c56c70d0d8daee4ecde69f6180a0575d9f3dacf0e", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -6622,7 +6622,9 @@ "default", "rand", "secp-recovery", - "std" + "serde", + "std", + "use-serde" ], "selects": {} }, @@ -6639,6 +6641,10 @@ { "id": "secp256k1 0.22.2", "target": "secp256k1" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -6854,7 +6860,7 @@ "target": "hex_lit" }, { - "id": "secp256k1 0.29.0", + "id": "secp256k1 0.29.1", "target": "secp256k1" }, { @@ -7173,10 +7179,20 @@ ], "crate_features": { "common": [ + "serde", "std" ], "selects": {} }, + "deps": { + "common": [ + { + "id": "serde 1.0.214", + "target": "serde" + } + ], + "selects": {} + }, "edition": "2015", "version": "0.10.0" }, @@ -18249,6 +18265,11 @@ "id": "bit-vec 0.6.3", "target": "bit_vec" }, + { + "id": "bitcoin 0.28.2", + "target": "bitcoin", + "alias": "bitcoin_0_28" + }, { "id": "bitcoin 0.32.5", "target": "bitcoin" @@ -19080,7 +19101,12 @@ "target": "scraper" }, { - "id": "secp256k1 0.29.0", + "id": "secp256k1 0.22.2", + "target": "secp256k1", + "alias": "secp256k1_0_22" + }, + { + "id": "secp256k1 0.29.1", "target": "secp256k1" }, { @@ -63302,9 +63328,12 @@ ], "crate_features": { "common": [ + "default", + "global-context", "rand", "rand-std", "recovery", + "serde", "std" ], "selects": {} @@ -63318,6 +63347,10 @@ { "id": "secp256k1-sys 0.5.2", "target": "secp256k1_sys" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -63402,14 +63435,14 @@ ], "license_file": "LICENSE" }, - "secp256k1 0.29.0": { + "secp256k1 0.29.1": { "name": "secp256k1", - "version": "0.29.0", + "version": "0.29.1", "package_url": "https://github.com/rust-bitcoin/rust-secp256k1/", "repository": { "Http": { - "url": "https://static.crates.io/crates/secp256k1/0.29.0/download", - "sha256": "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" + "url": "https://static.crates.io/crates/secp256k1/0.29.1/download", + "sha256": "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" } }, "targets": [ @@ -63468,7 +63501,7 @@ "selects": {} }, "edition": "2021", - "version": "0.29.0" + "version": "0.29.1" }, "license": "CC0-1.0", "license_ids": [ @@ -86558,6 +86591,7 @@ "bindgen 0.65.1", "bip32 0.5.1", "bit-vec 0.6.3", + "bitcoin 0.28.2", "bitcoin 0.32.5", "bitcoincore-rpc 0.19.0", "bitcoind 0.32.0", @@ -86773,7 +86807,8 @@ "scoped_threadpool 0.1.9", "scopeguard 1.2.0", "scraper 0.17.1", - "secp256k1 0.29.0", + "secp256k1 0.22.2", + "secp256k1 0.29.1", "semver 1.0.22", "serde 1.0.214", "serde-bytes-repr 0.1.5", diff --git a/Cargo.Bazel.toml.lock b/Cargo.Bazel.toml.lock index e15dd14171a..cd7032c440e 100644 --- a/Cargo.Bazel.toml.lock +++ b/Cargo.Bazel.toml.lock @@ -1157,6 +1157,7 @@ dependencies = [ "bech32 0.8.1", "bitcoin_hashes 0.10.0", "secp256k1 0.22.2", + "serde", ] [[package]] @@ -1187,7 +1188,7 @@ dependencies = [ "bitcoin_hashes 0.14.0", "hex-conservative", "hex_lit", - "secp256k1 0.29.0", + "secp256k1 0.29.1", "serde", ] @@ -1227,6 +1228,9 @@ name = "bitcoin_hashes" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "006cc91e1a1d99819bc5b8214be3555c1f0611b169f527a1fdc54ed1f2b745b0" +dependencies = [ + "serde", +] [[package]] name = "bitcoin_hashes" @@ -2974,6 +2978,7 @@ dependencies = [ "bindgen 0.65.1", "bip32", "bit-vec", + "bitcoin 0.28.2", "bitcoin 0.32.5", "bitcoincore-rpc", "bitcoind", @@ -3189,7 +3194,8 @@ dependencies = [ "scoped_threadpool", "scopeguard", "scraper", - "secp256k1 0.29.0", + "secp256k1 0.22.2", + "secp256k1 0.29.1", "semver", "serde", "serde-bytes-repr", @@ -9773,6 +9779,7 @@ checksum = "295642060261c80709ac034f52fca8e5a9fa2c7d341ded5cdb164b7c33768b2a" dependencies = [ "rand 0.6.5", "secp256k1-sys 0.5.2", + "serde", ] [[package]] @@ -9789,9 +9796,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.29.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ "bitcoin_hashes 0.14.0", "rand 0.8.5", diff --git a/bazel/external_crates.bzl b/bazel/external_crates.bzl index 72dbade4771..54219b53b0b 100644 --- a/bazel/external_crates.bzl +++ b/bazel/external_crates.bzl @@ -98,6 +98,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable patch_args = ["-p4"], patches = ["@@//bazel:cranelift-codegen-meta.patch"], )], + #TODO(mihailjianu): check if we need this at all. "secp256k1-sys": [crate.annotation( # This specific version is used by ic-btc-kyt canister, which # requires an extra cfg flag to avoid linking issues. @@ -265,7 +266,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable version = "^0.6.3", ), "bitcoin": crate.spec( - package = "bitcoin", + #TODO(mihailjianu): upgrade to 0.32.5. here and in the cacrgo.toml. version = "^0.32.4", features = [ "default", @@ -273,6 +274,15 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable "serde", ], ), + "bitcoin-0-28": crate.spec( + package = "bitcoin", + version = "^0.28.2", + features = [ + "default", + "rand", + "use-serde", + ], + ), "bitcoincore-rpc": crate.spec( version = "^0.19.0", ), @@ -1106,13 +1116,24 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable "scraper": crate.spec( version = "^0.17.1", ), + #TODO(mihailjianu): add this back. "secp256k1": crate.spec( version = "^0.29", features = [ "global-context", "rand-std", #TODO(mihailjianu): check if/why this is needed. - "serde", + #"serde", + ], + ), + "secp256k1-0-22": crate.spec( + package = "secp256k1", + version = "^0.22", + features = [ + "global-context", + "rand-std", + #TODO(mihailjianu): check if/why this is needed. + #"serde", ], ), "semver": crate.spec( diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel index 4b37b095268..f4c86874ab1 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel @@ -14,14 +14,15 @@ rust_library( "//rs/crypto/sha2", "//rs/types/types", "@crate_index//:assert_matches", - "@crate_index//:bitcoin", + #TODO(mihailjianu): Migrate this to bitcoin. + "@crate_index//:bitcoin_0_28", "@crate_index//:ed25519-dalek", "@crate_index//:hex", "@crate_index//:k256", "@crate_index//:p256", "@crate_index//:rand", #TODO(mihailjianu): check if this is replacable with ic-secp256k1 - "@crate_index//:secp256k1", + "@crate_index//:secp256k1_0_22", "@crate_index//:sha2", ], ) diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/src/lib.rs b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/src/lib.rs index 2be4ca51f25..7c8457fa6bb 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/src/lib.rs +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/src/lib.rs @@ -50,29 +50,25 @@ pub fn verify_taproot_signature_using_third_party( msg: &[u8], taproot_hash: &[u8], ) -> bool { - - use bitcoin::hashes::Hash; + use bitcoin::hashes::hex::FromHex; if msg.len() != 32 { // The bitcoin Rust library doesn't support arbitrary hash inputs yet // https://github.com/rust-bitcoin/rust-secp256k1/issues/702 return true; } - use bitcoin::key::TapTweak; + use bitcoin::schnorr::TapTweak; use bitcoin::secp256k1::{schnorr::Signature, Message, Secp256k1, XOnlyPublicKey}; - use bitcoin::TapNodeHash; + use bitcoin::util::taproot::TapBranchHash; let secp256k1 = Secp256k1::new(); let pk = XOnlyPublicKey::from_slice(&sec1_pk[1..]).unwrap(); - //TODO(mihailjianu): check if this is correct. - //TODO(mihailjianu): check if we can reove the hex dependency. - let tnh = TapNodeHash::from_slice(taproot_hash).unwrap(); + let tnh = TapBranchHash::from_hex(&hex::encode(taproot_hash)).unwrap(); let dk = pk.tap_tweak(&secp256k1, Some(tnh)).0.to_inner(); - //TODO(mihailjianu): find a way to not use those. - let msg = Message::from_digest_slice(msg).unwrap(); + let msg = Message::from_slice(msg).unwrap(); let sig = Signature::from_slice(sig).unwrap(); sig.verify(&msg, &dk).is_ok() } From 94a82ec2f06145e903310d0337b5eb12991ffc13 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Thu, 12 Dec 2024 20:23:05 +0000 Subject: [PATCH 09/50] changes --- Cargo.Bazel.json.lock | 2 +- Cargo.lock | 22 +++++++++---------- Cargo.toml | 2 +- bazel/external_crates.bzl | 8 +------ rs/bitcoin/adapter/src/blockchainmanager.rs | 1 - rs/bitcoin/adapter/src/stream.rs | 1 - .../test_utils/BUILD.bazel | 4 ++-- 7 files changed, 16 insertions(+), 24 deletions(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 637e74bb039..80bb5d10c0e 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "c9ad1f2eca99349c1f774d9c56c70d0d8daee4ecde69f6180a0575d9f3dacf0e", + "checksum": "46eba5cf2a6d479e45baf3369cdb40eb29dd3c5ea4c273a525e7066c918df87b", "crates": { "abnf 0.12.0": { "name": "abnf", diff --git a/Cargo.lock b/Cargo.lock index ae118742f4e..fb587395f46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1186,9 +1186,9 @@ dependencies = [ [[package]] name = "bitcoin" -version = "0.32.4" +version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "788902099d47c8682efe6a7afb01c8d58b9794ba66c06affd81c3d6b560743eb" +checksum = "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" dependencies = [ "base58ck", "bech32 0.11.0", @@ -1306,7 +1306,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" dependencies = [ - "bitcoin 0.32.4", + "bitcoin 0.32.5", "serde", "serde_json", ] @@ -5608,7 +5608,7 @@ name = "ic-bitcoin-canister-mock" version = "0.9.0" dependencies = [ "bech32 0.9.1", - "bitcoin 0.32.4", + "bitcoin 0.32.5", "candid", "candid_parser", "hex", @@ -5869,7 +5869,7 @@ dependencies = [ name = "ic-btc-adapter" version = "0.9.0" dependencies = [ - "bitcoin 0.32.4", + "bitcoin 0.32.5", "bitcoincore-rpc 0.19.0", "bitcoind", "clap 4.5.20", @@ -5936,7 +5936,7 @@ dependencies = [ name = "ic-btc-adapter-test-utils" version = "0.9.0" dependencies = [ - "bitcoin 0.32.4", + "bitcoin 0.32.5", "flate2", "hex", "rand 0.8.5", @@ -5995,7 +5995,7 @@ version = "0.9.0" dependencies = [ "askama", "base64 0.13.1", - "bitcoin 0.32.4", + "bitcoin 0.32.5", "candid", "candid_parser", "ciborium", @@ -6052,7 +6052,7 @@ dependencies = [ name = "ic-btc-validation" version = "0.1.0" dependencies = [ - "bitcoin 0.32.4", + "bitcoin 0.32.5", "csv", "proptest 0.9.6", ] @@ -6576,7 +6576,7 @@ dependencies = [ "assert_matches", "async-trait", "bech32 0.9.1", - "bitcoin 0.32.4", + "bitcoin 0.32.5", "bs58", "candid", "candid_parser", @@ -7519,7 +7519,7 @@ name = "ic-crypto-internal-threshold-sig-canister-threshold-sig-test-utils" version = "0.9.0" dependencies = [ "assert_matches", - "bitcoin 0.32.4", + "bitcoin 0.32.5", "ed25519-dalek", "ic-crypto-internal-threshold-sig-canister-threshold-sig", "ic-crypto-sha2", @@ -17083,7 +17083,7 @@ dependencies = [ "axum-server", "backoff", "base64 0.13.1", - "bitcoin 0.32.4", + "bitcoin 0.32.5", "bitcoincore-rpc 0.19.0", "bytes", "candid", diff --git a/Cargo.toml b/Cargo.toml index d21474cf242..ac077e399f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -506,7 +506,7 @@ backoff = "0.4" base64 = { version = "0.13.1" } bincode = "1.3.3" #TODO(mihailjianu): consider moving the feature into each crate. -bitcoin = { version = "0.32.4", features = ["default", "rand", "serde"] } +bitcoin = { version = "0.32.5", features = ["default", "rand", "serde"] } bitcoincore-rpc = "0.19.0" # build-info and build-info-build MUST be kept in sync! build-info = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7" } diff --git a/bazel/external_crates.bzl b/bazel/external_crates.bzl index 54219b53b0b..e6634fa4ed7 100644 --- a/bazel/external_crates.bzl +++ b/bazel/external_crates.bzl @@ -266,8 +266,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable version = "^0.6.3", ), "bitcoin": crate.spec( - #TODO(mihailjianu): upgrade to 0.32.5. here and in the cacrgo.toml. - version = "^0.32.4", + version = "^0.32.5", features = [ "default", "rand", @@ -1116,14 +1115,11 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable "scraper": crate.spec( version = "^0.17.1", ), - #TODO(mihailjianu): add this back. "secp256k1": crate.spec( version = "^0.29", features = [ "global-context", "rand-std", - #TODO(mihailjianu): check if/why this is needed. - #"serde", ], ), "secp256k1-0-22": crate.spec( @@ -1132,8 +1128,6 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable features = [ "global-context", "rand-std", - #TODO(mihailjianu): check if/why this is needed. - #"serde", ], ), "semver": crate.spec( diff --git a/rs/bitcoin/adapter/src/blockchainmanager.rs b/rs/bitcoin/adapter/src/blockchainmanager.rs index 39c76e5a317..4ee2b261ab2 100644 --- a/rs/bitcoin/adapter/src/blockchainmanager.rs +++ b/rs/bitcoin/adapter/src/blockchainmanager.rs @@ -775,7 +775,6 @@ pub mod test { }; use bitcoin::blockdata::constants::genesis_block; use bitcoin::consensus::deserialize; - //TODO(mihailjianu): check if this is needed. use bitcoin::Network; use bitcoin::{ p2p::message::NetworkMessage, BlockHash, diff --git a/rs/bitcoin/adapter/src/stream.rs b/rs/bitcoin/adapter/src/stream.rs index f86913b5a90..1112bb214fb 100644 --- a/rs/bitcoin/adapter/src/stream.rs +++ b/rs/bitcoin/adapter/src/stream.rs @@ -492,7 +492,6 @@ pub mod test { // Large messgage just below limit. let payload_large = RawNetworkMessage::new( - //TODO(mihailjianu): check byte order network.magic(), NetworkMessage::Alert(vec![0; MAX_RAW_MESSAGE_SIZE - 30]) ); diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel index f4c86874ab1..60f6eb7a527 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel @@ -15,14 +15,14 @@ rust_library( "//rs/types/types", "@crate_index//:assert_matches", #TODO(mihailjianu): Migrate this to bitcoin. - "@crate_index//:bitcoin_0_28", + "@crate_index//:bitcoin", "@crate_index//:ed25519-dalek", "@crate_index//:hex", "@crate_index//:k256", "@crate_index//:p256", "@crate_index//:rand", #TODO(mihailjianu): check if this is replacable with ic-secp256k1 - "@crate_index//:secp256k1_0_22", + "@crate_index//:secp256k1", "@crate_index//:sha2", ], ) From b9983e0250f2dc8eed7a1d7cedefe2b564c45b92 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Fri, 13 Dec 2024 17:35:04 +0000 Subject: [PATCH 10/50] cargo.lock --- Cargo.lock | 204 ++--------------------------------------------------- 1 file changed, 6 insertions(+), 198 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0014acc631d..db69f00e8d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5984,7 +5984,7 @@ version = "0.9.0" dependencies = [ "askama", "base64 0.13.1", - "bitcoin 0.32.3", + "bitcoin 0.32.5", "candid", "candid_parser", "ciborium", @@ -6002,7 +6002,7 @@ dependencies = [ "ic-universal-canister", "num-traits", "pocket-ic", - "proptest", + "proptest 1.5.0", "scraper", "serde", "serde_json", @@ -6056,35 +6056,6 @@ dependencies = [ "serde_bytes", ] -[[package]] -name = "ic-btc-kyt" -version = "0.9.0" -dependencies = [ - "askama", - "base64 0.13.1", - "bitcoin 0.32.3", - "candid", - "candid_parser", - "ciborium", - "futures", - "hex", - "ic-base-types", - "ic-btc-interface", - "ic-canisters-http-types", - "ic-cdk 0.16.0", - "ic-stable-structures", - "ic-test-utilities-load-wasm", - "ic-types", - "ic-universal-canister", - "pocket-ic", - "scraper", - "serde", - "serde_json", - "time", - "tokio", - "url", -] - [[package]] name = "ic-btc-replica-types" version = "0.9.0" @@ -6684,7 +6655,8 @@ dependencies = [ "minicbor-derive", "mockall", "num-traits", - "proptest", + "proptest 1.5.0", + "regex", "ripemd", "scopeguard", "serde", @@ -14132,7 +14104,7 @@ dependencies = [ "minicbor", "num-bigint 0.4.6", "num-traits", - "proptest", + "proptest 1.5.0", ] [[package]] @@ -15094,7 +15066,7 @@ dependencies = [ "minicbor", "num-traits", "on_wire", - "proptest", + "proptest 1.5.0", "serde", "serde_bytes", "serde_cbor", @@ -20882,170 +20854,6 @@ dependencies = [ "xrc-mock", ] -[[package]] -name = "tests" -version = "0.9.0" -dependencies = [ - "anyhow", - "assert-json-diff", - "assert_matches", - "async-recursion", - "async-trait", - "axum", - "backon", - "base64 0.13.1", - "bincode", - "candid", - "canister-test", - "chrono", - "crossbeam-channel", - "cycles-minting-canister", - "deterministic_ips", - "dfn_candid", - "dfn_json", - "dfn_protobuf", - "ed25519-dalek", - "flate2", - "futures", - "hex", - "humantime", - "ic-agent", - "ic-async-utils", - "ic-base-types", - "ic-btc-interface", - "ic-canister-client", - "ic-canister-client-sender", - "ic-cdk 0.16.0", - "ic-certification 0.9.0", - "ic-ckbtc-agent", - "ic-ckbtc-minter", - "ic-config", - "ic-crypto-sha2", - "ic-crypto-test-utils-reproducible-rng", - "ic-crypto-tree-hash", - "ic-crypto-utils-threshold-sig-der", - "ic-cycles-account-manager", - "ic-fstrim-tool", - "ic-http-utils", - "ic-icrc1", - "ic-icrc1-index-ng", - "ic-icrc1-ledger", - "ic-icrc1-test-utils", - "ic-interfaces", - "ic-interfaces-registry", - "ic-ledger-canister-blocks-synchronizer-test-utils", - "ic-ledger-core", - "ic-ledger-suite-orchestrator", - "ic-limits", - "ic-management-canister-types", - "ic-message", - "ic-nervous-system-clients", - "ic-nervous-system-common", - "ic-nervous-system-common-test-keys", - "ic-nervous-system-proto", - "ic-nervous-system-root", - "ic-nns-common", - "ic-nns-constants", - "ic-nns-governance-api", - "ic-nns-gtc", - "ic-nns-handler-root", - "ic-nns-init", - "ic-nns-test-utils", - "ic-prep", - "ic-protobuf", - "ic-regedit", - "ic-registry-canister-api", - "ic-registry-client", - "ic-registry-client-helpers", - "ic-registry-keys", - "ic-registry-local-registry", - "ic-registry-local-store", - "ic-registry-local-store-artifacts", - "ic-registry-nns-data-provider", - "ic-registry-provisional-whitelist", - "ic-registry-routing-table", - "ic-registry-subnet-features", - "ic-registry-subnet-type", - "ic-registry-transport", - "ic-rosetta-api", - "ic-rosetta-test-utils", - "ic-sns-governance", - "ic-sns-init", - "ic-sns-root", - "ic-sns-swap", - "ic-sns-wasm", - "ic-sys", - "ic-system-test-driver", - "ic-test-identity", - "ic-test-utilities", - "ic-test-utilities-time", - "ic-test-utilities-types", - "ic-types", - "ic-types-test-utils", - "ic-universal-canister", - "ic-utils 0.37.0", - "ic-wasm-types", - "ic_consensus_system_test_utils", - "ic_consensus_threshold_sig_system_test_utils", - "icp-ledger", - "icrc-ledger-agent", - "icrc-ledger-types", - "itertools 0.12.1", - "json5", - "k256", - "kube", - "lazy_static", - "leb128", - "libflate", - "lifeline", - "maplit", - "nix 0.24.3", - "num-traits", - "num_cpus", - "on_wire", - "once_cell", - "openssh-keys", - "pem 1.1.1", - "phantom_newtype", - "proptest", - "prost 0.13.3", - "quickcheck", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rayon", - "rcgen", - "regex", - "registry-canister", - "reqwest 0.12.9", - "rosetta-core", - "rsa", - "rust_decimal", - "serde", - "serde_bytes", - "serde_cbor", - "serde_json", - "serde_yaml", - "sha2 0.10.8", - "slog", - "slog-async", - "slog-term", - "ssh2", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "time", - "tokio", - "tokio-util", - "tracing", - "tracing-subscriber", - "tree-deserializer", - "url", - "walkdir", - "wat", - "xnet-test", -] - [[package]] name = "textplots" version = "0.8.6" From 1f4ed12d015a3218a70ed2548504175d64d78277 Mon Sep 17 00:00:00 2001 From: IDX GitHub Automation Date: Fri, 13 Dec 2024 17:45:09 +0000 Subject: [PATCH 11/50] Automatically updated Cargo*.lock --- Cargo.Bazel.Fuzzing.json.lock | 278 +++++++++++++++++++++++++++------- Cargo.Bazel.Fuzzing.toml.lock | 60 ++++++-- Cargo.Bazel.json.lock | 113 +------------- 3 files changed, 270 insertions(+), 181 deletions(-) diff --git a/Cargo.Bazel.Fuzzing.json.lock b/Cargo.Bazel.Fuzzing.json.lock index 39d9714fa5e..b5e514dd129 100644 --- a/Cargo.Bazel.Fuzzing.json.lock +++ b/Cargo.Bazel.Fuzzing.json.lock @@ -1,5 +1,5 @@ { - "checksum": "61fa7882b7d8c8b66da348a9f5ed357bc146f15c3115297225877dc099b3dac3", + "checksum": "2c2d6f7eab72d46e93f2b998562f0f29dd67a0c847253063fa67916eb3fa1abb", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -5506,6 +5506,12 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -5938,7 +5944,8 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "std" ], "selects": {} }, @@ -6268,7 +6275,7 @@ "target": "clang_sys" }, { - "id": "itertools 0.11.0", + "id": "itertools 0.12.0", "target": "itertools" }, { @@ -6881,14 +6888,14 @@ ], "license_file": null }, - "bitcoin 0.32.2": { + "bitcoin 0.32.5": { "name": "bitcoin", - "version": "0.32.2", + "version": "0.32.5", "package_url": "https://github.com/rust-bitcoin/rust-bitcoin/", "repository": { "Http": { - "url": "https://static.crates.io/crates/bitcoin/0.32.2/download", - "sha256": "ea507acc1cd80fc084ace38544bbcf7ced7c2aa65b653b102de0ce718df668f6" + "url": "https://static.crates.io/crates/bitcoin/0.32.5/download", + "sha256": "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" } }, "targets": [ @@ -6922,6 +6929,18 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "actual-serde", + "default", + "rand", + "rand-std", + "secp-recovery", + "serde", + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -6934,7 +6953,7 @@ "target": "bech32" }, { - "id": "bitcoin 0.32.2", + "id": "bitcoin 0.32.5", "target": "build_script_build" }, { @@ -6969,6 +6988,11 @@ { "id": "secp256k1 0.29.0", "target": "secp256k1" + }, + { + "id": "serde 1.0.214", + "target": "serde", + "alias": "actual_serde" } ], "selects": {} @@ -6995,7 +7019,7 @@ ], "selects": {} }, - "version": "0.32.2" + "version": "0.32.5" }, "build_script_attrs": { "compile_data_glob": [ @@ -7055,7 +7079,9 @@ "crate_features": { "common": [ "alloc", - "default" + "default", + "serde", + "std" ], "selects": {} }, @@ -7064,6 +7090,10 @@ { "id": "bitcoin-internals 0.3.0", "target": "build_script_build" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -7116,7 +7146,8 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "std" ], "selects": {} }, @@ -7235,7 +7266,9 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "serde", + "std" ], "selects": {} }, @@ -7245,6 +7278,10 @@ "id": "bitcoin-internals 0.3.0", "target": "bitcoin_internals", "alias": "internals" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -7405,7 +7442,9 @@ "common": [ "alloc", "bitcoin-io", - "io" + "io", + "serde", + "std" ], "selects": {} }, @@ -7419,6 +7458,10 @@ "id": "hex-conservative 0.2.1", "target": "hex_conservative", "alias": "hex" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -7432,14 +7475,14 @@ ], "license_file": null }, - "bitcoincore-rpc 0.15.0": { + "bitcoincore-rpc 0.19.0": { "name": "bitcoincore-rpc", - "version": "0.15.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.15.0/download", - "sha256": "dd0e67dbf7a9971e7f4276f6089e9e814ce0f624a03216b7d92d00351ae7fb3e" + "url": "https://static.crates.io/crates/bitcoincore-rpc/0.19.0/download", + "sha256": "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" } }, "targets": [ @@ -7461,14 +7504,21 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "default", + "rand" + ], + "selects": {} + }, "deps": { "common": [ { - "id": "bitcoincore-rpc-json 0.15.0", + "id": "bitcoincore-rpc-json 0.19.0", "target": "bitcoincore_rpc_json" }, { - "id": "jsonrpc 0.12.1", + "id": "jsonrpc 0.18.0", "target": "jsonrpc" }, { @@ -7486,8 +7536,8 @@ ], "selects": {} }, - "edition": "2015", - "version": "0.15.0" + "edition": "2018", + "version": "0.19.0" }, "license": "CC0-1.0", "license_ids": [ @@ -7495,14 +7545,14 @@ ], "license_file": "LICENSE" }, - "bitcoincore-rpc-json 0.15.0": { + "bitcoincore-rpc-json 0.19.0": { "name": "bitcoincore-rpc-json", - "version": "0.15.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.15.0/download", - "sha256": "2e2ae16202721ba8c3409045681fac790a5ddc791f05731a2df22c0c6bffc0f1" + "url": "https://static.crates.io/crates/bitcoincore-rpc-json/0.19.0/download", + "sha256": "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" } }, "targets": [ @@ -7524,10 +7574,17 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "default", + "rand" + ], + "selects": {} + }, "deps": { "common": [ { - "id": "bitcoin 0.28.2", + "id": "bitcoin 0.32.5", "target": "bitcoin" }, { @@ -7541,8 +7598,8 @@ ], "selects": {} }, - "edition": "2015", - "version": "0.15.0" + "edition": "2021", + "version": "0.19.0" }, "license": "CC0-1.0", "license_ids": [ @@ -18513,15 +18570,15 @@ }, { "id": "bitcoin 0.28.2", - "target": "bitcoin" + "target": "bitcoin", + "alias": "bitcoin_0_28" }, { - "id": "bitcoin 0.32.2", - "target": "bitcoin", - "alias": "bitcoin_0_32" + "id": "bitcoin 0.32.5", + "target": "bitcoin" }, { - "id": "bitcoincore-rpc 0.15.0", + "id": "bitcoincore-rpc 0.19.0", "target": "bitcoincore_rpc" }, { @@ -19356,6 +19413,11 @@ }, { "id": "secp256k1 0.22.2", + "target": "secp256k1", + "alias": "secp256k1_0_22" + }, + { + "id": "secp256k1 0.29.0", "target": "secp256k1" }, { @@ -27270,7 +27332,8 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "std" ], "selects": {} }, @@ -36775,16 +36838,14 @@ "license_ids": [], "license_file": "LICENSE" }, - "jsonrpc 0.12.1": { + "jsonrpc 0.13.0": { "name": "jsonrpc", - "version": "0.12.1", + "version": "0.13.0", "package_url": "https://github.com/apoelstra/rust-jsonrpc/", "repository": { - "Git": { - "remote": "https://github.com/apoelstra/rust-jsonrpc", - "commitish": { - "Rev": "e42044d8e0896317488dfbd65eb5563d76e937fe" - } + "Http": { + "url": "https://static.crates.io/crates/jsonrpc/0.13.0/download", + "sha256": "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" } }, "targets": [ @@ -36833,7 +36894,7 @@ "selects": {} }, "edition": "2018", - "version": "0.12.1" + "version": "0.13.0" }, "license": "CC0-1.0", "license_ids": [ @@ -36841,14 +36902,14 @@ ], "license_file": "LICENSE" }, - "jsonrpc 0.13.0": { + "jsonrpc 0.18.0": { "name": "jsonrpc", - "version": "0.13.0", + "version": "0.18.0", "package_url": "https://github.com/apoelstra/rust-jsonrpc/", "repository": { "Http": { - "url": "https://static.crates.io/crates/jsonrpc/0.13.0/download", - "sha256": "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" + "url": "https://static.crates.io/crates/jsonrpc/0.18.0/download", + "sha256": "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" } }, "targets": [ @@ -36874,6 +36935,8 @@ "common": [ "base64", "default", + "minreq", + "minreq_http", "simple_http", "simple_tcp" ], @@ -36885,6 +36948,10 @@ "id": "base64 0.13.1", "target": "base64" }, + { + "id": "minreq 2.13.0", + "target": "minreq" + }, { "id": "serde 1.0.214", "target": "serde" @@ -36897,7 +36964,7 @@ "selects": {} }, "edition": "2018", - "version": "0.13.0" + "version": "0.18.0" }, "license": "CC0-1.0", "license_ids": [ @@ -42353,6 +42420,93 @@ ], "license_file": "LICENSE" }, + "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.214", + "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", @@ -52720,7 +52874,7 @@ "target": "heck" }, { - "id": "itertools 0.11.0", + "id": "itertools 0.12.0", "target": "itertools" }, { @@ -52874,7 +53028,7 @@ "target": "anyhow" }, { - "id": "itertools 0.11.0", + "id": "itertools 0.12.0", "target": "itertools" }, { @@ -64344,7 +64498,14 @@ "crate_features": { "common": [ "alloc", - "hashes" + "default", + "global-context", + "hashes", + "rand", + "rand-std", + "recovery", + "serde", + "std" ], "selects": {} }, @@ -64355,9 +64516,17 @@ "target": "bitcoin_hashes", "alias": "hashes" }, + { + "id": "rand 0.8.5", + "target": "rand" + }, { "id": "secp256k1-sys 0.10.0", "target": "secp256k1_sys" + }, + { + "id": "serde 1.0.214", + "target": "serde" } ], "selects": {} @@ -64583,7 +64752,9 @@ ], "crate_features": { "common": [ - "alloc" + "alloc", + "recovery", + "std" ], "selects": {} }, @@ -87652,8 +87823,8 @@ "bip32 0.5.1", "bit-vec 0.6.3", "bitcoin 0.28.2", - "bitcoin 0.32.2", - "bitcoincore-rpc 0.15.0", + "bitcoin 0.32.5", + "bitcoincore-rpc 0.19.0", "bitcoind 0.32.0", "bitflags 1.3.2", "bs58 0.5.0", @@ -87870,6 +88041,7 @@ "scopeguard 1.2.0", "scraper 0.17.1", "secp256k1 0.22.2", + "secp256k1 0.29.0", "semver 1.0.22", "serde 1.0.214", "serde-bytes-repr 0.1.5", diff --git a/Cargo.Bazel.Fuzzing.toml.lock b/Cargo.Bazel.Fuzzing.toml.lock index 4bab6230a1e..4b420cfa481 100644 --- a/Cargo.Bazel.Fuzzing.toml.lock +++ b/Cargo.Bazel.Fuzzing.toml.lock @@ -1091,7 +1091,7 @@ dependencies = [ "bitflags 2.6.0", "cexpr", "clang-sys", - "itertools 0.11.0", + "itertools 0.12.0", "lazy_static", "lazycell", "proc-macro2", @@ -1186,9 +1186,9 @@ dependencies = [ [[package]] name = "bitcoin" -version = "0.32.2" +version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea507acc1cd80fc084ace38544bbcf7ced7c2aa65b653b102de0ce718df668f6" +checksum = "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" dependencies = [ "base58ck", "bech32 0.11.0", @@ -1199,6 +1199,7 @@ dependencies = [ "hex-conservative", "hex_lit", "secp256k1 0.29.0", + "serde", ] [[package]] @@ -1206,6 +1207,9 @@ name = "bitcoin-internals" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" +dependencies = [ + "serde", +] [[package]] name = "bitcoin-io" @@ -1226,6 +1230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2" dependencies = [ "bitcoin-internals", + "serde", ] [[package]] @@ -1255,16 +1260,17 @@ checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" dependencies = [ "bitcoin-io", "hex-conservative", + "serde", ] [[package]] name = "bitcoincore-rpc" -version = "0.15.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0e67dbf7a9971e7f4276f6089e9e814ce0f624a03216b7d92d00351ae7fb3e" +checksum = "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" dependencies = [ "bitcoincore-rpc-json", - "jsonrpc 0.12.1", + "jsonrpc 0.18.0", "log", "serde", "serde_json", @@ -1272,11 +1278,11 @@ dependencies = [ [[package]] name = "bitcoincore-rpc-json" -version = "0.15.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e2ae16202721ba8c3409045681fac790a5ddc791f05731a2df22c0c6bffc0f1" +checksum = "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" dependencies = [ - "bitcoin 0.28.2", + "bitcoin 0.32.5", "serde", "serde_json", ] @@ -3009,7 +3015,7 @@ dependencies = [ "bip32", "bit-vec", "bitcoin 0.28.2", - "bitcoin 0.32.2", + "bitcoin 0.32.5", "bitcoincore-rpc", "bitcoind", "bitflags 1.3.2", @@ -3227,6 +3233,7 @@ dependencies = [ "scopeguard", "scraper", "secp256k1 0.22.2", + "secp256k1 0.29.0", "semver", "serde", "serde-bytes-repr", @@ -6073,8 +6080,9 @@ dependencies = [ [[package]] name = "jsonrpc" -version = "0.12.1" -source = "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" dependencies = [ "base64 0.13.1", "serde", @@ -6083,11 +6091,12 @@ dependencies = [ [[package]] name = "jsonrpc" -version = "0.13.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd8d6b3f301ba426b30feca834a2a18d48d5b54e5065496b5c1b05537bee3639" +checksum = "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" dependencies = [ "base64 0.13.1", + "minreq", "serde", "serde_json", ] @@ -6894,6 +6903,17 @@ dependencies = [ "adler", ] +[[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.10" @@ -8576,7 +8596,7 @@ checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", "heck 0.5.0", - "itertools 0.11.0", + "itertools 0.12.0", "log", "multimap", "once_cell", @@ -8609,7 +8629,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools 0.12.0", "proc-macro2", "quote", "syn 2.0.87", @@ -9934,7 +9954,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ "bitcoin_hashes 0.14.0", + "rand 0.8.5", "secp256k1-sys 0.10.0", + "serde", ] [[package]] @@ -13318,3 +13340,9 @@ dependencies = [ "cc", "pkg-config", ] + +[[patch.unused]] +name = "jsonrpc" +version = "0.12.1" +source = "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" + diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 04112e9f8f4..55eb449c980 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "46eba5cf2a6d479e45baf3369cdb40eb29dd3c5ea4c273a525e7066c918df87b", + "checksum": "be5cf4e40f81269a4b62efe4c58e4759a6e2eec494a1eacc1fb6e02c61d7e15d", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -54353,12 +54353,6 @@ "target": "libc" } ], - "aarch64-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "aarch64-unknown-linux-gnu": [ { "id": "libc 0.2.158", @@ -54407,12 +54401,6 @@ "target": "libc" } ], - "i686-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "i686-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -54461,12 +54449,6 @@ "target": "libc" } ], - "x86_64-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -61432,11 +61414,6 @@ "time", "use-libc-auxv" ], - "aarch64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "aarch64-unknown-linux-gnu": [ "default", "event", @@ -61529,11 +61506,6 @@ "time", "use-libc-auxv" ], - "i686-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "i686-unknown-freebsd": [ "default", "event", @@ -61648,11 +61620,6 @@ "time", "use-libc-auxv" ], - "x86_64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "x86_64-unknown-freebsd": [ "default", "event", @@ -61768,32 +61735,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "aarch64-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "aarch64-unknown-nixos-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "aarch64-unknown-nto-qnx710": [ @@ -61807,17 +61748,6 @@ "target": "libc" } ], - "arm-unknown-linux-gnueabi": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "armv7-linux-androideabi": [ { "id": "errno 0.3.8", @@ -61890,10 +61820,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "i686-unknown-freebsd": [ @@ -61907,17 +61833,6 @@ "target": "libc" } ], - "i686-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "powerpc-unknown-linux-gnu": [ { "id": "errno 0.3.8", @@ -62055,10 +61970,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "x86_64-unknown-freebsd": [ @@ -62072,28 +61983,6 @@ "target": "libc" } ], - "x86_64-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "x86_64-unknown-nixos-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "x86_64-unknown-none": [ { "id": "errno 0.3.8", From 6b7fe3d32a7f15bebdcd95ffc98a2ba7f48b5f99 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 09:36:34 +0000 Subject: [PATCH 12/50] fix test + clippy --- Cargo.Bazel.json.lock | 2 +- Cargo.lock | 5 ++- rs/bitcoin/adapter/benches/e2e.rs | 4 +- rs/bitcoin/adapter/src/blockchainmanager.rs | 11 +++--- rs/bitcoin/adapter/src/blockchainstate.rs | 22 ++++++----- rs/bitcoin/adapter/src/connectionmanager.rs | 2 +- .../adapter/src/get_successors_handler.rs | 4 +- rs/bitcoin/adapter/src/lib.rs | 2 +- rs/bitcoin/adapter/src/stream.rs | 20 +++++----- rs/bitcoin/adapter/src/stress_test.rs | 11 +++++- rs/bitcoin/adapter/src/transaction_store.rs | 7 +++- rs/bitcoin/adapter/test_utils/src/bitcoind.rs | 13 +++++-- rs/bitcoin/adapter/test_utils/src/lib.rs | 9 ++++- rs/bitcoin/adapter/tests/adapter_test.rs | 38 ++++++++++++++----- rs/bitcoin/validation/BUILD.bazel | 3 +- rs/bitcoin/validation/src/constants.rs | 4 +- rs/bitcoin/validation/src/header.rs | 16 +++----- rs/bitcoin/validation/src/lib.rs | 2 +- .../test_utils/BUILD.bazel | 5 +-- .../test_utils/Cargo.toml | 6 ++- .../tests/bitcoin_integration_tests.rs | 14 ++++++- 21 files changed, 128 insertions(+), 72 deletions(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 04112e9f8f4..64b667679af 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "46eba5cf2a6d479e45baf3369cdb40eb29dd3c5ea4c273a525e7066c918df87b", + "checksum": "f08630277fa926e75f95b5e41b9dec6bdcd71430fe3f9ee6fa25ed1840baf3c9", "crates": { "abnf 0.12.0": { "name": "abnf", diff --git a/Cargo.lock b/Cargo.lock index db69f00e8d5..985a73dfa6a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7561,15 +7561,16 @@ name = "ic-crypto-internal-threshold-sig-canister-threshold-sig-test-utils" version = "0.9.0" dependencies = [ "assert_matches", - "bitcoin 0.32.5", + "bitcoin 0.28.2", "ed25519-dalek", + "hex", "ic-crypto-internal-threshold-sig-canister-threshold-sig", "ic-crypto-sha2", "ic-types", "k256", "p256", "rand 0.8.5", - "secp256k1 0.29.1", + "secp256k1 0.22.2", "sha2 0.10.8", ] diff --git a/rs/bitcoin/adapter/benches/e2e.rs b/rs/bitcoin/adapter/benches/e2e.rs index fcdb15b46d3..1248a1bbbb5 100644 --- a/rs/bitcoin/adapter/benches/e2e.rs +++ b/rs/bitcoin/adapter/benches/e2e.rs @@ -1,4 +1,6 @@ -use bitcoin::{blockdata::constants::genesis_block, BlockHash, block::Header as BlockHeader, Network}; +use bitcoin::{ + block::Header as BlockHeader, blockdata::constants::genesis_block, BlockHash, Network, +}; use criterion::{criterion_group, criterion_main, Criterion}; use ic_btc_adapter::config::Config; use ic_btc_adapter::config::IncomingSource; diff --git a/rs/bitcoin/adapter/src/blockchainmanager.rs b/rs/bitcoin/adapter/src/blockchainmanager.rs index 4ee2b261ab2..56e7a0eca2e 100644 --- a/rs/bitcoin/adapter/src/blockchainmanager.rs +++ b/rs/bitcoin/adapter/src/blockchainmanager.rs @@ -5,10 +5,13 @@ use crate::{ Channel, Command, ProcessBitcoinNetworkMessageError, }; use bitcoin::{ - block::Header as BlockHeader, hashes::Hash as _, p2p::{ + block::Header as BlockHeader, + hashes::Hash as _, + p2p::{ message::{NetworkMessage, MAX_INV_SIZE}, message_blockdata::{GetHeadersMessage, Inventory}, - }, Block, BlockHash + }, + Block, BlockHash, }; use hashlink::{LinkedHashMap, LinkedHashSet}; use ic_btc_validation::ValidateHeaderError; @@ -776,9 +779,7 @@ pub mod test { use bitcoin::blockdata::constants::genesis_block; use bitcoin::consensus::deserialize; use bitcoin::Network; - use bitcoin::{ - p2p::message::NetworkMessage, BlockHash, - }; + use bitcoin::{p2p::message::NetworkMessage, BlockHash}; use hex::FromHex; use ic_btc_adapter_test_utils::{ generate_headers, generate_large_block_blockchain, BLOCK_1_ENCODED, BLOCK_2_ENCODED, diff --git a/rs/bitcoin/adapter/src/blockchainstate.rs b/rs/bitcoin/adapter/src/blockchainstate.rs index 3d963db1a00..6f948e8d3df 100644 --- a/rs/bitcoin/adapter/src/blockchainstate.rs +++ b/rs/bitcoin/adapter/src/blockchainstate.rs @@ -1,9 +1,9 @@ //! The module is responsible for keeping track of the blockchain state. //! use crate::{common::BlockHeight, config::Config, metrics::BlockchainStateMetrics}; -use bitcoin::{blockdata::constants::genesis_block, Block, BlockHash, block::Header as BlockHeader, Network}; - -use bitcoin::hashes::Hash; +use bitcoin::{ + block::Header as BlockHeader, blockdata::constants::genesis_block, Block, BlockHash, Network, +}; use ic_btc_validation::{validate_header, HeaderStore, ValidateHeaderError}; use ic_metrics::MetricsRegistry; @@ -330,18 +330,19 @@ impl BlockchainState { /// Returns the current size of the block cache. pub fn get_block_cache_size(&self) -> usize { - self.block_cache.values().fold(0, |sum, b| b.total_size() + sum) + self.block_cache + .values() + .fold(0, |sum, b| b.total_size() + sum) } } impl HeaderStore for BlockchainState { fn get_with_block_hash(&self, hash: &BlockHash) -> Option { - self.get_cached_header(hash) - .map(|cached| cached.header) + self.get_cached_header(hash).map(|cached| cached.header) } - // TODO: this is terribly innefficient. We should: either have and index for this, or - // rething how this is used. + // TODO: this is terribly innefficient. We should: either have and index for this, or + // rething how this is used. fn get_with_height(&self, height: u32) -> Option { self.header_cache .values() @@ -549,7 +550,7 @@ mod test { let initial_header = state.genesis(); let mut chain = generate_headers(initial_header.block_hash(), initial_header.time, 16, &[]); let last_header = chain.get_mut(10).unwrap(); - last_header.prev_blockhash = BlockHash::all_zeros(); + last_header.prev_blockhash = BlockHash::from_raw_hash(bitcoin::hashes::Hash::all_zeros()); let chain_hashes: Vec = chain.iter().map(|header| header.block_hash()).collect(); let last_hash = chain_hashes[10]; @@ -586,7 +587,8 @@ mod test { assert!(matches!(result, Ok(()))); // Make a block 2's merkle root invalid and try to add the block to the cache. - block_2.header.merkle_root = TxMerkleNode::all_zeros(); + block_2.header.merkle_root = + TxMerkleNode::from_raw_hash(bitcoin::hashes::Hash::all_zeros()); // Block 2's hash will now be changed because of the merkle root change. let block_2_hash = block_2.block_hash(); let result = state.add_block(block_2); diff --git a/rs/bitcoin/adapter/src/connectionmanager.rs b/rs/bitcoin/adapter/src/connectionmanager.rs index 318ef11c4ab..eeb9f8eaad6 100644 --- a/rs/bitcoin/adapter/src/connectionmanager.rs +++ b/rs/bitcoin/adapter/src/connectionmanager.rs @@ -694,8 +694,8 @@ fn connection_limits(address_book: &AddressBook) -> (usize, usize) { mod test { use super::*; use crate::config::test::ConfigBuilder; - use bitcoin::Network; use bitcoin::p2p::ServiceFlags; + use bitcoin::Network; use ic_logger::replica_logger::no_op_logger; use ic_metrics::MetricsRegistry; use std::str::FromStr; diff --git a/rs/bitcoin/adapter/src/get_successors_handler.rs b/rs/bitcoin/adapter/src/get_successors_handler.rs index 397667edb07..fb0efc8f546 100644 --- a/rs/bitcoin/adapter/src/get_successors_handler.rs +++ b/rs/bitcoin/adapter/src/get_successors_handler.rs @@ -3,7 +3,7 @@ use std::{ sync::{Arc, Mutex}, }; -use bitcoin::{Block, BlockHash, block::Header as BlockHeader, Network}; +use bitcoin::{block::Header as BlockHeader, Block, BlockHash, Network}; use ic_metrics::MetricsRegistry; use tokio::sync::mpsc::Sender; use tonic::Status; @@ -168,7 +168,7 @@ fn get_successor_blocks( // Retrieve the block from the cache. match state.get_block(block_hash) { Some(block) => { - //TODO(mihailjianu): think this through. + //TODO(mihailjianu): think this through. let block_size = block.total_size(); if response_block_size == 0 || (response_block_size + block_size <= MAX_BLOCKS_BYTES diff --git a/rs/bitcoin/adapter/src/lib.rs b/rs/bitcoin/adapter/src/lib.rs index 7550baeb15d..ff88f3533a8 100644 --- a/rs/bitcoin/adapter/src/lib.rs +++ b/rs/bitcoin/adapter/src/lib.rs @@ -4,8 +4,8 @@ //! and publish transactions. Moreover, it interacts with the Bitcoin system //! component to provide blocks and collect outgoing transactions. -use bitcoin::{BlockHash, block::Header as BlockHeader}; use bitcoin::p2p::message::NetworkMessage; +use bitcoin::{block::Header as BlockHeader, BlockHash}; use ic_logger::ReplicaLogger; use ic_metrics::MetricsRegistry; use std::{ diff --git a/rs/bitcoin/adapter/src/stream.rs b/rs/bitcoin/adapter/src/stream.rs index 1112bb214fb..46252773590 100644 --- a/rs/bitcoin/adapter/src/stream.rs +++ b/rs/bitcoin/adapter/src/stream.rs @@ -1,10 +1,10 @@ +use bitcoin::io as bitcoin_io; use bitcoin::{ consensus::serialize, p2p::message::RawNetworkMessage, p2p::Magic, {consensus::encode, p2p::message::NetworkMessage}, }; -use bitcoin::io as bitcoin_io; use futures::TryFutureExt; use http::Uri; use ic_logger::{debug, error, info, ReplicaLogger}; @@ -230,7 +230,9 @@ impl Stream { // If the read successfully received bytes, then the bytes are added to the // unparsed buffer to attempt another deserialize call. If no bytes found, // return the unexpected end-of-file error. - Err(encode::Error::Io(ref err)) if err.kind() == bitcoin_io::ErrorKind::UnexpectedEof => { + Err(encode::Error::Io(ref err)) + if err.kind() == bitcoin_io::ErrorKind::UnexpectedEof => + { let count = self .read_half .try_read(&mut self.data) @@ -269,7 +271,7 @@ impl Stream { async fn write_message(&mut self, network_message: NetworkMessage) -> StreamResult<()> { let raw_network_message = RawNetworkMessage::new(self.magic, network_message); let bytes = serialize(&raw_network_message); - self.write_half + self.write_half .write_all(bytes.as_slice()) .await .map_err(StreamError::Io)?; @@ -411,8 +413,8 @@ pub mod test { tokio::spawn(async move { let (mut socket, _addr) = listener.accept().await.unwrap(); let addr = RawNetworkMessage::new( - network.magic(), - NetworkMessage::Alert(vec![0; MAX_RAW_MESSAGE_SIZE + 10]), + network.magic(), + NetworkMessage::Alert(vec![0; MAX_RAW_MESSAGE_SIZE + 10]), ); let mut buf = Vec::new(); let raw_addr = addr.consensus_encode(&mut buf).unwrap(); @@ -492,16 +494,16 @@ pub mod test { // Large messgage just below limit. let payload_large = RawNetworkMessage::new( - network.magic(), - NetworkMessage::Alert(vec![0; MAX_RAW_MESSAGE_SIZE - 30]) + network.magic(), + NetworkMessage::Alert(vec![0; MAX_RAW_MESSAGE_SIZE - 30]), ); let mut buf_large = Vec::new(); let _ = payload_large.consensus_encode(&mut buf_large).unwrap(); // Message that crosses the boundary limit. let payload_small = RawNetworkMessage::new( - network.magic(), - NetworkMessage::Alert(vec![0; 31 + STREAM_BUFFER_SIZE]), + network.magic(), + NetworkMessage::Alert(vec![0; 31 + STREAM_BUFFER_SIZE]), ); let mut buf_small = Vec::new(); let _ = payload_small.consensus_encode(&mut buf_small).unwrap(); diff --git a/rs/bitcoin/adapter/src/stress_test.rs b/rs/bitcoin/adapter/src/stress_test.rs index 60cf243e27e..57949cf22cd 100644 --- a/rs/bitcoin/adapter/src/stress_test.rs +++ b/rs/bitcoin/adapter/src/stress_test.rs @@ -57,7 +57,10 @@ async fn main() { loop { let mut request = tonic::Request::new(BtcServiceGetSuccessorsRequest { - processed_block_hashes: processed_block_hashes.iter().map(|h| h[..].to_vec()).collect(), + processed_block_hashes: processed_block_hashes + .iter() + .map(|h| h[..].to_vec()) + .collect(), anchor: current_anchor[..].to_vec(), }); request.set_timeout(request_timeout_ms); @@ -79,7 +82,11 @@ async fn main() { let block_hashes = inner .blocks .iter() - .map(|b| Block::consensus_decode(&mut b.as_slice()).unwrap().block_hash()) + .map(|b| { + Block::consensus_decode(&mut b.as_slice()) + .unwrap() + .block_hash() + }) .collect::>(); current_anchor = *block_hashes.last().expect("failed to get last block hash"); diff --git a/rs/bitcoin/adapter/src/transaction_store.rs b/rs/bitcoin/adapter/src/transaction_store.rs index 68c0e448ee6..4605e5e3561 100644 --- a/rs/bitcoin/adapter/src/transaction_store.rs +++ b/rs/bitcoin/adapter/src/transaction_store.rs @@ -203,7 +203,8 @@ mod test { use super::*; use crate::common::test_common::TestChannel; use bitcoin::{ - absolute::LockTime, blockdata::constants::genesis_block, consensus::serialize, Network, Transaction + absolute::LockTime, blockdata::constants::genesis_block, consensus::serialize, Network, + Transaction, }; use ic_logger::replica_logger::no_op_logger; use std::str::FromStr; @@ -461,7 +462,9 @@ mod test { channel.pop_front().unwrap(), Command { address: Some(address2), - message: NetworkMessage::Inv(vec![Inventory::Transaction(transaction.compute_txid())]) + message: NetworkMessage::Inv(vec![Inventory::Transaction( + transaction.compute_txid() + )]) } ); } diff --git a/rs/bitcoin/adapter/test_utils/src/bitcoind.rs b/rs/bitcoin/adapter/test_utils/src/bitcoind.rs index 53fe6644452..b3ef7a9b94c 100644 --- a/rs/bitcoin/adapter/test_utils/src/bitcoind.rs +++ b/rs/bitcoin/adapter/test_utils/src/bitcoind.rs @@ -8,13 +8,14 @@ use std::{ use bitcoin::p2p::{Magic, ServiceFlags}; use bitcoin::{ + block::Header as BlockHeader, consensus::{deserialize_partial, encode, serialize}, p2p::{ message::{NetworkMessage, RawNetworkMessage}, message_blockdata::{GetHeadersMessage, Inventory}, message_network::VersionMessage, }, - Block, BlockHash, block::Header as BlockHeader, + Block, BlockHash, }; use bitcoin::io as bitcoin_io; @@ -40,7 +41,7 @@ async fn write_network_message( async fn handle_getdata( socket: &mut TcpStream, - msg: &Vec, + msg: &[Inventory], magic: Magic, blocks: Arc>, ) -> io::Result<()> { @@ -65,7 +66,11 @@ async fn handle_ping(socket: &mut TcpStream, val: u64, magic: Magic) -> io::Resu write_network_message(socket, magic, NetworkMessage::Pong(val)).await } -async fn handle_version(socket: &mut TcpStream, v: &VersionMessage, magic: Magic) -> io::Result<()> { +async fn handle_version( + socket: &mut TcpStream, + v: &VersionMessage, + magic: Magic, +) -> io::Result<()> { if v.version < MINIMUM_PROTOCOL_VERSION { let err = io::Error::new(ErrorKind::Other, "Protocol version too low"); return Err(err); @@ -95,7 +100,7 @@ async fn handle_getheaders( for locator in &msg.locator_hashes { if cached_headers.contains_key(locator) { - found = Some(locator.clone()); + found = Some(*locator); break; } } diff --git a/rs/bitcoin/adapter/test_utils/src/lib.rs b/rs/bitcoin/adapter/test_utils/src/lib.rs index 106bb79aced..452059a24a2 100644 --- a/rs/bitcoin/adapter/test_utils/src/lib.rs +++ b/rs/bitcoin/adapter/test_utils/src/lib.rs @@ -1,7 +1,10 @@ use std::collections::HashSet; use bitcoin::{ - block::{Header as BlockHeader, Version}, consensus::deserialize, hashes::Hash, Block, BlockHash, Target, Transaction, TxMerkleNode + block::{Header as BlockHeader, Version}, + consensus::deserialize, + hashes::Hash, + Block, BlockHash, Target, Transaction, TxMerkleNode, }; use hex::FromHex; use rand::{prelude::StdRng, Rng, SeedableRng}; @@ -59,7 +62,9 @@ fn large_block(prev_blockhash: &BlockHash, prev_time: u32, tx: Transaction) -> B block.txdata.push(tx.clone()); } - block.header.merkle_root = block.compute_merkle_root().unwrap_or(TxMerkleNode::all_zeros()); + block.header.merkle_root = block + .compute_merkle_root() + .unwrap_or(TxMerkleNode::all_zeros()); solve_proof_of_work(&mut block.header); block } diff --git a/rs/bitcoin/adapter/tests/adapter_test.rs b/rs/bitcoin/adapter/tests/adapter_test.rs index 5fe292045e5..c7bc902c57c 100644 --- a/rs/bitcoin/adapter/tests/adapter_test.rs +++ b/rs/bitcoin/adapter/tests/adapter_test.rs @@ -55,7 +55,7 @@ impl ForkTestData { } } -fn make_get_successors_request( +fn make_get_successors_request( adapter_client: &BitcoinAdapterClient, anchor: Vec, headers: Vec>, @@ -379,7 +379,9 @@ fn sync_blocks_at_once( } fn get_blackhole_address() -> Address { - Address::from_str("mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn").unwrap().assume_checked() + Address::from_str("mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn") + .unwrap() + .assume_checked() } fn create_alice_and_bob_wallets(bitcoind: &BitcoinD) -> (Client, Client, Address, Address) { @@ -401,8 +403,14 @@ fn create_alice_and_bob_wallets(bitcoind: &BitcoinD) -> (Client, Client, Address .create_wallet("bob", None, None, None, None) .unwrap(); - let alice_address = alice_client.get_new_address(None, None).unwrap().assume_checked(); - let bob_address = bob_client.get_new_address(None, None).unwrap().assume_checked(); + let alice_address = alice_client + .get_new_address(None, None) + .unwrap() + .assume_checked(); + let bob_address = bob_client + .get_new_address(None, None) + .unwrap() + .assume_checked(); (alice_client, bob_client, alice_address, bob_address) } @@ -526,7 +534,7 @@ fn test_receives_blocks() { assert_eq!(0, client.get_blockchain_info().unwrap().blocks); - //TODO(mihailjianu): check that "assume_checked" is enough. + //TODO(mihailjianu): check that "assume_checked" is enough. let address = client.get_new_address(None, None).unwrap().assume_checked(); @@ -823,13 +831,19 @@ fn test_receives_blocks_from_forks() { wait_for_connection(&client1, 2); wait_for_connection(&client2, 2); - let address1 = client1.get_new_address(None, None).unwrap().assume_checked(); + let address1 = client1 + .get_new_address(None, None) + .unwrap() + .assume_checked(); client1.generate_to_address(25, &address1).unwrap(); wait_for_blocks(&client1, 25); wait_for_blocks(&client2, 25); - let address2 = client2.get_new_address(None, None).unwrap().assume_checked(); + let address2 = client2 + .get_new_address(None, None) + .unwrap() + .assume_checked(); client2.generate_to_address(25, &address2).unwrap(); wait_for_blocks(&client1, 50); @@ -891,7 +905,10 @@ fn test_bfs_order() { wait_for_connection(&client1, 2); wait_for_connection(&client2, 2); - let address1 = client1.get_new_address(None, None).unwrap().assume_checked(); + let address1 = client1 + .get_new_address(None, None) + .unwrap() + .assume_checked(); let shared_blocks = client1.generate_to_address(5, &address1).unwrap(); wait_for_blocks(&client1, 5); @@ -907,7 +924,10 @@ fn test_bfs_order() { let fork1 = client1.generate_to_address(15, &address1).unwrap(); - let address2 = client2.get_new_address(None, None).unwrap().assume_checked(); + let address2 = client2 + .get_new_address(None, None) + .unwrap() + .assume_checked(); let fork2 = client2.generate_to_address(15, &address2).unwrap(); wait_for_blocks(&client1, 20); diff --git a/rs/bitcoin/validation/BUILD.bazel b/rs/bitcoin/validation/BUILD.bazel index 15551334115..f39e83b14e5 100644 --- a/rs/bitcoin/validation/BUILD.bazel +++ b/rs/bitcoin/validation/BUILD.bazel @@ -13,7 +13,8 @@ DEV_DEPENDENCIES = [ # Keep sorted. "@crate_index//:csv", "@crate_index//:hex", - "@crate_index//:primitive-types", + #TODO(mihailjianu): figure out why this is needed. + #"@crate_index//:primitive-types", "@crate_index//:proptest", ] diff --git a/rs/bitcoin/validation/src/constants.rs b/rs/bitcoin/validation/src/constants.rs index 435a8fdbddb..72cd045ebda 100644 --- a/rs/bitcoin/validation/src/constants.rs +++ b/rs/bitcoin/validation/src/constants.rs @@ -12,7 +12,7 @@ pub const TEN_MINUTES: u32 = 60 * 10; pub fn max_target(network: &Network) -> Target { match network { Network::Bitcoin => Target::MAX_ATTAINABLE_MAINNET, - Network::Testnet4 => Target::MAX_ATTAINABLE_TESTNET, + Network::Testnet => Target::MAX_ATTAINABLE_TESTNET, Network::Regtest => Target::MAX_ATTAINABLE_REGTEST, Network::Signet => Target::MAX_ATTAINABLE_SIGNET, &other => unreachable!("Unsupported network: {:?}", other), @@ -55,4 +55,4 @@ pub mod test { pub const TESTNET_HEADER_2132555: &str = "004000200e1ff99438666c67c649def743fb82117537c2017bcc6ad617000000000000007fa40cf82bf224909e3174281a57af2eb3a4a2a961d33f50ec0772c1221c9e61ddfdc061ffff001a64526636"; /// Testnet 00000000383cd7fff4692410ccd9bd6201790043bb41b93bacb21e9b85620767 pub const TESTNET_HEADER_2132556: &str = "00000020974f55e77dff100bc252a01aa7b00d16736c6e04a091b03be200000000000000c44f2d69fc200c4a2211885000b6b67512f42c1bec550f3754e103b6c4046e05a202c161ffff001d09ec1bc4"; -} \ No newline at end of file +} diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index ef8e71be514..eb26eae9633 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -77,7 +77,8 @@ pub fn validate_header( return Err(ValidateHeaderError::InvalidPoWForHeaderTarget); } - let compact_target = get_next_compact_target(network, store, &prev_header, prev_height, header.time); + let compact_target = + get_next_compact_target(network, store, &prev_header, prev_height, header.time); if let Err(err) = header.validate_pow(Target::from_compact(compact_target)) { match err { ValidationError::BadProofOfWork => println!("bad proof of work"), @@ -216,7 +217,8 @@ fn compute_next_difficulty( // actual_interval will deviate slightly from 2 weeks. Our goal is to // readjust the difficulty target so that the expected time taken for the next // 2016 blocks is again 2 weeks. - let actual_interval = std::cmp::max((prev_header.time as i64) - (last_adjustment_time as i64), 0) as u64; + 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) } @@ -238,8 +240,6 @@ mod test { TESTNET_HEADER_2132555, TESTNET_HEADER_2132556, }; - const MOCK_CURRENT_TIME: u64 = 2_634_590_600; - #[derive(Clone)] struct StoredHeader { header: BlockHeader, @@ -361,11 +361,7 @@ mod test { let header_2132555 = deserialize_header(TESTNET_HEADER_2132555); let header_2132556 = deserialize_header(TESTNET_HEADER_2132556); let store = SimpleHeaderStore::new(header_2132555, 2_132_555); - let result = validate_header( - &Network::Testnet, - &store, - &header_2132556, - ); + let result = validate_header(&Network::Testnet, &store, &header_2132556); assert!(result.is_ok()); } @@ -565,4 +561,4 @@ mod test { assert_eq!(compact_target, expected_pow); } } -} \ No newline at end of file +} diff --git a/rs/bitcoin/validation/src/lib.rs b/rs/bitcoin/validation/src/lib.rs index d8597e1f788..dbfaee7bfec 100644 --- a/rs/bitcoin/validation/src/lib.rs +++ b/rs/bitcoin/validation/src/lib.rs @@ -4,4 +4,4 @@ mod header; pub use crate::constants::max_target; pub use crate::header::{validate_header, HeaderStore, ValidateHeaderError}; -type BlockHeight = u32; \ No newline at end of file +type BlockHeight = u32; diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel index 60f6eb7a527..40a2381305d 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel @@ -15,14 +15,13 @@ rust_library( "//rs/types/types", "@crate_index//:assert_matches", #TODO(mihailjianu): Migrate this to bitcoin. - "@crate_index//:bitcoin", + "@crate_index//:bitcoin_0_28", "@crate_index//:ed25519-dalek", "@crate_index//:hex", "@crate_index//:k256", "@crate_index//:p256", "@crate_index//:rand", - #TODO(mihailjianu): check if this is replacable with ic-secp256k1 - "@crate_index//:secp256k1", + "@crate_index//:secp256k1-0-22", "@crate_index//:sha2", ], ) diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml index e4f43931299..7d87baeeac9 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml @@ -9,8 +9,10 @@ documentation.workspace = true [dependencies] assert_matches = { workspace = true } ed25519-dalek = { workspace = true } -bitcoin = { workspace = true } -secp256k1 = { version = "0.29", features = ["global-context", "rand-std", "serde"] } +#TODO(mihailjianu): try migrating this to the latest bitcoin crate. +bitcoin = { version = "0.28.2" } +hex = "0.4" +secp256k1 = { version = "0.22", features = ["global-context", "rand-std"] } ic-crypto-internal-threshold-sig-canister-threshold-sig = { path = ".." } ic-crypto-sha2 = { path = "../../../../../sha2" } ic-types = { path = "../../../../../../types/types" } diff --git a/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs b/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs index bf70bd76d64..1d5281b3f4f 100644 --- a/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs +++ b/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs @@ -141,7 +141,12 @@ rpcauth=ic-btc-integration:cdf2741387f3a12438f69092f0fdad8e$62081498c98bee09a0dc // `n` must be more than 100 (Coinbase maturity rule) so that the reward for the first block can be sent out let mut n = 101; btc_rpc - .generate_to_address(n, &Address::from_str(&bitcoin_address).unwrap().assume_checked()) + .generate_to_address( + n, + &Address::from_str(&bitcoin_address) + .unwrap() + .assume_checked(), + ) .unwrap(); let reward = 50 * 100_000_000; // 50 BTC @@ -175,7 +180,12 @@ rpcauth=ic-btc-integration:cdf2741387f3a12438f69092f0fdad8e$62081498c98bee09a0dc break; } else { btc_rpc - .generate_to_address(1, &Address::from_str(&bitcoin_address).unwrap().assume_checked()) + .generate_to_address( + 1, + &Address::from_str(&bitcoin_address) + .unwrap() + .assume_checked(), + ) .unwrap(); n += 1; } From 6f22775c2533413a26673d5b06047064c4414b03 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 09:42:50 +0000 Subject: [PATCH 13/50] cleanup --- Cargo.toml | 1 - bazel/external_crates.bzl | 1 - rs/bitcoin/adapter/src/get_successors_handler.rs | 1 - rs/bitcoin/adapter/tests/adapter_test.rs | 2 -- rs/bitcoin/validation/BUILD.bazel | 2 -- .../threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel | 2 +- .../threshold_sig/canister_threshold_sig/test_utils/Cargo.toml | 2 +- 7 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d7fac4c0640..925a6f7b63e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -507,7 +507,6 @@ axum = "0.7.9" backoff = "0.4" base64 = { version = "0.13.1" } bincode = "1.3.3" -#TODO(mihailjianu): consider moving the feature into each crate. bitcoin = { version = "0.32.5", features = ["default", "rand", "serde"] } bitcoincore-rpc = "0.19.0" # build-info and build-info-build MUST be kept in sync! diff --git a/bazel/external_crates.bzl b/bazel/external_crates.bzl index e0e572309a4..706caf18128 100644 --- a/bazel/external_crates.bzl +++ b/bazel/external_crates.bzl @@ -101,7 +101,6 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable patch_args = ["-p4"], patches = ["@@//bazel:cranelift-codegen-meta.patch"], )], - #TODO(mihailjianu): check if we need this at all. "secp256k1-sys": [crate.annotation( # This specific version is used by ic-btc-kyt canister, which # requires an extra cfg flag to avoid linking issues. diff --git a/rs/bitcoin/adapter/src/get_successors_handler.rs b/rs/bitcoin/adapter/src/get_successors_handler.rs index fb0efc8f546..d3ddc79e9ea 100644 --- a/rs/bitcoin/adapter/src/get_successors_handler.rs +++ b/rs/bitcoin/adapter/src/get_successors_handler.rs @@ -168,7 +168,6 @@ fn get_successor_blocks( // Retrieve the block from the cache. match state.get_block(block_hash) { Some(block) => { - //TODO(mihailjianu): think this through. let block_size = block.total_size(); if response_block_size == 0 || (response_block_size + block_size <= MAX_BLOCKS_BYTES diff --git a/rs/bitcoin/adapter/tests/adapter_test.rs b/rs/bitcoin/adapter/tests/adapter_test.rs index c7bc902c57c..3fa103e20dc 100644 --- a/rs/bitcoin/adapter/tests/adapter_test.rs +++ b/rs/bitcoin/adapter/tests/adapter_test.rs @@ -534,8 +534,6 @@ fn test_receives_blocks() { assert_eq!(0, client.get_blockchain_info().unwrap().blocks); - //TODO(mihailjianu): check that "assume_checked" is enough. - let address = client.get_new_address(None, None).unwrap().assume_checked(); client.generate_to_address(150, &address).unwrap(); diff --git a/rs/bitcoin/validation/BUILD.bazel b/rs/bitcoin/validation/BUILD.bazel index f39e83b14e5..259fa9534cf 100644 --- a/rs/bitcoin/validation/BUILD.bazel +++ b/rs/bitcoin/validation/BUILD.bazel @@ -13,8 +13,6 @@ DEV_DEPENDENCIES = [ # Keep sorted. "@crate_index//:csv", "@crate_index//:hex", - #TODO(mihailjianu): figure out why this is needed. - #"@crate_index//:primitive-types", "@crate_index//:proptest", ] diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel index 40a2381305d..fcbc4746f73 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel @@ -14,7 +14,7 @@ rust_library( "//rs/crypto/sha2", "//rs/types/types", "@crate_index//:assert_matches", - #TODO(mihailjianu): Migrate this to bitcoin. + #TODO(BTC-CRATE-UPGRADE): Migrate this to bitcoin. "@crate_index//:bitcoin_0_28", "@crate_index//:ed25519-dalek", "@crate_index//:hex", diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml index 7d87baeeac9..8d3138963b6 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml @@ -9,7 +9,7 @@ documentation.workspace = true [dependencies] assert_matches = { workspace = true } ed25519-dalek = { workspace = true } -#TODO(mihailjianu): try migrating this to the latest bitcoin crate. +#TODO: try migrating this to the latest bitcoin crate. bitcoin = { version = "0.28.2" } hex = "0.4" secp256k1 = { version = "0.22", features = ["global-context", "rand-std"] } From 8994a735aec04247243e313f53f9cda27e5fbe69 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 09:47:43 +0000 Subject: [PATCH 14/50] lock --- Cargo.Bazel.json.lock | 111 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 0b10ef05025..64b667679af 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -54353,6 +54353,12 @@ "target": "libc" } ], + "aarch64-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "aarch64-unknown-linux-gnu": [ { "id": "libc 0.2.158", @@ -54401,6 +54407,12 @@ "target": "libc" } ], + "i686-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "i686-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -54449,6 +54461,12 @@ "target": "libc" } ], + "x86_64-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -61414,6 +61432,11 @@ "time", "use-libc-auxv" ], + "aarch64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "aarch64-unknown-linux-gnu": [ "default", "event", @@ -61506,6 +61529,11 @@ "time", "use-libc-auxv" ], + "i686-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "i686-unknown-freebsd": [ "default", "event", @@ -61620,6 +61648,11 @@ "time", "use-libc-auxv" ], + "x86_64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "x86_64-unknown-freebsd": [ "default", "event", @@ -61735,6 +61768,32 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "aarch64-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "aarch64-unknown-nixos-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "aarch64-unknown-nto-qnx710": [ @@ -61748,6 +61807,17 @@ "target": "libc" } ], + "arm-unknown-linux-gnueabi": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "armv7-linux-androideabi": [ { "id": "errno 0.3.8", @@ -61820,6 +61890,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "i686-unknown-freebsd": [ @@ -61833,6 +61907,17 @@ "target": "libc" } ], + "i686-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "powerpc-unknown-linux-gnu": [ { "id": "errno 0.3.8", @@ -61970,6 +62055,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "x86_64-unknown-freebsd": [ @@ -61983,6 +62072,28 @@ "target": "libc" } ], + "x86_64-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "x86_64-unknown-nixos-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-none": [ { "id": "errno 0.3.8", From 48329b36627067cadd9f5283d8788d18ea26159e Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 09:51:39 +0000 Subject: [PATCH 15/50] typo --- .../threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel index fcbc4746f73..26fa7828933 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel @@ -21,7 +21,7 @@ rust_library( "@crate_index//:k256", "@crate_index//:p256", "@crate_index//:rand", - "@crate_index//:secp256k1-0-22", + "@crate_index//:secp256k1_0_22", "@crate_index//:sha2", ], ) From 592100487fac8d2c56f24f6d005e2617b31bc046 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 09:59:57 +0000 Subject: [PATCH 16/50] hex --- Cargo.lock | 1 + rs/bitcoin/validation/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 985a73dfa6a..b0e479187dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6092,6 +6092,7 @@ version = "0.9.0" dependencies = [ "bitcoin 0.32.5", "csv", + "hex", "proptest 0.9.6", ] diff --git a/rs/bitcoin/validation/Cargo.toml b/rs/bitcoin/validation/Cargo.toml index a1a8389396b..752eea92d36 100644 --- a/rs/bitcoin/validation/Cargo.toml +++ b/rs/bitcoin/validation/Cargo.toml @@ -10,6 +10,7 @@ documentation.workspace = true [dependencies] bitcoin = { workspace = true } +hex = { workspace = true } [dev-dependencies] csv = "1.1" From 6d7d9bf782809a9efcb57d9eee85bde2dfddea95 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 10:13:12 +0000 Subject: [PATCH 17/50] fix --- rs/crypto/secp256k1/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rs/crypto/secp256k1/BUILD.bazel b/rs/crypto/secp256k1/BUILD.bazel index c646f7b7969..9f7d69d1c9c 100644 --- a/rs/crypto/secp256k1/BUILD.bazel +++ b/rs/crypto/secp256k1/BUILD.bazel @@ -21,7 +21,7 @@ MACRO_DEPENDENCIES = [] DEV_DEPENDENCIES = [ # Keep sorted. "@crate_index//:bip32", - "@crate_index//:bitcoin", + "@crate_index//:bitcoin_0_28", "@crate_index//:hex", "@crate_index//:hex-literal", "@crate_index//:wycheproof", From b361974fe392eb6056e3299405a24bdbac19622c Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 12:13:13 +0000 Subject: [PATCH 18/50] changes --- rs/bitcoin/adapter/src/transaction_store.rs | 4 +- rs/bitcoin/ckbtc/minter/src/tests.rs | 58 +++++++++------------ rs/bitcoin/ckbtc/minter/tests/tests.rs | 25 ++++----- 3 files changed, 39 insertions(+), 48 deletions(-) diff --git a/rs/bitcoin/adapter/src/transaction_store.rs b/rs/bitcoin/adapter/src/transaction_store.rs index 4605e5e3561..865c57254aa 100644 --- a/rs/bitcoin/adapter/src/transaction_store.rs +++ b/rs/bitcoin/adapter/src/transaction_store.rs @@ -203,7 +203,7 @@ mod test { use super::*; use crate::common::test_common::TestChannel; use bitcoin::{ - absolute::LockTime, blockdata::constants::genesis_block, consensus::serialize, Network, + absolute::{LockTime, LOCK_TIME_THRESHOLD}, blockdata::constants::genesis_block, consensus::serialize, Network, Transaction, }; use ic_logger::replica_logger::no_op_logger; @@ -305,7 +305,7 @@ mod test { // Send one transaction. This transaction should be removed first if we are at capacity. let mut first_tx = get_transaction(); - first_tx.lock_time = LockTime::from_height(u32::MAX).unwrap(); + first_tx.lock_time = LockTime::from_height(LOCK_TIME_THRESHOLD - 1).unwrap(); let raw_tx = serialize(&first_tx); manager.enqueue_transaction(&raw_tx); diff --git a/rs/bitcoin/ckbtc/minter/src/tests.rs b/rs/bitcoin/ckbtc/minter/src/tests.rs index e492584e597..cb41597bd7c 100644 --- a/rs/bitcoin/ckbtc/minter/src/tests.rs +++ b/rs/bitcoin/ckbtc/minter/src/tests.rs @@ -12,7 +12,7 @@ use crate::{ }, }; use bitcoin::network::constants::Network as BtcNetwork; -use bitcoin::util::psbt::serialize::{Deserialize, Serialize}; +use bitcoin::psbt::serialize::{Deserialize, Serialize}; use candid::Principal; use ic_base_types::{CanisterId, PrincipalId}; use ic_btc_interface::{Network, OutPoint, Satoshi, Txid, Utxo}; @@ -75,41 +75,31 @@ fn network_to_btc_network(network: Network) -> BtcNetwork { } } -fn address_to_btc_address(address: &BitcoinAddress, network: Network) -> bitcoin::Address { - use bitcoin::util::address::{Payload, WitnessVersion}; +fn address_to_btc_address(address: &BitcoinAddress, network: Network) -> Address { + let btc_net = network_to_btc_network(network); match address { - BitcoinAddress::P2wpkhV0(pkhash) => bitcoin::Address { - payload: Payload::WitnessProgram { - version: WitnessVersion::V0, - program: pkhash.to_vec(), - }, - network: network_to_btc_network(network), + BitcoinAddress::P2wpkhV0(pkhash) => { + Address::p2wpkh(WPubkeyHash::from_slice(pkhash).unwrap(), btc_net) + .expect("Invalid p2wpkh hash") }, - BitcoinAddress::P2wshV0(script_hash) => bitcoin::Address { - payload: Payload::WitnessProgram { - version: WitnessVersion::V0, - program: script_hash.to_vec(), - }, - network: network_to_btc_network(network), + BitcoinAddress::P2wshV0(script_hash) => { + Address::p2wsh(WScriptHash::from_slice(script_hash).unwrap(), btc_net) + .expect("Invalid p2wsh hash") }, - BitcoinAddress::P2pkh(pkhash) => bitcoin::Address { - payload: Payload::PubkeyHash(bitcoin::PubkeyHash::from_hash( - bitcoin::hashes::Hash::from_slice(pkhash).unwrap(), - )), - network: network_to_btc_network(network), + BitcoinAddress::P2pkh(pkhash) => { + Address::p2pkh(PubkeyHash::from_slice(pkhash).unwrap(), btc_net) }, - BitcoinAddress::P2sh(script_hash) => bitcoin::Address { - payload: Payload::ScriptHash(bitcoin::ScriptHash::from_hash( - bitcoin::hashes::Hash::from_slice(script_hash).unwrap(), - )), - network: network_to_btc_network(network), + BitcoinAddress::P2sh(script_hash) => { + Address::p2sh(ScriptHash::from_slice(script_hash).unwrap(), btc_net) }, - BitcoinAddress::P2trV1(pkhash) => bitcoin::Address { - payload: Payload::WitnessProgram { - version: WitnessVersion::V1, - program: pkhash.to_vec(), - }, - network: network_to_btc_network(network), + BitcoinAddress::P2trV1(pkhash) => { + // If `pkhash` is a 32-byte witness program for a taproot address, you can use: + Address::from_witness_program(btc_net, WitnessVersion::V1, pkhash) + .expect("Invalid p2tr witness program") + + // If you know `pkhash` is actually an x-only public key, use: + // let xonly_key = bitcoin::XOnlyPublicKey::from_slice(pkhash).expect("Invalid x-only key"); + // Address::p2tr(btc_net, xonly_key) }, } } @@ -664,7 +654,7 @@ proptest! { let btc_tx = unsigned_tx_to_bitcoin_tx(&arb_tx); let sighasher = tx::TxSigHasher::new(&arb_tx); - let mut btc_sighasher = bitcoin::util::sighash::SighashCache::new(&btc_tx); + let mut btc_sighasher = bitcoin::sighash::SighashCache::new(&btc_tx); for (i, (utxo, _, pubkey)) in inputs_data.iter().enumerate() { let mut buf = Vec::::new(); @@ -1020,7 +1010,7 @@ proptest! { BitcoinAddress::parse(&btc_addr.to_string(), *network) ); - let btc_addr = bitcoin::Address::p2wpkh(&pk, btc_net).unwrap(); + let btc_addr = bitcoin::Address::p2wpkh(&pk, btc_net); prop_assert_eq!( Ok(BitcoinAddress::P2wpkhV0(pkhash)), BitcoinAddress::parse(&btc_addr.to_string(), *network) @@ -1033,7 +1023,7 @@ proptest! { for network in [Network::Mainnet, Network::Testnet].iter() { let addr_str = address.display(*network); let btc_addr = address_to_btc_address(&address, *network); - prop_assert_eq!(btc_addr, bitcoin::Address::from_str(&addr_str).unwrap()); + prop_assert_eq!(btc_addr, bitcoin::Address::from_str(&addr_str).unwrap().assume_checked()); } } diff --git a/rs/bitcoin/ckbtc/minter/tests/tests.rs b/rs/bitcoin/ckbtc/minter/tests/tests.rs index 085a0a12479..706fe200788 100644 --- a/rs/bitcoin/ckbtc/minter/tests/tests.rs +++ b/rs/bitcoin/ckbtc/minter/tests/tests.rs @@ -1,6 +1,6 @@ use assert_matches::assert_matches; -use bitcoin::util::psbt::serialize::Deserialize; -use bitcoin::{Address as BtcAddress, Network as BtcNetwork}; +use bitcoin::consensus::deserialize; +use bitcoin::{Address as BtcAddress, Network as BtcNetwork, blockdata::transaction::Transaction}; use candid::{Decode, Encode, Nat, Principal}; use ic_base_types::{CanisterId, PrincipalId}; use ic_bitcoin_canister_mock::{OutPoint, PushUtxoToAddress, Utxo}; @@ -142,11 +142,11 @@ fn input_utxos(tx: &bitcoin::Transaction) -> Vec { } fn assert_replacement_transaction(old: &bitcoin::Transaction, new: &bitcoin::Transaction) { - assert_ne!(old.txid(), new.txid()); + assert_ne!(old.compute_txid(), new.compute_txid()); assert_eq!(input_utxos(old), input_utxos(new)); - let new_out_value = new.output.iter().map(|out| out.value).sum::(); - let prev_out_value = old.output.iter().map(|out| out.value).sum::(); + let new_out_value = new.output.iter().map(|out| out.value.to_sat()).sum::(); + let prev_out_value = old.output.iter().map(|out| out.value.to_sat()).sum::(); let relay_cost = new.vsize() as u64 * MIN_RELAY_FEE_PER_VBYTE / 1000; assert!( @@ -1184,11 +1184,11 @@ impl CkBtcSetup { self.env .advance_time(MIN_CONFIRMATIONS * Duration::from_secs(600) + Duration::from_secs(1)); - let txid_bytes: [u8; 32] = tx.txid().to_vec().try_into().unwrap(); + let txid_bytes: [u8; 32] = tx.compute_txid()[..].to_vec().try_into().unwrap(); self.push_utxo( change_address.to_string(), Utxo { - value: change_utxo.value, + value: change_utxo.value.to_sat(), height: 0, outpoint: OutPoint { txid: txid_bytes.into(), @@ -1210,10 +1210,11 @@ impl CkBtcSetup { .unwrap() .iter() .map(|tx_bytes| { - let tx = bitcoin::Transaction::deserialize(tx_bytes) + //TODO(mihailjianu): fix this (Deserialize is private) + let tx = deserialize::(tx_bytes) .expect("failed to parse a bitcoin transaction"); - (vec_to_txid(tx.txid().to_vec()), tx) + (vec_to_txid(tx.compute_txid()[..].to_vec()), tx) }) .collect() } @@ -1291,7 +1292,7 @@ fn test_transaction_finalization() { assert_eq!(2, tx.output.len()); assert_eq!( - tx.output[0].value, + tx.output[0].value.to_sat(), withdrawal_amount - fee_estimate.minter_fee - fee_estimate.bitcoin_fee ); @@ -1891,7 +1892,7 @@ fn test_retrieve_btc_with_approval() { assert_eq!(2, tx.output.len()); assert_eq!( - tx.output[0].value, + tx.output[0].value.to_sat(), withdrawal_amount - fee_estimate.minter_fee - fee_estimate.bitcoin_fee ); @@ -1988,7 +1989,7 @@ fn test_retrieve_btc_with_approval_from_subaccount() { assert_eq!(2, tx.output.len()); assert_eq!( - tx.output[0].value, + tx.output[0].value.to_sat(), withdrawal_amount - fee_estimate.minter_fee - fee_estimate.bitcoin_fee ); From e6c040acf4eb0cb995c4c48cc098e3f00599d373 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 15:05:13 +0000 Subject: [PATCH 19/50] ckbtc attempt --- .../generate-btc-adapter-config.sh | 3 +- rs/bitcoin/ckbtc/minter/src/address.rs | 13 +++-- rs/bitcoin/ckbtc/minter/src/tests.rs | 54 +++++++++---------- rs/bitcoin/ckbtc/minter/src/tx.rs | 7 ++- rs/bitcoin/ckbtc/minter/tests/tests.rs | 3 +- rs/bitcoin/mock/tests/tests.rs | 2 +- 6 files changed, 42 insertions(+), 40 deletions(-) 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..d6ba8f7e90e 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,7 +69,8 @@ if [ "${SOCKS_FILE}" != "" -a -e "${SOCKS_FILE}" ]; then read_socks_proxy "${SOCKS_FILE}" fi -BITCOIN_NETWORK='"testnet"' +#TODO(mihailjianu): change the seeds. +BITCOIN_NETWORK='"testnet4"' DNS_SEEDS='"testnet-seed.bitcoin.jonasschnelli.ch", "seed.tbtc.petertodd.org", "seed.testnet.bitcoin.sprovoost.nl", diff --git a/rs/bitcoin/ckbtc/minter/src/address.rs b/rs/bitcoin/ckbtc/minter/src/address.rs index d503545900c..03da1db0d81 100644 --- a/rs/bitcoin/ckbtc/minter/src/address.rs +++ b/rs/bitcoin/ckbtc/minter/src/address.rs @@ -446,7 +446,7 @@ mod tests { #[test] fn test_check_address() { use crate::address::ParseAddressError::BadWitnessLength; - use bitcoin::util::address::Payload; + use bitcoin::blockdata::script::witness_program::WitnessProgram; use bitcoin::Address; use std::str::FromStr; @@ -480,8 +480,8 @@ mod tests { "bc1q088j3hnr0htc8fjwhk337aply0w3fwj33a56fqkdqfpq8dupgx6q4l0e39", ]; for p2wsh_address in valid_p2wsh_addresses { - let expected_p2wsh_pkhash = match Address::from_str(p2wsh_address).unwrap().payload { - Payload::WitnessProgram { program, .. } => program, + let expected_p2wsh_pkhash = match Address::from_str(p2wsh_address).unwrap().witness_program() { + Some(witness_program) => witness_program.program(), _ => panic!("expected P2WSH address"), }; assert_eq!( @@ -504,10 +504,9 @@ mod tests { ]; for taproot_address in taproot_addresses { - let expected_taproot_pkhash = match Address::from_str(taproot_address).unwrap().payload - { - Payload::WitnessProgram { program, .. } => program, - _ => panic!("expected taproot address"), + let expected_taproot_pkhash = match Address::from_str(taproot_address).unwrap().witness_program() { + Some(witness_program) => witness_program.program(), + None => panic!("expected taproot address"), }; let expected_taproot_pkhash = expected_taproot_pkhash.try_into().unwrap(); assert_eq!( diff --git a/rs/bitcoin/ckbtc/minter/src/tests.rs b/rs/bitcoin/ckbtc/minter/src/tests.rs index cb41597bd7c..64527ebbb8f 100644 --- a/rs/bitcoin/ckbtc/minter/src/tests.rs +++ b/rs/bitcoin/ckbtc/minter/src/tests.rs @@ -11,8 +11,10 @@ use crate::{ SubmittedBtcTransaction, }, }; -use bitcoin::network::constants::Network as BtcNetwork; -use bitcoin::psbt::serialize::{Deserialize, Serialize}; +use bitcoin::blockdata::transaction::Version; +use bitcoin::Address; +use bitcoin::Network as BtcNetwork; +use bitcoin::consensus::{deserialize, serialize}; use candid::Principal; use ic_base_types::{CanisterId, PrincipalId}; use ic_btc_interface::{Network, OutPoint, Satoshi, Txid, Utxo}; @@ -63,7 +65,7 @@ fn dummy_utxo_from_value(v: u64) -> Utxo { fn address_to_script_pubkey(address: &BitcoinAddress) -> bitcoin::Script { let address_string = address.display(Network::Mainnet); - let btc_address = bitcoin::Address::from_str(&address_string).unwrap(); + let btc_address = bitcoin::Address::from_str(&address_string).unwrap().assume_checked(); btc_address.script_pubkey() } @@ -77,35 +79,31 @@ fn network_to_btc_network(network: Network) -> BtcNetwork { fn address_to_btc_address(address: &BitcoinAddress, network: Network) -> Address { let btc_net = network_to_btc_network(network); + use bitcoin::blockdata::script::witness_version::WitnessVersion; + use bitcoin::blockdata::script::witness_program::WitnessProgram; + use bitcoin::blockdata::script::Script; + use bitcoin::key::CompressedPublicKey; match address { BitcoinAddress::P2wpkhV0(pkhash) => { - Address::p2wpkh(WPubkeyHash::from_slice(pkhash).unwrap(), btc_net) - .expect("Invalid p2wpkh hash") + Address::p2wpkh(&CompressedPublicKey::from_slice(pkhash), btc_net) }, BitcoinAddress::P2wshV0(script_hash) => { - Address::p2wsh(WScriptHash::from_slice(script_hash).unwrap(), btc_net) - .expect("Invalid p2wsh hash") + Address::p2wsh(Script::from_bytes(script_hash), btc_net) }, BitcoinAddress::P2pkh(pkhash) => { - Address::p2pkh(PubkeyHash::from_slice(pkhash).unwrap(), btc_net) + Address::p2pkh(pkhash, btc_net) }, BitcoinAddress::P2sh(script_hash) => { - Address::p2sh(ScriptHash::from_slice(script_hash).unwrap(), btc_net) + Address::p2sh(Script::from_bytes(script_hash), btc_net).expect("coult not create p2sh address: {script_hash}") }, BitcoinAddress::P2trV1(pkhash) => { - // If `pkhash` is a 32-byte witness program for a taproot address, you can use: - Address::from_witness_program(btc_net, WitnessVersion::V1, pkhash) - .expect("Invalid p2tr witness program") - - // If you know `pkhash` is actually an x-only public key, use: - // let xonly_key = bitcoin::XOnlyPublicKey::from_slice(pkhash).expect("Invalid x-only key"); - // Address::p2tr(btc_net, xonly_key) + Address::from_witness_program(WitnessProgram::new(WitnessVersion::V1, pkhash).expect("Could not create WitnessProgram from pkhash: {pkhash}"), btc_net) }, } } fn as_txid(hash: &[u8; 32]) -> bitcoin::Txid { - bitcoin::Txid::from_hash(bitcoin::hashes::Hash::from_slice(hash).unwrap()) + bitcoin::Txid::from_raw_hash(bitcoin::hashes::Hash::from_slice(hash).unwrap()) } fn p2wpkh_script_code(pkhash: &[u8; 20]) -> bitcoin::Script { @@ -122,7 +120,7 @@ fn p2wpkh_script_code(pkhash: &[u8; 20]) -> bitcoin::Script { fn unsigned_tx_to_bitcoin_tx(tx: &tx::UnsignedTransaction) -> bitcoin::Transaction { bitcoin::Transaction { - version: tx::TX_VERSION as i32, + version: tx::TX_VERSION as Version, lock_time: tx.lock_time, input: tx .inputs @@ -150,7 +148,7 @@ fn unsigned_tx_to_bitcoin_tx(tx: &tx::UnsignedTransaction) -> bitcoin::Transacti fn signed_tx_to_bitcoin_tx(tx: &tx::SignedTransaction) -> bitcoin::Transaction { bitcoin::Transaction { - version: tx::TX_VERSION as i32, + version: tx::TX_VERSION as Version, lock_time: tx.lock_time, input: tx .inputs @@ -618,13 +616,13 @@ proptest! { let arb_tx = tx::UnsignedTransaction { inputs, outputs, lock_time }; println!("{:?}", arb_tx); let btc_tx = unsigned_tx_to_bitcoin_tx(&arb_tx); - println!("{:?}", btc_tx.serialize()); + println!("{:?}", serialize(&btc_tx)); let tx_bytes = tx::encode_into(&arb_tx, Vec::::new()); println!("{:?}", tx_bytes); - let decoded_btc_tx = bitcoin::Transaction::deserialize(&tx_bytes).expect("failed to deserialize an unsigned transaction"); + let decoded_btc_tx: bitcoin::Transaction = deserialize(&tx_bytes).expect("failed to deserialize an unsigned transaction"); - prop_assert_eq!(btc_tx.serialize(), tx_bytes); + prop_assert_eq!(serialize(&btc_tx), tx_bytes); prop_assert_eq!(&decoded_btc_tx, &btc_tx); prop_assert_eq!(&arb_tx.txid().as_ref().to_vec(), &*btc_tx.txid()); } @@ -683,13 +681,13 @@ proptest! { let arb_tx = tx::SignedTransaction { inputs, outputs, lock_time }; println!("{:?}", arb_tx); let btc_tx = signed_tx_to_bitcoin_tx(&arb_tx); - println!("{:?}", btc_tx.serialize()); + println!("{:?}", serialize(&btc_tx)); let tx_bytes = tx::encode_into(&arb_tx, Vec::::new()); println!("{:?}", tx_bytes); - let decoded_btc_tx = bitcoin::Transaction::deserialize(&tx_bytes).expect("failed to deserialize a signed transaction"); + let decoded_btc_tx: bitcoin::Transaction = deserialize(&tx_bytes).expect("failed to deserialize a signed transaction"); - prop_assert_eq!(btc_tx.serialize(), tx_bytes); + prop_assert_eq!(serialize(&btc_tx), tx_bytes); prop_assert_eq!(&decoded_btc_tx, &btc_tx); prop_assert_eq!(&arb_tx.wtxid(), &*btc_tx.wtxid()); prop_assert_eq!(arb_tx.vsize(), btc_tx.vsize()); @@ -1004,13 +1002,13 @@ proptest! { for network in [Network::Mainnet, Network::Testnet, Network::Regtest].iter() { let btc_net = network_to_btc_network(*network); - let btc_addr = bitcoin::Address::p2pkh(&pk, btc_net); + let btc_addr = Address::p2pkh(&pk, btc_net); prop_assert_eq!( Ok(BitcoinAddress::P2pkh(tx::hash160(&pkbytes))), BitcoinAddress::parse(&btc_addr.to_string(), *network) ); - let btc_addr = bitcoin::Address::p2wpkh(&pk, btc_net); + let btc_addr = Address::p2wpkh(&pk, btc_net); prop_assert_eq!( Ok(BitcoinAddress::P2wpkhV0(pkhash)), BitcoinAddress::parse(&btc_addr.to_string(), *network) @@ -1023,7 +1021,7 @@ proptest! { for network in [Network::Mainnet, Network::Testnet].iter() { let addr_str = address.display(*network); let btc_addr = address_to_btc_address(&address, *network); - prop_assert_eq!(btc_addr, bitcoin::Address::from_str(&addr_str).unwrap().assume_checked()); + prop_assert_eq!(btc_addr, Address::from_str(&addr_str).unwrap().assume_checked()); } } diff --git a/rs/bitcoin/ckbtc/minter/src/tx.rs b/rs/bitcoin/ckbtc/minter/src/tx.rs index 83835737ef4..93f3eba0fa5 100644 --- a/rs/bitcoin/ckbtc/minter/src/tx.rs +++ b/rs/bitcoin/ckbtc/minter/src/tx.rs @@ -7,11 +7,14 @@ use ic_crypto_sha2::Sha256; use serde_bytes::{ByteBuf, Bytes}; use std::fmt; +use bitcoin::blockdata::transaction::Version; + pub use ic_btc_interface::{OutPoint, Satoshi, Txid}; /// The current Bitcoin transaction encoding version. -/// See https://github.com/bitcoin/bitcoin/blob/c90f86e4c7760a9f7ed0a574f54465964e006a64/src/primitives/transaction.h#L291. -pub const TX_VERSION: u32 = 2; +/// See https://github.com/bitcoin/bitcoin/blob/c90f86e4c7760a9f7ed0a574f54465964e006a64/src/primitives/transaction.h#L291.\ +//TODO(mihailjianu): make this a bitcoin::transaction::Version. +pub const TX_VERSION: Version = Version::TWO; /// The length of the public key. pub const PUBKEY_LEN: usize = 32; diff --git a/rs/bitcoin/ckbtc/minter/tests/tests.rs b/rs/bitcoin/ckbtc/minter/tests/tests.rs index 706fe200788..df6ac9da099 100644 --- a/rs/bitcoin/ckbtc/minter/tests/tests.rs +++ b/rs/bitcoin/ckbtc/minter/tests/tests.rs @@ -1,5 +1,6 @@ use assert_matches::assert_matches; use bitcoin::consensus::deserialize; +//TODO(mihailjianu): bitcoin::Transaction works. use bitcoin::{Address as BtcAddress, Network as BtcNetwork, blockdata::transaction::Transaction}; use candid::{Decode, Encode, Nat, Principal}; use ic_base_types::{CanisterId, PrincipalId}; @@ -1211,7 +1212,7 @@ impl CkBtcSetup { .iter() .map(|tx_bytes| { //TODO(mihailjianu): fix this (Deserialize is private) - let tx = deserialize::(tx_bytes) + let tx: Transaction = deserialize(tx_bytes) .expect("failed to parse a bitcoin transaction"); (vec_to_txid(tx.compute_txid()[..].to_vec()), tx) diff --git a/rs/bitcoin/mock/tests/tests.rs b/rs/bitcoin/mock/tests/tests.rs index a2b5b4ef574..e532fed62e9 100644 --- a/rs/bitcoin/mock/tests/tests.rs +++ b/rs/bitcoin/mock/tests/tests.rs @@ -152,7 +152,7 @@ fn test_install_bitcoin_mock_canister() { .expect("failed to decode get_mempool response"); assert_eq!(mempool.len(), 1); - let tx = deserialize::(&mempool[0]).expect("failed to parse transaction"); + let tx:Transaction = deserialize(&mempool[0]).expect("failed to parse transaction"); assert_eq!(tx.input.len(), 1); assert_eq!(tx.output.len(), 2); From 5c093881cf9d760db149bec2efd7c0df5be1aa30 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 15:16:56 +0000 Subject: [PATCH 20/50] revert minter --- Cargo.lock | 2 +- rs/bitcoin/ckbtc/minter/BUILD.bazel | 6 +- rs/bitcoin/ckbtc/minter/Cargo.toml | 2 +- rs/bitcoin/ckbtc/minter/src/address.rs | 13 +++-- rs/bitcoin/ckbtc/minter/src/tests.rs | 80 +++++++++++++++----------- rs/bitcoin/ckbtc/minter/src/tx.rs | 7 +-- rs/bitcoin/ckbtc/minter/tests/tests.rs | 26 ++++----- 7 files changed, 72 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b0e479187dc..9f2a4da4339 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6616,7 +6616,7 @@ dependencies = [ "assert_matches", "async-trait", "bech32 0.9.1", - "bitcoin 0.32.5", + "bitcoin 0.28.2", "bs58", "candid", "candid_parser", diff --git a/rs/bitcoin/ckbtc/minter/BUILD.bazel b/rs/bitcoin/ckbtc/minter/BUILD.bazel index f1a304a7c34..079ec88c011 100644 --- a/rs/bitcoin/ckbtc/minter/BUILD.bazel +++ b/rs/bitcoin/ckbtc/minter/BUILD.bazel @@ -109,7 +109,7 @@ rust_test( crate = ":ckbtc_minter_lib", deps = [ # Keep sorted. - "@crate_index//:bitcoin", + "@crate_index//:bitcoin_0_28", "@crate_index//:maplit", "@crate_index//:mockall", "@crate_index//:proptest", @@ -141,7 +141,7 @@ rust_test( deps = [ # Keep sorted. ":ckbtc_minter_lib", - "@crate_index//:bitcoin", + "@crate_index//:bitcoin_0_28", "@crate_index//:candid", "@crate_index//:flate2", "@crate_index//:ic-agent", @@ -183,7 +183,7 @@ rust_ic_test( "//rs/types/base_types", "//rs/types/types", "@crate_index//:assert_matches", - "@crate_index//:bitcoin", + "@crate_index//:bitcoin_0_28", "@crate_index//:candid", "@crate_index//:ic-btc-interface", "@crate_index//:minicbor", diff --git a/rs/bitcoin/ckbtc/minter/Cargo.toml b/rs/bitcoin/ckbtc/minter/Cargo.toml index 22f238d721a..2601134652a 100644 --- a/rs/bitcoin/ckbtc/minter/Cargo.toml +++ b/rs/bitcoin/ckbtc/minter/Cargo.toml @@ -48,7 +48,7 @@ serde_json = { workspace = true } [dev-dependencies] assert_matches = { workspace = true } -bitcoin = { workspace = true } +bitcoin = { version = "0.28.2" } candid_parser = { workspace = true } canister-test = { path = "../../../rust_canisters/canister_test" } flate2 = { workspace = true } diff --git a/rs/bitcoin/ckbtc/minter/src/address.rs b/rs/bitcoin/ckbtc/minter/src/address.rs index 03da1db0d81..d503545900c 100644 --- a/rs/bitcoin/ckbtc/minter/src/address.rs +++ b/rs/bitcoin/ckbtc/minter/src/address.rs @@ -446,7 +446,7 @@ mod tests { #[test] fn test_check_address() { use crate::address::ParseAddressError::BadWitnessLength; - use bitcoin::blockdata::script::witness_program::WitnessProgram; + use bitcoin::util::address::Payload; use bitcoin::Address; use std::str::FromStr; @@ -480,8 +480,8 @@ mod tests { "bc1q088j3hnr0htc8fjwhk337aply0w3fwj33a56fqkdqfpq8dupgx6q4l0e39", ]; for p2wsh_address in valid_p2wsh_addresses { - let expected_p2wsh_pkhash = match Address::from_str(p2wsh_address).unwrap().witness_program() { - Some(witness_program) => witness_program.program(), + let expected_p2wsh_pkhash = match Address::from_str(p2wsh_address).unwrap().payload { + Payload::WitnessProgram { program, .. } => program, _ => panic!("expected P2WSH address"), }; assert_eq!( @@ -504,9 +504,10 @@ mod tests { ]; for taproot_address in taproot_addresses { - let expected_taproot_pkhash = match Address::from_str(taproot_address).unwrap().witness_program() { - Some(witness_program) => witness_program.program(), - None => panic!("expected taproot address"), + let expected_taproot_pkhash = match Address::from_str(taproot_address).unwrap().payload + { + Payload::WitnessProgram { program, .. } => program, + _ => panic!("expected taproot address"), }; let expected_taproot_pkhash = expected_taproot_pkhash.try_into().unwrap(); assert_eq!( diff --git a/rs/bitcoin/ckbtc/minter/src/tests.rs b/rs/bitcoin/ckbtc/minter/src/tests.rs index 64527ebbb8f..e492584e597 100644 --- a/rs/bitcoin/ckbtc/minter/src/tests.rs +++ b/rs/bitcoin/ckbtc/minter/src/tests.rs @@ -11,10 +11,8 @@ use crate::{ SubmittedBtcTransaction, }, }; -use bitcoin::blockdata::transaction::Version; -use bitcoin::Address; -use bitcoin::Network as BtcNetwork; -use bitcoin::consensus::{deserialize, serialize}; +use bitcoin::network::constants::Network as BtcNetwork; +use bitcoin::util::psbt::serialize::{Deserialize, Serialize}; use candid::Principal; use ic_base_types::{CanisterId, PrincipalId}; use ic_btc_interface::{Network, OutPoint, Satoshi, Txid, Utxo}; @@ -65,7 +63,7 @@ fn dummy_utxo_from_value(v: u64) -> Utxo { fn address_to_script_pubkey(address: &BitcoinAddress) -> bitcoin::Script { let address_string = address.display(Network::Mainnet); - let btc_address = bitcoin::Address::from_str(&address_string).unwrap().assume_checked(); + let btc_address = bitcoin::Address::from_str(&address_string).unwrap(); btc_address.script_pubkey() } @@ -77,33 +75,47 @@ fn network_to_btc_network(network: Network) -> BtcNetwork { } } -fn address_to_btc_address(address: &BitcoinAddress, network: Network) -> Address { - let btc_net = network_to_btc_network(network); - use bitcoin::blockdata::script::witness_version::WitnessVersion; - use bitcoin::blockdata::script::witness_program::WitnessProgram; - use bitcoin::blockdata::script::Script; - use bitcoin::key::CompressedPublicKey; +fn address_to_btc_address(address: &BitcoinAddress, network: Network) -> bitcoin::Address { + use bitcoin::util::address::{Payload, WitnessVersion}; match address { - BitcoinAddress::P2wpkhV0(pkhash) => { - Address::p2wpkh(&CompressedPublicKey::from_slice(pkhash), btc_net) + BitcoinAddress::P2wpkhV0(pkhash) => bitcoin::Address { + payload: Payload::WitnessProgram { + version: WitnessVersion::V0, + program: pkhash.to_vec(), + }, + network: network_to_btc_network(network), }, - BitcoinAddress::P2wshV0(script_hash) => { - Address::p2wsh(Script::from_bytes(script_hash), btc_net) + BitcoinAddress::P2wshV0(script_hash) => bitcoin::Address { + payload: Payload::WitnessProgram { + version: WitnessVersion::V0, + program: script_hash.to_vec(), + }, + network: network_to_btc_network(network), }, - BitcoinAddress::P2pkh(pkhash) => { - Address::p2pkh(pkhash, btc_net) + BitcoinAddress::P2pkh(pkhash) => bitcoin::Address { + payload: Payload::PubkeyHash(bitcoin::PubkeyHash::from_hash( + bitcoin::hashes::Hash::from_slice(pkhash).unwrap(), + )), + network: network_to_btc_network(network), }, - BitcoinAddress::P2sh(script_hash) => { - Address::p2sh(Script::from_bytes(script_hash), btc_net).expect("coult not create p2sh address: {script_hash}") + BitcoinAddress::P2sh(script_hash) => bitcoin::Address { + payload: Payload::ScriptHash(bitcoin::ScriptHash::from_hash( + bitcoin::hashes::Hash::from_slice(script_hash).unwrap(), + )), + network: network_to_btc_network(network), }, - BitcoinAddress::P2trV1(pkhash) => { - Address::from_witness_program(WitnessProgram::new(WitnessVersion::V1, pkhash).expect("Could not create WitnessProgram from pkhash: {pkhash}"), btc_net) + BitcoinAddress::P2trV1(pkhash) => bitcoin::Address { + payload: Payload::WitnessProgram { + version: WitnessVersion::V1, + program: pkhash.to_vec(), + }, + network: network_to_btc_network(network), }, } } fn as_txid(hash: &[u8; 32]) -> bitcoin::Txid { - bitcoin::Txid::from_raw_hash(bitcoin::hashes::Hash::from_slice(hash).unwrap()) + bitcoin::Txid::from_hash(bitcoin::hashes::Hash::from_slice(hash).unwrap()) } fn p2wpkh_script_code(pkhash: &[u8; 20]) -> bitcoin::Script { @@ -120,7 +132,7 @@ fn p2wpkh_script_code(pkhash: &[u8; 20]) -> bitcoin::Script { fn unsigned_tx_to_bitcoin_tx(tx: &tx::UnsignedTransaction) -> bitcoin::Transaction { bitcoin::Transaction { - version: tx::TX_VERSION as Version, + version: tx::TX_VERSION as i32, lock_time: tx.lock_time, input: tx .inputs @@ -148,7 +160,7 @@ fn unsigned_tx_to_bitcoin_tx(tx: &tx::UnsignedTransaction) -> bitcoin::Transacti fn signed_tx_to_bitcoin_tx(tx: &tx::SignedTransaction) -> bitcoin::Transaction { bitcoin::Transaction { - version: tx::TX_VERSION as Version, + version: tx::TX_VERSION as i32, lock_time: tx.lock_time, input: tx .inputs @@ -616,13 +628,13 @@ proptest! { let arb_tx = tx::UnsignedTransaction { inputs, outputs, lock_time }; println!("{:?}", arb_tx); let btc_tx = unsigned_tx_to_bitcoin_tx(&arb_tx); - println!("{:?}", serialize(&btc_tx)); + println!("{:?}", btc_tx.serialize()); let tx_bytes = tx::encode_into(&arb_tx, Vec::::new()); println!("{:?}", tx_bytes); - let decoded_btc_tx: bitcoin::Transaction = deserialize(&tx_bytes).expect("failed to deserialize an unsigned transaction"); + let decoded_btc_tx = bitcoin::Transaction::deserialize(&tx_bytes).expect("failed to deserialize an unsigned transaction"); - prop_assert_eq!(serialize(&btc_tx), tx_bytes); + prop_assert_eq!(btc_tx.serialize(), tx_bytes); prop_assert_eq!(&decoded_btc_tx, &btc_tx); prop_assert_eq!(&arb_tx.txid().as_ref().to_vec(), &*btc_tx.txid()); } @@ -652,7 +664,7 @@ proptest! { let btc_tx = unsigned_tx_to_bitcoin_tx(&arb_tx); let sighasher = tx::TxSigHasher::new(&arb_tx); - let mut btc_sighasher = bitcoin::sighash::SighashCache::new(&btc_tx); + let mut btc_sighasher = bitcoin::util::sighash::SighashCache::new(&btc_tx); for (i, (utxo, _, pubkey)) in inputs_data.iter().enumerate() { let mut buf = Vec::::new(); @@ -681,13 +693,13 @@ proptest! { let arb_tx = tx::SignedTransaction { inputs, outputs, lock_time }; println!("{:?}", arb_tx); let btc_tx = signed_tx_to_bitcoin_tx(&arb_tx); - println!("{:?}", serialize(&btc_tx)); + println!("{:?}", btc_tx.serialize()); let tx_bytes = tx::encode_into(&arb_tx, Vec::::new()); println!("{:?}", tx_bytes); - let decoded_btc_tx: bitcoin::Transaction = deserialize(&tx_bytes).expect("failed to deserialize a signed transaction"); + let decoded_btc_tx = bitcoin::Transaction::deserialize(&tx_bytes).expect("failed to deserialize a signed transaction"); - prop_assert_eq!(serialize(&btc_tx), tx_bytes); + prop_assert_eq!(btc_tx.serialize(), tx_bytes); prop_assert_eq!(&decoded_btc_tx, &btc_tx); prop_assert_eq!(&arb_tx.wtxid(), &*btc_tx.wtxid()); prop_assert_eq!(arb_tx.vsize(), btc_tx.vsize()); @@ -1002,13 +1014,13 @@ proptest! { for network in [Network::Mainnet, Network::Testnet, Network::Regtest].iter() { let btc_net = network_to_btc_network(*network); - let btc_addr = Address::p2pkh(&pk, btc_net); + let btc_addr = bitcoin::Address::p2pkh(&pk, btc_net); prop_assert_eq!( Ok(BitcoinAddress::P2pkh(tx::hash160(&pkbytes))), BitcoinAddress::parse(&btc_addr.to_string(), *network) ); - let btc_addr = Address::p2wpkh(&pk, btc_net); + let btc_addr = bitcoin::Address::p2wpkh(&pk, btc_net).unwrap(); prop_assert_eq!( Ok(BitcoinAddress::P2wpkhV0(pkhash)), BitcoinAddress::parse(&btc_addr.to_string(), *network) @@ -1021,7 +1033,7 @@ proptest! { for network in [Network::Mainnet, Network::Testnet].iter() { let addr_str = address.display(*network); let btc_addr = address_to_btc_address(&address, *network); - prop_assert_eq!(btc_addr, Address::from_str(&addr_str).unwrap().assume_checked()); + prop_assert_eq!(btc_addr, bitcoin::Address::from_str(&addr_str).unwrap()); } } diff --git a/rs/bitcoin/ckbtc/minter/src/tx.rs b/rs/bitcoin/ckbtc/minter/src/tx.rs index 93f3eba0fa5..83835737ef4 100644 --- a/rs/bitcoin/ckbtc/minter/src/tx.rs +++ b/rs/bitcoin/ckbtc/minter/src/tx.rs @@ -7,14 +7,11 @@ use ic_crypto_sha2::Sha256; use serde_bytes::{ByteBuf, Bytes}; use std::fmt; -use bitcoin::blockdata::transaction::Version; - pub use ic_btc_interface::{OutPoint, Satoshi, Txid}; /// The current Bitcoin transaction encoding version. -/// See https://github.com/bitcoin/bitcoin/blob/c90f86e4c7760a9f7ed0a574f54465964e006a64/src/primitives/transaction.h#L291.\ -//TODO(mihailjianu): make this a bitcoin::transaction::Version. -pub const TX_VERSION: Version = Version::TWO; +/// See https://github.com/bitcoin/bitcoin/blob/c90f86e4c7760a9f7ed0a574f54465964e006a64/src/primitives/transaction.h#L291. +pub const TX_VERSION: u32 = 2; /// The length of the public key. pub const PUBKEY_LEN: usize = 32; diff --git a/rs/bitcoin/ckbtc/minter/tests/tests.rs b/rs/bitcoin/ckbtc/minter/tests/tests.rs index df6ac9da099..085a0a12479 100644 --- a/rs/bitcoin/ckbtc/minter/tests/tests.rs +++ b/rs/bitcoin/ckbtc/minter/tests/tests.rs @@ -1,7 +1,6 @@ use assert_matches::assert_matches; -use bitcoin::consensus::deserialize; -//TODO(mihailjianu): bitcoin::Transaction works. -use bitcoin::{Address as BtcAddress, Network as BtcNetwork, blockdata::transaction::Transaction}; +use bitcoin::util::psbt::serialize::Deserialize; +use bitcoin::{Address as BtcAddress, Network as BtcNetwork}; use candid::{Decode, Encode, Nat, Principal}; use ic_base_types::{CanisterId, PrincipalId}; use ic_bitcoin_canister_mock::{OutPoint, PushUtxoToAddress, Utxo}; @@ -143,11 +142,11 @@ fn input_utxos(tx: &bitcoin::Transaction) -> Vec { } fn assert_replacement_transaction(old: &bitcoin::Transaction, new: &bitcoin::Transaction) { - assert_ne!(old.compute_txid(), new.compute_txid()); + assert_ne!(old.txid(), new.txid()); assert_eq!(input_utxos(old), input_utxos(new)); - let new_out_value = new.output.iter().map(|out| out.value.to_sat()).sum::(); - let prev_out_value = old.output.iter().map(|out| out.value.to_sat()).sum::(); + let new_out_value = new.output.iter().map(|out| out.value).sum::(); + let prev_out_value = old.output.iter().map(|out| out.value).sum::(); let relay_cost = new.vsize() as u64 * MIN_RELAY_FEE_PER_VBYTE / 1000; assert!( @@ -1185,11 +1184,11 @@ impl CkBtcSetup { self.env .advance_time(MIN_CONFIRMATIONS * Duration::from_secs(600) + Duration::from_secs(1)); - let txid_bytes: [u8; 32] = tx.compute_txid()[..].to_vec().try_into().unwrap(); + let txid_bytes: [u8; 32] = tx.txid().to_vec().try_into().unwrap(); self.push_utxo( change_address.to_string(), Utxo { - value: change_utxo.value.to_sat(), + value: change_utxo.value, height: 0, outpoint: OutPoint { txid: txid_bytes.into(), @@ -1211,11 +1210,10 @@ impl CkBtcSetup { .unwrap() .iter() .map(|tx_bytes| { - //TODO(mihailjianu): fix this (Deserialize is private) - let tx: Transaction = deserialize(tx_bytes) + let tx = bitcoin::Transaction::deserialize(tx_bytes) .expect("failed to parse a bitcoin transaction"); - (vec_to_txid(tx.compute_txid()[..].to_vec()), tx) + (vec_to_txid(tx.txid().to_vec()), tx) }) .collect() } @@ -1293,7 +1291,7 @@ fn test_transaction_finalization() { assert_eq!(2, tx.output.len()); assert_eq!( - tx.output[0].value.to_sat(), + tx.output[0].value, withdrawal_amount - fee_estimate.minter_fee - fee_estimate.bitcoin_fee ); @@ -1893,7 +1891,7 @@ fn test_retrieve_btc_with_approval() { assert_eq!(2, tx.output.len()); assert_eq!( - tx.output[0].value.to_sat(), + tx.output[0].value, withdrawal_amount - fee_estimate.minter_fee - fee_estimate.bitcoin_fee ); @@ -1990,7 +1988,7 @@ fn test_retrieve_btc_with_approval_from_subaccount() { assert_eq!(2, tx.output.len()); assert_eq!( - tx.output[0].value.to_sat(), + tx.output[0].value, withdrawal_amount - fee_estimate.minter_fee - fee_estimate.bitcoin_fee ); From dd31d9310ed19f5874a00b06bcbb408316cecf65 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 15:25:59 +0000 Subject: [PATCH 21/50] lock --- Cargo.Bazel.json.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index f0c53e9a71d..6d1f67738b6 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "f08630277fa926e75f95b5e41b9dec6bdcd71430fe3f9ee6fa25ed1840baf3c9", + "checksum": "80de75ed6173bf356cd5a2d9e31cc0e873b51f4790381d60b061652bbe81c8a3", "crates": { "abnf 0.12.0": { "name": "abnf", From 97dcdc9f7cc59e5b322cc12c8cc23bb1e7810891 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 17:34:11 +0000 Subject: [PATCH 22/50] more changes --- Cargo.lock | 2 +- rs/bitcoin/adapter/src/transaction_store.rs | 6 ++++-- rs/bitcoin/validation/src/header.rs | 1 + rs/tests/ckbtc/Cargo.toml | 2 +- rs/tests/ckbtc/ckbtc_minter_batching.rs | 13 +++++++------ rs/tests/ckbtc/ckbtc_minter_checker.rs | 2 +- .../ckbtc/ckbtc_minter_deposit_and_withdrawal.rs | 8 ++++---- rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs | 4 ++-- rs/tests/ckbtc/ckbtc_minter_update_balance.rs | 2 +- rs/tests/ckbtc/src/utils.rs | 3 ++- rs/tests/execution/btc_get_balance_test.rs | 4 ++-- 11 files changed, 26 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42ab03f7c51..0ad4702cc8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13176,7 +13176,7 @@ version = "0.9.0" dependencies = [ "anyhow", "assert_matches", - "bitcoincore-rpc 0.15.0", + "bitcoincore-rpc 0.19.0", "candid", "canister-test", "dfn_candid", diff --git a/rs/bitcoin/adapter/src/transaction_store.rs b/rs/bitcoin/adapter/src/transaction_store.rs index 865c57254aa..29e2e743fa4 100644 --- a/rs/bitcoin/adapter/src/transaction_store.rs +++ b/rs/bitcoin/adapter/src/transaction_store.rs @@ -203,8 +203,10 @@ mod test { use super::*; use crate::common::test_common::TestChannel; use bitcoin::{ - absolute::{LockTime, LOCK_TIME_THRESHOLD}, blockdata::constants::genesis_block, consensus::serialize, Network, - Transaction, + absolute::{LockTime, LOCK_TIME_THRESHOLD}, + blockdata::constants::genesis_block, + consensus::serialize, + Network, Transaction, }; use ic_logger::replica_logger::no_op_logger; use std::str::FromStr; diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index eb26eae9633..b01dca055cc 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -477,6 +477,7 @@ mod test { }); } + //TODO(mihailjianu): add the csv files. #[test] fn mainnet_next_targets() { test_next_targets( diff --git a/rs/tests/ckbtc/Cargo.toml b/rs/tests/ckbtc/Cargo.toml index d7156f4b708..e23131167b0 100644 --- a/rs/tests/ckbtc/Cargo.toml +++ b/rs/tests/ckbtc/Cargo.toml @@ -9,7 +9,7 @@ documentation.workspace = true [dependencies] anyhow = { workspace = true } assert_matches = { workspace = true } -bitcoincore-rpc = "0.15.0" +bitcoincore-rpc = { workspace = true } candid = { workspace = true } canister-test = { path = "../../rust_canisters/canister_test" } dfn_candid = { path = "../../rust_canisters/dfn_candid" } diff --git a/rs/tests/ckbtc/ckbtc_minter_batching.rs b/rs/tests/ckbtc/ckbtc_minter_batching.rs index a8f23e13fd3..4477021bdea 100644 --- a/rs/tests/ckbtc/ckbtc_minter_batching.rs +++ b/rs/tests/ckbtc/ckbtc_minter_batching.rs @@ -61,7 +61,7 @@ pub fn test_batching(env: TestEnv) { let btc_rpc = get_btc_client(&env); ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap(); + let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); // Creating the 101 first block to reach the min confirmations to spend a coinbase utxo. debug!( &logger, @@ -163,7 +163,7 @@ pub fn test_batching(env: TestEnv) { "Transfer to the minter account occurred at block {}", transfer_result ); - let destination_btc_address = btc_rpc.get_new_address(None, None).unwrap(); + let destination_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); info!(&logger, "Call retrieve_btc"); @@ -237,9 +237,10 @@ pub fn test_batching(env: TestEnv) { .await; // Let's wait for the transaction to appear on the mempool + //TODO(mihailjianu): revisit the usefulness of this test. let mempool_txids = wait_for_mempool_change(&btc_rpc, &logger).await; let txid = mempool_txids[0]; - let btc_txid = Txid::from_hash(Hash::from_slice(&txid).unwrap()); + let btc_txid = Txid::from_raw_hash(Hash::from_slice(&txid[..]).unwrap()); // Check if we have the txid in the bitcoind mempool assert!( mempool_txids.contains(&btc_txid), @@ -262,7 +263,7 @@ pub fn test_batching(env: TestEnv) { // Hence, we expect the fee to be 3650 // By checking the fee we know that we have the right amount of inputs and outputs const EXPECTED_FEE: u64 = 3650; - assert_eq!(get_tx_infos.fees.base.as_sat(), EXPECTED_FEE); + assert_eq!(get_tx_infos.fees.base.to_sat(), EXPECTED_FEE); // Check that we can modify the fee assert!(get_tx_infos.bip125_replaceable); @@ -278,7 +279,7 @@ pub fn test_batching(env: TestEnv) { let finalized_txid = wait_for_finalization_no_new_blocks(&minter_agent, block_indexes[0]).await; // We don't need to check which input has been used as there is only one input in the possession of the minter - let txid_array: [u8; 32] = txid.as_hash().to_vec().try_into().unwrap(); + let txid_array: [u8; 32] = txid[..].to_vec().try_into().unwrap(); assert_eq!(ic_btc_interface::Txid::from(txid_array), finalized_txid); // We can now check that the destination_btc_address received some utxos @@ -293,7 +294,7 @@ pub fn test_batching(env: TestEnv) { .expect("failed to get tx infos"); let destination_balance = unspent_result .iter() - .map(|entry| entry.amount.as_sat()) + .map(|entry| entry.amount.to_sat()) .sum::(); // We have 1 input and 21 outputs (20 requests and the minter's address) diff --git a/rs/tests/ckbtc/ckbtc_minter_checker.rs b/rs/tests/ckbtc/ckbtc_minter_checker.rs index 1dc74182214..219025ab7e5 100644 --- a/rs/tests/ckbtc/ckbtc_minter_checker.rs +++ b/rs/tests/ckbtc/ckbtc_minter_checker.rs @@ -49,7 +49,7 @@ pub fn test_btc_checker(env: TestEnv) { // Create wallet if required. ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap(); + let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); // Creating the 101 first block to reach the min confirmations to spend a coinbase utxo. debug!( &logger, diff --git a/rs/tests/ckbtc/ckbtc_minter_deposit_and_withdrawal.rs b/rs/tests/ckbtc/ckbtc_minter_deposit_and_withdrawal.rs index 5286e85192b..ce5b492c727 100644 --- a/rs/tests/ckbtc/ckbtc_minter_deposit_and_withdrawal.rs +++ b/rs/tests/ckbtc/ckbtc_minter_deposit_and_withdrawal.rs @@ -41,7 +41,7 @@ pub fn test_deposit_and_withdrawal(env: TestEnv) { let btc_rpc = get_btc_client(&env); ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap(); + let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); // Creating the 101 first block to reach the min confirmations to spend a coinbase utxo. debug!( &logger, @@ -128,7 +128,7 @@ pub fn test_deposit_and_withdrawal(env: TestEnv) { "Transfer to the minter account occurred at block {}", transfer_result ); - let destination_btc_address = btc_rpc.get_new_address(None, None).unwrap(); + let destination_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); info!(&logger, "Call retrieve_btc"); @@ -165,7 +165,7 @@ pub fn test_deposit_and_withdrawal(env: TestEnv) { // We wait for the heartbeat to send the transaction to the mempool info!(&logger, "Waiting for tx to appear in mempool"); let mempool_txids = wait_for_mempool_change(&btc_rpc, &logger).await; - let btc_txid = Txid::from_hash(Hash::from_slice(&txid_bytes).unwrap()); + let btc_txid = Txid::from_raw_hash(Hash::from_slice(&txid_bytes).unwrap()); // Check if we have the txid in the bitcoind mempool assert!( mempool_txids.contains(&btc_txid), @@ -187,7 +187,7 @@ pub fn test_deposit_and_withdrawal(env: TestEnv) { // - a fee of 5 satoshis/vbytes // Hence a total fee of 705 satoshis const EXPECTED_FEE: u64 = 705; - assert_eq!(get_tx_infos.fees.base.as_sat(), EXPECTED_FEE); + assert_eq!(get_tx_infos.fees.base.to_sat(), EXPECTED_FEE); // Check that we can modify the fee assert!(get_tx_infos.bip125_replaceable); diff --git a/rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs b/rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs index e6aedb2e375..2ba4445300d 100644 --- a/rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs +++ b/rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs @@ -45,11 +45,11 @@ pub fn test_retrieve_btc(env: TestEnv) { let btc_rpc = get_btc_client(&env); ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap(); + let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); // Creating the 10 first block to reach the min confirmations of the minter canister. debug!( &logger, - "Generating 10 blocks to default address: {}", &default_btc_address + "Generating 10 blocks to default address: {}", &default_btc_address.to_string() ); btc_rpc .generate_to_address(10, &default_btc_address) diff --git a/rs/tests/ckbtc/ckbtc_minter_update_balance.rs b/rs/tests/ckbtc/ckbtc_minter_update_balance.rs index e0419c7b2cf..c8e9abef783 100644 --- a/rs/tests/ckbtc/ckbtc_minter_update_balance.rs +++ b/rs/tests/ckbtc/ckbtc_minter_update_balance.rs @@ -55,7 +55,7 @@ pub fn test_update_balance(env: TestEnv) { // Create wallet if required. ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap(); + let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); // Creating the 10 first block to reach the min confirmations of the minter canister. debug!( &logger, diff --git a/rs/tests/ckbtc/src/utils.rs b/rs/tests/ckbtc/src/utils.rs index 25b2674f871..3f73ca1af71 100644 --- a/rs/tests/ckbtc/src/utils.rs +++ b/rs/tests/ckbtc/src/utils.rs @@ -382,7 +382,8 @@ pub async fn get_btc_address( debug!(logger, "Btc address for subaccount is: {}", address); // Checking only proper format of address since ECDSA signature is non-deterministic. assert_eq!(ADDRESS_LENGTH, address.len()); - address.parse().unwrap() + //TODO(mihailjianu): check all assume_checked. + address.parse::>().unwrap().assume_checked() } pub async fn send_to_btc_address(btc_rpc: &Client, logger: &Logger, dst: &Address, amount: u64) { diff --git a/rs/tests/execution/btc_get_balance_test.rs b/rs/tests/execution/btc_get_balance_test.rs index 6200c1be7c9..e1ae70b9b83 100644 --- a/rs/tests/execution/btc_get_balance_test.rs +++ b/rs/tests/execution/btc_get_balance_test.rs @@ -149,8 +149,8 @@ pub fn get_balance(env: TestEnv) { .unwrap(); // Generate an address. - let btc_address = btc_rpc.get_new_address(None, None).unwrap(); - info!(&logger, "Created temporary btc address: {}", btc_address); + let btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); + info!(&logger, "Created temporary btc address: {}", btc_address.to_string()); // Mint some blocks for the address we generated. let block = btc_rpc.generate_to_address(101, &btc_address).unwrap(); From 623ae3dcf37f7e95473f5b5fe1f48036be0bb8cc Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 17:42:19 +0000 Subject: [PATCH 23/50] lock --- Cargo.Bazel.json.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 58f29173f0b..5b3a6620979 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "80de75ed6173bf356cd5a2d9e31cc0e873b51f4790381d60b061652bbe81c8a3", + "checksum": "b370deb14a4a4991400d9897a96fd717dffd5b316510898b68f18a66a86ee946", "crates": { "abnf 0.12.0": { "name": "abnf", From 21945b4a759756a64e28d5c0e6703a336437fbce Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 19:40:26 +0000 Subject: [PATCH 24/50] clippy --- .../generate-btc-adapter-config.sh | 2 +- rs/bitcoin/mock/tests/tests.rs | 2 +- rs/bitcoin/validation/src/header.rs | 36 +++++++++---------- rs/tests/ckbtc/ckbtc_minter_batching.rs | 10 ++++-- rs/tests/ckbtc/ckbtc_minter_checker.rs | 5 ++- .../ckbtc_minter_deposit_and_withdrawal.rs | 10 ++++-- rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs | 8 +++-- rs/tests/ckbtc/ckbtc_minter_update_balance.rs | 5 ++- rs/tests/execution/btc_get_balance_test.rs | 11 ++++-- 9 files changed, 59 insertions(+), 30 deletions(-) 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 d6ba8f7e90e..f8816922cc6 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,7 +69,7 @@ if [ "${SOCKS_FILE}" != "" -a -e "${SOCKS_FILE}" ]; then read_socks_proxy "${SOCKS_FILE}" fi -#TODO(mihailjianu): change the seeds. +#TODO(mihailjianu): change the seeds. BITCOIN_NETWORK='"testnet4"' DNS_SEEDS='"testnet-seed.bitcoin.jonasschnelli.ch", "seed.tbtc.petertodd.org", diff --git a/rs/bitcoin/mock/tests/tests.rs b/rs/bitcoin/mock/tests/tests.rs index e532fed62e9..0d0b71cd890 100644 --- a/rs/bitcoin/mock/tests/tests.rs +++ b/rs/bitcoin/mock/tests/tests.rs @@ -152,7 +152,7 @@ fn test_install_bitcoin_mock_canister() { .expect("failed to decode get_mempool response"); assert_eq!(mempool.len(), 1); - let tx:Transaction = deserialize(&mempool[0]).expect("failed to parse transaction"); + let tx: Transaction = deserialize(&mempool[0]).expect("failed to parse transaction"); assert_eq!(tx.input.len(), 1); assert_eq!(tx.output.len(), 2); diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index b01dca055cc..1dcb9dcec73 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -477,24 +477,24 @@ mod test { }); } - //TODO(mihailjianu): add the csv files. - #[test] - fn mainnet_next_targets() { - test_next_targets( - Network::Bitcoin, - "tests/data/block_headers_mainnet.csv", - 700_000, - ); - } - - #[test] - fn testnet_next_targets() { - test_next_targets( - Network::Testnet, - "tests/data/block_headers_testnet.csv", - 2_400_000, - ); - } + //TODO(mihailjianu): add the csv files. + // #[test] + // fn mainnet_next_targets() { + // test_next_targets( + // Network::Bitcoin, + // "tests/data/block_headers_mainnet.csv", + // 700_000, + // ); + // } + + // #[test] + // fn testnet_next_targets() { + // test_next_targets( + // Network::Testnet, + // "tests/data/block_headers_testnet.csv", + // 2_400_000, + // ); + // } fn genesis_header(bits: CompactTarget) -> BlockHeader { BlockHeader { diff --git a/rs/tests/ckbtc/ckbtc_minter_batching.rs b/rs/tests/ckbtc/ckbtc_minter_batching.rs index 4477021bdea..60dde7f757b 100644 --- a/rs/tests/ckbtc/ckbtc_minter_batching.rs +++ b/rs/tests/ckbtc/ckbtc_minter_batching.rs @@ -61,7 +61,10 @@ pub fn test_batching(env: TestEnv) { let btc_rpc = get_btc_client(&env); ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); + let default_btc_address = btc_rpc + .get_new_address(None, None) + .unwrap() + .assume_checked(); // Creating the 101 first block to reach the min confirmations to spend a coinbase utxo. debug!( &logger, @@ -163,7 +166,10 @@ pub fn test_batching(env: TestEnv) { "Transfer to the minter account occurred at block {}", transfer_result ); - let destination_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); + let destination_btc_address = btc_rpc + .get_new_address(None, None) + .unwrap() + .assume_checked(); info!(&logger, "Call retrieve_btc"); diff --git a/rs/tests/ckbtc/ckbtc_minter_checker.rs b/rs/tests/ckbtc/ckbtc_minter_checker.rs index 219025ab7e5..c3c8a096953 100644 --- a/rs/tests/ckbtc/ckbtc_minter_checker.rs +++ b/rs/tests/ckbtc/ckbtc_minter_checker.rs @@ -49,7 +49,10 @@ pub fn test_btc_checker(env: TestEnv) { // Create wallet if required. ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); + let default_btc_address = btc_rpc + .get_new_address(None, None) + .unwrap() + .assume_checked(); // Creating the 101 first block to reach the min confirmations to spend a coinbase utxo. debug!( &logger, diff --git a/rs/tests/ckbtc/ckbtc_minter_deposit_and_withdrawal.rs b/rs/tests/ckbtc/ckbtc_minter_deposit_and_withdrawal.rs index ce5b492c727..b6e1e4a90f7 100644 --- a/rs/tests/ckbtc/ckbtc_minter_deposit_and_withdrawal.rs +++ b/rs/tests/ckbtc/ckbtc_minter_deposit_and_withdrawal.rs @@ -41,7 +41,10 @@ pub fn test_deposit_and_withdrawal(env: TestEnv) { let btc_rpc = get_btc_client(&env); ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); + let default_btc_address = btc_rpc + .get_new_address(None, None) + .unwrap() + .assume_checked(); // Creating the 101 first block to reach the min confirmations to spend a coinbase utxo. debug!( &logger, @@ -128,7 +131,10 @@ pub fn test_deposit_and_withdrawal(env: TestEnv) { "Transfer to the minter account occurred at block {}", transfer_result ); - let destination_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); + let destination_btc_address = btc_rpc + .get_new_address(None, None) + .unwrap() + .assume_checked(); info!(&logger, "Call retrieve_btc"); diff --git a/rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs b/rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs index 2ba4445300d..edcc1be38be 100644 --- a/rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs +++ b/rs/tests/ckbtc/ckbtc_minter_retrieve_btc.rs @@ -45,11 +45,15 @@ pub fn test_retrieve_btc(env: TestEnv) { let btc_rpc = get_btc_client(&env); ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); + let default_btc_address = btc_rpc + .get_new_address(None, None) + .unwrap() + .assume_checked(); // Creating the 10 first block to reach the min confirmations of the minter canister. debug!( &logger, - "Generating 10 blocks to default address: {}", &default_btc_address.to_string() + "Generating 10 blocks to default address: {}", + &default_btc_address.to_string() ); btc_rpc .generate_to_address(10, &default_btc_address) diff --git a/rs/tests/ckbtc/ckbtc_minter_update_balance.rs b/rs/tests/ckbtc/ckbtc_minter_update_balance.rs index c8e9abef783..d00fbf11f01 100644 --- a/rs/tests/ckbtc/ckbtc_minter_update_balance.rs +++ b/rs/tests/ckbtc/ckbtc_minter_update_balance.rs @@ -55,7 +55,10 @@ pub fn test_update_balance(env: TestEnv) { // Create wallet if required. ensure_wallet(&btc_rpc, &logger); - let default_btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); + let default_btc_address = btc_rpc + .get_new_address(None, None) + .unwrap() + .assume_checked(); // Creating the 10 first block to reach the min confirmations of the minter canister. debug!( &logger, diff --git a/rs/tests/execution/btc_get_balance_test.rs b/rs/tests/execution/btc_get_balance_test.rs index e1ae70b9b83..859d0a81d16 100644 --- a/rs/tests/execution/btc_get_balance_test.rs +++ b/rs/tests/execution/btc_get_balance_test.rs @@ -149,8 +149,15 @@ pub fn get_balance(env: TestEnv) { .unwrap(); // Generate an address. - let btc_address = btc_rpc.get_new_address(None, None).unwrap().assume_checked(); - info!(&logger, "Created temporary btc address: {}", btc_address.to_string()); + let btc_address = btc_rpc + .get_new_address(None, None) + .unwrap() + .assume_checked(); + info!( + &logger, + "Created temporary btc address: {}", + btc_address.to_string() + ); // Mint some blocks for the address we generated. let block = btc_rpc.generate_to_address(101, &btc_address).unwrap(); From e0666fe3da26bf52418878945bc67c0a46a9dec4 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 19:48:18 +0000 Subject: [PATCH 25/50] remove test --- rs/bitcoin/validation/src/header.rs | 58 ----------------------------- 1 file changed, 58 deletions(-) diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index 1dcb9dcec73..f58c19d5746 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -438,64 +438,6 @@ mod test { )); } - fn test_next_targets(network: Network, headers_path: &str, up_to_height: usize) { - use bitcoin::consensus::Decodable; - use std::io::BufRead; - let file = std::fs::File::open( - PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()).join(headers_path), - ) - .unwrap(); - - let rdr = std::io::BufReader::new(file); - - println!("Loading headers..."); - let mut headers = vec![]; - for line in rdr.lines() { - let header = line.unwrap(); - let header = hex::decode(header.trim()).unwrap(); - let header = BlockHeader::consensus_decode(&mut header.as_slice()).unwrap(); - headers.push(header); - } - - println!("Creating header store..."); - let mut store = SimpleHeaderStore::new(headers[0], 0); - for header in headers[1..].iter() { - store.add(*header); - } - - println!("Verifying next targets..."); - proptest!(|(i in 0..up_to_height)| { - // Compute what the target of the next header should be. - let expected_next_compact_target = - get_next_compact_target(&network, &store, &headers[i], i as u32, headers[i + 1].time); - - // Assert that the expected next target matches the next header's target. - assert_eq!( - expected_next_compact_target, - headers[i + 1].bits - ); - }); - } - - //TODO(mihailjianu): add the csv files. - // #[test] - // fn mainnet_next_targets() { - // test_next_targets( - // Network::Bitcoin, - // "tests/data/block_headers_mainnet.csv", - // 700_000, - // ); - // } - - // #[test] - // fn testnet_next_targets() { - // test_next_targets( - // Network::Testnet, - // "tests/data/block_headers_testnet.csv", - // 2_400_000, - // ); - // } - fn genesis_header(bits: CompactTarget) -> BlockHeader { BlockHeader { version: Version::ONE, From 74bc6e2ed9675c313ff437d51efb4f901362c780 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 16 Dec 2024 20:02:38 +0000 Subject: [PATCH 26/50] more fixes --- Cargo.lock | 54 ++++++----------------------- rs/bitcoin/validation/src/header.rs | 1 - rs/tests/execution/Cargo.toml | 2 +- 3 files changed, 11 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0ad4702cc8c..e21624b097b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1166,7 +1166,6 @@ dependencies = [ "bech32 0.8.1", "bitcoin_hashes 0.10.0", "secp256k1 0.22.2", - "serde", ] [[package]] @@ -1237,9 +1236,6 @@ name = "bitcoin_hashes" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "006cc91e1a1d99819bc5b8214be3555c1f0611b169f527a1fdc54ed1f2b745b0" -dependencies = [ - "serde", -] [[package]] name = "bitcoin_hashes" @@ -1262,43 +1258,19 @@ dependencies = [ "serde", ] -[[package]] -name = "bitcoincore-rpc" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0e67dbf7a9971e7f4276f6089e9e814ce0f624a03216b7d92d00351ae7fb3e" -dependencies = [ - "bitcoincore-rpc-json 0.15.0", - "jsonrpc 0.12.1", - "log", - "serde", - "serde_json", -] - [[package]] name = "bitcoincore-rpc" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aedd23ae0fd321affb4bbbc36126c6f49a32818dc6b979395d24da8c9d4e80ee" dependencies = [ - "bitcoincore-rpc-json 0.19.0", + "bitcoincore-rpc-json", "jsonrpc 0.18.0", "log", "serde", "serde_json", ] -[[package]] -name = "bitcoincore-rpc-json" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e2ae16202721ba8c3409045681fac790a5ddc791f05731a2df22c0c6bffc0f1" -dependencies = [ - "bitcoin 0.28.2", - "serde", - "serde_json", -] - [[package]] name = "bitcoincore-rpc-json" version = "0.19.0" @@ -4097,7 +4069,7 @@ version = "0.9.0" dependencies = [ "anyhow", "assert_matches", - "bitcoincore-rpc 0.15.0", + "bitcoincore-rpc", "candid", "futures", "ic-agent 0.37.1", @@ -5904,7 +5876,7 @@ name = "ic-btc-adapter" version = "0.9.0" dependencies = [ "bitcoin 0.32.5", - "bitcoincore-rpc 0.19.0", + "bitcoincore-rpc", "bitcoind", "clap 4.5.20", "criterion", @@ -13176,7 +13148,7 @@ version = "0.9.0" dependencies = [ "anyhow", "assert_matches", - "bitcoincore-rpc 0.19.0", + "bitcoincore-rpc", "candid", "canister-test", "dfn_candid", @@ -14738,16 +14710,6 @@ dependencies = [ "thiserror 1.0.68", ] -[[package]] -name = "jsonrpc" -version = "0.12.1" -source = "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" -dependencies = [ - "base64 0.13.1", - "serde", - "serde_json", -] - [[package]] name = "jsonrpc" version = "0.13.0" @@ -17289,7 +17251,7 @@ dependencies = [ "backoff", "base64 0.13.1", "bitcoin 0.32.5", - "bitcoincore-rpc 0.19.0", + "bitcoincore-rpc", "bytes", "candid", "clap 4.5.20", @@ -19442,7 +19404,6 @@ checksum = "295642060261c80709ac034f52fca8e5a9fa2c7d341ded5cdb164b7c33768b2a" dependencies = [ "rand 0.6.5", "secp256k1-sys 0.5.2", - "serde", ] [[package]] @@ -23118,3 +23079,8 @@ dependencies = [ "cc", "pkg-config", ] + +[[patch.unused]] +name = "jsonrpc" +version = "0.12.1" +source = "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index f58c19d5746..a577330b407 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -232,7 +232,6 @@ mod test { block::Version, consensus::deserialize, hashes::hex::FromHex, hashes::Hash, TxMerkleNode, }; use csv::Reader; - use proptest::prelude::*; use super::*; use crate::constants::test::{ diff --git a/rs/tests/execution/Cargo.toml b/rs/tests/execution/Cargo.toml index a50cb647351..5c3ede82769 100644 --- a/rs/tests/execution/Cargo.toml +++ b/rs/tests/execution/Cargo.toml @@ -8,7 +8,7 @@ documentation.workspace = true [dependencies] anyhow = { workspace = true } -bitcoincore-rpc = "0.15.0" +bitcoincore-rpc = { workspace = true } candid = { workspace = true } futures = { workspace = true } ic-agent = { workspace = true } From 8cf7919b1533cc2467716c620204139c3036a546 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Thu, 19 Dec 2024 14:11:51 +0000 Subject: [PATCH 27/50] cleanup --- .../ic/ic-btc-adapter/generate-btc-adapter-config.sh | 3 +-- rs/tests/ckbtc/ckbtc_minter_batching.rs | 2 +- rs/tests/ckbtc/src/utils.rs | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) 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 f8816922cc6..888415ff806 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,8 +69,7 @@ if [ "${SOCKS_FILE}" != "" -a -e "${SOCKS_FILE}" ]; then read_socks_proxy "${SOCKS_FILE}" fi -#TODO(mihailjianu): change the seeds. -BITCOIN_NETWORK='"testnet4"' +BITCOIN_NETWORK='"testnet"' DNS_SEEDS='"testnet-seed.bitcoin.jonasschnelli.ch", "seed.tbtc.petertodd.org", "seed.testnet.bitcoin.sprovoost.nl", diff --git a/rs/tests/ckbtc/ckbtc_minter_batching.rs b/rs/tests/ckbtc/ckbtc_minter_batching.rs index 60dde7f757b..d9954d32b4e 100644 --- a/rs/tests/ckbtc/ckbtc_minter_batching.rs +++ b/rs/tests/ckbtc/ckbtc_minter_batching.rs @@ -243,7 +243,7 @@ pub fn test_batching(env: TestEnv) { .await; // Let's wait for the transaction to appear on the mempool - //TODO(mihailjianu): revisit the usefulness of this test. + //TODO(mihailjianu): revisit the usefulness of this check. let mempool_txids = wait_for_mempool_change(&btc_rpc, &logger).await; let txid = mempool_txids[0]; let btc_txid = Txid::from_raw_hash(Hash::from_slice(&txid[..]).unwrap()); diff --git a/rs/tests/ckbtc/src/utils.rs b/rs/tests/ckbtc/src/utils.rs index 3f73ca1af71..2a826552331 100644 --- a/rs/tests/ckbtc/src/utils.rs +++ b/rs/tests/ckbtc/src/utils.rs @@ -382,7 +382,6 @@ pub async fn get_btc_address( debug!(logger, "Btc address for subaccount is: {}", address); // Checking only proper format of address since ECDSA signature is non-deterministic. assert_eq!(ADDRESS_LENGTH, address.len()); - //TODO(mihailjianu): check all assume_checked. address.parse::>().unwrap().assume_checked() } From b321477e6d3cbc4843988d78d8fe0b51173edc7f Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Thu, 19 Dec 2024 14:28:34 +0000 Subject: [PATCH 28/50] f --- rs/bitcoin/adapter/src/blockchainstate.rs | 19 ++----- rs/bitcoin/validation/src/header.rs | 60 +++++++---------------- 2 files changed, 21 insertions(+), 58 deletions(-) diff --git a/rs/bitcoin/adapter/src/blockchainstate.rs b/rs/bitcoin/adapter/src/blockchainstate.rs index 6f948e8d3df..d248eed639c 100644 --- a/rs/bitcoin/adapter/src/blockchainstate.rs +++ b/rs/bitcoin/adapter/src/blockchainstate.rs @@ -337,28 +337,15 @@ impl BlockchainState { } impl HeaderStore for BlockchainState { - fn get_with_block_hash(&self, hash: &BlockHash) -> Option { - self.get_cached_header(hash).map(|cached| cached.header) - } - - // TODO: this is terribly innefficient. We should: either have and index for this, or - // rething how this is used. - fn get_with_height(&self, height: u32) -> Option { - self.header_cache - .values() - .find(|cached| cached.height == height) - .map(|cached| cached.header) - } - - fn height(&self) -> BlockHeight { - self.get_active_chain_tip().height + fn get_header(&self, hash: &BlockHash) -> Option<(BlockHeader, BlockHeight)> { + self.get_cached_header(hash) + .map(|cached| (cached.header, cached.height)) } fn get_initial_hash(&self) -> BlockHash { self.genesis().block_hash() } } - #[cfg(test)] mod test { use bitcoin::TxMerkleNode; diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index a577330b407..33792dc7638 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -37,20 +37,10 @@ pub enum ValidateHeaderError { pub trait HeaderStore { /// Returns the header with the given block hash. - fn get_with_block_hash(&self, hash: &BlockHash) -> Option; - - /// Returns the header at the given height. - fn get_with_height(&self, height: u32) -> Option; - - /// Returns the height of the tip that the new header will extend. - fn height(&self) -> u32; + fn get_header(&self, hash: &BlockHash) -> Option<(BlockHeader, BlockHeight)>; /// Returns the initial hash the store starts from. - fn get_initial_hash(&self) -> BlockHash { - self.get_with_height(0) - .expect("genesis block header not found") - .block_hash() - } + fn get_initial_hash(&self) -> BlockHash; } /// Validates a header. If a failure occurs, a @@ -60,8 +50,7 @@ pub fn validate_header( store: &impl HeaderStore, header: &BlockHeader, ) -> Result<(), ValidateHeaderError> { - let prev_height = store.height(); - let prev_header = match store.get_with_block_hash(&header.prev_blockhash) { + let (prev_header, prev_height) = match store.get_header(&header.prev_blockhash) { Some(result) => result, None => { return Err(ValidateHeaderError::PrevHeaderNotFound); @@ -167,8 +156,8 @@ fn find_next_difficulty_in_chain( // Traverse to the previous header. let prev_blockhash = current_header.prev_blockhash; - current_header = store - .get_with_block_hash(&prev_blockhash) + (current_header, _) = store + .get_header(&prev_blockhash) .expect("previous header should be in the header store"); // Update the current height and hash. current_height -= 1; @@ -199,16 +188,15 @@ fn compute_next_difficulty( return prev_header.bits; } - // Computing the `last_adjustment_header`. - // `last_adjustment_header` is the last header with height multiple of 2016 - let last_adjustment_height = if height < DIFFICULTY_ADJUSTMENT_INTERVAL { - 0 - } else { - height - DIFFICULTY_ADJUSTMENT_INTERVAL - }; - let last_adjustment_header = store - .get_with_height(last_adjustment_height) - .expect("Last adjustment header must exist"); + // Computing the last header with height multiple of 2016 + let mut current_header = *prev_header; + for _i in 0..(DIFFICULTY_ADJUSTMENT_INTERVAL - 1) { + if let Some((header, _)) = store.get_header(¤t_header.prev_blockhash) { + current_header = header; + } + } + // last_adjustment_header is the last header with height multiple of 2016 + let last_adjustment_header = current_header; let last_adjustment_time = last_adjustment_header.time; // Computing the time interval between the last adjustment header time and @@ -290,21 +278,10 @@ mod test { } impl HeaderStore for SimpleHeaderStore { - fn get_with_block_hash(&self, hash: &BlockHash) -> Option { - self.headers.get(hash).map(|stored| stored.header) - } - - fn get_with_height(&self, height: u32) -> Option { - let blocks_to_traverse = self.height - height; - let mut header = self.headers.get(&self.tip_hash).unwrap().header; - for _ in 0..blocks_to_traverse { - header = self.headers.get(&header.prev_blockhash).unwrap().header; - } - Some(header) - } - - fn height(&self) -> u32 { - self.height + fn get_header(&self, hash: &BlockHash) -> Option<(BlockHeader, BlockHeight)> { + self.headers + .get(hash) + .map(|stored| (stored.header, stored.height)) } fn get_initial_hash(&self) -> BlockHash { @@ -490,7 +467,6 @@ mod test { let expected_pow = CompactTarget::from_consensus(7); // Some non-limit PoW, the actual value is not important. for chain_length in 1..10 { let (store, last_header) = create_chain(&network, expected_pow, chain_length); - assert_eq!(store.height() + 1, chain_length); // Act. let compact_target = get_next_compact_target( &network, From bf1f8a7dc33c6a52227e123131e8b409e9caca20 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Thu, 19 Dec 2024 15:08:23 +0000 Subject: [PATCH 29/50] cargo.bazel.json.lock? --- Cargo.Bazel.json.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index b053b3ca524..40ec08ba10d 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "b370deb14a4a4991400d9897a96fd717dffd5b316510898b68f18a66a86ee946", + "checksum": "f7b916b5ae52b1ec54cf657fdea8b730c9381c987fda81a6841140184f221e4a", "crates": { "abnf 0.12.0": { "name": "abnf", From 63b9ca795c5f78d30cc807caf1fa50cb57f75a4c Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 23 Dec 2024 11:52:05 +0000 Subject: [PATCH 30/50] add test back --- rs/bitcoin/validation/src/header.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index 33792dc7638..670a2bdb87b 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -479,4 +479,32 @@ mod test { assert_eq!(compact_target, expected_pow); } } + + #[test] + fn test_compute_next_difficulty_for_backdated_blocks() { + // 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); + + // Create the genesis header and initialize the header store + 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 { + let new_header = BlockHeader { + prev_blockhash: last_header.block_hash(), + time: last_header.time - 1, // Each new block is 1 second earlier + ..last_header + }; + store.add(new_header); + last_header = new_header; + } + + // Act. + let difficulty = compute_next_difficulty(&network, &store, &last_header, chain_length); + + // Assert. + assert_eq!(difficulty, CompactTarget::from_consensus(473956288)); + } } From f1adf9d2f6fe559312bd2d582bc96510bb7df4f9 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 13 Jan 2025 13:45:25 +0000 Subject: [PATCH 31/50] add back header validation --- rs/bitcoin/adapter/src/blockchainstate.rs | 5 ++ rs/bitcoin/validation/src/constants.rs | 91 ++++++++++++++++++++++- rs/bitcoin/validation/src/header.rs | 80 +++++++++++++++++++- 3 files changed, 174 insertions(+), 2 deletions(-) diff --git a/rs/bitcoin/adapter/src/blockchainstate.rs b/rs/bitcoin/adapter/src/blockchainstate.rs index d248eed639c..b0711f5e3b1 100644 --- a/rs/bitcoin/adapter/src/blockchainstate.rs +++ b/rs/bitcoin/adapter/src/blockchainstate.rs @@ -345,7 +345,12 @@ impl HeaderStore for BlockchainState { fn get_initial_hash(&self) -> BlockHash { self.genesis().block_hash() } + + fn get_height(&self) -> BlockHeight { + self.get_active_chain_tip().height + } } + #[cfg(test)] mod test { use bitcoin::TxMerkleNode; diff --git a/rs/bitcoin/validation/src/constants.rs b/rs/bitcoin/validation/src/constants.rs index 72cd045ebda..a3d551d8685 100644 --- a/rs/bitcoin/validation/src/constants.rs +++ b/rs/bitcoin/validation/src/constants.rs @@ -1,4 +1,6 @@ -use bitcoin::{CompactTarget, Network, Target}; +use std::{collections::HashMap, str::FromStr}; + +use bitcoin::{BlockHash, CompactTarget, Network, Target}; use crate::BlockHeight; @@ -8,6 +10,53 @@ pub const DIFFICULTY_ADJUSTMENT_INTERVAL: BlockHeight = 6 * 24 * 14; /// Needed to help test check for the 20 minute testnet/regtest rule pub const TEN_MINUTES: u32 = 60 * 10; +/// Represents approximately the number of blocks that will be created within one year. +/// +/// This number is determine by the following formula. A year approximately has 356.25 days. Assuming the +/// Bitcoin network produces a new block every 10 minutes on average, `6 * 24 * 365.25 = 52,596`. +pub const BLOCKS_IN_ONE_YEAR: BlockHeight = 52_596; + +/// Bitcoin mainnet checkpoints +#[rustfmt::skip] +const BITCOIN: &[(BlockHeight, &str)] = &[ + (11_111, "0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d",), + (33_333, "000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6",), + (74_000, "0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20",), + (105_000, "00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97",), + (134_444, "00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe",), + (168_000, "000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763",), + (193_000, "000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317",), + (210_000, "000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e",), + (216_116, "00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e",), + (225_430, "00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932",), + (250_000, "000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214",), + (279_000, "0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40",), + (295_000, "00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983",), + (393_216, "00000000000000000390df7d2bdc06b9fcb260b39e3fb15b4bc9f62572553924"), + (421_888, "000000000000000004b232ad9492d0729d7f9d6737399ffcdaac1c8160db5ef6"), + (438_784, "0000000000000000040d6ef667d7a52caf93d8e0d1e40fd7155c787b42667179"), + (451_840, "0000000000000000029103c8ade7786e7379623465c72d71d84624eb9c159bea"), + (469_766, "000000000000000000130b2bd812c6a7ae9c02a74fc111806b1dd11e8975da45"), + (481_824, "0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893"), + (514_048, "00000000000000000022fe630be397a62c58972bb81f0a2d1ae8c968511a4659"), + (553_472, "0000000000000000000e06b6698a4f65ab9915f24b23ca2f9d1abf30cc3e9173"), + (571_392, "00000000000000000019c18b43077775fc299a6646ab0e9dbbd5770bf6ca392d"), + (596_000, "0000000000000000000706f93dc673ca366c810f317e7cfe8d951c0107b65223"), + (601_723, "000000000000000000009837f74796532b21d8ccf7def3dcfcb45aa92cd86b9e"), + (617_056, "0000000000000000000ca51b293fb2be2fbaf1acc76dcbbbff7e4d7796380b9e"), + (632_549, "00000000000000000001bae1b2b73ec3fde475c1ed7fdd382c2c49860ec19920"), + (643_700, "00000000000000000002959e9b44507120453344794df09bd1276eb325ed7110"), + (667_811, "00000000000000000007888a9d01313d69d6335df46ea33e875ee6832670c596"), + (688_888, "0000000000000000000e1e3bd783ce0de7b0cdabf2034723595dbcd5a28cf831"), + (704_256, "0000000000000000000465f5acfcd603337994261a4d67a647cb49866c98b538"), +]; + +/// Bitcoin testnet checkpoints +#[rustfmt::skip] +const TESTNET: &[(BlockHeight, &str)] = &[ + (546, "000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70") +]; + /// Returns the maximum difficulty target depending on the network pub fn max_target(network: &Network) -> Target { match network { @@ -40,6 +89,46 @@ pub fn pow_limit_bits(network: &Network) -> CompactTarget { }) } +/// Checkpoints used to validate blocks at certain heights. +pub fn checkpoints(network: &Network) -> HashMap { + let points = match network { + Network::Bitcoin => BITCOIN, + Network::Testnet => TESTNET, + //TODO(mihailjianu): Add Testnet4 checkpoints. + Network::Testnet4 => &[], + Network::Signet => &[], + Network::Regtest => &[], + _ => &[], + }; + points + .iter() + .cloned() + .map(|(height, hash)| { + //TODO(mihailjianu): check that this is correct. + let hash = BlockHash::from_str(hash).expect("Programmer error: invalid hash"); + (height, hash) + }) + .collect() +} + +pub fn latest_checkpoint_height(network: &Network, current_height: BlockHeight) -> BlockHeight { + let points = match network { + Network::Bitcoin => BITCOIN, + Network::Testnet => TESTNET, + //TODO(mihailjianu): Add Testnet4 checkpoints. + Network::Testnet4 => &[], + Network::Signet => &[], + Network::Regtest => &[], + _ => &[], + }; + + points + .iter() + .rev() + .find(|(height, _)| *height <= current_height) + .map_or(0, |(height, _)| *height) +} + #[cfg(test)] pub mod test { /// Mainnet 000000000000000000063108ecc1f03f7fd1481eb20f97307d532a612bc97f04 diff --git a/rs/bitcoin/validation/src/header.rs b/rs/bitcoin/validation/src/header.rs index 670a2bdb87b..ef7769ebaf4 100644 --- a/rs/bitcoin/validation/src/header.rs +++ b/rs/bitcoin/validation/src/header.rs @@ -4,7 +4,8 @@ use bitcoin::{ use crate::{ constants::{ - max_target, no_pow_retargeting, pow_limit_bits, DIFFICULTY_ADJUSTMENT_INTERVAL, TEN_MINUTES, + checkpoints, latest_checkpoint_height, max_target, no_pow_retargeting, pow_limit_bits, + BLOCKS_IN_ONE_YEAR, DIFFICULTY_ADJUSTMENT_INTERVAL, TEN_MINUTES, }, BlockHeight, }; @@ -15,6 +16,8 @@ pub enum ValidateHeaderError { /// Used when the timestamp in the header is lower than /// the median of timestamps of past 11 headers. HeaderIsOld, + /// Used when the header doesn't match with a checkpoint. + DoesNotMatchCheckpoint, /// Used when the timestamp in the header is more than 2 hours /// from the current time. HeaderIsTooFarInFuture { @@ -30,6 +33,8 @@ pub enum ValidateHeaderError { /// Used when the target in the header is greater than the max possible /// value. TargetDifficultyAboveMax, + /// The next height is less than the tip height - 52_596 (one year worth of blocks). + HeightTooLow, /// Used when the predecessor of the input header is not found in the /// HeaderStore. PrevHeaderNotFound, @@ -41,6 +46,8 @@ pub trait HeaderStore { /// Returns the initial hash the store starts from. fn get_initial_hash(&self) -> BlockHash; + + fn get_height(&self) -> BlockHeight; } /// Validates a header. If a failure occurs, a @@ -50,6 +57,7 @@ pub fn validate_header( store: &impl HeaderStore, header: &BlockHeader, ) -> Result<(), ValidateHeaderError> { + let chain_height = store.get_height(); let (prev_header, prev_height) = match store.get_header(&header.prev_blockhash) { Some(result) => result, None => { @@ -57,6 +65,18 @@ pub fn validate_header( } }; + if !is_header_within_one_year_of_tip(prev_height, chain_height) { + return Err(ValidateHeaderError::HeightTooLow); + } + + if !is_timestamp_valid(store, header) { + return Err(ValidateHeaderError::HeaderIsOld); + } + + if !is_checkpoint_valid(network, prev_height, header, chain_height) { + return Err(ValidateHeaderError::DoesNotMatchCheckpoint); + } + let header_target = header.target(); if header_target > max_target(network) { return Err(ValidateHeaderError::TargetDifficultyAboveMax); @@ -80,6 +100,60 @@ pub fn validate_header( Ok(()) } +/// This validates the header against the network's checkpoints. +/// 1. If the next header is at a checkpoint height, the checkpoint is compared to the next header's block hash. +/// 2. If the header is not the same height, the function then compares the height to the latest checkpoint. +/// If the next header's height is less than the last checkpoint's height, the header is invalid. +fn is_checkpoint_valid( + network: &Network, + prev_height: BlockHeight, + header: &BlockHeader, + chain_height: BlockHeight, +) -> bool { + let checkpoints = checkpoints(network); + let next_height = prev_height.saturating_add(1); + if let Some(next_hash) = checkpoints.get(&next_height) { + return *next_hash == header.block_hash(); + } + + let checkpoint_height = latest_checkpoint_height(network, chain_height); + next_height > checkpoint_height +} + +/// This validates that the header has a height that is within 1 year of the tip height. +fn is_header_within_one_year_of_tip(prev_height: BlockHeight, chain_height: BlockHeight) -> bool { + // perhaps checked_add would be preferable here, if the next height would cause an overflow, + // we should know about it instead of being swallowed. + let header_height = prev_height + .checked_add(1) + .expect("next height causes an overflow"); + + let height_one_year_ago = chain_height.saturating_sub(BLOCKS_IN_ONE_YEAR); + header_height >= height_one_year_ago +} + +/// Validates if a header's timestamp is valid. +/// Bitcoin Protocol Rules wiki https://en.bitcoin.it/wiki/Protocol_rules says, +/// "Reject if timestamp is the median time of the last 11 blocks or before" +fn is_timestamp_valid(store: &impl HeaderStore, header: &BlockHeader) -> bool { + let mut times = vec![]; + let mut current_header = *header; + let initial_hash = store.get_initial_hash(); + for _ in 0..11 { + if let Some((prev_header, _)) = store.get_header(¤t_header.prev_blockhash) { + times.push(prev_header.time); + if current_header.prev_blockhash == initial_hash { + break; + } + current_header = prev_header; + } + } + + times.sort_unstable(); + let median = times[times.len() / 2]; + header.time > median +} + // Returns the next required target at the given timestamp. // The target is the number that a block hash must be below for it to be accepted. fn get_next_compact_target( @@ -287,6 +361,10 @@ mod test { fn get_initial_hash(&self) -> BlockHash { self.initial_hash } + + fn get_height(&self) -> BlockHeight { + self.height + } } fn deserialize_header(encoded_bytes: &str) -> BlockHeader { From a208fe6ba95732390b72f45c791249b8beb04a58 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 13 Jan 2025 16:30:35 +0000 Subject: [PATCH 32/50] cleanup --- rs/bitcoin/validation/src/constants.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rs/bitcoin/validation/src/constants.rs b/rs/bitcoin/validation/src/constants.rs index a3d551d8685..5a632b27808 100644 --- a/rs/bitcoin/validation/src/constants.rs +++ b/rs/bitcoin/validation/src/constants.rs @@ -94,7 +94,6 @@ pub fn checkpoints(network: &Network) -> HashMap { let points = match network { Network::Bitcoin => BITCOIN, Network::Testnet => TESTNET, - //TODO(mihailjianu): Add Testnet4 checkpoints. Network::Testnet4 => &[], Network::Signet => &[], Network::Regtest => &[], @@ -104,7 +103,7 @@ pub fn checkpoints(network: &Network) -> HashMap { .iter() .cloned() .map(|(height, hash)| { - //TODO(mihailjianu): check that this is correct. + //TODO: handle this unwrap without crashing let hash = BlockHash::from_str(hash).expect("Programmer error: invalid hash"); (height, hash) }) @@ -115,7 +114,6 @@ pub fn latest_checkpoint_height(network: &Network, current_height: BlockHeight) let points = match network { Network::Bitcoin => BITCOIN, Network::Testnet => TESTNET, - //TODO(mihailjianu): Add Testnet4 checkpoints. Network::Testnet4 => &[], Network::Signet => &[], Network::Regtest => &[], From 0cc726b95f2a264f9ac6bd718f939445b7065a43 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Mon, 13 Jan 2025 17:57:48 +0000 Subject: [PATCH 33/50] lock.. --- Cargo.Bazel.json.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 67aaf9fb0c0..53cde42bc4a 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "f7b916b5ae52b1ec54cf657fdea8b730c9381c987fda81a6841140184f221e4a", + "checksum": "f21e594e63e06dc65bcf1c283fbec2dbcb34fad4478d5a09b8077fb908613bf9", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -7032,7 +7032,7 @@ "target": "secp256k1" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde", "alias": "actual_serde" } @@ -7113,7 +7113,7 @@ "target": "build_script_build" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" } ], @@ -7301,7 +7301,7 @@ "alias": "internals" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" } ], @@ -7481,7 +7481,7 @@ "alias": "hex" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" } ], @@ -36093,7 +36093,7 @@ "target": "minreq" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" }, { @@ -41630,7 +41630,7 @@ "target": "build_script_build" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" }, { @@ -63719,7 +63719,7 @@ "target": "secp256k1_sys" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" } ], From 0fcf9546921a427273086eced76dfe53ba986ce9 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Tue, 14 Jan 2025 10:44:53 +0000 Subject: [PATCH 34/50] cargo lock --- Cargo.lock | 1279 ++++++++++++++++++++++++++-------------------------- 1 file changed, 633 insertions(+), 646 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c52fc20299e..69371d8a3d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bytes", "futures-core", "futures-sink", @@ -62,7 +62,7 @@ dependencies = [ "actix-utils", "ahash 0.8.11", "base64 0.22.1", - "bitflags 2.6.0", + "bitflags 2.7.0", "brotli 6.0.0", "bytes", "bytestring", @@ -96,7 +96,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -214,7 +214,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -292,9 +292,9 @@ dependencies = [ [[package]] name = "aide" -version = "0.13.4" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0e3b97a21e41ec5c19bfd9b4fc1f7086be104f8b988681230247ffc91cc8ed" +checksum = "5678d2978845ddb4bd736a026f467dd652d831e9e6254b0e41b07f7ee7523309" dependencies = [ "axum", "bytes", @@ -375,7 +375,7 @@ dependencies = [ "prometheus", "rand 0.8.5", "rsa", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", ] @@ -403,7 +403,7 @@ dependencies = [ "lazy_static", "prometheus", "serde", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -447,19 +447,20 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "arbitrary" @@ -525,7 +526,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -567,7 +568,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure", ] @@ -579,7 +580,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -691,7 +692,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.0", "event-listener-strategy", "pin-project-lite", ] @@ -747,7 +748,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -758,13 +759,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -813,13 +814,13 @@ dependencies = [ [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1108,7 +1109,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cexpr", "clang-sys", "itertools 0.12.1", @@ -1119,7 +1120,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1221,10 +1222,8 @@ dependencies = [ [[package]] name = "bitcoin" version = "0.32.5" -version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" -checksum = "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" dependencies = [ "base58ck", "bech32 0.11.0", @@ -1341,9 +1340,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" [[package]] name = "bitvec" @@ -1390,9 +1389,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" +checksum = "9fb65153674e51d3a42c8f27b05b9508cea85edfaade8aa46bc8fc18cecdfef3" dependencies = [ "borsh-derive", "cfg_aliases", @@ -1400,15 +1399,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" +checksum = "a396e17ad94059c650db3d253bb6e25927f1eb462eede7e7a153bb6e75dce0a7" dependencies = [ "once_cell", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1455,9 +1454,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.1" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", "regex-automata 0.4.9", @@ -1578,9 +1577,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -1678,7 +1677,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1714,7 +1713,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bytes", - "clap 4.5.23", + "clap 4.5.26", "futures-util", "http 1.2.0", "http-body 1.0.1", @@ -1784,7 +1783,7 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1892,9 +1891,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.5" +version = "1.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" dependencies = [ "jobserver", "libc", @@ -1944,7 +1943,7 @@ dependencies = [ "candid", "certificate_orchestrator_interface", "chacha20poly1305", - "clap 4.5.23", + "clap 4.5.26", "cloudflare 0.12.0 (git+https://github.com/dfinity/cloudflare-rs.git?rev=a6538a036926bd756986c9c0a5de356daef48881)", "flate2", "futures", @@ -1952,7 +1951,7 @@ dependencies = [ "ic-agent", "ic-http-certification", "ic-response-verification", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "idna 1.0.3", "instant-acme", "leb128", @@ -1962,12 +1961,12 @@ dependencies = [ "pem 1.1.1", "prometheus", "rcgen", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "serde_cbor", "serde_json", "sha2 0.10.8", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tower 0.5.2", "tracing", @@ -1999,7 +1998,7 @@ dependencies = [ "serde", "serde_cbor", "sha2 0.10.8", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -2011,7 +2010,7 @@ dependencies = [ "ic-stable-structures", "serde", "serde_bytes", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -2154,19 +2153,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", - "clap_derive 4.5.18", + "clap_derive 4.5.24", ] [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -2189,14 +2188,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -2372,7 +2371,7 @@ name = "config" version = "1.0.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "config_types", "ic-types", "macaddr", @@ -2399,7 +2398,7 @@ dependencies = [ "serde_json", "serde_with 1.14.0", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "url", ] @@ -2508,7 +2507,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "registry-canister", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde_json", "slog", "tokio", @@ -2587,7 +2586,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "hex", - "proptest 1.5.0", + "proptest 1.6.0", "serde", ] @@ -2818,7 +2817,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.5.23", + "clap 4.5.26", "criterion-plot", "futures", "is-terminal", @@ -2917,7 +2916,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "crossterm_winapi", "libc", "mio 0.8.11", @@ -2974,7 +2973,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa", - "phf 0.11.2", + "phf 0.11.3", "smallvec", ] @@ -2985,7 +2984,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3045,7 +3044,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3182,7 +3181,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3204,7 +3203,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3297,7 +3296,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3318,7 +3317,7 @@ checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3329,7 +3328,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3342,7 +3341,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3362,7 +3361,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3370,11 +3369,11 @@ name = "deterministic_ips" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "config_types", "ic-crypto-sha2", "macaddr", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -3382,7 +3381,7 @@ name = "dflate" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "libc", "tar", ] @@ -3497,7 +3496,7 @@ name = "diroid" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "walkdir", ] @@ -3530,7 +3529,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3775,7 +3774,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3788,7 +3787,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3838,7 +3837,7 @@ checksum = "3bf679796c0322556351f287a51b49e48f7c4986e727b5dd78c972d30e2e16cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3991,9 +3990,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.3.1" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -4006,7 +4005,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.0", "pin-project-lite", ] @@ -4021,7 +4020,7 @@ dependencies = [ "ic-cdk 0.16.0", "mockall", "serde", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", ] @@ -4104,11 +4103,11 @@ dependencies = [ "ic-types", "ic-types-test-utils", "ic-universal-canister", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "lazy_static", "rand 0.8.5", "rand_chacha 0.3.1", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde_cbor", "slog", "tokio", @@ -4392,9 +4391,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ "fastrand", "futures-core", @@ -4411,7 +4410,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4421,7 +4420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pki-types", ] @@ -4476,6 +4475,19 @@ version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" +[[package]] +name = "generator" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "rustversion", + "windows", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -4555,9 +4567,9 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "governor" @@ -4595,7 +4607,7 @@ name = "guestos_tool" version = "1.0.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "config", "indoc", "itertools 0.12.1", @@ -4932,7 +4944,7 @@ name = "hostos_tool" version = "1.0.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "config", "config_types", "deterministic_ips", @@ -5032,10 +5044,10 @@ name = "httpbin-rs" version = "0.9.0" dependencies = [ "axum", - "clap 4.5.23", + "clap 4.5.26", "hyper 1.5.2", "hyper-util", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pemfile 2.2.0", "serde_json", "tokio", @@ -5164,7 +5176,7 @@ dependencies = [ "hyper 1.5.2", "hyper-util", "log", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", @@ -5231,7 +5243,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -5292,7 +5304,7 @@ dependencies = [ "base64 0.13.1", "candid", "chrono", - "clap 4.5.23", + "clap 4.5.26", "cycles-minting-canister", "futures", "hex", @@ -5392,7 +5404,7 @@ dependencies = [ "pkcs8", "rand 0.8.5", "rangemap", - "reqwest 0.12.9", + "reqwest 0.12.12", "ring 0.17.8", "sec1", "serde", @@ -5402,7 +5414,7 @@ dependencies = [ "sha2 0.10.8", "simple_asn1", "stop-token", - "thiserror 2.0.8", + "thiserror 2.0.11", "time", "tokio", "tower-service", @@ -5438,7 +5450,7 @@ dependencies = [ "prost 0.13.4", "rand 0.8.5", "slog", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tower 0.5.2", "tracing", @@ -5467,7 +5479,7 @@ version = "0.9.0" dependencies = [ "bincode", "byteorder", - "clap 4.5.23", + "clap 4.5.26", "criterion", "ic-config", "ic-crypto-test-utils-canister-threshold-sigs", @@ -5510,7 +5522,7 @@ version = "0.9.0" dependencies = [ "anyhow", "chrono", - "clap 4.5.23", + "clap 4.5.26", "ic-config", "ic-crypto-utils-threshold-sig-der", "ic-logger", @@ -5522,7 +5534,7 @@ dependencies = [ "ic-test-utilities-tmpdir", "ic-types", "rand 0.8.5", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "serde_json", "slog", @@ -5548,7 +5560,7 @@ dependencies = [ "ic-protobuf", "ic-test-utilities-compare-dirs", "phantom_newtype", - "proptest 1.5.0", + "proptest 1.6.0", "proptest-derive", "prost 0.13.4", "serde", @@ -5604,8 +5616,8 @@ dependencies = [ "base64 0.22.1", "bytes", "chacha20poly1305", - "clap 4.5.23", - "clap_derive 4.5.18", + "clap 4.5.26", + "clap_derive 4.5.24", "cloudflare 0.12.0 (git+https://github.com/cloudflare/cloudflare-rs.git?rev=f14720e42184ee176a97676e85ef2d2d85bc3aae)", "derive-new", "fqdn 0.4.4", @@ -5627,8 +5639,8 @@ dependencies = [ "prost-types 0.13.4", "rand 0.8.5", "rcgen", - "reqwest 0.12.9", - "rustls 0.23.20", + "reqwest 0.12.12", + "rustls 0.23.21", "rustls-acme", "rustls-pemfile 2.2.0", "rustls-platform-verifier", @@ -5639,7 +5651,7 @@ dependencies = [ "strum", "strum_macros", "systemstat", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tokio-io-timeout", "tokio-rustls 0.26.1", @@ -5668,7 +5680,7 @@ dependencies = [ "axum-extra", "bytes", "candid", - "clap 4.5.23", + "clap 4.5.26", "criterion", "dashmap 6.1.0", "ethnum", @@ -5720,8 +5732,8 @@ dependencies = [ "ratelimit", "rcgen", "regex", - "reqwest 0.12.9", - "rustls 0.23.20", + "reqwest 0.12.12", + "rustls 0.23.21", "rustls-pemfile 2.2.0", "serde", "serde_bytes", @@ -5733,7 +5745,7 @@ dependencies = [ "slog", "strum", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "tikv-jemalloc-ctl", "tikv-jemallocator", "tokio", @@ -5770,7 +5782,7 @@ dependencies = [ "pem 1.1.1", "rand 0.8.5", "rand_chacha 0.3.1", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde_json", "slog", "tokio", @@ -5787,7 +5799,7 @@ dependencies = [ "ic-crypto-tree-hash", "ic-system-test-driver", "ic-types", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "serde_cbor", "slog", @@ -5811,7 +5823,7 @@ dependencies = [ "ic-system-test-driver", "prost 0.13.4", "rand 0.8.5", - "reqwest 0.12.9", + "reqwest 0.12.12", "slog", "tokio", ] @@ -5832,7 +5844,7 @@ dependencies = [ "ic-registry-subnet-type", "ic-system-test-driver", "ic-types", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "slog", "url", ] @@ -5844,7 +5856,7 @@ dependencies = [ "bitcoin 0.32.5", "bitcoincore-rpc", "bitcoind", - "clap 4.5.23", + "clap 4.5.26", "criterion", "futures", "hashlink", @@ -5874,7 +5886,7 @@ dependencies = [ "slog", "slog-async", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tokio-socks", "tonic", @@ -5923,7 +5935,6 @@ dependencies = [ "askama", "base64 0.13.1", "bitcoin 0.32.5", - "bitcoin 0.32.5", "candid", "candid_parser", "ciborium", @@ -5940,7 +5951,8 @@ dependencies = [ "ic-types", "ic-universal-canister", "pocket-ic", - "proptest 1.5.0", + "proptest 1.6.0", + "regex", "scraper", "serde", "serde_json", @@ -5977,10 +5989,10 @@ dependencies = [ "ic-types", "mockall", "prometheus", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "slog", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -6056,7 +6068,7 @@ dependencies = [ "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", - "rustls 0.23.20", + "rustls 0.23.21", "serde", "serde_cbor", "tokio", @@ -6182,7 +6194,7 @@ dependencies = [ "serde_bytes", "serde_cbor", "sha2 0.10.8", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -6225,7 +6237,7 @@ dependencies = [ "leb128", "maplit", "phantom_newtype", - "proptest 1.5.0", + "proptest 1.6.0", "serde", "serde_bytes", "serde_cbor", @@ -6245,11 +6257,11 @@ dependencies = [ "ic-crypto-tree-hash-test-utils", "itertools 0.12.1", "leb128", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "scoped_threadpool", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -6380,7 +6392,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream 0.2.2", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6394,7 +6406,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream 0.2.2", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6584,7 +6596,7 @@ dependencies = [ "minicbor-derive", "mockall", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", "regex", "ripemd", "scopeguard", @@ -6638,7 +6650,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "phantom_newtype", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "rlp", "scopeguard", @@ -6649,7 +6661,7 @@ dependencies = [ "strum", "strum_macros", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "thousands", "time", "tokio", @@ -6696,7 +6708,7 @@ dependencies = [ "ic-sys", "ic-types", "json5", - "proptest 1.5.0", + "proptest 1.6.0", "proptest-derive", "serde", "tempfile", @@ -6761,8 +6773,8 @@ dependencies = [ "num-traits", "phantom_newtype", "prometheus", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "rstest", @@ -6898,7 +6910,7 @@ dependencies = [ "assert_matches", "async-trait", "bincode", - "clap 4.5.23", + "clap 4.5.26", "criterion", "hex", "ic-adapter-metrics-server", @@ -6971,13 +6983,13 @@ dependencies = [ "maplit", "mockall", "parking_lot 0.12.3", - "proptest 1.5.0", + "proptest 1.6.0", "proptest-derive", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "rsa", - "rustls 0.23.20", + "rustls 0.23.21", "serde", "sha2 0.10.8", "simple_asn1", @@ -7021,7 +7033,7 @@ dependencies = [ "pem 1.1.1", "rand 0.8.5", "rand_chacha 0.3.1", - "thiserror 2.0.8", + "thiserror 2.0.11", "wycheproof", "zeroize", ] @@ -7151,7 +7163,7 @@ dependencies = [ "ic-protobuf", "ic-types", "num-bigint 0.4.6", - "proptest 1.5.0", + "proptest 1.6.0", "proptest-derive", "rand 0.8.5", "rand_chacha 0.3.1", @@ -7310,7 +7322,7 @@ dependencies = [ "mockall", "num_cpus", "parking_lot 0.12.3", - "proptest 1.5.0", + "proptest 1.6.0", "proptest-derive", "prost 0.13.4", "rand 0.8.5", @@ -7327,7 +7339,7 @@ dependencies = [ "stubborn-io", "tarpc", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "time", "tokio", "tokio-serde", @@ -7354,7 +7366,7 @@ dependencies = [ "ic-protobuf", "ic-types", "paste", - "proptest 1.5.0", + "proptest 1.6.0", "strum", ] @@ -7416,7 +7428,7 @@ dependencies = [ "ic-crypto-test-utils-reproducible-rng", "ic-protobuf", "ic-types", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "serde", @@ -7469,7 +7481,7 @@ dependencies = [ "ic-types", "lazy_static", "parking_lot 0.12.3", - "proptest 1.5.0", + "proptest 1.6.0", "proptest-derive", "rand 0.8.5", "rand_chacha 0.3.1", @@ -7569,7 +7581,7 @@ dependencies = [ "serde_cbor", "strum", "strum_macros", - "thiserror 2.0.8", + "thiserror 2.0.11", "zeroize", ] @@ -7738,7 +7750,7 @@ dependencies = [ "ic-types-test-utils", "rand 0.8.5", "rand_chacha 0.3.1", - "rustls 0.23.20", + "rustls 0.23.21", "tempfile", "tokio", ] @@ -7917,7 +7929,7 @@ version = "0.9.0" dependencies = [ "ic-types", "mockall", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -7938,7 +7950,7 @@ dependencies = [ "ic-types", "pkcs8", "rand 0.8.5", - "rustls 0.23.20", + "rustls 0.23.21", "signature", "time", "tokio", @@ -7974,9 +7986,9 @@ dependencies = [ "ic-types", "json5", "maplit", - "rustls 0.23.20", + "rustls 0.23.21", "serde", - "thiserror 2.0.8", + "thiserror 2.0.11", "x509-parser", ] @@ -7987,7 +7999,7 @@ dependencies = [ "ic-base-types", "ic-crypto-tls-interfaces", "mockall", - "rustls 0.23.20", + "rustls 0.23.21", ] [[package]] @@ -8002,13 +8014,13 @@ dependencies = [ "ic-crypto-tree-hash-test-utils", "ic-protobuf", "maplit", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", "serde", "serde_bytes", "serde_cbor", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -8018,9 +8030,9 @@ dependencies = [ "assert_matches", "ic-crypto-test-utils-reproducible-rng", "ic-crypto-tree-hash", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -8087,7 +8099,7 @@ name = "ic-crypto-utils-tls" version = "0.9.0" dependencies = [ "ic-base-types", - "thiserror 2.0.8", + "thiserror 2.0.11", "x509-parser", ] @@ -8102,7 +8114,7 @@ dependencies = [ "ic-registry-nns-data-provider", "ic-types", "prost 0.13.4", - "reqwest 0.12.9", + "reqwest 0.12.12", "tokio", ] @@ -8172,7 +8184,7 @@ dependencies = [ name = "ic-drun" version = "0.9.0" dependencies = [ - "clap 4.5.23", + "clap 4.5.26", "futures", "hex", "ic-canister-sandbox-backend-lib", @@ -8217,7 +8229,7 @@ dependencies = [ "bincode", "candid", "canister-test", - "clap 4.5.23", + "clap 4.5.26", "criterion", "embedders_bench", "ic-base-types", @@ -8255,7 +8267,7 @@ dependencies = [ "num-traits", "pretty_assertions", "prometheus", - "proptest 1.5.0", + "proptest 1.6.0", "rayon", "rustc-demangle", "serde", @@ -8292,7 +8304,7 @@ dependencies = [ "ic-sha3 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "minicbor", "minicbor-derive", - "proptest 1.5.0", + "proptest 1.6.0", "serde", "serde_json", ] @@ -8361,7 +8373,7 @@ dependencies = [ "num-traits", "phantom_newtype", "prometheus", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "scoped_threadpool", "serde", @@ -8395,7 +8407,7 @@ dependencies = [ "anyhow", "assert_cmd", "assert_matches", - "clap 4.5.23", + "clap 4.5.26", "ic-crypto-test-utils-reproducible-rng", "ic-sys", "maplit", @@ -8448,9 +8460,9 @@ dependencies = [ "ic-metrics", "ic-test-utilities-logger", "prometheus", - "reqwest 0.12.9", + "reqwest 0.12.12", "slog", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tokio-io-timeout", "tower 0.5.2", @@ -8513,17 +8525,17 @@ dependencies = [ "ic-tracing", "ic-types", "ic-validator", - "inferno 0.12.0", + "inferno 0.12.1", "maplit", "mockall", "pretty_assertions", "prometheus", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", - "reqwest 0.12.9", + "reqwest 0.12.12", "rstest", - "rustls 0.23.20", + "rustls 0.23.21", "serde", "serde_bytes", "serde_cbor", @@ -8570,7 +8582,7 @@ dependencies = [ "maplit", "prometheus", "prost 0.13.4", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "serde_json", "slog", @@ -8595,7 +8607,7 @@ dependencies = [ "ic-agent", "ic-http-certification", "ic-response-verification", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "thiserror 1.0.69", ] @@ -8611,7 +8623,7 @@ dependencies = [ "ic-logger", "ic-test-utilities-in-memory-logger", "mockito", - "reqwest 0.12.9", + "reqwest 0.12.12", "slog", "tar", "tempfile", @@ -8626,7 +8638,7 @@ dependencies = [ "async-stream", "byte-unit", "bytes", - "clap 4.5.23", + "clap 4.5.26", "futures", "http 1.2.0", "http-body-util", @@ -8644,13 +8656,13 @@ dependencies = [ "prometheus", "rand 0.8.5", "rstest", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pemfile 2.2.0", "serde", "serde_json", "slog", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tokio-rustls 0.26.1", "tonic", @@ -8718,7 +8730,7 @@ dependencies = [ "ic-types", "mockall", "prometheus", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "slog", @@ -8784,7 +8796,7 @@ dependencies = [ "icrc-ledger-types", "num-bigint 0.4.6", "pocket-ic", - "reqwest 0.12.9", + "reqwest 0.12.12", "rosetta-core", "serde", "tempfile", @@ -8801,7 +8813,7 @@ dependencies = [ "ic-rosetta-test-utils", "icp-ledger", "pocket-ic", - "reqwest 0.12.9", + "reqwest 0.12.12", "tempfile", "tokio", ] @@ -8814,7 +8826,7 @@ dependencies = [ "axum", "candid", "ciborium", - "clap 4.5.23", + "clap 4.5.26", "futures", "hex", "ic-agent", @@ -8834,7 +8846,7 @@ dependencies = [ "ic-rosetta-test-utils", "ic-sys", "ic-test-utilities-load-wasm", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "icrc-ledger-agent", "icrc-ledger-types", "indicatif", @@ -8843,9 +8855,9 @@ dependencies = [ "num-traits", "once_cell", "pocket-ic", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", - "reqwest 0.12.9", + "reqwest 0.12.12", "rolling-file", "rosetta-core", "rusqlite", @@ -8871,7 +8883,7 @@ version = "0.1.0" dependencies = [ "anyhow", "candid", - "clap 4.5.23", + "clap 4.5.26", "hex", "ic-agent", "ic-crypto-ed25519", @@ -8882,7 +8894,7 @@ dependencies = [ "icrc-ledger-types", "num-bigint 0.4.6", "pocket-ic", - "reqwest 0.12.9", + "reqwest 0.12.12", "rosetta-core", "serde", "tokio", @@ -8897,7 +8909,7 @@ dependencies = [ "candid", "icrc-ledger-types", "pocket-ic", - "reqwest 0.12.9", + "reqwest 0.12.12", "tempfile", "tokio", ] @@ -8931,11 +8943,11 @@ dependencies = [ "leb128", "num-bigint 0.4.6", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "serde", "serde_bytes", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -8963,93 +8975,6 @@ dependencies = [ "serde", ] -[[package]] -name = "ic-icrc1-benchmark-generator" -version = "0.9.0" -dependencies = [ - "async-trait", - "candid", - "dfn_http_metrics", - "futures", - "getrandom", - "ic-base-types", - "ic-cdk 0.16.0", - "ic-cdk-macros 0.9.0", - "ic-icrc1-benchmark-worker", - "ic-icrc1-index", - "ic-ledger-core", - "ic-metrics-encoder", - "icrc-ledger-client-cdk", - "icrc-ledger-types", - "rand 0.8.5", - "rand_chacha 0.3.1", - "serde", - "serde_bytes", -] - -[[package]] -name = "ic-icrc1-benchmark-worker" -version = "0.9.0" -dependencies = [ - "async-trait", - "candid", - "ciborium", - "dfn_http_metrics", - "futures", - "getrandom", - "hex", - "ic-base-types", - "ic-cdk 0.16.0", - "ic-cdk-macros 0.9.0", - "ic-crypto-tree-hash", - "ic-icrc1", - "ic-ledger-canister-core", - "ic-ledger-core", - "ic-metrics-encoder", - "icrc-ledger-client", - "icrc-ledger-client-cdk", - "icrc-ledger-types", - "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", - "serde", - "serde_bytes", -] - -[[package]] -name = "ic-icrc1-index" -version = "0.9.0" -dependencies = [ - "assert_matches", - "async-trait", - "candid", - "candid_parser", - "ciborium", - "ic-base-types", - "ic-canister-profiler", - "ic-canisters-http-types", - "ic-cdk 0.16.0", - "ic-cdk-macros 0.9.0", - "ic-cdk-timers", - "ic-icrc1", - "ic-icrc1-ledger", - "ic-icrc1-tokens-u64", - "ic-ledger-canister-core", - "ic-ledger-core", - "ic-ledger-hash-of", - "ic-ledger-suite-state-machine-tests", - "ic-metrics-encoder", - "ic-rosetta-test-utils", - "ic-state-machine-tests", - "ic-test-utilities-load-wasm", - "icrc-ledger-types", - "num-traits", - "proptest 1.5.0", - "scopeguard", - "serde", - "serde_json", -] - [[package]] name = "ic-icrc1-index-ng" version = "0.9.0" @@ -9083,7 +9008,7 @@ dependencies = [ "ic-types", "icrc-ledger-types", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", "scopeguard", "serde", "serde_bytes", @@ -9128,7 +9053,7 @@ dependencies = [ "minicbor", "num-bigint 0.4.6", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", "serde", "serde_bytes", ] @@ -9148,7 +9073,7 @@ dependencies = [ "ic-types", "icrc-ledger-types", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "rosetta-core", @@ -9170,7 +9095,7 @@ dependencies = [ "minicbor", "num-bigint 0.4.6", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", "serde", ] @@ -9184,7 +9109,7 @@ dependencies = [ "ic-stable-structures", "minicbor", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", "serde", ] @@ -9234,7 +9159,7 @@ dependencies = [ "ic-validator", "pprof", "prometheus", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "slog", "tokio", @@ -9257,12 +9182,12 @@ dependencies = [ "ic-types", "ic-wasm-types", "phantom_newtype", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "serde", "strum", "strum_macros", - "thiserror 2.0.8", + "thiserror 2.0.11", "tower 0.5.2", ] @@ -9271,7 +9196,7 @@ name = "ic-interfaces-adapter-client" version = "0.9.0" dependencies = [ "strum_macros", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -9326,7 +9251,7 @@ dependencies = [ "ic-crypto-tree-hash", "ic-types", "phantom_newtype", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -9360,7 +9285,8 @@ dependencies = [ "ic-types", "icp-ledger", "on_wire", - "proptest 1.5.0", + "proptest 1.6.0", + "reqwest 0.12.12", "rusqlite", "serde", "tokio", @@ -9407,7 +9333,7 @@ dependencies = [ "ic-stable-structures", "minicbor", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", "serde", "serde_bytes", ] @@ -9454,7 +9380,7 @@ dependencies = [ "mockall", "num-traits", "paste", - "proptest 1.5.0", + "proptest 1.6.0", "scopeguard", "scraper", "serde", @@ -9482,7 +9408,7 @@ dependencies = [ "ic-universal-canister", "icrc-ledger-types", "paste", - "proptest 1.5.0", + "proptest 1.6.0", ] [[package]] @@ -9520,7 +9446,7 @@ dependencies = [ "icrc1-test-env", "icrc1-test-suite", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", ] [[package]] @@ -9585,7 +9511,7 @@ dependencies = [ "ic-types", "ic_consensus_system_test_utils", "icp-ledger", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "slog", "url", @@ -9599,11 +9525,11 @@ dependencies = [ "assert_matches", "candid", "candid_parser", - "clap 4.5.23", + "clap 4.5.26", "futures", "hex", "maplit", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "serde_json", "sha2 0.10.8", @@ -9716,7 +9642,7 @@ dependencies = [ "mockall", "pretty_assertions", "prometheus", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "random-traffic-test", @@ -9754,7 +9680,7 @@ name = "ic-metrics-tool" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", ] [[package]] @@ -9776,7 +9702,7 @@ dependencies = [ "pocket-ic", "serde", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", ] @@ -9858,8 +9784,8 @@ dependencies = [ "mockall", "num-traits", "priority-queue", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rust_decimal", "serde", "serde_bytes", @@ -10192,7 +10118,7 @@ dependencies = [ "assert_matches", "ic-nervous-system-common", "lazy_static", - "proptest 1.5.0", + "proptest 1.6.0", "rust_decimal", "rust_decimal_macros", "serde", @@ -10332,8 +10258,8 @@ dependencies = [ "on_wire", "pretty_assertions", "prometheus-parse", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "registry-canister", @@ -10537,7 +10463,7 @@ version = "0.9.0" dependencies = [ "candid", "canister-test", - "clap 4.5.23", + "clap 4.5.26", "ic-base-types", "ic-canister-client", "ic-interfaces-registry", @@ -10561,7 +10487,7 @@ dependencies = [ name = "ic-nns-inspector" version = "0.1.0" dependencies = [ - "clap 4.5.23", + "clap 4.5.26", "csv", "hex", "ic-base-types", @@ -10796,7 +10722,7 @@ dependencies = [ "quinn", "quinn-udp", "rcgen", - "rustls 0.23.20", + "rustls 0.23.21", "serde", "slog", "tempfile", @@ -10833,7 +10759,7 @@ dependencies = [ "pprof", "prost 0.12.6", "regex", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", ] @@ -10844,7 +10770,7 @@ dependencies = [ "anyhow", "assert_matches", "base64 0.13.1", - "clap 4.5.23", + "clap 4.5.26", "fs_extra", "ic-config", "ic-crypto-node-key-generation", @@ -10875,12 +10801,12 @@ dependencies = [ "pretty_assertions", "prost 0.13.4", "rand 0.8.5", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "serde_json", "slog", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "url", "x509-cert", ] @@ -10960,11 +10886,11 @@ dependencies = [ "prost 0.13.4", "quinn", "rstest", - "rustls 0.23.20", + "rustls 0.23.21", "slog", "socket2 0.5.8", "static_assertions", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tokio-metrics", "tokio-util", @@ -10992,7 +10918,7 @@ name = "ic-recovery" version = "0.9.0" dependencies = [ "base64 0.13.1", - "clap 4.5.23", + "clap 4.5.26", "futures", "hex", "ic-artifact-pool", @@ -11022,7 +10948,7 @@ dependencies = [ "ic-test-utilities-types", "ic-types", "prost 0.13.4", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "serde_cbor", "serde_json", @@ -11042,7 +10968,7 @@ version = "0.9.0" dependencies = [ "anyhow", "base64 0.13.1", - "clap 4.5.23", + "clap 4.5.26", "ic-base-types", "ic-crypto-sha2", "ic-crypto-utils-threshold-sig-der", @@ -11060,7 +10986,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "url", ] @@ -11072,7 +10998,7 @@ dependencies = [ "candid", "ic-base-types", "serde", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -11147,7 +11073,7 @@ dependencies = [ "ic-registry-subnet-features", "ic-types", "serde_cbor", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -11196,7 +11122,7 @@ dependencies = [ "ic-registry-transport", "ic-types", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "url", ] @@ -11269,7 +11195,7 @@ dependencies = [ "ic-registry-transport", "ic-sys", "ic-types", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -11284,7 +11210,7 @@ dependencies = [ name = "ic-registry-replicator" version = "0.9.0" dependencies = [ - "clap 4.5.23", + "clap 4.5.26", "ic-config", "ic-crypto-utils-threshold-sig-der", "ic-http-endpoints-metrics", @@ -11369,7 +11295,7 @@ name = "ic-replay" version = "0.9.0" dependencies = [ "candid", - "clap 4.5.23", + "clap 4.5.26", "hex", "ic-artifact-pool", "ic-canister-client", @@ -11423,7 +11349,7 @@ version = "0.9.0" dependencies = [ "assert_cmd", "canister-test", - "clap 4.5.23", + "clap 4.5.26", "criterion", "hex", "ic-artifact-pool", @@ -11618,8 +11544,8 @@ dependencies = [ "nix 0.24.3", "phantom_newtype", "prometheus", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "rayon", @@ -11679,7 +11605,7 @@ dependencies = [ "async-trait", "base64 0.13.1", "candid", - "clap 4.5.23", + "clap 4.5.26", "dfn_candid", "dfn_protobuf", "futures", @@ -11721,12 +11647,12 @@ dependencies = [ "on_wire", "pocket-ic", "prometheus", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "registry-canister", - "reqwest 0.12.9", + "reqwest 0.12.12", "rolling-file", "rosetta-core", "rusqlite", @@ -11759,7 +11685,7 @@ dependencies = [ "icp-ledger", "nix 0.24.3", "rand 0.8.5", - "reqwest 0.12.9", + "reqwest 0.12.12", "rosetta-core", "serde", "serde_bytes", @@ -11840,7 +11766,7 @@ dependencies = [ "serde", "serde_json", "textplots", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", ] @@ -11851,7 +11777,7 @@ dependencies = [ "anyhow", "base64 0.13.1", "candid", - "clap 4.5.23", + "clap 4.5.26", "futures", "hex", "ic-agent", @@ -11877,7 +11803,7 @@ dependencies = [ "serde_json", "serde_yaml", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", ] @@ -11893,7 +11819,7 @@ dependencies = [ "canbench-rs", "candid", "candid_parser", - "clap 4.5.23", + "clap 4.5.26", "comparable", "futures", "hex", @@ -11945,9 +11871,9 @@ dependencies = [ "maplit", "num-traits", "pretty_assertions", - "proptest 1.5.0", - "prost 0.13.3", - "prost-build 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", + "prost-build 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "rust_decimal", @@ -11968,7 +11894,7 @@ version = "0.9.0" dependencies = [ "bytes", "candid", - "clap 4.5.23", + "clap 4.5.26", "comparable", "ic-base-types", "ic-nervous-system-proto", @@ -12131,8 +12057,8 @@ dependencies = [ "on_wire", "pretty-bytes", "pretty_assertions", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", "rust_decimal", "rust_decimal_macros", @@ -12226,8 +12152,8 @@ dependencies = [ "lazy_static", "maplit", "pretty_assertions", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rust_decimal", "rust_decimal_macros", "serde", @@ -12383,7 +12309,7 @@ name = "ic-starter" version = "0.9.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "ic-config", "ic-logger", "ic-management-canister-types", @@ -12423,8 +12349,8 @@ dependencies = [ "itertools 0.12.1", "libc", "prometheus", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "scoped_threadpool", "slog", ] @@ -12435,7 +12361,7 @@ version = "0.9.0" dependencies = [ "candid", "ciborium", - "clap 4.5.23", + "clap 4.5.26", "hex", "ic-artifact-pool", "ic-base-types", @@ -12489,7 +12415,7 @@ dependencies = [ "ic-universal-canister", "ic-xnet-payload-builder", "maplit", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "rcgen", "serde", @@ -12555,8 +12481,8 @@ dependencies = [ "nix 0.24.3", "parking_lot 0.12.3", "prometheus", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "scoped_threadpool", @@ -12595,7 +12521,7 @@ dependencies = [ "prost 0.13.4", "rand 0.8.5", "slog", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tokio-metrics", "tokio-util", @@ -12607,7 +12533,7 @@ dependencies = [ name = "ic-state-tool" version = "0.9.0" dependencies = [ - "clap 4.5.23", + "clap 4.5.26", "hex", "ic-config", "ic-logger", @@ -12631,7 +12557,7 @@ dependencies = [ name = "ic-subnet-splitting" version = "0.9.0" dependencies = [ - "clap 4.5.23", + "clap 4.5.26", "hex", "ic-agent", "ic-base-types", @@ -12670,7 +12596,7 @@ dependencies = [ "prost 0.13.4", "rand 0.8.5", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "wsl", ] @@ -12727,7 +12653,7 @@ dependencies = [ "candid", "canister-test", "chrono", - "clap 4.5.23", + "clap 4.5.26", "config_types", "crossbeam-channel", "cycles-minting-canister", @@ -12805,7 +12731,7 @@ dependencies = [ "ic-types", "ic-types-test-utils", "ic-universal-canister", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "ic-wasm-types", "icp-ledger", "icrc-ledger-types", @@ -12825,15 +12751,15 @@ dependencies = [ "once_cell", "pem 1.1.1", "phantom_newtype", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "rayon", "rcgen", "regex", "registry-canister", - "reqwest 0.12.9", + "reqwest 0.12.12", "ring 0.17.8", "rosetta-core", "rsa", @@ -12851,7 +12777,7 @@ dependencies = [ "strum", "strum_macros", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "time", "tokio", "tokio-util", @@ -13129,7 +13055,7 @@ dependencies = [ "ic-types", "ic-wasm-types", "mockall", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", "rand_chacha 0.3.1", "strum", @@ -13240,7 +13166,7 @@ dependencies = [ "ic_consensus_system_test_utils", "ic_consensus_threshold_sig_system_test_utils", "icrc-ledger-types", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde_json", "slog", ] @@ -13293,7 +13219,7 @@ dependencies = [ "serde_cbor", "serde_repr", "sha2 0.10.8", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -13327,7 +13253,7 @@ dependencies = [ "once_cell", "phantom_newtype", "pretty_assertions", - "proptest 1.5.0", + "proptest 1.6.0", "proptest-derive", "prost 0.13.4", "rand 0.8.5", @@ -13340,7 +13266,7 @@ dependencies = [ "serde_with 1.14.0", "strum", "strum_macros", - "thiserror 2.0.8", + "thiserror 2.0.11", "thousands", ] @@ -13350,7 +13276,7 @@ version = "0.9.0" dependencies = [ "ic-protobuf", "ic-types", - "proptest 1.5.0", + "proptest 1.6.0", "strum", ] @@ -13381,9 +13307,9 @@ dependencies = [ [[package]] name = "ic-utils" -version = "0.39.0" +version = "0.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1da4a68c45146018b8496c157ad94126b9c202ab4400c6c0a9030c1ef0f0ba" +checksum = "e1fb9c35ef4976a71d37f3ebf73ee43bb52b360be60d91d3a77f74fbc875dda4" dependencies = [ "async-trait", "candid", @@ -13396,7 +13322,7 @@ dependencies = [ "sha2 0.10.8", "strum", "strum_macros", - "thiserror 1.0.69", + "thiserror 2.0.11", "time", "tokio", ] @@ -13411,7 +13337,7 @@ version = "0.9.0" dependencies = [ "ic-types", "lru", - "proptest", + "proptest 1.6.0", ] [[package]] @@ -13460,7 +13386,7 @@ dependencies = [ "ic-types", "mockall", "rand 0.8.5", - "thiserror 2.0.8", + "thiserror 2.0.11", ] [[package]] @@ -13592,7 +13518,7 @@ checksum = "19fabaeecfe37f24b433c62489242fc54503d98d4cc8d0f9ef7544dfdfc0ddcb" dependencies = [ "anyhow", "candid", - "clap 4.5.23", + "clap 4.5.26", "libflate", "rustc-demangle", "serde", @@ -13632,7 +13558,7 @@ dependencies = [ "byte-unit", "candid", "chrono", - "clap 4.5.23", + "clap 4.5.26", "console 0.11.3", "futures", "hex", @@ -13722,12 +13648,12 @@ dependencies = [ "mockall", "nix 0.24.3", "prometheus", - "proptest 1.5.0", + "proptest 1.6.0", "rand 0.8.5", - "reqwest 0.12.9", + "reqwest 0.12.12", "slog", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "url", ] @@ -13877,7 +13803,7 @@ dependencies = [ "prost 0.13.4", "rand 0.8.5", "registry-canister", - "reqwest 0.12.9", + "reqwest 0.12.12", "rsa", "serde_json", "slog", @@ -13916,7 +13842,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "registry-canister", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde_cbor", "serde_json", "slog", @@ -13974,7 +13900,7 @@ dependencies = [ "ic_consensus_system_test_utils", "k256", "rand 0.8.5", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde_bytes", "serde_cbor", "slog", @@ -13999,7 +13925,7 @@ dependencies = [ name = "icp-config" version = "0.9.0" dependencies = [ - "clap 4.5.23", + "clap 4.5.26", "eyre", "ic-config", "ic-replicated-state", @@ -14044,8 +13970,8 @@ dependencies = [ "maplit", "on_wire", "pocket-ic", - "proptest 1.5.0", - "prost 0.13.3", + "proptest 1.6.0", + "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "serde", @@ -14090,7 +14016,7 @@ dependencies = [ "minicbor", "num-bigint 0.4.6", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", ] [[package]] @@ -14142,7 +14068,7 @@ dependencies = [ "minicbor", "num-bigint 0.4.6", "num-traits", - "proptest 1.5.0", + "proptest 1.6.0", "serde", "serde_bytes", "sha2 0.10.8", @@ -14289,7 +14215,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -14351,9 +14277,9 @@ dependencies = [ [[package]] name = "impl-more" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae21c3177a27788957044151cc2800043d127acaa460a47ebb9b84dfa2c6aa0" +checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" [[package]] name = "impl-rlp" @@ -14381,7 +14307,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -14451,12 +14377,12 @@ dependencies = [ [[package]] name = "inferno" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a5d75fee4d36809e6b021e4b96b686e763d365ffdb03af2bd00786353f84fe" +checksum = "692eda1cc790750b9f5a5e3921ef9c117fd5498b97cfacbc910693e5b29002dc" dependencies = [ "ahash 0.8.11", - "clap 4.5.23", + "clap 4.5.26", "crossbeam-channel", "crossbeam-utils", "dashmap 6.1.0", @@ -14466,7 +14392,7 @@ dependencies = [ "log", "num-format", "once_cell", - "quick-xml 0.37.1", + "quick-xml 0.37.2", "rgb", "str_stack", ] @@ -14476,7 +14402,7 @@ name = "inject-files" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "partition_tools", "tempfile", "tokio", @@ -14493,13 +14419,13 @@ dependencies = [ [[package]] name = "insta" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9ffc4d4892617c50a928c52b2961cb5174b6fc6ebf252b2fac9d21955c48b8" +checksum = "6513e4067e16e69ed1db5ab56048ed65db32d10ba5fc1217f5393f8f17d8b5a5" dependencies = [ "console 0.15.10", - "lazy_static", "linked-hash-map", + "once_cell", "similar", ] @@ -14673,9 +14599,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -14812,7 +14738,7 @@ dependencies = [ "k8s-openapi", "kube-core", "pem 3.0.4", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pemfile 2.2.0", "secrecy", "serde", @@ -14928,12 +14854,12 @@ checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" name = "launch-single-vm" version = "0.1.0" dependencies = [ - "clap 4.5.23", + "clap 4.5.26", "ic-prep", "ic-registry-subnet-type", "ic-system-test-driver", "ic-types", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "slog", "slog-async", @@ -15026,7 +14952,7 @@ dependencies = [ "minicbor", "num-traits", "on_wire", - "proptest 1.5.0", + "proptest 1.6.0", "serde", "serde_bytes", "serde_cbor", @@ -15167,7 +15093,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "libc", "redox_syscall 0.5.8", ] @@ -15225,9 +15151,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.20" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" dependencies = [ "cc", "libc", @@ -15259,9 +15185,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux_kernel_command_line" @@ -15386,7 +15312,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -15412,6 +15338,19 @@ dependencies = [ "logos-codegen", ] +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if 1.0.0", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lru" version = "0.7.8" @@ -15599,7 +15538,7 @@ dependencies = [ "lazy_static", "libc", "nix 0.24.3", - "proptest 1.5.0", + "proptest 1.6.0", "slog", "tempfile", ] @@ -15636,7 +15575,7 @@ dependencies = [ "ic-registry-subnet-type", "ic-system-test-driver", "ic-types", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "itertools 0.12.1", "rand 0.8.5", "rand_chacha 0.3.1", @@ -15706,9 +15645,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", ] @@ -15777,7 +15716,7 @@ dependencies = [ "cfg-if 1.0.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -15806,25 +15745,23 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.8" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" dependencies = [ "async-lock", - "async-trait", "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", - "event-listener 5.3.1", + "event-listener 5.4.0", "futures-util", - "once_cell", + "loom", "parking_lot 0.12.3", - "quanta", + "portable-atomic", "rustc_version", "smallvec", "tagptr", "thiserror 1.0.69", - "triomphe", "uuid", ] @@ -15961,12 +15898,12 @@ dependencies = [ "ic-test-utilities", "ic-test-utilities-types", "ic-types", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "proxy_canister", "rand 0.8.5", "rand_chacha 0.3.1", "registry-canister", - "reqwest 0.12.9", + "reqwest 0.12.12", "slog", "tokio", "url", @@ -15983,7 +15920,7 @@ name = "nft_exporter" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "serde", "serde_json", ] @@ -16031,7 +15968,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if 1.0.0", "libc", "memoffset 0.9.1", @@ -16043,7 +15980,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if 1.0.0", "cfg_aliases", "libc", @@ -16093,7 +16030,7 @@ dependencies = [ "on_wire", "prost 0.13.4", "registry-canister", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde_cbor", "slog", "tokio", @@ -16322,7 +16259,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -16342,9 +16279,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "crc32fast", "hashbrown 0.15.2", @@ -16614,7 +16551,7 @@ dependencies = [ "async-trait", "backoff", "candid", - "clap 4.5.23", + "clap 4.5.26", "env-file-reader", "exec", "get_if_addrs", @@ -16724,7 +16661,7 @@ dependencies = [ "ic-types", "ic_consensus_system_test_utils", "itertools 0.12.1", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "slog", "tokio", @@ -16950,7 +16887,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.8", + "thiserror 2.0.11", "ucd-trie", ] @@ -16974,7 +16911,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -17030,12 +16967,12 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", - "phf_shared 0.11.2", + "phf_shared 0.11.3", ] [[package]] @@ -17060,25 +16997,25 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "phf_shared 0.11.2", + "phf_shared 0.11.3", "rand 0.8.5", ] [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ - "phf_generator 0.11.2", - "phf_shared 0.11.2", + "phf_generator 0.11.3", + "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -17087,16 +17024,16 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" dependencies = [ - "siphasher", + "siphasher 0.3.11", ] [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ - "siphasher", + "siphasher 1.0.1", ] [[package]] @@ -17107,29 +17044,29 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -17242,7 +17179,7 @@ dependencies = [ "ic-transport-types", "k256", "lazy_static", - "reqwest 0.12.9", + "reqwest 0.12.12", "schemars", "serde", "serde_bytes", @@ -17252,7 +17189,7 @@ dependencies = [ "slog", "strum", "strum_macros", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tracing", "tracing-appender", @@ -17277,7 +17214,7 @@ dependencies = [ "bitcoincore-rpc", "bytes", "candid", - "clap 4.5.23", + "clap 4.5.26", "ctrlc", "flate2", "form_urlencoded", @@ -17326,7 +17263,7 @@ dependencies = [ "ic-test-utilities", "ic-test-utilities-registry", "ic-types", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "ic-utils-thread", "ic-validator-ingress-message", "itertools 0.12.1", @@ -17335,7 +17272,7 @@ dependencies = [ "rand 0.8.5", "rcgen", "registry-canister", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "serde_cbor", "serde_json", @@ -17531,12 +17468,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -17614,9 +17551,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -17641,7 +17578,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "hex", "lazy_static", "procfs-core", @@ -17654,7 +17591,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "hex", ] @@ -17693,7 +17630,7 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01c477819b845fe023d33583ebf10c9f62518c8d79a0960ba5c36d6ac8a55a5b" dependencies = [ - "bit-set", + "bit-set 0.5.3", "bitflags 1.3.2", "byteorder", "lazy_static", @@ -17709,13 +17646,13 @@ dependencies = [ [[package]] name = "proptest" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ - "bit-set", - "bit-vec", - "bitflags 2.6.0", + "bit-set 0.8.0", + "bit-vec 0.8.0", + "bitflags 2.7.0", "lazy_static", "num-traits", "rand 0.8.5", @@ -17735,7 +17672,7 @@ checksum = "4ee1c9ac207483d5e7db4940700de86a9aae46ef90c48b57f99fe7edb8345e49" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -17775,7 +17712,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.90", + "syn 2.0.96", "tempfile", ] @@ -17795,7 +17732,7 @@ dependencies = [ "prost 0.13.4", "prost-types 0.13.4", "regex", - "syn 2.0.90", + "syn 2.0.96", "tempfile", ] @@ -17809,7 +17746,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -17822,7 +17759,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -17918,9 +17855,9 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773ce68d0bb9bc7ef20be3536ffe94e223e1f365bd374108b2659fac0c65cfe6" +checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" dependencies = [ "crossbeam-utils", "libc", @@ -17948,9 +17885,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.37.1" +version = "0.37.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22f29bdff3987b4d8632ef95fd6424ec7e4e0a57e2f4fc63e489e75357f6a03" +checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" dependencies = [ "memchr", ] @@ -17966,9 +17903,9 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.1.0", - "rustls 0.23.20", + "rustls 0.23.21", "socket2 0.5.8", - "thiserror 2.0.8", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -17984,10 +17921,10 @@ dependencies = [ "rand 0.8.5", "ring 0.17.8", "rustc-hash 2.1.0", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pki-types", "slab", - "thiserror 2.0.8", + "thiserror 2.0.11", "tinyvec", "tracing", "web-time", @@ -18009,9 +17946,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -18233,7 +18170,7 @@ version = "0.9.0" dependencies = [ "anyhow", "candid", - "clap 4.5.23", + "clap 4.5.26", "ic-agent", "k256", "rate-limits-api", @@ -18287,7 +18224,7 @@ dependencies = [ "serde_cbor", "serde_json", "strum", - "thiserror 2.0.8", + "thiserror 2.0.11", "uuid", ] @@ -18304,11 +18241,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.2.0" +version = "11.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +checksum = "c6928fa44c097620b706542d428957635951bade7143269085389d42c8a4927e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -18333,9 +18270,9 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" +checksum = "75e669e5202259b5314d1ea5397316ad400819437857b90861765f24c4cf80a2" dependencies = [ "pem 3.0.4", "ring 0.17.8", @@ -18369,7 +18306,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -18609,9 +18546,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.9" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64 0.22.1", "bytes", @@ -18635,7 +18572,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-native-certs 0.8.1", "rustls-pemfile 2.2.0", "rustls-pki-types", @@ -18647,6 +18584,7 @@ dependencies = [ "tokio-rustls 0.26.1", "tokio-socks", "tokio-util", + "tower 0.5.2", "tower-service", "url", "wasm-bindgen", @@ -18835,7 +18773,7 @@ dependencies = [ "icp-ledger", "icrc-ledger-types", "num-bigint 0.4.6", - "proptest 1.5.0", + "proptest 1.6.0", "serde", "serde_bytes", "serde_json", @@ -18904,7 +18842,7 @@ dependencies = [ "on_wire", "prost 0.13.4", "rand 0.8.5", - "reqwest 0.12.9", + "reqwest 0.12.12", "rosetta-core", "serde", "serde_json", @@ -18959,7 +18897,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.90", + "syn 2.0.96", "unicode-ident", ] @@ -19082,11 +19020,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "errno 0.3.10", "libc", "linux-raw-sys", @@ -19121,9 +19059,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "brotli 7.0.0", "brotli-decompressor", @@ -19157,7 +19095,7 @@ dependencies = [ "ring 0.17.8", "serde", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.11", "webpki-roots 0.26.7", "x509-parser", ] @@ -19184,7 +19122,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.1.0", + "security-framework 3.2.0", ] [[package]] @@ -19225,7 +19163,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", @@ -19264,9 +19202,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "rusty-fork" @@ -19328,7 +19266,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -19362,7 +19300,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -19421,7 +19359,7 @@ dependencies = [ "ic-system-test-driver", "ic_consensus_system_test_utils", "nns_dapp", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde_json", "slog", ] @@ -19523,7 +19461,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -19533,11 +19471,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d3f8c9bfcc3cbb6b0179eb57042d75b1582bdc65c3cb95f3fa999509c03cbc" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -19546,9 +19484,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -19560,7 +19498,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb30575f3638fc8f6815f448d50cb1a2e255b0897985c8c59f4d37b72a07b06" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cssparser", "derive_more 0.99.18", "fxhash", @@ -19584,9 +19522,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -19644,13 +19582,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -19661,14 +19599,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa", "memchr", @@ -19717,7 +19655,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -19740,7 +19678,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -19802,7 +19740,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -19832,7 +19770,7 @@ name = "setupos-disable-checks" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "indoc", "linux_kernel_command_line", "partition_tools", @@ -19846,7 +19784,7 @@ name = "setupos-inject-configuration" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "config", "partition_tools", "serde", @@ -19862,7 +19800,7 @@ name = "setupos_tool" version = "1.0.0" dependencies = [ "anyhow", - "clap 4.5.23", + "clap 4.5.26", "config", "config_types", "deterministic_ips", @@ -19984,13 +19922,13 @@ checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "simple_asn1" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ "num-bigint 0.4.6", "num-traits", - "thiserror 1.0.69", + "thiserror 2.0.11", "time", ] @@ -20020,6 +19958,12 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "slab" version = "0.4.9" @@ -20149,7 +20093,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -20177,7 +20121,7 @@ dependencies = [ "ic-system-test-driver", "ic-types", "ic-universal-canister", - "ic-utils 0.39.0", + "ic-utils 0.39.2", "ic_consensus_system_test_utils", "icp-ledger", "icrc-ledger-agent", @@ -20235,7 +20179,7 @@ dependencies = [ "ic-registry-subnet-type", "ic-system-test-driver", "ic-types", - "reqwest 0.12.9", + "reqwest 0.12.12", "slog", ] @@ -20415,7 +20359,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive 0.2.0", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -20427,7 +20371,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive 0.3.0", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -20438,7 +20382,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -20449,7 +20393,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -20471,7 +20415,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -20499,9 +20443,9 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "symbolic-common" -version = "12.12.4" +version = "12.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd33e73f154e36ec223c18013f7064a2c120f1162fc086ac9933542def186b00" +checksum = "bf08b42a6f9469bd8584daee39a1352c8133ccabc5151ccccb15896ef047d99a" dependencies = [ "debugid", "memmap2", @@ -20511,9 +20455,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.12.4" +version = "12.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e51191290147f071777e37fe111800bb82a9059f9c95b19d2dd41bfeddf477" +checksum = "32f73b5a5bd4da72720c45756a2d11edf110116b87f998bda59b97be8c2c7cf1" dependencies = [ "rustc-demangle", "symbolic-common", @@ -20532,9 +20476,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -20586,7 +20530,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -20617,11 +20561,11 @@ dependencies = [ "anyhow", "async-trait", "axum", - "clap 4.5.23", + "clap 4.5.26", "http 1.2.0", "itertools 0.12.1", - "reqwest 0.12.9", - "thiserror 2.0.8", + "reqwest 0.12.12", + "thiserror 2.0.11", "tokio", "url", ] @@ -20726,12 +20670,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if 1.0.0", "fastrand", + "getrandom", "once_cell", "rustix", "windows-sys 0.59.0", @@ -20802,7 +20747,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta 0.2.0", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -20814,7 +20759,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta 0.3.0", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -20854,7 +20799,7 @@ dependencies = [ "ic_consensus_system_test_utils", "nns_dapp", "os_qualification_utils", - "reqwest 0.12.9", + "reqwest 0.12.12", "serde", "serde_json", "slog", @@ -20889,11 +20834,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.8" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.8", + "thiserror-impl 2.0.11", ] [[package]] @@ -20904,18 +20849,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "thiserror-impl" -version = "2.0.8" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -21038,9 +20983,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -21091,14 +21036,14 @@ checksum = "8d9ef545650e79f30233c0003bcc2504d7efac6dad25fca40744de773fe2049c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -21124,13 +21069,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -21172,7 +21117,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.20", + "rustls 0.23.21", "tokio", ] @@ -21315,7 +21260,7 @@ dependencies = [ "prost-build 0.13.4", "prost-types 0.13.4", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -21365,7 +21310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "base64 0.21.7", - "bitflags 2.6.0", + "bitflags 2.7.0", "bytes", "http 1.2.0", "http-body 1.0.1", @@ -21384,7 +21329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "async-compression", - "bitflags 2.6.0", + "bitflags 2.7.0", "bytes", "futures-core", "http 1.2.0", @@ -21486,7 +21431,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -21612,7 +21557,7 @@ dependencies = [ "ic-crypto-tree-hash", "leb128", "maplit", - "proptest 1.5.0", + "proptest 1.6.0", "proptest-derive", "serde", ] @@ -21626,12 +21571,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "triomphe" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" - [[package]] name = "trust-dns-proto" version = "0.22.0" @@ -21754,11 +21693,10 @@ dependencies = [ [[package]] name = "ulid" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f903f293d11f31c0c29e4148f6dc0d033a7f80cebc0282bea147611667d289" +checksum = "f294bff79170ed1c5633812aff1e565c35d993a36e757f9bc0accf5eec4e6045" dependencies = [ - "getrandom", "rand 0.8.5", "web-time", ] @@ -21771,9 +21709,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicase" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-bidi" @@ -21925,9 +21863,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4" dependencies = [ "getrandom", "serde", @@ -21984,7 +21922,7 @@ dependencies = [ name = "vsock_guest" version = "1.0.0" dependencies = [ - "clap 4.5.23", + "clap 4.5.26", "vsock_lib", ] @@ -22001,7 +21939,7 @@ version = "1.0.0" dependencies = [ "anyhow", "regex", - "reqwest 0.12.9", + "reqwest 0.12.12", "rusb", "serde", "serde_json", @@ -22113,34 +22051,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if 1.0.0", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.49" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -22151,9 +22090,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -22161,22 +22100,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-encoder" @@ -22209,12 +22151,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.222.0" +version = "0.223.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3432682105d7e994565ef928ccf5856cf6af4ba3dddebedb737f61caed70f956" +checksum = "7e636076193fa68103e937ac951b5f2f587624097017d764b8984d9c0f149464" dependencies = [ "leb128", - "wasmparser 0.222.0", + "wasmparser 0.223.0", ] [[package]] @@ -22237,7 +22179,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d28bc49ba1e5c5b61ffa7a2eace10820443c4b7d1c0b144109261d14570fdf8" dependencies = [ "ahash 0.8.11", - "bitflags 2.6.0", + "bitflags 2.7.0", "hashbrown 0.14.5", "indexmap 2.7.0", "semver", @@ -22251,7 +22193,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca917a21307d3adf2b9857b94dd05ebf8496bdcff4437a9b9fb3899d3e6c74e7" dependencies = [ "ahash 0.8.11", - "bitflags 2.6.0", + "bitflags 2.7.0", "hashbrown 0.14.5", "indexmap 2.7.0", "semver", @@ -22264,7 +22206,7 @@ version = "0.221.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9845c470a2e10b61dd42c385839cdd6496363ed63b5c9e420b5488b77bd22083" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "hashbrown 0.15.2", "indexmap 2.7.0", "semver", @@ -22273,11 +22215,11 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.222.0" +version = "0.223.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4adf50fde1b1a49c1add6a80d47aea500c88db70551805853aa8b88f3ea27ab5" +checksum = "d5a99faceb1a5a84dd6084ec4bfa4b2ab153b5793b43fd8f58b89232634afc35" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "indexmap 2.7.0", "semver", ] @@ -22311,7 +22253,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f639ecae347b9a2227e453a7b7671e84370a0b61f47a15e0390fe9b7725e47b3" dependencies = [ "anyhow", - "bitflags 2.6.0", + "bitflags 2.7.0", "bumpalo", "cc", "cfg-if 1.0.0", @@ -22366,7 +22308,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -22467,7 +22409,7 @@ checksum = "d7de0a56fb0a69b185968f2d7a9ba54750920a806470dff7ad8de91ac06d277e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -22514,31 +22456,31 @@ dependencies = [ [[package]] name = "wast" -version = "222.0.0" +version = "223.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce7191f4b7da0dd300cc32476abae6457154e4625d9b1bc26890828a9a26f6e" +checksum = "d59b2ba8a2ff9f06194b7be9524f92e45e70149f4dacc0d0c7ad92b59ac875e4" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width 0.2.0", - "wasm-encoder 0.222.0", + "wasm-encoder 0.223.0", ] [[package]] name = "wat" -version = "1.222.0" +version = "1.223.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fde61b4b52f9a84ae31b5e8902a2cd3162ea45d8bf564c729c3288fe52f4334" +checksum = "662786915c427e4918ff01eabb3c4756d4d947cd8f635761526b4cc9da2eaaad" dependencies = [ - "wast 222.0.0", + "wast 223.0.0", ] [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -22674,6 +22616,16 @@ dependencies = [ "wasmtime-environ", ] +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -22683,6 +22635,41 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -22863,9 +22850,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] @@ -22981,9 +22968,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ "libc", "linux-raw-sys", @@ -23080,7 +23067,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure", ] @@ -23102,7 +23089,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -23122,7 +23109,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure", ] @@ -23143,7 +23130,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -23165,7 +23152,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] From 335d3fab5d26929231a68e556cb936a14714bc87 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Tue, 14 Jan 2025 12:14:41 +0000 Subject: [PATCH 35/50] cargo lock --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69371d8a3d3..4671a8586bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15279,9 +15279,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "logos" @@ -21863,9 +21863,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4" +checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" dependencies = [ "getrandom", "serde", From dd4211a82dd64e70fbeea3b3d2110cba3ffe12da Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Tue, 14 Jan 2025 12:17:42 +0000 Subject: [PATCH 36/50] remove todo --- rs/tests/ckbtc/ckbtc_minter_batching.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/rs/tests/ckbtc/ckbtc_minter_batching.rs b/rs/tests/ckbtc/ckbtc_minter_batching.rs index d9954d32b4e..9f439bf2358 100644 --- a/rs/tests/ckbtc/ckbtc_minter_batching.rs +++ b/rs/tests/ckbtc/ckbtc_minter_batching.rs @@ -243,7 +243,6 @@ pub fn test_batching(env: TestEnv) { .await; // Let's wait for the transaction to appear on the mempool - //TODO(mihailjianu): revisit the usefulness of this check. let mempool_txids = wait_for_mempool_change(&btc_rpc, &logger).await; let txid = mempool_txids[0]; let btc_txid = Txid::from_raw_hash(Hash::from_slice(&txid[..]).unwrap()); From 178215871530514ab754c79f0b54c77ab5361b1a Mon Sep 17 00:00:00 2001 From: IDX GitHub Automation Date: Tue, 14 Jan 2025 12:52:27 +0000 Subject: [PATCH 37/50] Automatically updated Cargo*.lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 63a1c752830..e2926b76d6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17168,7 +17168,7 @@ version = "6.0.0" dependencies = [ "backoff", "base64 0.13.1", - "bitcoin 0.28.2", + "bitcoin 0.32.5", "candid", "candid_parser", "ed25519-dalek", From c1020ce1c60d8f98b91d46e3b761397169e9e05a Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Tue, 14 Jan 2025 13:08:23 +0000 Subject: [PATCH 38/50] bring pocket_idc testing back to .28 for now. --- Cargo.lock | 2 +- packages/pocket-ic/BUILD.bazel | 3 ++- packages/pocket-ic/Cargo.toml | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e2926b76d6d..63a1c752830 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17168,7 +17168,7 @@ version = "6.0.0" dependencies = [ "backoff", "base64 0.13.1", - "bitcoin 0.32.5", + "bitcoin 0.28.2", "candid", "candid_parser", "ed25519-dalek", diff --git a/packages/pocket-ic/BUILD.bazel b/packages/pocket-ic/BUILD.bazel index 57e445d9270..1488350e884 100644 --- a/packages/pocket-ic/BUILD.bazel +++ b/packages/pocket-ic/BUILD.bazel @@ -33,7 +33,8 @@ MACRO_DEPENDENCIES = [ TEST_DEPENDENCIES = [ # Keep sorted. "//rs/types/error_types", - "@crate_index//:bitcoin", + #TODO: try upgrading this to the latest bitcion crate + "@crate_index//:bitcoin_0_28", "@crate_index//:candid_parser", "@crate_index//:ed25519-dalek", "@crate_index//:flate2", diff --git a/packages/pocket-ic/Cargo.toml b/packages/pocket-ic/Cargo.toml index fbf1a1555bf..2f607c8ed66 100644 --- a/packages/pocket-ic/Cargo.toml +++ b/packages/pocket-ic/Cargo.toml @@ -46,7 +46,8 @@ tracing-subscriber = { workspace = true } wslpath = "0.0.2" [dev-dependencies] -bitcoin = { workspace = true } +#TODO: try upgrading this to the latest bitcion crate +bitcoin = { version = "0.28.2" } candid_parser = { workspace = true } ed25519-dalek = { workspace = true } flate2 = { workspace = true } From 0bab1d04d8a6d94712c1ea5f6f448c35c85d81af Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Tue, 14 Jan 2025 13:34:03 +0000 Subject: [PATCH 39/50] bazel lock --- Cargo.Bazel.json.lock | 113 +----------------------------------------- 1 file changed, 1 insertion(+), 112 deletions(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 53cde42bc4a..962fd29ed4e 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "f21e594e63e06dc65bcf1c283fbec2dbcb34fad4478d5a09b8077fb908613bf9", + "checksum": "4c6e999e0d04eed4610e0b4a09e4f72db9b9ad8b7c8d0ca9c9f2db557d7f1c9d", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -53683,12 +53683,6 @@ "target": "libc" } ], - "aarch64-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "aarch64-unknown-linux-gnu": [ { "id": "libc 0.2.158", @@ -53737,12 +53731,6 @@ "target": "libc" } ], - "i686-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "i686-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -53791,12 +53779,6 @@ "target": "libc" } ], - "x86_64-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -60766,11 +60748,6 @@ "time", "use-libc-auxv" ], - "aarch64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "aarch64-unknown-linux-gnu": [ "default", "event", @@ -60863,11 +60840,6 @@ "time", "use-libc-auxv" ], - "i686-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "i686-unknown-freebsd": [ "default", "event", @@ -60982,11 +60954,6 @@ "time", "use-libc-auxv" ], - "x86_64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "x86_64-unknown-freebsd": [ "default", "event", @@ -61102,32 +61069,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "aarch64-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "aarch64-unknown-nixos-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "aarch64-unknown-nto-qnx710": [ @@ -61141,17 +61082,6 @@ "target": "libc" } ], - "arm-unknown-linux-gnueabi": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "armv7-linux-androideabi": [ { "id": "errno 0.3.8", @@ -61224,10 +61154,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "i686-unknown-freebsd": [ @@ -61241,17 +61167,6 @@ "target": "libc" } ], - "i686-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "powerpc-unknown-linux-gnu": [ { "id": "errno 0.3.8", @@ -61389,10 +61304,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "x86_64-unknown-freebsd": [ @@ -61406,28 +61317,6 @@ "target": "libc" } ], - "x86_64-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "x86_64-unknown-nixos-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "x86_64-unknown-none": [ { "id": "errno 0.3.8", From 4b58754c366ffc798ed7ff5eb618d0e6a24522ae Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Tue, 14 Jan 2025 14:13:25 +0000 Subject: [PATCH 40/50] fuzzing lock --- Cargo.Bazel.Fuzzing.json.lock | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Cargo.Bazel.Fuzzing.json.lock b/Cargo.Bazel.Fuzzing.json.lock index c45fde1e16d..13a29d9d5cf 100644 --- a/Cargo.Bazel.Fuzzing.json.lock +++ b/Cargo.Bazel.Fuzzing.json.lock @@ -1,5 +1,5 @@ { - "checksum": "2c2d6f7eab72d46e93f2b998562f0f29dd67a0c847253063fa67916eb3fa1abb", + "checksum": "99f4f52ce63a30622e2c70091876a5090aa4e58dad64f5f6d1b5fab793d76d97", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -6379,7 +6379,6 @@ "target": "clang_sys" }, { - "id": "itertools 0.12.0", "id": "itertools 0.12.0", "target": "itertools" }, @@ -7095,7 +7094,7 @@ "target": "secp256k1" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde", "alias": "actual_serde" } @@ -7197,7 +7196,7 @@ "target": "build_script_build" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" } ], @@ -7385,7 +7384,7 @@ "alias": "internals" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" } ], @@ -7565,7 +7564,7 @@ "alias": "hex" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" } ], @@ -36260,7 +36259,7 @@ "target": "minreq" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" }, { @@ -41791,7 +41790,7 @@ "target": "build_script_build" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" }, { @@ -52205,7 +52204,6 @@ "target": "heck" }, { - "id": "itertools 0.12.0", "id": "itertools 0.12.0", "target": "itertools" }, @@ -52360,7 +52358,6 @@ "target": "anyhow" }, { - "id": "itertools 0.12.0", "id": "itertools 0.12.0", "target": "itertools" }, @@ -63765,7 +63762,7 @@ "target": "secp256k1_sys" }, { - "id": "serde 1.0.214", + "id": "serde 1.0.217", "target": "serde" } ], From f695b5a3fcae4fd81ad9f37be97fb59adf03de14 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Wed, 15 Jan 2025 15:55:53 +0000 Subject: [PATCH 41/50] remove secp --- Cargo.Bazel.Fuzzing.json.lock | 121 ++++++++++++++++-- Cargo.Bazel.Fuzzing.toml.lock | 1 - Cargo.Bazel.json.lock | 121 ++++++++++++++++-- Cargo.Bazel.toml.lock | 1 - bazel/external_crates.bzl | 8 -- .../test_utils/BUILD.bazel | 2 +- 6 files changed, 225 insertions(+), 29 deletions(-) diff --git a/Cargo.Bazel.Fuzzing.json.lock b/Cargo.Bazel.Fuzzing.json.lock index 13a29d9d5cf..d00db5e771c 100644 --- a/Cargo.Bazel.Fuzzing.json.lock +++ b/Cargo.Bazel.Fuzzing.json.lock @@ -1,5 +1,5 @@ { - "checksum": "99f4f52ce63a30622e2c70091876a5090aa4e58dad64f5f6d1b5fab793d76d97", + "checksum": "e3c190879652106d58b888264639c221595402cdb35b106b2676c636c4dfebb7", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -19331,11 +19331,6 @@ }, { "id": "secp256k1 0.22.2", - "target": "secp256k1", - "alias": "secp256k1_0_22" - }, - { - "id": "secp256k1 0.29.0", "target": "secp256k1" }, { @@ -53881,6 +53876,12 @@ "target": "libc" } ], + "aarch64-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "aarch64-unknown-linux-gnu": [ { "id": "libc 0.2.158", @@ -53929,6 +53930,12 @@ "target": "libc" } ], + "i686-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "i686-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -53977,6 +53984,12 @@ "target": "libc" } ], + "x86_64-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -60902,6 +60915,11 @@ "time", "use-libc-auxv" ], + "aarch64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "aarch64-unknown-linux-gnu": [ "default", "event", @@ -60994,6 +61012,11 @@ "time", "use-libc-auxv" ], + "i686-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "i686-unknown-freebsd": [ "default", "event", @@ -61108,6 +61131,11 @@ "time", "use-libc-auxv" ], + "x86_64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "x86_64-unknown-freebsd": [ "default", "event", @@ -61223,6 +61251,32 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "aarch64-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "aarch64-unknown-nixos-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "aarch64-unknown-nto-qnx710": [ @@ -61236,6 +61290,17 @@ "target": "libc" } ], + "arm-unknown-linux-gnueabi": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "armv7-linux-androideabi": [ { "id": "errno 0.3.8", @@ -61308,6 +61373,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "i686-unknown-freebsd": [ @@ -61321,6 +61390,17 @@ "target": "libc" } ], + "i686-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "powerpc-unknown-linux-gnu": [ { "id": "errno 0.3.8", @@ -61458,6 +61538,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "x86_64-unknown-freebsd": [ @@ -61471,6 +61555,28 @@ "target": "libc" } ], + "x86_64-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "x86_64-unknown-nixos-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-none": [ { "id": "errno 0.3.8", @@ -63735,8 +63841,6 @@ "crate_features": { "common": [ "alloc", - "default", - "global-context", "hashes", "rand", "rand-std", @@ -87633,7 +87737,6 @@ "scopeguard 1.2.0", "scraper 0.17.1", "secp256k1 0.22.2", - "secp256k1 0.29.0", "semver 1.0.22", "serde 1.0.217", "serde-bytes-repr 0.1.5", diff --git a/Cargo.Bazel.Fuzzing.toml.lock b/Cargo.Bazel.Fuzzing.toml.lock index db23eed9762..db1811f3cdb 100644 --- a/Cargo.Bazel.Fuzzing.toml.lock +++ b/Cargo.Bazel.Fuzzing.toml.lock @@ -3221,7 +3221,6 @@ dependencies = [ "scopeguard", "scraper", "secp256k1 0.22.2", - "secp256k1 0.29.0", "semver", "serde", "serde-bytes-repr", diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 962fd29ed4e..d95d1f69b80 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "4c6e999e0d04eed4610e0b4a09e4f72db9b9ad8b7c8d0ca9c9f2db557d7f1c9d", + "checksum": "97b45eac24bbc0fd625f3cf63626a383bd09b30b36311221d6c7754821baae80", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -19159,11 +19159,6 @@ }, { "id": "secp256k1 0.22.2", - "target": "secp256k1", - "alias": "secp256k1_0_22" - }, - { - "id": "secp256k1 0.29.1", "target": "secp256k1" }, { @@ -53683,6 +53678,12 @@ "target": "libc" } ], + "aarch64-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "aarch64-unknown-linux-gnu": [ { "id": "libc 0.2.158", @@ -53731,6 +53732,12 @@ "target": "libc" } ], + "i686-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "i686-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -53779,6 +53786,12 @@ "target": "libc" } ], + "x86_64-pc-windows-msvc": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -60748,6 +60761,11 @@ "time", "use-libc-auxv" ], + "aarch64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "aarch64-unknown-linux-gnu": [ "default", "event", @@ -60840,6 +60858,11 @@ "time", "use-libc-auxv" ], + "i686-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "i686-unknown-freebsd": [ "default", "event", @@ -60954,6 +60977,11 @@ "time", "use-libc-auxv" ], + "x86_64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "x86_64-unknown-freebsd": [ "default", "event", @@ -61069,6 +61097,32 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "aarch64-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "aarch64-unknown-nixos-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "aarch64-unknown-nto-qnx710": [ @@ -61082,6 +61136,17 @@ "target": "libc" } ], + "arm-unknown-linux-gnueabi": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "armv7-linux-androideabi": [ { "id": "errno 0.3.8", @@ -61154,6 +61219,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "i686-unknown-freebsd": [ @@ -61167,6 +61236,17 @@ "target": "libc" } ], + "i686-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "powerpc-unknown-linux-gnu": [ { "id": "errno 0.3.8", @@ -61304,6 +61384,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "x86_64-unknown-freebsd": [ @@ -61317,6 +61401,28 @@ "target": "libc" } ], + "x86_64-unknown-linux-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "x86_64-unknown-nixos-gnu": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-none": [ { "id": "errno 0.3.8", @@ -63581,8 +63687,6 @@ "crate_features": { "common": [ "alloc", - "default", - "global-context", "hashes", "rand", "rand-std", @@ -87513,7 +87617,6 @@ "scopeguard 1.2.0", "scraper 0.17.1", "secp256k1 0.22.2", - "secp256k1 0.29.1", "semver 1.0.22", "serde 1.0.217", "serde-bytes-repr 0.1.5", diff --git a/Cargo.Bazel.toml.lock b/Cargo.Bazel.toml.lock index 8d46232483a..c72e8f206d2 100644 --- a/Cargo.Bazel.toml.lock +++ b/Cargo.Bazel.toml.lock @@ -3210,7 +3210,6 @@ dependencies = [ "scopeguard", "scraper", "secp256k1 0.22.2", - "secp256k1 0.29.1", "semver", "serde", "serde-bytes-repr", diff --git a/bazel/external_crates.bzl b/bazel/external_crates.bzl index c6f1cfc6e80..066fecf6540 100644 --- a/bazel/external_crates.bzl +++ b/bazel/external_crates.bzl @@ -1122,14 +1122,6 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable version = "^0.17.1", ), "secp256k1": crate.spec( - version = "^0.29", - features = [ - "global-context", - "rand-std", - ], - ), - "secp256k1-0-22": crate.spec( - package = "secp256k1", version = "^0.22", features = [ "global-context", diff --git a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel index 26fa7828933..27e05aead38 100644 --- a/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel +++ b/rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel @@ -21,7 +21,7 @@ rust_library( "@crate_index//:k256", "@crate_index//:p256", "@crate_index//:rand", - "@crate_index//:secp256k1_0_22", + "@crate_index//:secp256k1", "@crate_index//:sha2", ], ) From 2a715ca272e54a7d3a12e349389ec748ec783a94 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Wed, 15 Jan 2025 16:13:35 +0000 Subject: [PATCH 42/50] locks --- Cargo.Bazel.Fuzzing.json.lock | 49 +++++++++++++++++++++++------------ Cargo.Bazel.json.lock | 49 +++++++++++++++++++++++------------ 2 files changed, 64 insertions(+), 34 deletions(-) diff --git a/Cargo.Bazel.Fuzzing.json.lock b/Cargo.Bazel.Fuzzing.json.lock index a68bfb3b487..7334d725025 100644 --- a/Cargo.Bazel.Fuzzing.json.lock +++ b/Cargo.Bazel.Fuzzing.json.lock @@ -1,5 +1,5 @@ { - "checksum": "e3c190879652106d58b888264639c221595402cdb35b106b2676c636c4dfebb7", + "checksum": "8f965f5f5a753e8bed176116c283f61ab1e297b086c541ab588ab7ec749372a5", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -53902,13 +53902,13 @@ "target": "libc" } ], - "aarch64-linux-android": [ + "aarch64-pc-windows-msvc": [ { "id": "libc 0.2.158", "target": "libc" } ], - "aarch64-pc-windows-msvc": [ + "aarch64-unknown-fuchsia": [ { "id": "libc 0.2.158", "target": "libc" @@ -54010,19 +54010,19 @@ "target": "libc" } ], - "x86_64-unknown-freebsd": [ + "x86_64-pc-windows-msvc": [ { "id": "libc 0.2.158", "target": "libc" } ], - "x86_64-pc-windows-msvc": [ + "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", "target": "libc" } ], - "x86_64-unknown-freebsd": [ + "x86_64-unknown-fuchsia": [ { "id": "libc 0.2.158", "target": "libc" @@ -60943,6 +60943,11 @@ "time", "use-libc-auxv" ], + "aarch64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "aarch64-unknown-fuchsia": [ "default", "event", @@ -60953,11 +60958,6 @@ "time", "use-libc-auxv" ], - "aarch64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "aarch64-unknown-linux-gnu": [ "default", "event", @@ -61164,6 +61164,11 @@ "time", "use-libc-auxv" ], + "x86_64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "x86_64-unknown-freebsd": [ "default", "event", @@ -61174,12 +61179,7 @@ "time", "use-libc-auxv" ], - "x86_64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], - "x86_64-unknown-freebsd": [ + "x86_64-unknown-fuchsia": [ "default", "event", "mm", @@ -61283,6 +61283,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "aarch64-unknown-fuchsia": [ @@ -61594,6 +61598,17 @@ "target": "libc" } ], + "x86_64-unknown-fuchsia": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-linux-gnu": [ { "id": "errno 0.3.8", diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 8533cb1ca57..5f166ce88dd 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "97b45eac24bbc0fd625f3cf63626a383bd09b30b36311221d6c7754821baae80", + "checksum": "0d0f07a82417a5445e64780417e27427470ef376d446e178e972bbc76555f945", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -53704,13 +53704,13 @@ "target": "libc" } ], - "aarch64-linux-android": [ + "aarch64-pc-windows-msvc": [ { "id": "libc 0.2.158", "target": "libc" } ], - "aarch64-pc-windows-msvc": [ + "aarch64-unknown-fuchsia": [ { "id": "libc 0.2.158", "target": "libc" @@ -53812,19 +53812,19 @@ "target": "libc" } ], - "x86_64-unknown-freebsd": [ + "x86_64-pc-windows-msvc": [ { "id": "libc 0.2.158", "target": "libc" } ], - "x86_64-pc-windows-msvc": [ + "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", "target": "libc" } ], - "x86_64-unknown-freebsd": [ + "x86_64-unknown-fuchsia": [ { "id": "libc 0.2.158", "target": "libc" @@ -60789,6 +60789,11 @@ "time", "use-libc-auxv" ], + "aarch64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "aarch64-unknown-fuchsia": [ "default", "event", @@ -60799,11 +60804,6 @@ "time", "use-libc-auxv" ], - "aarch64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "aarch64-unknown-linux-gnu": [ "default", "event", @@ -61010,6 +61010,11 @@ "time", "use-libc-auxv" ], + "x86_64-pc-windows-msvc": [ + "default", + "termios", + "use-libc-auxv" + ], "x86_64-unknown-freebsd": [ "default", "event", @@ -61020,12 +61025,7 @@ "time", "use-libc-auxv" ], - "x86_64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], - "x86_64-unknown-freebsd": [ + "x86_64-unknown-fuchsia": [ "default", "event", "mm", @@ -61129,6 +61129,10 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" } ], "aarch64-unknown-fuchsia": [ @@ -61440,6 +61444,17 @@ "target": "libc" } ], + "x86_64-unknown-fuchsia": [ + { + "id": "errno 0.3.8", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], "x86_64-unknown-linux-gnu": [ { "id": "errno 0.3.8", From d63168703b83ba358b33411211b024766a9bad9b Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Thu, 16 Jan 2025 13:39:37 +0000 Subject: [PATCH 43/50] downgrade to 0.32.4 --- Cargo.Bazel.Fuzzing.json.lock | 2 +- Cargo.Bazel.json.lock | 2 +- Cargo.toml | 2 +- bazel/external_crates.bzl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.Bazel.Fuzzing.json.lock b/Cargo.Bazel.Fuzzing.json.lock index 7334d725025..16be8e2bffa 100644 --- a/Cargo.Bazel.Fuzzing.json.lock +++ b/Cargo.Bazel.Fuzzing.json.lock @@ -1,5 +1,5 @@ { - "checksum": "8f965f5f5a753e8bed176116c283f61ab1e297b086c541ab588ab7ec749372a5", + "checksum": "ca12e5f2121f17fec492bc47ef1eafefc9e1aefe7e38af55e17ae20dce96a9ed", "crates": { "abnf 0.12.0": { "name": "abnf", diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 5f166ce88dd..7743333452b 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "0d0f07a82417a5445e64780417e27427470ef376d446e178e972bbc76555f945", + "checksum": "d0c111ba7331e6106a59eace651e3ff24915ab84c8954ace0d4dfd50da6d0376", "crates": { "abnf 0.12.0": { "name": "abnf", diff --git a/Cargo.toml b/Cargo.toml index c2ee5b4f9d9..c673b594c43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -506,7 +506,7 @@ axum = "0.7.9" backoff = "0.4" base64 = { version = "0.13.1" } bincode = "1.3.3" -bitcoin = { version = "0.32.5", features = ["default", "rand", "serde"] } +bitcoin = { version = "0.32.4", features = ["default", "rand", "serde"] } bitcoincore-rpc = "0.19.0" # build-info and build-info-build MUST be kept in sync! build-info = { git = "https://github.com/dfinity-lab/build-info", rev = "701a696844fba5c87df162fbbc1ccef96f27c9d7" } diff --git a/bazel/external_crates.bzl b/bazel/external_crates.bzl index 066fecf6540..79d27c12830 100644 --- a/bazel/external_crates.bzl +++ b/bazel/external_crates.bzl @@ -273,7 +273,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable version = "^0.6.3", ), "bitcoin": crate.spec( - version = "^0.32.5", + version = "^0.32.4", features = [ "default", "rand", From e63b7b1be9223306f21532c2e0356e50cf4f8f10 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Tue, 21 Jan 2025 14:12:30 +0000 Subject: [PATCH 44/50] locks --- Cargo.Bazel.Fuzzing.json.lock | 134 +++------------------------------- Cargo.Bazel.Fuzzing.toml.lock | 2 +- Cargo.Bazel.json.lock | 134 +++------------------------------- Cargo.Bazel.toml.lock | 2 +- 4 files changed, 20 insertions(+), 252 deletions(-) diff --git a/Cargo.Bazel.Fuzzing.json.lock b/Cargo.Bazel.Fuzzing.json.lock index 384da60b8e3..82f6ecb713d 100644 --- a/Cargo.Bazel.Fuzzing.json.lock +++ b/Cargo.Bazel.Fuzzing.json.lock @@ -1,5 +1,5 @@ { - "checksum": "ca12e5f2121f17fec492bc47ef1eafefc9e1aefe7e38af55e17ae20dce96a9ed", + "checksum": "1c46b4f6a233dc96e1b4073db2b128a7a9db0bb645704f7907e59c417999ee45", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -53923,12 +53923,6 @@ "target": "libc" } ], - "aarch64-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "aarch64-unknown-fuchsia": [ { "id": "libc 0.2.158", @@ -53983,12 +53977,6 @@ "target": "libc" } ], - "i686-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "i686-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -54031,12 +54019,6 @@ "target": "libc" } ], - "x86_64-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -60958,11 +60940,6 @@ "time", "use-libc-auxv" ], - "aarch64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "aarch64-unknown-fuchsia": [ "default", "event", @@ -61065,11 +61042,6 @@ "time", "use-libc-auxv" ], - "i686-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "i686-unknown-freebsd": [ "default", "event", @@ -61174,11 +61146,6 @@ "time", "use-libc-auxv" ], - "x86_64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "x86_64-unknown-freebsd": [ "default", "event", @@ -61293,10 +61260,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "aarch64-unknown-fuchsia": [ @@ -61310,28 +61273,6 @@ "target": "libc" } ], - "aarch64-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "aarch64-unknown-nixos-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "aarch64-unknown-nto-qnx710": [ { "id": "errno 0.3.8", @@ -61343,17 +61284,6 @@ "target": "libc" } ], - "arm-unknown-linux-gnueabi": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "armv7-linux-androideabi": [ { "id": "errno 0.3.8", @@ -61426,10 +61356,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "i686-unknown-freebsd": [ @@ -61443,28 +61369,6 @@ "target": "libc" } ], - "i686-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "powerpc-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "powerpc-unknown-linux-gnu": [ { "id": "errno 0.3.8", @@ -61531,7 +61435,7 @@ "target": "libc" } ], - "wasm32-wasi": [ + "wasm32-unknown-unknown": [ { "id": "errno 0.3.8", "target": "errno", @@ -61591,10 +61495,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "x86_64-unknown-freebsd": [ @@ -61619,28 +61519,6 @@ "target": "libc" } ], - "x86_64-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "x86_64-unknown-nixos-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "x86_64-unknown-none": [ { "id": "errno 0.3.8", @@ -87999,5 +87877,11 @@ "zstd 0.13.2" ], "direct_dev_deps": [], - "unused_patches": [] + "unused_patches": [ + { + "name": "jsonrpc", + "version": "0.12.1", + "source": "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" + } + ] } diff --git a/Cargo.Bazel.Fuzzing.toml.lock b/Cargo.Bazel.Fuzzing.toml.lock index 7b51f43aff9..6f1408a30af 100644 --- a/Cargo.Bazel.Fuzzing.toml.lock +++ b/Cargo.Bazel.Fuzzing.toml.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "abnf" diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index b4d8af168b2..4bbc08c126c 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "d0c111ba7331e6106a59eace651e3ff24915ab84c8954ace0d4dfd50da6d0376", + "checksum": "4ccd9584772f3080197c29d447288d85b80c5e050752533a7a9bc85d2d82e2cc", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -53725,12 +53725,6 @@ "target": "libc" } ], - "aarch64-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "aarch64-unknown-fuchsia": [ { "id": "libc 0.2.158", @@ -53785,12 +53779,6 @@ "target": "libc" } ], - "i686-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "i686-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -53833,12 +53821,6 @@ "target": "libc" } ], - "x86_64-pc-windows-msvc": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "x86_64-unknown-freebsd": [ { "id": "libc 0.2.158", @@ -60804,11 +60786,6 @@ "time", "use-libc-auxv" ], - "aarch64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "aarch64-unknown-fuchsia": [ "default", "event", @@ -60911,11 +60888,6 @@ "time", "use-libc-auxv" ], - "i686-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "i686-unknown-freebsd": [ "default", "event", @@ -61020,11 +60992,6 @@ "time", "use-libc-auxv" ], - "x86_64-pc-windows-msvc": [ - "default", - "termios", - "use-libc-auxv" - ], "x86_64-unknown-freebsd": [ "default", "event", @@ -61139,10 +61106,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "aarch64-unknown-fuchsia": [ @@ -61156,28 +61119,6 @@ "target": "libc" } ], - "aarch64-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "aarch64-unknown-nixos-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "aarch64-unknown-nto-qnx710": [ { "id": "errno 0.3.8", @@ -61189,17 +61130,6 @@ "target": "libc" } ], - "arm-unknown-linux-gnueabi": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "armv7-linux-androideabi": [ { "id": "errno 0.3.8", @@ -61272,10 +61202,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "i686-unknown-freebsd": [ @@ -61289,28 +61215,6 @@ "target": "libc" } ], - "i686-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "powerpc-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "powerpc-unknown-linux-gnu": [ { "id": "errno 0.3.8", @@ -61377,7 +61281,7 @@ "target": "libc" } ], - "wasm32-wasi": [ + "wasm32-unknown-unknown": [ { "id": "errno 0.3.8", "target": "errno", @@ -61437,10 +61341,6 @@ "id": "errno 0.3.8", "target": "errno", "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" } ], "x86_64-unknown-freebsd": [ @@ -61465,28 +61365,6 @@ "target": "libc" } ], - "x86_64-unknown-linux-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "x86_64-unknown-nixos-gnu": [ - { - "id": "errno 0.3.8", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], "x86_64-unknown-none": [ { "id": "errno 0.3.8", @@ -87879,5 +87757,11 @@ "zstd 0.13.2" ], "direct_dev_deps": [], - "unused_patches": [] + "unused_patches": [ + { + "name": "jsonrpc", + "version": "0.12.1", + "source": "git+https://github.com/apoelstra/rust-jsonrpc?rev=e42044d#e42044d8e0896317488dfbd65eb5563d76e937fe" + } + ] } diff --git a/Cargo.Bazel.toml.lock b/Cargo.Bazel.toml.lock index 3c8c2c7c57b..6d0e7eb2323 100644 --- a/Cargo.Bazel.toml.lock +++ b/Cargo.Bazel.toml.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "abnf" From bf80abcc27444029ed79193962c4919b41853cd2 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Wed, 22 Jan 2025 08:56:41 +0000 Subject: [PATCH 45/50] lock --- Cargo.lock | 845 +++++++++++------------------------------------------ 1 file changed, 163 insertions(+), 682 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8d03352fbb8..9111de2c59f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bytes", "futures-core", "futures-sink", @@ -62,7 +62,7 @@ dependencies = [ "actix-utils", "ahash 0.8.11", "base64 0.22.1", - "bitflags 2.7.0", + "bitflags 2.8.0", "brotli 6.0.0", "bytes", "bytestring", @@ -97,7 +97,6 @@ checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -216,7 +215,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -295,16 +293,14 @@ dependencies = [ [[package]] name = "aide" version = "0.13.5" -version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5678d2978845ddb4bd736a026f467dd652d831e9e6254b0e41b07f7ee7523309" -checksum = "5678d2978845ddb4bd736a026f467dd652d831e9e6254b0e41b07f7ee7523309" dependencies = [ "axum", "bytes", "cfg-if 1.0.0", "http 1.2.0", - "indexmap 2.7.0", + "indexmap 2.7.1", "schemars", "serde", "serde_json", @@ -380,7 +376,6 @@ dependencies = [ "rand 0.8.5", "rsa", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", ] @@ -409,7 +404,6 @@ dependencies = [ "prometheus", "serde", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -454,24 +448,19 @@ dependencies = [ [[package]] name = "anstyle-wincon" version = "3.0.7" -version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", "once_cell", - "once_cell", "windows-sys 0.59.0", ] [[package]] name = "anyhow" version = "1.0.95" -version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "arbitrary" @@ -538,7 +527,6 @@ dependencies = [ "quote", "serde", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -581,7 +569,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", "synstructure", ] @@ -594,7 +581,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -706,7 +692,6 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.4.0", "event-listener 5.4.0", "event-listener-strategy", "pin-project-lite", @@ -764,7 +749,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -776,15 +760,12 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" version = "0.1.85" -version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -834,15 +815,12 @@ dependencies = [ [[package]] name = "auto_impl" version = "1.2.1" -version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" -checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -1131,7 +1109,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cexpr", "clang-sys", "itertools 0.12.1", @@ -1143,7 +1121,6 @@ dependencies = [ "rustc-hash 1.1.0", "shlex", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -1363,9 +1340,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitvec" @@ -1412,11 +1389,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.4" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb65153674e51d3a42c8f27b05b9508cea85edfaade8aa46bc8fc18cecdfef3" -checksum = "9fb65153674e51d3a42c8f27b05b9508cea85edfaade8aa46bc8fc18cecdfef3" +checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" dependencies = [ "borsh-derive", "cfg_aliases", @@ -1424,18 +1399,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.4" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a396e17ad94059c650db3d253bb6e25927f1eb462eede7e7a153bb6e75dce0a7" -checksum = "a396e17ad94059c650db3d253bb6e25927f1eb462eede7e7a153bb6e75dce0a7" +checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" dependencies = [ "once_cell", "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -1462,9 +1434,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.1" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1483,10 +1455,8 @@ dependencies = [ [[package]] name = "bstr" version = "1.11.3" -version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", "regex-automata 0.4.9", @@ -1608,10 +1578,8 @@ dependencies = [ [[package]] name = "bytemuck" version = "1.21.0" -version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -1710,7 +1678,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -1746,8 +1713,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bytes", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "futures-util", "http 1.2.0", "http-body 1.0.1", @@ -1826,7 +1792,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -1934,9 +1899,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.9" +version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "jobserver", "libc", @@ -1986,8 +1951,7 @@ dependencies = [ "candid", "certificate_orchestrator_interface", "chacha20poly1305", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "cloudflare 0.12.0 (git+https://github.com/dfinity/cloudflare-rs.git?rev=a6538a036926bd756986c9c0a5de356daef48881)", "flate2", "futures", @@ -1995,8 +1959,7 @@ dependencies = [ "ic-agent", "ic-http-certification", "ic-response-verification", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "idna 1.0.3", "instant-acme", "leb128", @@ -2007,13 +1970,11 @@ dependencies = [ "prometheus", "rcgen", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "serde_cbor", "serde_json", "sha2 0.10.8", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tower 0.5.2", "tracing", @@ -2046,7 +2007,6 @@ dependencies = [ "serde_cbor", "sha2 0.10.8", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -2059,7 +2019,6 @@ dependencies = [ "serde", "serde_bytes", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -2202,24 +2161,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.26" -version = "4.5.26" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" -checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" +checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" dependencies = [ "clap_builder", "clap_derive 4.5.24", - "clap_derive 4.5.24", ] [[package]] name = "clap_builder" -version = "4.5.26" -version = "4.5.26" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" -checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" dependencies = [ "anstream", "anstyle", @@ -2243,16 +2197,13 @@ dependencies = [ [[package]] name = "clap_derive" version = "4.5.24" -version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -2428,8 +2379,7 @@ name = "config" version = "1.0.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "config_types", "ic-types", "macaddr", @@ -2457,7 +2407,6 @@ dependencies = [ "serde_with 1.14.0", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "url", ] @@ -2567,7 +2516,6 @@ dependencies = [ "rand_chacha 0.3.1", "registry-canister", "reqwest 0.12.12", - "reqwest 0.12.12", "serde_json", "slog", "tokio", @@ -2877,8 +2825,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "criterion-plot", "futures", "is-terminal", @@ -2977,7 +2924,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "crossterm_winapi", "libc", "mio 0.8.11", @@ -3035,7 +2982,6 @@ dependencies = [ "dtoa-short", "itoa", "phf 0.11.3", - "phf 0.11.3", "smallvec", ] @@ -3047,7 +2993,6 @@ checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3108,7 +3053,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3246,7 +3190,6 @@ dependencies = [ "quote", "strsim 0.11.1", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3269,7 +3212,6 @@ dependencies = [ "darling_core 0.20.10", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3363,7 +3305,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3385,7 +3326,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3397,7 +3337,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3411,7 +3350,6 @@ dependencies = [ "quote", "rustc_version", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3432,7 +3370,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3440,13 +3377,11 @@ name = "deterministic_ips" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "config_types", "ic-crypto-sha2", "macaddr", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -3454,8 +3389,7 @@ name = "dflate" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "libc", "tar", ] @@ -3570,8 +3504,7 @@ name = "diroid" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "walkdir", ] @@ -3605,7 +3538,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3851,7 +3783,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3865,7 +3796,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -3916,7 +3846,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -4070,10 +3999,8 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" version = "5.4.0" -version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" -checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -4086,7 +4013,6 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ - "event-listener 5.4.0", "event-listener 5.4.0", "pin-project-lite", ] @@ -4103,7 +4029,6 @@ dependencies = [ "mockall", "serde", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", ] @@ -4186,13 +4111,11 @@ dependencies = [ "ic-types", "ic-types-test-utils", "ic-universal-canister", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "lazy_static", "rand 0.8.5", "rand_chacha 0.3.1", "reqwest 0.12.12", - "reqwest 0.12.12", "serde_cbor", "slog", "tokio", @@ -4477,10 +4400,8 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" version = "2.6.0" -version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" -checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ "fastrand", "futures-core", @@ -4498,7 +4419,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -4509,7 +4429,6 @@ checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", "rustls 0.23.21", - "rustls 0.23.21", "rustls-pki-types", ] @@ -4577,19 +4496,6 @@ dependencies = [ "windows", ] -[[package]] -name = "generator" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "log", - "rustversion", - "windows", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -4663,17 +4569,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ "fallible-iterator 0.3.0", - "indexmap 2.7.0", + "indexmap 2.7.1", "stable_deref_trait", ] [[package]] name = "glob" version = "0.3.2" -version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "governor" @@ -4711,8 +4615,7 @@ name = "guestos_tool" version = "1.0.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "config", "indoc", "itertools 0.12.1", @@ -4733,7 +4636,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.7.0", + "indexmap 2.7.1", "slab", "tokio", "tokio-util", @@ -4752,7 +4655,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.2.0", - "indexmap 2.7.0", + "indexmap 2.7.1", "slab", "tokio", "tokio-util", @@ -5049,8 +4952,7 @@ name = "hostos_tool" version = "1.0.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "config", "config_types", "deterministic_ips", @@ -5150,12 +5052,10 @@ name = "httpbin-rs" version = "0.9.0" dependencies = [ "axum", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "hyper 1.5.2", "hyper-util", "rustls 0.23.21", - "rustls 0.23.21", "rustls-pemfile 2.2.0", "serde_json", "tokio", @@ -5285,7 +5185,6 @@ dependencies = [ "hyper-util", "log", "rustls 0.23.21", - "rustls 0.23.21", "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", @@ -5353,7 +5252,6 @@ dependencies = [ "js-sys", "wasm-bindgen", "windows-core 0.52.0", - "windows-core 0.52.0", ] [[package]] @@ -5414,8 +5312,7 @@ dependencies = [ "base64 0.13.1", "candid", "chrono", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "cycles-minting-canister", "futures", "hex", @@ -5459,7 +5356,7 @@ dependencies = [ "ic-sns-swap", "ic-sns-wasm", "ic-types", - "indexmap 2.7.0", + "indexmap 2.7.1", "itertools 0.12.1", "maplit", "pocket-ic", @@ -5485,9 +5382,9 @@ dependencies = [ [[package]] name = "ic-agent" -version = "0.39.2" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba408987ca48fc3eee6a613e760d076a9046cccbbb5ba29efbada339ab28ed9" +checksum = "820d65a05258f2fdff326c65561b1ddc7ec54e5d43a4b1203b25eb83075c83d4" dependencies = [ "arc-swap", "async-channel 1.9.0", @@ -5516,7 +5413,6 @@ dependencies = [ "rand 0.8.5", "rangemap", "reqwest 0.12.12", - "reqwest 0.12.12", "ring 0.17.8", "sec1", "serde", @@ -5527,7 +5423,6 @@ dependencies = [ "simple_asn1", "stop-token", "thiserror 2.0.11", - "thiserror 2.0.11", "time", "tokio", "tower-service", @@ -5564,7 +5459,6 @@ dependencies = [ "rand 0.8.5", "slog", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tower 0.5.2", "tracing", @@ -5595,8 +5489,7 @@ version = "0.9.0" dependencies = [ "bincode", "byteorder", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "criterion", "ic-config", "ic-crypto-test-utils-canister-threshold-sigs", @@ -5639,8 +5532,7 @@ version = "0.9.0" dependencies = [ "anyhow", "chrono", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "ic-config", "ic-crypto-utils-threshold-sig-der", "ic-logger", @@ -5653,7 +5545,6 @@ dependencies = [ "ic-types", "rand 0.8.5", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "serde_json", "slog", @@ -5735,9 +5626,7 @@ dependencies = [ "base64 0.22.1", "bytes", "chacha20poly1305", - "clap 4.5.26", - "clap_derive 4.5.24", - "clap 4.5.26", + "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", @@ -5762,8 +5651,6 @@ dependencies = [ "rcgen", "reqwest 0.12.12", "rustls 0.23.21", - "reqwest 0.12.12", - "rustls 0.23.21", "rustls-acme", "rustls-pemfile 2.2.0", "rustls-platform-verifier", @@ -5775,7 +5662,6 @@ dependencies = [ "strum_macros", "systemstat", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tokio-io-timeout", "tokio-rustls 0.26.1", @@ -5804,8 +5690,7 @@ dependencies = [ "axum-extra", "bytes", "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "criterion", "dashmap 6.1.0", "ethnum", @@ -5859,8 +5744,6 @@ dependencies = [ "regex", "reqwest 0.12.12", "rustls 0.23.21", - "reqwest 0.12.12", - "rustls 0.23.21", "rustls-pemfile 2.2.0", "serde", "serde_bytes", @@ -5873,7 +5756,6 @@ dependencies = [ "strum", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "tikv-jemalloc-ctl", "tikv-jemallocator", "tokio", @@ -5911,7 +5793,6 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "reqwest 0.12.12", - "reqwest 0.12.12", "serde_json", "slog", "tokio", @@ -5929,7 +5810,6 @@ dependencies = [ "ic-system-test-driver", "ic-types", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "serde_cbor", "slog", @@ -5954,7 +5834,6 @@ dependencies = [ "prost 0.13.4", "rand 0.8.5", "reqwest 0.12.12", - "reqwest 0.12.12", "slog", "tokio", ] @@ -5975,8 +5854,7 @@ dependencies = [ "ic-registry-subnet-type", "ic-system-test-driver", "ic-types", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "slog", "url", ] @@ -5988,8 +5866,7 @@ dependencies = [ "bitcoin 0.32.5", "bitcoincore-rpc", "bitcoind", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "criterion", "futures", "hashlink", @@ -6020,7 +5897,6 @@ dependencies = [ "slog-async", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tokio-socks", "tonic", @@ -6087,7 +5963,6 @@ dependencies = [ "ic-universal-canister", "pocket-ic", "proptest 1.6.0", - "regex", "scraper", "serde", "serde_json", @@ -6128,7 +6003,6 @@ dependencies = [ "prost 0.13.4", "slog", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -6205,7 +6079,6 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rustls 0.23.21", - "rustls 0.23.21", "serde", "serde_cbor", "tokio", @@ -6332,7 +6205,6 @@ dependencies = [ "serde_cbor", "sha2 0.10.8", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -6400,7 +6272,6 @@ dependencies = [ "rand_chacha 0.3.1", "scoped_threadpool", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -6532,7 +6403,6 @@ dependencies = [ "serde", "serde_tokenstream 0.2.2", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -6547,7 +6417,6 @@ dependencies = [ "serde", "serde_tokenstream 0.2.2", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -6739,7 +6608,6 @@ dependencies = [ "mockall", "num-traits", "proptest 1.6.0", - "regex", "ripemd", "scopeguard", "serde", @@ -6804,7 +6672,6 @@ dependencies = [ "strum_macros", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "thousands", "time", "tokio", @@ -7053,8 +6920,7 @@ dependencies = [ "assert_matches", "async-trait", "bincode", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "criterion", "hex", "ic-adapter-metrics-server", @@ -7134,7 +7000,6 @@ dependencies = [ "rand_chacha 0.3.1", "rsa", "rustls 0.23.21", - "rustls 0.23.21", "serde", "sha2 0.10.8", "simple_asn1", @@ -7179,7 +7044,6 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "thiserror 2.0.11", - "thiserror 2.0.11", "wycheproof", "zeroize", ] @@ -7486,7 +7350,6 @@ dependencies = [ "tarpc", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "time", "tokio", "tokio-serde", @@ -7729,7 +7592,6 @@ dependencies = [ "strum", "strum_macros", "thiserror 2.0.11", - "thiserror 2.0.11", "zeroize", ] @@ -7899,7 +7761,6 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rustls 0.23.21", - "rustls 0.23.21", "tempfile", "tokio", ] @@ -8079,7 +7940,6 @@ dependencies = [ "ic-types", "mockall", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -8101,7 +7961,6 @@ dependencies = [ "pkcs8", "rand 0.8.5", "rustls 0.23.21", - "rustls 0.23.21", "signature", "time", "tokio", @@ -8138,10 +7997,8 @@ dependencies = [ "json5", "maplit", "rustls 0.23.21", - "rustls 0.23.21", "serde", "thiserror 2.0.11", - "thiserror 2.0.11", "x509-parser", ] @@ -8153,7 +8010,6 @@ dependencies = [ "ic-crypto-tls-interfaces", "mockall", "rustls 0.23.21", - "rustls 0.23.21", ] [[package]] @@ -8175,7 +8031,6 @@ dependencies = [ "serde_bytes", "serde_cbor", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -8188,7 +8043,6 @@ dependencies = [ "proptest 1.6.0", "rand 0.8.5", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -8256,7 +8110,6 @@ version = "0.9.0" dependencies = [ "ic-base-types", "thiserror 2.0.11", - "thiserror 2.0.11", "x509-parser", ] @@ -8272,7 +8125,6 @@ dependencies = [ "ic-types", "prost 0.13.4", "reqwest 0.12.12", - "reqwest 0.12.12", "tokio", ] @@ -8342,8 +8194,7 @@ dependencies = [ name = "ic-drun" version = "0.9.0" dependencies = [ - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "futures", "hex", "ic-canister-sandbox-backend-lib", @@ -8388,8 +8239,7 @@ dependencies = [ "bincode", "candid", "canister-test", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "criterion", "embedders_bench", "ic-base-types", @@ -8567,8 +8417,7 @@ dependencies = [ "anyhow", "assert_cmd", "assert_matches", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "ic-crypto-test-utils-reproducible-rng", "ic-sys", "maplit", @@ -8623,10 +8472,8 @@ dependencies = [ "ic-test-utilities-logger", "prometheus", "reqwest 0.12.12", - "reqwest 0.12.12", "slog", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tokio-io-timeout", "tower 0.5.2", @@ -8690,7 +8537,6 @@ dependencies = [ "ic-types", "ic-validator", "inferno 0.12.1", - "inferno 0.12.1", "maplit", "mockall", "pretty_assertions", @@ -8699,10 +8545,8 @@ dependencies = [ "prost 0.13.4", "rand 0.8.5", "reqwest 0.12.12", - "reqwest 0.12.12", "rstest", "rustls 0.23.21", - "rustls 0.23.21", "serde", "serde_bytes", "serde_cbor", @@ -8750,7 +8594,6 @@ dependencies = [ "prometheus", "prost 0.13.4", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "serde_json", "slog", @@ -8775,8 +8618,7 @@ dependencies = [ "ic-agent", "ic-http-certification", "ic-response-verification", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "thiserror 1.0.69", ] @@ -8793,7 +8635,6 @@ dependencies = [ "ic-test-utilities-in-memory-logger", "mockito", "reqwest 0.12.12", - "reqwest 0.12.12", "slog", "tar", "tempfile", @@ -8808,8 +8649,7 @@ dependencies = [ "async-stream", "byte-unit", "bytes", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "futures", "http 1.2.0", "http-body-util", @@ -8828,14 +8668,12 @@ dependencies = [ "rand 0.8.5", "rstest", "rustls 0.23.21", - "rustls 0.23.21", "rustls-pemfile 2.2.0", "serde", "serde_json", "slog", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tokio-rustls 0.26.1", "tonic", @@ -8970,7 +8808,6 @@ dependencies = [ "num-bigint 0.4.6", "pocket-ic", "reqwest 0.12.12", - "reqwest 0.12.12", "rosetta-core", "serde", "tempfile", @@ -8988,7 +8825,6 @@ dependencies = [ "icp-ledger", "pocket-ic", "reqwest 0.12.12", - "reqwest 0.12.12", "tempfile", "tokio", ] @@ -9001,8 +8837,7 @@ dependencies = [ "axum", "candid", "ciborium", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "futures", "hex", "ic-agent", @@ -9022,8 +8857,7 @@ dependencies = [ "ic-rosetta-test-utils", "ic-sys", "ic-test-utilities-load-wasm", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "icrc-ledger-agent", "icrc-ledger-types", "indicatif", @@ -9035,7 +8869,6 @@ dependencies = [ "proptest 1.6.0", "rand 0.8.5", "reqwest 0.12.12", - "reqwest 0.12.12", "rolling-file", "rosetta-core", "rusqlite", @@ -9061,8 +8894,7 @@ version = "0.1.0" dependencies = [ "anyhow", "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "hex", "ic-agent", "ic-crypto-ed25519", @@ -9074,7 +8906,6 @@ dependencies = [ "num-bigint 0.4.6", "pocket-ic", "reqwest 0.12.12", - "reqwest 0.12.12", "rosetta-core", "serde", "tokio", @@ -9090,7 +8921,6 @@ dependencies = [ "icrc-ledger-types", "pocket-ic", "reqwest 0.12.12", - "reqwest 0.12.12", "tempfile", "tokio", ] @@ -9129,7 +8959,6 @@ dependencies = [ "serde", "serde_bytes", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -9370,7 +9199,6 @@ dependencies = [ "strum", "strum_macros", "thiserror 2.0.11", - "thiserror 2.0.11", "tower 0.5.2", ] @@ -9380,7 +9208,6 @@ version = "0.9.0" dependencies = [ "strum_macros", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -9436,7 +9263,6 @@ dependencies = [ "ic-types", "phantom_newtype", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -9698,7 +9524,6 @@ dependencies = [ "ic_consensus_system_test_utils", "icp-ledger", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "slog", "url", @@ -9712,13 +9537,11 @@ dependencies = [ "assert_matches", "candid", "candid_parser", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "futures", "hex", "maplit", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "serde_json", "sha2 0.10.8", @@ -9880,8 +9703,7 @@ name = "ic-metrics-tool" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", ] [[package]] @@ -9904,7 +9726,6 @@ dependencies = [ "serde", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", ] @@ -10665,8 +10486,7 @@ version = "0.9.0" dependencies = [ "candid", "canister-test", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "ic-base-types", "ic-canister-client", "ic-interfaces-registry", @@ -10690,8 +10510,7 @@ dependencies = [ name = "ic-nns-inspector" version = "0.1.0" dependencies = [ - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "csv", "hex", "ic-base-types", @@ -10927,7 +10746,6 @@ dependencies = [ "quinn-udp", "rcgen", "rustls 0.23.21", - "rustls 0.23.21", "serde", "slog", "tempfile", @@ -10966,7 +10784,6 @@ dependencies = [ "prost 0.12.6", "regex", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", ] @@ -10977,8 +10794,7 @@ dependencies = [ "anyhow", "assert_matches", "base64 0.13.1", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "fs_extra", "ic-config", "ic-crypto-node-key-generation", @@ -11010,13 +10826,11 @@ dependencies = [ "prost 0.13.4", "rand 0.8.5", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "serde_json", "slog", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "url", "x509-cert", ] @@ -11097,12 +10911,10 @@ dependencies = [ "quinn", "rstest", "rustls 0.23.21", - "rustls 0.23.21", "slog", "socket2 0.5.8", "static_assertions", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tokio-metrics", "tokio-util", @@ -11130,8 +10942,7 @@ name = "ic-recovery" version = "0.9.0" dependencies = [ "base64 0.13.1", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "futures", "hex", "ic-artifact-pool", @@ -11162,7 +10973,6 @@ dependencies = [ "ic-types", "prost 0.13.4", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "serde_cbor", "serde_json", @@ -11182,8 +10992,7 @@ version = "0.9.0" dependencies = [ "anyhow", "base64 0.13.1", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "ic-base-types", "ic-crypto-sha2", "ic-crypto-utils-threshold-sig-der", @@ -11202,7 +11011,6 @@ dependencies = [ "serde_json", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "url", ] @@ -11215,7 +11023,6 @@ dependencies = [ "ic-base-types", "serde", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -11291,7 +11098,6 @@ dependencies = [ "ic-types", "serde_cbor", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -11341,7 +11147,6 @@ dependencies = [ "ic-types", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "url", ] @@ -11415,7 +11220,6 @@ dependencies = [ "ic-sys", "ic-types", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -11430,8 +11234,7 @@ dependencies = [ name = "ic-registry-replicator" version = "0.9.0" dependencies = [ - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "ic-config", "ic-crypto-utils-threshold-sig-der", "ic-http-endpoints-metrics", @@ -11516,8 +11319,7 @@ name = "ic-replay" version = "0.9.0" dependencies = [ "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "hex", "ic-artifact-pool", "ic-canister-client", @@ -11571,8 +11373,7 @@ version = "0.9.0" dependencies = [ "assert_cmd", "canister-test", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "criterion", "hex", "ic-artifact-pool", @@ -11828,8 +11629,7 @@ dependencies = [ "async-trait", "base64 0.13.1", "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "dfn_candid", "dfn_protobuf", "futures", @@ -11877,7 +11677,6 @@ dependencies = [ "rand_chacha 0.3.1", "registry-canister", "reqwest 0.12.12", - "reqwest 0.12.12", "rolling-file", "rosetta-core", "rusqlite", @@ -11911,7 +11710,6 @@ dependencies = [ "nix 0.24.3", "rand 0.8.5", "reqwest 0.12.12", - "reqwest 0.12.12", "rosetta-core", "serde", "serde_bytes", @@ -11993,7 +11791,6 @@ dependencies = [ "serde_json", "textplots", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", ] @@ -12004,8 +11801,7 @@ dependencies = [ "anyhow", "base64 0.13.1", "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "futures", "hex", "ic-agent", @@ -12032,7 +11828,6 @@ dependencies = [ "serde_yaml", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", ] @@ -12048,8 +11843,7 @@ dependencies = [ "canbench-rs", "candid", "candid_parser", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "comparable", "futures", "hex", @@ -12124,8 +11918,7 @@ version = "0.9.0" dependencies = [ "bytes", "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "comparable", "ic-base-types", "ic-nervous-system-proto", @@ -12540,8 +12333,7 @@ name = "ic-starter" version = "0.9.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "ic-config", "ic-logger", "ic-management-canister-types", @@ -12593,8 +12385,7 @@ version = "0.9.0" dependencies = [ "candid", "ciborium", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "hex", "ic-artifact-pool", "ic-base-types", @@ -12755,7 +12546,6 @@ dependencies = [ "rand 0.8.5", "slog", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tokio-metrics", "tokio-util", @@ -12767,8 +12557,7 @@ dependencies = [ name = "ic-state-tool" version = "0.9.0" dependencies = [ - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "hex", "ic-config", "ic-logger", @@ -12793,8 +12582,7 @@ dependencies = [ name = "ic-subnet-splitting" version = "0.9.0" dependencies = [ - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "hex", "ic-agent", "ic-base-types", @@ -12834,7 +12622,6 @@ dependencies = [ "rand 0.8.5", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "wsl", ] @@ -12891,8 +12678,7 @@ dependencies = [ "candid", "canister-test", "chrono", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "config_types", "crossbeam-channel", "cycles-minting-canister", @@ -12970,8 +12756,7 @@ dependencies = [ "ic-types", "ic-types-test-utils", "ic-universal-canister", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "ic-wasm-types", "icp-ledger", "icrc-ledger-types", @@ -13000,7 +12785,6 @@ dependencies = [ "regex", "registry-canister", "reqwest 0.12.12", - "reqwest 0.12.12", "ring 0.17.8", "rosetta-core", "rsa", @@ -13019,7 +12803,6 @@ dependencies = [ "strum_macros", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "time", "tokio", "tokio-util", @@ -13409,7 +13192,6 @@ dependencies = [ "ic_consensus_threshold_sig_system_test_utils", "icrc-ledger-types", "reqwest 0.12.12", - "reqwest 0.12.12", "serde_json", "slog", ] @@ -13449,9 +13231,9 @@ dependencies = [ [[package]] name = "ic-transport-types" -version = "0.39.2" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e2418868dd5857d2a5bac3f1cb6de1aecf2316d380997ef842aec3d8a79d4e" +checksum = "979ee7bee5a67150a4c090fb012c93c294a528b4a867bad9a15cc6d01cb4227f" dependencies = [ "candid", "hex", @@ -13463,7 +13245,6 @@ dependencies = [ "serde_repr", "sha2 0.10.8", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -13511,7 +13292,6 @@ dependencies = [ "strum", "strum_macros", "thiserror 2.0.11", - "thiserror 2.0.11", "thousands", ] @@ -13552,11 +13332,9 @@ dependencies = [ [[package]] name = "ic-utils" -version = "0.39.2" -version = "0.39.2" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb9c35ef4976a71d37f3ebf73ee43bb52b360be60d91d3a77f74fbc875dda4" -checksum = "e1fb9c35ef4976a71d37f3ebf73ee43bb52b360be60d91d3a77f74fbc875dda4" +checksum = "cd4274ab690a646a4fb4105428617e9c622255903aad34183bdc892ad8a7cc48" dependencies = [ "async-trait", "candid", @@ -13570,7 +13348,6 @@ dependencies = [ "strum", "strum_macros", "thiserror 2.0.11", - "thiserror 2.0.11", "time", "tokio", ] @@ -13635,7 +13412,6 @@ dependencies = [ "mockall", "rand 0.8.5", "thiserror 2.0.11", - "thiserror 2.0.11", ] [[package]] @@ -13767,8 +13543,7 @@ checksum = "19fabaeecfe37f24b433c62489242fc54503d98d4cc8d0f9ef7544dfdfc0ddcb" dependencies = [ "anyhow", "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "libflate", "rustc-demangle", "serde", @@ -13808,8 +13583,7 @@ dependencies = [ "byte-unit", "candid", "chrono", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "console 0.11.3", "futures", "hex", @@ -13902,11 +13676,9 @@ dependencies = [ "proptest 1.6.0", "rand 0.8.5", "reqwest 0.12.12", - "reqwest 0.12.12", "slog", "tempfile", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "url", ] @@ -14057,7 +13829,6 @@ dependencies = [ "rand 0.8.5", "registry-canister", "reqwest 0.12.12", - "reqwest 0.12.12", "rsa", "serde_json", "slog", @@ -14097,7 +13868,6 @@ dependencies = [ "rand_chacha 0.3.1", "registry-canister", "reqwest 0.12.12", - "reqwest 0.12.12", "serde_cbor", "serde_json", "slog", @@ -14156,7 +13926,6 @@ dependencies = [ "k256", "rand 0.8.5", "reqwest 0.12.12", - "reqwest 0.12.12", "serde_bytes", "serde_cbor", "slog", @@ -14181,8 +13950,7 @@ dependencies = [ name = "icp-config" version = "0.9.0" dependencies = [ - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "eyre", "ic-config", "ic-replicated-state", @@ -14473,7 +14241,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -14536,10 +14303,8 @@ dependencies = [ [[package]] name = "impl-more" version = "0.1.9" -version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" -checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" [[package]] name = "impl-rlp" @@ -14568,7 +14333,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -14590,9 +14354,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -14625,7 +14389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232929e1d75fe899576a3d5c7416ad0d88dbfbb3c3d6aa00873a7408a50ddb88" dependencies = [ "ahash 0.8.11", - "indexmap 2.7.0", + "indexmap 2.7.1", "is-terminal", "itoa", "log", @@ -14639,25 +14403,21 @@ dependencies = [ [[package]] name = "inferno" version = "0.12.1" -version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "692eda1cc790750b9f5a5e3921ef9c117fd5498b97cfacbc910693e5b29002dc" -checksum = "692eda1cc790750b9f5a5e3921ef9c117fd5498b97cfacbc910693e5b29002dc" dependencies = [ "ahash 0.8.11", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "crossbeam-channel", "crossbeam-utils", "dashmap 6.1.0", "env_logger", - "indexmap 2.7.0", + "indexmap 2.7.1", "itoa", "log", "num-format", "once_cell", "quick-xml 0.37.2", - "quick-xml 0.37.2", "rgb", "str_stack", ] @@ -14667,8 +14427,7 @@ name = "inject-files" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "partition_tools", "tempfile", "tokio", @@ -14686,15 +14445,12 @@ dependencies = [ [[package]] name = "insta" version = "1.42.0" -version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6513e4067e16e69ed1db5ab56048ed65db32d10ba5fc1217f5393f8f17d8b5a5" -checksum = "6513e4067e16e69ed1db5ab56048ed65db32d10ba5fc1217f5393f8f17d8b5a5" dependencies = [ "console 0.15.10", "linked-hash-map", "once_cell", - "once_cell", "similar", ] @@ -14752,9 +14508,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" dependencies = [ "serde", ] @@ -14770,13 +14526,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "3f187290c0ed3dfe3f7c85bedddd320949b68fc86ca0ceb71adfb05b3dc3af2a" dependencies = [ "hermit-abi 0.4.0", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -14869,10 +14625,8 @@ dependencies = [ [[package]] name = "js-sys" version = "0.3.77" -version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -15010,7 +14764,6 @@ dependencies = [ "kube-core", "pem 3.0.4", "rustls 0.23.21", - "rustls 0.23.21", "rustls-pemfile 2.2.0", "secrecy", "serde", @@ -15126,14 +14879,12 @@ checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" name = "launch-single-vm" version = "0.1.0" dependencies = [ - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "ic-prep", "ic-registry-subnet-type", "ic-system-test-driver", "ic-types", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "slog", "slog-async", @@ -15367,7 +15118,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "libc", "redox_syscall 0.5.8", ] @@ -15426,10 +15177,8 @@ dependencies = [ [[package]] name = "libz-sys" version = "1.1.21" -version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" -checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" dependencies = [ "cc", "libc", @@ -15462,10 +15211,8 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" version = "0.4.15" -version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux_kernel_command_line" @@ -15558,10 +15305,8 @@ dependencies = [ [[package]] name = "log" version = "0.4.25" -version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "logos" @@ -15593,7 +15338,6 @@ dependencies = [ "quote", "regex-syntax 0.6.29", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -15632,19 +15376,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "loom" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" -dependencies = [ - "cfg-if 1.0.0", - "generator", - "scoped-tls", - "tracing", - "tracing-subscriber", -] - [[package]] name = "lru" version = "0.7.8" @@ -15869,8 +15600,7 @@ dependencies = [ "ic-registry-subnet-type", "ic-system-test-driver", "ic-types", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "itertools 0.12.1", "rand 0.8.5", "rand_chacha 0.3.1", @@ -15941,10 +15671,8 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" version = "0.8.3" -version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", ] @@ -16014,7 +15742,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -16044,23 +15771,18 @@ dependencies = [ [[package]] name = "moka" version = "0.12.10" -version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" -checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" dependencies = [ "async-lock", "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", "event-listener 5.4.0", - "event-listener 5.4.0", "futures-util", "loom", - "loom", "parking_lot 0.12.3", "portable-atomic", - "portable-atomic", "rustc_version", "smallvec", "tagptr", @@ -16201,14 +15923,12 @@ dependencies = [ "ic-test-utilities", "ic-test-utilities-types", "ic-types", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "proxy_canister", "rand 0.8.5", "rand_chacha 0.3.1", "registry-canister", "reqwest 0.12.12", - "reqwest 0.12.12", "slog", "tokio", "url", @@ -16225,8 +15945,7 @@ name = "nft_exporter" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "serde", "serde_json", ] @@ -16274,7 +15993,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cfg-if 1.0.0", "libc", "memoffset 0.9.1", @@ -16286,7 +16005,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cfg-if 1.0.0", "cfg_aliases", "libc", @@ -16337,7 +16056,6 @@ dependencies = [ "prost 0.13.4", "registry-canister", "reqwest 0.12.12", - "reqwest 0.12.12", "serde_cbor", "slog", "tokio", @@ -16567,7 +16285,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -16588,14 +16305,12 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" version = "0.36.7" -version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "crc32fast", "hashbrown 0.15.2", - "indexmap 2.7.0", + "indexmap 2.7.1", "memchr", ] @@ -16861,8 +16576,7 @@ dependencies = [ "async-trait", "backoff", "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "env-file-reader", "exec", "get_if_addrs", @@ -16973,7 +16687,6 @@ dependencies = [ "ic_consensus_system_test_utils", "itertools 0.12.1", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "slog", "tokio", @@ -17200,7 +16913,6 @@ checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", "thiserror 2.0.11", - "thiserror 2.0.11", "ucd-trie", ] @@ -17225,7 +16937,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -17256,7 +16967,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.7.0", + "indexmap 2.7.1", ] [[package]] @@ -17282,14 +16993,11 @@ dependencies = [ [[package]] name = "phf" version = "0.11.3" -version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared 0.11.3", - "phf_shared 0.11.3", ] [[package]] @@ -17315,12 +17023,9 @@ dependencies = [ [[package]] name = "phf_generator" version = "0.11.3" -version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "phf_shared 0.11.3", "phf_shared 0.11.3", "rand 0.8.5", ] @@ -17328,19 +17033,14 @@ dependencies = [ [[package]] name = "phf_macros" version = "0.11.3" -version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ - "phf_generator 0.11.3", - "phf_shared 0.11.3", "phf_generator 0.11.3", "phf_shared 0.11.3", "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -17350,19 +17050,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" dependencies = [ "siphasher 0.3.11", - "siphasher 0.3.11", ] [[package]] name = "phf_shared" version = "0.11.3" -version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher 1.0.1", - "siphasher 1.0.1", ] [[package]] @@ -17374,10 +17070,8 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" version = "1.1.8" -version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" -checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" dependencies = [ "pin-project-internal", ] @@ -17385,24 +17079,19 @@ dependencies = [ [[package]] name = "pin-project-internal" version = "1.1.8" -version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" -checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] name = "pin-project-lite" version = "0.2.16" -version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -17517,7 +17206,6 @@ dependencies = [ "k256", "lazy_static", "reqwest 0.12.12", - "reqwest 0.12.12", "schemars", "serde", "serde_bytes", @@ -17528,7 +17216,6 @@ dependencies = [ "strum", "strum_macros", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tracing", "tracing-appender", @@ -17553,8 +17240,7 @@ dependencies = [ "bitcoincore-rpc", "bytes", "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "ctrlc", "flate2", "form_urlencoded", @@ -17603,8 +17289,7 @@ dependencies = [ "ic-test-utilities", "ic-test-utilities-registry", "ic-types", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "ic-utils-thread", "ic-validator-ingress-message", "itertools 0.12.1", @@ -17614,7 +17299,6 @@ dependencies = [ "rcgen", "registry-canister", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "serde_cbor", "serde_json", @@ -17811,14 +17495,11 @@ dependencies = [ [[package]] name = "prettyplease" version = "0.2.29" -version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -17897,10 +17578,8 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" version = "1.0.93" -version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -17925,7 +17604,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "hex", "lazy_static", "procfs-core", @@ -17938,7 +17617,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "hex", ] @@ -17999,7 +17678,7 @@ checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set 0.8.0", "bit-vec 0.8.0", - "bitflags 2.7.0", + "bitflags 2.8.0", "lazy_static", "num-traits", "rand 0.8.5", @@ -18020,7 +17699,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -18061,7 +17739,6 @@ dependencies = [ "prost-types 0.12.6", "regex", "syn 2.0.96", - "syn 2.0.96", "tempfile", ] @@ -18082,7 +17759,6 @@ dependencies = [ "prost-types 0.13.4", "regex", "syn 2.0.96", - "syn 2.0.96", "tempfile", ] @@ -18097,7 +17773,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -18111,7 +17786,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -18208,10 +17882,8 @@ dependencies = [ [[package]] name = "quanta" version = "0.12.5" -version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" -checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" dependencies = [ "crossbeam-utils", "libc", @@ -18240,10 +17912,8 @@ dependencies = [ [[package]] name = "quick-xml" version = "0.37.2" -version = "0.37.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" -checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" dependencies = [ "memchr", ] @@ -18260,10 +17930,8 @@ dependencies = [ "quinn-udp", "rustc-hash 2.1.0", "rustls 0.23.21", - "rustls 0.23.21", "socket2 0.5.8", "thiserror 2.0.11", - "thiserror 2.0.11", "tokio", "tracing", ] @@ -18280,11 +17948,9 @@ dependencies = [ "ring 0.17.8", "rustc-hash 2.1.0", "rustls 0.23.21", - "rustls 0.23.21", "rustls-pki-types", "slab", "thiserror 2.0.11", - "thiserror 2.0.11", "tinyvec", "tracing", "web-time", @@ -18307,10 +17973,8 @@ dependencies = [ [[package]] name = "quote" version = "1.0.38" -version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -18532,8 +18196,7 @@ version = "0.9.0" dependencies = [ "anyhow", "candid", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "ic-agent", "k256", "rate-limits-api", @@ -18588,7 +18251,6 @@ dependencies = [ "serde_json", "strum", "thiserror 2.0.11", - "thiserror 2.0.11", "uuid", ] @@ -18606,12 +18268,10 @@ dependencies = [ [[package]] name = "raw-cpuid" version = "11.3.0" -version = "11.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6928fa44c097620b706542d428957635951bade7143269085389d42c8a4927e" -checksum = "c6928fa44c097620b706542d428957635951bade7143269085389d42c8a4927e" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", ] [[package]] @@ -18637,10 +18297,8 @@ dependencies = [ [[package]] name = "rcgen" version = "0.13.2" -version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75e669e5202259b5314d1ea5397316ad400819437857b90861765f24c4cf80a2" -checksum = "75e669e5202259b5314d1ea5397316ad400819437857b90861765f24c4cf80a2" dependencies = [ "pem 3.0.4", "ring 0.17.8", @@ -18674,7 +18332,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", ] [[package]] @@ -18938,10 +18596,8 @@ dependencies = [ [[package]] name = "reqwest" version = "0.12.12" -version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64 0.22.1", "bytes", @@ -18966,7 +18622,6 @@ dependencies = [ "pin-project-lite", "quinn", "rustls 0.23.21", - "rustls 0.23.21", "rustls-native-certs 0.8.1", "rustls-pemfile 2.2.0", "rustls-pki-types", @@ -18979,7 +18634,6 @@ dependencies = [ "tokio-socks", "tokio-util", "tower 0.5.2", - "tower 0.5.2", "tower-service", "url", "wasm-bindgen", @@ -19238,7 +18892,6 @@ dependencies = [ "prost 0.13.4", "rand 0.8.5", "reqwest 0.12.12", - "reqwest 0.12.12", "rosetta-core", "serde", "serde_json", @@ -19294,7 +18947,6 @@ dependencies = [ "relative-path", "rustc_version", "syn 2.0.96", - "syn 2.0.96", "unicode-ident", ] @@ -19417,13 +19069,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.43" -version = "0.38.43" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "errno 0.3.10", "libc", "linux-raw-sys", @@ -19459,10 +19109,8 @@ dependencies = [ [[package]] name = "rustls" version = "0.23.21" -version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" -checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "brotli 7.0.0", "brotli-decompressor", @@ -19497,7 +19145,6 @@ dependencies = [ "serde", "serde_json", "thiserror 2.0.11", - "thiserror 2.0.11", "webpki-roots 0.26.7", "x509-parser", ] @@ -19525,7 +19172,6 @@ dependencies = [ "rustls-pki-types", "schannel", "security-framework 3.2.0", - "security-framework 3.2.0", ] [[package]] @@ -19567,7 +19213,6 @@ dependencies = [ "log", "once_cell", "rustls 0.23.21", - "rustls 0.23.21", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", @@ -19607,7 +19252,6 @@ dependencies = [ [[package]] name = "rustversion" version = "1.0.19" -version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" @@ -19672,7 +19316,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -19691,7 +19334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", - "indexmap 2.7.0", + "indexmap 2.7.1", "schemars_derive", "serde", "serde_json", @@ -19707,7 +19350,6 @@ dependencies = [ "quote", "serde_derive_internals", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -19767,7 +19409,6 @@ dependencies = [ "ic_consensus_system_test_utils", "nns_dapp", "reqwest 0.12.12", - "reqwest 0.12.12", "serde_json", "slog", ] @@ -19869,7 +19510,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -19880,12 +19521,10 @@ dependencies = [ [[package]] name = "security-framework" version = "3.2.0" -version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" -checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -19895,10 +19534,8 @@ dependencies = [ [[package]] name = "security-framework-sys" version = "2.14.0" -version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -19910,7 +19547,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb30575f3638fc8f6815f448d50cb1a2e255b0897985c8c59f4d37b72a07b06" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cssparser", "derive_more 0.99.18", "fxhash", @@ -19925,9 +19562,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" dependencies = [ "serde", ] @@ -19935,10 +19572,8 @@ dependencies = [ [[package]] name = "serde" version = "1.0.217" -version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -19997,15 +19632,12 @@ dependencies = [ [[package]] name = "serde_derive" version = "1.0.217" -version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20017,16 +19649,13 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.135" -version = "1.0.135" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" dependencies = [ "itoa", "memchr", @@ -20076,7 +19705,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20100,7 +19728,6 @@ dependencies = [ "quote", "serde", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20163,7 +19790,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20172,7 +19798,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.7.1", "itoa", "ryu", "serde", @@ -20193,8 +19819,7 @@ name = "setupos-disable-checks" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "indoc", "linux_kernel_command_line", "partition_tools", @@ -20208,8 +19833,7 @@ name = "setupos-inject-configuration" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "config", "partition_tools", "serde", @@ -20225,8 +19849,7 @@ name = "setupos_tool" version = "1.0.0" dependencies = [ "anyhow", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "config", "config_types", "deterministic_ips", @@ -20342,22 +19965,19 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "similar" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "simple_asn1" version = "0.6.3" -version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" -checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ "num-bigint 0.4.6", "num-traits", "thiserror 2.0.11", - "thiserror 2.0.11", "time", ] @@ -20393,12 +20013,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - [[package]] name = "slab" version = "0.4.9" @@ -20529,7 +20143,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20557,8 +20170,7 @@ dependencies = [ "ic-system-test-driver", "ic-types", "ic-universal-canister", - "ic-utils 0.39.2", - "ic-utils 0.39.2", + "ic-utils 0.39.3", "ic_consensus_system_test_utils", "icp-ledger", "icrc-ledger-agent", @@ -20617,7 +20229,6 @@ dependencies = [ "ic-system-test-driver", "ic-types", "reqwest 0.12.12", - "reqwest 0.12.12", "slog", ] @@ -20798,7 +20409,6 @@ dependencies = [ "quote", "structmeta-derive 0.2.0", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20811,7 +20421,6 @@ dependencies = [ "quote", "structmeta-derive 0.3.0", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20823,7 +20432,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20835,7 +20443,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20858,7 +20465,6 @@ dependencies = [ "quote", "rustversion", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -20886,9 +20492,9 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "symbolic-common" -version = "12.13.1" +version = "12.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf08b42a6f9469bd8584daee39a1352c8133ccabc5151ccccb15896ef047d99a" +checksum = "13a4dfe4bbeef59c1f32fc7524ae7c95b9e1de5e79a43ce1604e181081d71b0c" dependencies = [ "debugid", "memmap2", @@ -20898,9 +20504,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.13.1" +version = "12.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f73b5a5bd4da72720c45756a2d11edf110116b87f998bda59b97be8c2c7cf1" +checksum = "98cf6a95abff97de4d7ff3473f33cacd38f1ddccad5c1feab435d6760300e3b6" dependencies = [ "rustc-demangle", "symbolic-common", @@ -20920,10 +20526,8 @@ dependencies = [ [[package]] name = "syn" version = "2.0.96" -version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -20976,7 +20580,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -21007,14 +20610,11 @@ dependencies = [ "anyhow", "async-trait", "axum", - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "http 1.2.0", "itertools 0.12.1", "reqwest 0.12.12", "thiserror 2.0.11", - "reqwest 0.12.12", - "thiserror 2.0.11", "tokio", "url", ] @@ -21120,15 +20720,12 @@ dependencies = [ [[package]] name = "tempfile" version = "3.15.0" -version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" -checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if 1.0.0", "fastrand", "getrandom", - "getrandom", "once_cell", "rustix", "windows-sys 0.59.0", @@ -21200,7 +20797,6 @@ dependencies = [ "quote", "structmeta 0.2.0", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -21213,7 +20809,6 @@ dependencies = [ "quote", "structmeta 0.3.0", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -21254,7 +20849,6 @@ dependencies = [ "nns_dapp", "os_qualification_utils", "reqwest 0.12.12", - "reqwest 0.12.12", "serde", "serde_json", "slog", @@ -21290,13 +20884,10 @@ dependencies = [ [[package]] name = "thiserror" version = "2.0.11" -version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ "thiserror-impl 2.0.11", - "thiserror-impl 2.0.11", ] [[package]] @@ -21308,21 +20899,17 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] name = "thiserror-impl" version = "2.0.11" -version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -21446,10 +21033,8 @@ dependencies = [ [[package]] name = "tinyvec" version = "1.8.1" -version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -21501,16 +21086,13 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] name = "tokio" version = "1.43.0" -version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -21537,15 +21119,12 @@ dependencies = [ [[package]] name = "tokio-macros" version = "2.5.0" -version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -21587,7 +21166,6 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.21", "rustls 0.23.21", "tokio", ] @@ -21685,7 +21263,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.7.1", "toml_datetime", "winnow", ] @@ -21732,7 +21310,6 @@ dependencies = [ "prost-types 0.13.4", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -21764,7 +21341,7 @@ dependencies = [ "futures-core", "futures-util", "hdrhistogram", - "indexmap 2.7.0", + "indexmap 2.7.1", "pin-project-lite", "slab", "sync_wrapper 1.0.2", @@ -21782,7 +21359,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "base64 0.21.7", - "bitflags 2.7.0", + "bitflags 2.8.0", "bytes", "http 1.2.0", "http-body 1.0.1", @@ -21801,7 +21378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "async-compression", - "bitflags 2.7.0", + "bitflags 2.8.0", "bytes", "futures-core", "http 1.2.0", @@ -21904,7 +21481,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -22167,10 +21743,8 @@ dependencies = [ [[package]] name = "ulid" version = "1.1.4" -version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f294bff79170ed1c5633812aff1e565c35d993a36e757f9bc0accf5eec4e6045" -checksum = "f294bff79170ed1c5633812aff1e565c35d993a36e757f9bc0accf5eec4e6045" dependencies = [ "rand 0.8.5", "web-time", @@ -22185,10 +21759,8 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicase" version = "2.8.1" -version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-bidi" @@ -22340,11 +21912,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.12.0" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" -checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" +checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" dependencies = [ "getrandom", "serde", @@ -22401,8 +21971,7 @@ dependencies = [ name = "vsock_guest" version = "1.0.0" dependencies = [ - "clap 4.5.26", - "clap 4.5.26", + "clap 4.5.27", "vsock_lib", ] @@ -22420,7 +21989,6 @@ dependencies = [ "anyhow", "regex", "reqwest 0.12.12", - "reqwest 0.12.12", "rusb", "serde", "serde_json", @@ -22533,42 +22101,34 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" version = "0.2.100" -version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if 1.0.0", "once_cell", "rustversion", - "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.100" -version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.50" -version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -22580,10 +22140,8 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" version = "0.2.100" -version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -22592,15 +22150,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" version = "0.2.100" -version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -22608,16 +22163,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" version = "0.2.100" -version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ "unicode-ident", ] -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] [[package]] name = "wasm-encoder" @@ -22650,15 +22200,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.223.0" -version = "0.223.0" +version = "0.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e636076193fa68103e937ac951b5f2f587624097017d764b8984d9c0f149464" -checksum = "7e636076193fa68103e937ac951b5f2f587624097017d764b8984d9c0f149464" +checksum = "b7249cf8cb0c6b9cb42bce90c0a5feb276fbf963fa385ff3d818ab3d90818ed6" dependencies = [ "leb128", - "wasmparser 0.223.0", - "wasmparser 0.223.0", + "wasmparser 0.224.0", ] [[package]] @@ -22681,9 +22228,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d28bc49ba1e5c5b61ffa7a2eace10820443c4b7d1c0b144109261d14570fdf8" dependencies = [ "ahash 0.8.11", - "bitflags 2.7.0", + "bitflags 2.8.0", "hashbrown 0.14.5", - "indexmap 2.7.0", + "indexmap 2.7.1", "semver", "serde", ] @@ -22695,9 +22242,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca917a21307d3adf2b9857b94dd05ebf8496bdcff4437a9b9fb3899d3e6c74e7" dependencies = [ "ahash 0.8.11", - "bitflags 2.7.0", + "bitflags 2.8.0", "hashbrown 0.14.5", - "indexmap 2.7.0", + "indexmap 2.7.1", "semver", "serde", ] @@ -22708,23 +22255,21 @@ version = "0.221.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9845c470a2e10b61dd42c385839cdd6496363ed63b5c9e420b5488b77bd22083" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "hashbrown 0.15.2", - "indexmap 2.7.0", + "indexmap 2.7.1", "semver", "serde", ] [[package]] name = "wasmparser" -version = "0.223.0" -version = "0.223.0" +version = "0.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5a99faceb1a5a84dd6084ec4bfa4b2ab153b5793b43fd8f58b89232634afc35" -checksum = "d5a99faceb1a5a84dd6084ec4bfa4b2ab153b5793b43fd8f58b89232634afc35" +checksum = "65881a664fdd43646b647bb27bf186ab09c05bf56779d40aed4c6dce47d423f5" dependencies = [ - "bitflags 2.7.0", - "indexmap 2.7.0", + "bitflags 2.8.0", + "indexmap 2.7.1", "semver", ] @@ -22757,12 +22302,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd30973c65eceb0f37dfcc430d83abd5eb24015fdfcab6912f52949287e04f0" dependencies = [ "anyhow", - "bitflags 2.7.0", + "bitflags 2.8.0", "bumpalo", "cc", "cfg-if 1.0.0", "hashbrown 0.14.5", - "indexmap 2.7.0", + "indexmap 2.7.1", "libc", "libm", "log", @@ -22813,7 +22358,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -22860,7 +22404,7 @@ dependencies = [ "cranelift-bitset", "cranelift-entity", "gimli 0.31.1", - "indexmap 2.7.0", + "indexmap 2.7.1", "log", "object", "postcard", @@ -22915,7 +22459,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -22943,7 +22486,7 @@ checksum = "5f38f7a5eb2f06f53fe943e7fb8bf4197f7cf279f1bc52c0ce56e9d3ffd750a4" dependencies = [ "anyhow", "heck 0.5.0", - "indexmap 2.7.0", + "indexmap 2.7.1", "wit-parser", ] @@ -22962,39 +22505,31 @@ dependencies = [ [[package]] name = "wast" -version = "223.0.0" -version = "223.0.0" +version = "224.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59b2ba8a2ff9f06194b7be9524f92e45e70149f4dacc0d0c7ad92b59ac875e4" -checksum = "d59b2ba8a2ff9f06194b7be9524f92e45e70149f4dacc0d0c7ad92b59ac875e4" +checksum = "d722a51e62b669d17e5a9f6bc8ec210178b37d869114355aa46989686c5c6391" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width 0.2.0", - "wasm-encoder 0.223.0", - "wasm-encoder 0.223.0", + "wasm-encoder 0.224.0", ] [[package]] name = "wat" -version = "1.223.0" -version = "1.223.0" +version = "1.224.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662786915c427e4918ff01eabb3c4756d4d947cd8f635761526b4cc9da2eaaad" -checksum = "662786915c427e4918ff01eabb3c4756d4d947cd8f635761526b4cc9da2eaaad" +checksum = "71dece6a7dd5bcbcf8d256606c7fb3faa36286d46bf3f98185407719a5ceede2" dependencies = [ - "wast 223.0.0", - "wast 223.0.0", + "wast 224.0.0", ] [[package]] name = "web-sys" version = "0.3.77" -version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -23140,16 +22675,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" -dependencies = [ - "windows-core 0.58.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.52.0" @@ -23194,41 +22719,6 @@ dependencies = [ "syn 2.0.96", ] -[[package]] -name = "windows-core" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", - "windows-strings", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-implement" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - -[[package]] -name = "windows-interface" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "windows-registry" version = "0.2.0" @@ -23410,10 +22900,8 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" version = "0.6.24" -version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] @@ -23442,7 +22930,7 @@ checksum = "fbe1538eea6ea5ddbe5defd0dc82539ad7ba751e1631e9185d24a931f0a5adc8" dependencies = [ "anyhow", "id-arena", - "indexmap 2.7.0", + "indexmap 2.7.1", "log", "semver", "serde", @@ -23530,10 +23018,8 @@ dependencies = [ [[package]] name = "xattr" version = "1.4.0" -version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" -checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ "libc", "linux-raw-sys", @@ -23631,7 +23117,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", "synstructure", ] @@ -23654,7 +23139,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -23675,7 +23159,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", "synstructure", ] @@ -23697,7 +23180,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] @@ -23720,7 +23202,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.96", - "syn 2.0.96", ] [[package]] From ed1f122d462c77a64f91d8b30e2e2b94139beba3 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Wed, 22 Jan 2025 09:11:51 +0000 Subject: [PATCH 46/50] test --- rs/pocket_ic_server/tests/bitcoin_integration_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs b/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs index 02534b81387..2ca90bf1858 100644 --- a/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs +++ b/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs @@ -143,7 +143,7 @@ rpcauth=ic-btc-integration:cdf2741387f3a12438f69092f0fdad8e$62081498c98bee09a0dc // retry generating blocks until the bitcoind is up and running let start = std::time::Instant::now(); loop { - match btc_rpc.generate_to_address(n, &Address::from_str(&bitcoin_address).unwrap()) { + match btc_rpc.generate_to_address(n, &Address::from_str(&bitcoin_address).unwrap().assume_checked()) { Ok(_) => break, Err(bitcoincore_rpc::Error::JsonRpc(err)) => { if start.elapsed() > std::time::Duration::from_secs(30) { From 104b4cbb3922ff6565c9ce324aaeed601ba630cf Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Wed, 22 Jan 2025 09:20:33 +0000 Subject: [PATCH 47/50] clippy --- rs/pocket_ic_server/tests/bitcoin_integration_tests.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs b/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs index 2ca90bf1858..7b29841928c 100644 --- a/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs +++ b/rs/pocket_ic_server/tests/bitcoin_integration_tests.rs @@ -143,7 +143,12 @@ rpcauth=ic-btc-integration:cdf2741387f3a12438f69092f0fdad8e$62081498c98bee09a0dc // retry generating blocks until the bitcoind is up and running let start = std::time::Instant::now(); loop { - match btc_rpc.generate_to_address(n, &Address::from_str(&bitcoin_address).unwrap().assume_checked()) { + match btc_rpc.generate_to_address( + n, + &Address::from_str(&bitcoin_address) + .unwrap() + .assume_checked(), + ) { Ok(_) => break, Err(bitcoincore_rpc::Error::JsonRpc(err)) => { if start.elapsed() > std::time::Duration::from_secs(30) { From 559a112fa95f74d8232716cbab988708b50e2c37 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Wed, 22 Jan 2025 09:31:03 +0000 Subject: [PATCH 48/50] clipppy #2 --- rs/bitcoin/adapter/test_utils/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/rs/bitcoin/adapter/test_utils/src/lib.rs b/rs/bitcoin/adapter/test_utils/src/lib.rs index 452059a24a2..e8a52da88c6 100644 --- a/rs/bitcoin/adapter/test_utils/src/lib.rs +++ b/rs/bitcoin/adapter/test_utils/src/lib.rs @@ -23,7 +23,6 @@ pub const BLOCK_2_ENCODED: &str = "010000004860eb18bf1b1620e37e9490fc8a427514416 /// an overflow occurs if bits is set to 0. /// /// https://github.com/bitcoin/bitcoin/blame/master/src/chainparams.cpp#L402 - const TARGET: Target = Target::MAX_ATTAINABLE_REGTEST; fn decode_block(hex_str: &str) -> Block { From d4c71d851285996c9b305eaa166d9c2a2b9604ac Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Wed, 22 Jan 2025 09:51:27 +0000 Subject: [PATCH 49/50] remove sys --- Cargo.Bazel.json.lock | 8 +------- bazel/external_crates.bzl | 8 -------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 4bbc08c126c..66b64cdaab1 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "4ccd9584772f3080197c29d447288d85b80c5e050752533a7a9bc85d2d82e2cc", + "checksum": "7ad240f3364cce93e81bf6380ec76aa3f302372278b8a52d756062257be4a94e", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -63897,12 +63897,6 @@ "selects": {} }, "edition": "2021", - "rustc_flags": { - "common": [ - "--cfg=rust_secp_no_symbol_renaming" - ], - "selects": {} - }, "version": "0.10.0" }, "build_script_attrs": { diff --git a/bazel/external_crates.bzl b/bazel/external_crates.bzl index c71345e8ca4..260505df33d 100644 --- a/bazel/external_crates.bzl +++ b/bazel/external_crates.bzl @@ -100,14 +100,6 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable patch_args = ["-p4"], patches = ["@@//bazel:cranelift-codegen-meta.patch"], )], - "secp256k1-sys": [crate.annotation( - # This specific version is used by ic-btc-kyt canister, which - # requires an extra cfg flag to avoid linking issues. - # Applying the same cfg to other versions of secp256k1-sys - # may break other programs or tests. - version = "0.10.0", - rustc_flags = ["--cfg=rust_secp_no_symbol_renaming"], - )], "sha2": [crate.annotation( rustc_flags = [ "-C", From cfe72d83dc117d42b6cc6dc5e2ed57dc917dc6d6 Mon Sep 17 00:00:00 2001 From: Mihail Jianu Date: Wed, 22 Jan 2025 10:02:10 +0000 Subject: [PATCH 50/50] fuzzing lock --- Cargo.Bazel.Fuzzing.json.lock | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Cargo.Bazel.Fuzzing.json.lock b/Cargo.Bazel.Fuzzing.json.lock index 82f6ecb713d..9d2285fc1ec 100644 --- a/Cargo.Bazel.Fuzzing.json.lock +++ b/Cargo.Bazel.Fuzzing.json.lock @@ -1,5 +1,5 @@ { - "checksum": "1c46b4f6a233dc96e1b4073db2b128a7a9db0bb645704f7907e59c417999ee45", + "checksum": "475262dbd28292db6d93e541eab13ac549912709898d0661b6c38fca3e6408d5", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -64051,12 +64051,6 @@ "selects": {} }, "edition": "2021", - "rustc_flags": { - "common": [ - "--cfg=rust_secp_no_symbol_renaming" - ], - "selects": {} - }, "version": "0.10.0" }, "build_script_attrs": {