From e0da45bc1bfdc980d9caf9ffcd3b52d89530162c Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Sat, 18 May 2024 16:59:08 -0300 Subject: [PATCH 1/4] update orchard for zebra-consensus (#8529) --- Cargo.lock | 2 +- zebra-consensus/Cargo.toml | 2 +- zebra-consensus/src/primitives/halo2/tests.rs | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e393f2aad2d..cd7c77a960c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6067,7 +6067,7 @@ dependencies = [ "metrics 0.22.3", "num-integer", "once_cell", - "orchard 0.6.0", + "orchard 0.7.1", "proptest", "proptest-derive", "rand 0.8.5", diff --git a/zebra-consensus/Cargo.toml b/zebra-consensus/Cargo.toml index b2931f1f2e7..0c869f30dd3 100644 --- a/zebra-consensus/Cargo.toml +++ b/zebra-consensus/Cargo.toml @@ -58,7 +58,7 @@ tower = { version = "0.4.13", features = ["timeout", "util", "buffer"] } tracing = "0.1.39" tracing-futures = "0.2.5" -orchard = "0.6.0" +orchard = "0.7.0" zcash_proofs = { version = "0.13.0-rc.1", features = ["multicore" ] } wagyu-zcash-parameters = "0.2.0" diff --git a/zebra-consensus/src/primitives/halo2/tests.rs b/zebra-consensus/src/primitives/halo2/tests.rs index 2c2da9c2a0f..e654adcc546 100644 --- a/zebra-consensus/src/primitives/halo2/tests.rs +++ b/zebra-consensus/src/primitives/halo2/tests.rs @@ -7,7 +7,7 @@ use tower::ServiceExt; use halo2::pasta::{group::ff::PrimeField, pallas}; use orchard::{ - builder::Builder, + builder::{Builder, BundleType}, bundle::Flags, circuit::ProvingKey, keys::{FullViewingKey, Scope, SpendingKey}, @@ -32,8 +32,6 @@ fn generate_test_vectors() { let sk = SpendingKey::from_bytes([7; 32]).unwrap(); let recipient = FullViewingKey::from(&sk).address_at(0u32, Scope::External); - let enable_spends = true; - let enable_outputs = true; let flags = zebra_chain::orchard::Flags::ENABLE_SPENDS | zebra_chain::orchard::Flags::ENABLE_OUTPUTS; @@ -43,17 +41,20 @@ fn generate_test_vectors() { let shielded_data: Vec = (1..=4) .map(|num_recipients| { let mut builder = Builder::new( - Flags::from_parts(enable_spends, enable_outputs), + BundleType::Transactional { + flags: Flags::from_byte(flags.bits()).unwrap(), + bundle_required: true, + }, Anchor::from_bytes(anchor_bytes).unwrap(), ); for _ in 0..num_recipients { builder - .add_recipient(None, recipient, NoteValue::from_raw(note_value), None) + .add_output(None, recipient, NoteValue::from_raw(note_value), None) .unwrap(); } - let bundle: Bundle<_, i64> = builder.build(rng).unwrap(); + let bundle: Bundle<_, i64> = builder.build(rng).unwrap().unwrap().0; let bundle = bundle .create_proof(&proving_key, rng) From 5ca40aa58b9aff32632a59d27de75147836860ec Mon Sep 17 00:00:00 2001 From: Arya Date: Sat, 18 May 2024 16:30:59 -0400 Subject: [PATCH 2/4] add(network): Adds a network magic field to `testnet::Parameters` and the config (#8524) * Adds a `target_difficulty_limit` field on `testnet::Parameters` * updates test to increment block nonce until finding a block that's below the difficulty threshold * increment the nonce while the difficulty is invalid instead of while the difficulty threshold is invalid * Adds comments * moves network Magic type from zebra-network to zebra-chain * Adds `network_magic` field to `testnet::Parameters` and uses the regtest network magic from zcashd * Add a network magic config field for custom testnets * Adds/updates tests * Update zebra-chain/src/parameters/network/testnet.rs * Adds a link to the Regtest network magic in zcashd --------- Co-authored-by: Alfredo Garcia --- zebra-chain/src/parameters.rs | 2 +- zebra-chain/src/parameters/constants.rs | 12 +++ zebra-chain/src/parameters/network.rs | 3 +- zebra-chain/src/parameters/network/magic.rs | 56 ++++++++++++ zebra-chain/src/parameters/network/testnet.rs | 37 +++++++- zebra-network/src/config.rs | 29 ++++-- zebra-network/src/constants.rs | 9 -- zebra-network/src/protocol/external/codec.rs | 6 +- .../protocol/external/codec/tests/vectors.rs | 20 ++++ zebra-network/src/protocol/external/types.rs | 54 +---------- zebra-state/src/service/read/address/utxo.rs | 2 +- zebrad/tests/common/configs/v1.8.0.toml | 91 +++++++++++++++++++ 12 files changed, 240 insertions(+), 81 deletions(-) create mode 100644 zebra-chain/src/parameters/network/magic.rs create mode 100644 zebrad/tests/common/configs/v1.8.0.toml diff --git a/zebra-chain/src/parameters.rs b/zebra-chain/src/parameters.rs index acae466fc6d..bfe806556a4 100644 --- a/zebra-chain/src/parameters.rs +++ b/zebra-chain/src/parameters.rs @@ -22,7 +22,7 @@ mod transaction; pub mod arbitrary; pub use genesis::*; -pub use network::{testnet, Network, NetworkKind}; +pub use network::{magic::Magic, testnet, Network, NetworkKind}; pub use network_upgrade::*; pub use transaction::*; diff --git a/zebra-chain/src/parameters/constants.rs b/zebra-chain/src/parameters/constants.rs index cb988c36c4e..548ad496e7d 100644 --- a/zebra-chain/src/parameters/constants.rs +++ b/zebra-chain/src/parameters/constants.rs @@ -15,3 +15,15 @@ pub const SLOW_START_INTERVAL: Height = Height(20_000); /// /// This calculation is exact, because `SLOW_START_INTERVAL` is divisible by 2. pub const SLOW_START_SHIFT: Height = Height(SLOW_START_INTERVAL.0 / 2); + +/// Magic numbers used to identify different Zcash networks. +pub mod magics { + use crate::parameters::network::magic::Magic; + + /// The production mainnet. + pub const MAINNET: Magic = Magic([0x24, 0xe9, 0x27, 0x64]); + /// The testnet. + pub const TESTNET: Magic = Magic([0xfa, 0x1a, 0xf9, 0xbf]); + /// The regtest, see + pub const REGTEST: Magic = Magic([0xaa, 0xe8, 0x3f, 0x5f]); +} diff --git a/zebra-chain/src/parameters/network.rs b/zebra-chain/src/parameters/network.rs index b9631e627e0..dd58012446c 100644 --- a/zebra-chain/src/parameters/network.rs +++ b/zebra-chain/src/parameters/network.rs @@ -9,6 +9,7 @@ use crate::{ parameters::NetworkUpgrade, }; +pub mod magic; pub mod testnet; #[cfg(test)] @@ -75,7 +76,7 @@ impl From for NetworkKind { } /// An enum describing the possible network choices. -#[derive(Clone, Debug, Default, Eq, PartialEq, Hash, Serialize)] +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)] #[serde(into = "NetworkKind")] pub enum Network { /// The production mainnet. diff --git a/zebra-chain/src/parameters/network/magic.rs b/zebra-chain/src/parameters/network/magic.rs new file mode 100644 index 00000000000..692a1b8d1ab --- /dev/null +++ b/zebra-chain/src/parameters/network/magic.rs @@ -0,0 +1,56 @@ +//! Network `Magic` type and implementation. + +use std::fmt; + +use crate::parameters::{constants::magics, Network}; + +#[cfg(any(test, feature = "proptest-impl"))] +use proptest_derive::Arbitrary; + +/// A magic number identifying the network. +#[derive(Copy, Clone, Eq, PartialEq)] +#[cfg_attr(any(test, feature = "proptest-impl"), derive(Arbitrary))] +pub struct Magic(pub [u8; 4]); + +impl fmt::Debug for Magic { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_tuple("Magic").field(&hex::encode(self.0)).finish() + } +} + +impl Network { + /// Get the magic value associated to this `Network`. + pub fn magic(&self) -> Magic { + match self { + Network::Mainnet => magics::MAINNET, + Network::Testnet(params) => params.network_magic(), + } + } +} + +#[cfg(test)] +mod proptest { + + use proptest::prelude::*; + + use super::{magics, Magic}; + + #[test] + fn magic_debug() { + let _init_guard = zebra_test::init(); + + assert_eq!(format!("{:?}", magics::MAINNET), "Magic(\"24e92764\")"); + assert_eq!(format!("{:?}", magics::TESTNET), "Magic(\"fa1af9bf\")"); + assert_eq!(format!("{:?}", magics::REGTEST), "Magic(\"aae83f5f\")"); + } + + proptest! { + + #[test] + fn proptest_magic_from_array(data in any::<[u8; 4]>()) { + let _init_guard = zebra_test::init(); + + assert_eq!(format!("{:?}", Magic(data)), format!("Magic({:x?})", hex::encode(data))); + } + } +} diff --git a/zebra-chain/src/parameters/network/testnet.rs b/zebra-chain/src/parameters/network/testnet.rs index 58d810e5871..e4f69d4feef 100644 --- a/zebra-chain/src/parameters/network/testnet.rs +++ b/zebra-chain/src/parameters/network/testnet.rs @@ -6,13 +6,15 @@ use zcash_primitives::constants as zp_constants; use crate::{ block::{self, Height}, parameters::{ - constants::{SLOW_START_INTERVAL, SLOW_START_SHIFT}, + constants::{magics, SLOW_START_INTERVAL, SLOW_START_SHIFT}, network_upgrade::TESTNET_ACTIVATION_HEIGHTS, Network, NetworkUpgrade, NETWORK_UPGRADES_IN_ORDER, }, work::difficulty::{ExpandedDifficulty, U256}, }; +use super::magic::Magic; + /// The Regtest NU5 activation height in tests // TODO: Serialize testnet parameters in Config then remove this and use a configured NU5 activation height. #[cfg(any(test, feature = "proptest-impl"))] @@ -64,10 +66,12 @@ pub struct ConfiguredActivationHeights { } /// Builder for the [`Parameters`] struct. -#[derive(Clone, Debug, Eq, PartialEq, Hash)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct ParametersBuilder { /// The name of this network to be used by the `Display` trait impl. network_name: String, + /// The network magic, acts as an identifier for the network. + network_magic: Magic, /// The genesis block hash genesis_hash: block::Hash, /// The network upgrade activation heights for this network, see [`Parameters::activation_heights`] for more details. @@ -91,6 +95,7 @@ impl Default for ParametersBuilder { fn default() -> Self { Self { network_name: "UnknownTestnet".to_string(), + network_magic: magics::TESTNET, // # Correctness // // `Genesis` network upgrade activation height must always be 0 @@ -148,6 +153,20 @@ impl ParametersBuilder { self } + /// Sets the network name to be used in the [`Parameters`] being built. + pub fn with_network_magic(mut self, network_magic: Magic) -> Self { + assert!( + [magics::MAINNET, magics::REGTEST] + .into_iter() + .all(|reserved_magic| network_magic != reserved_magic), + "network magic should be distinct from reserved network magics" + ); + + self.network_magic = network_magic; + + self + } + /// Checks that the provided Sapling human-readable prefixes (HRPs) are valid and unique, then /// sets the Sapling HRPs to be used in the [`Parameters`] being built. pub fn with_sapling_hrps( @@ -283,6 +302,7 @@ impl ParametersBuilder { pub fn finish(self) -> Parameters { let Self { network_name, + network_magic, genesis_hash, activation_heights, hrp_sapling_extended_spending_key, @@ -294,6 +314,7 @@ impl ParametersBuilder { } = self; Parameters { network_name, + network_magic, genesis_hash, activation_heights, hrp_sapling_extended_spending_key, @@ -313,10 +334,12 @@ impl ParametersBuilder { } /// Network consensus parameters for test networks such as Regtest and the default Testnet. -#[derive(Clone, Debug, Eq, PartialEq, Hash)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct Parameters { /// The name of this network to be used by the `Display` trait impl. network_name: String, + /// The network magic, acts as an identifier for the network. + network_magic: Magic, /// The genesis block hash genesis_hash: block::Hash, /// The network upgrade activation heights for this network. @@ -366,6 +389,7 @@ impl Parameters { Self { network_name: "Regtest".to_string(), + network_magic: magics::REGTEST, ..Self::build() .with_genesis_hash(REGTEST_GENESIS_HASH) // This value is chosen to match zcashd, see: @@ -397,6 +421,7 @@ impl Parameters { pub fn is_regtest(&self) -> bool { let Self { network_name, + network_magic, genesis_hash, // Activation heights are configurable on Regtest activation_heights: _, @@ -410,6 +435,7 @@ impl Parameters { } = Self::new_regtest(None); self.network_name == network_name + && self.network_magic == network_magic && self.genesis_hash == genesis_hash && self.hrp_sapling_extended_spending_key == hrp_sapling_extended_spending_key && self.hrp_sapling_extended_full_viewing_key == hrp_sapling_extended_full_viewing_key @@ -425,6 +451,11 @@ impl Parameters { &self.network_name } + /// Returns the network magic + pub fn network_magic(&self) -> Magic { + self.network_magic + } + /// Returns the genesis hash pub fn genesis_hash(&self) -> block::Hash { self.genesis_hash diff --git a/zebra-network/src/config.rs b/zebra-network/src/config.rs index 4c7956887c1..9ab27cc961c 100644 --- a/zebra-network/src/config.rs +++ b/zebra-network/src/config.rs @@ -16,7 +16,7 @@ use tracing::Span; use zebra_chain::parameters::{ testnet::{self, ConfiguredActivationHeights}, - Network, NetworkKind, + Magic, Network, NetworkKind, }; use crate::{ @@ -636,6 +636,7 @@ impl<'de> Deserialize<'de> for Config { { #[derive(Deserialize)] struct DTestnetParameters { + network_magic: Option<[u8; 4]>, network_name: Option, activation_heights: Option, } @@ -718,26 +719,34 @@ impl<'de> Deserialize<'de> for Config { NetworkKind::Testnet, Some(DTestnetParameters { network_name, + network_magic, activation_heights, }), ) => { let mut params_builder = testnet::Parameters::build(); + let should_avoid_default_peers = + network_magic.is_some() || activation_heights.is_some(); + + // Return an error if the initial testnet peers includes any of the default initial Mainnet or Testnet + // peers while activation heights or a custom network magic is configured. + if should_avoid_default_peers + && contains_default_initial_peers(&initial_testnet_peers) + { + return Err(de::Error::custom( + "cannot use default initials peers with incompatible testnet", + )); + } if let Some(network_name) = network_name { params_builder = params_builder.with_network_name(network_name) } + if let Some(network_magic) = network_magic { + params_builder = params_builder.with_network_magic(Magic(network_magic)); + } + // Retain default Testnet activation heights unless there's an empty [testnet_parameters.activation_heights] section. if let Some(activation_heights) = activation_heights { - // Return an error if the initial testnet peers includes any of the default initial Mainnet or Testnet - // peers while activation heights are configured. - // TODO: Check that the network magic is different from the default Mainnet/Testnet network magic too? - if contains_default_initial_peers(&initial_testnet_peers) { - return Err(de::Error::custom( - "cannot use default initial testnet peers with configured activation heights", - )); - } - params_builder = params_builder.with_activation_heights(activation_heights) } diff --git a/zebra-network/src/constants.rs b/zebra-network/src/constants.rs index 4e49698b747..12b18b25450 100644 --- a/zebra-network/src/constants.rs +++ b/zebra-network/src/constants.rs @@ -422,15 +422,6 @@ lazy_static! { /// [6.1.3.3 Efficient Resource Usage] pub const DNS_LOOKUP_TIMEOUT: Duration = Duration::from_secs(5); -/// Magic numbers used to identify different Zcash networks. -pub mod magics { - use super::*; - /// The production mainnet. - pub const MAINNET: Magic = Magic([0x24, 0xe9, 0x27, 0x64]); - /// The testnet. - pub const TESTNET: Magic = Magic([0xfa, 0x1a, 0xf9, 0xbf]); -} - #[cfg(test)] mod tests { use zebra_chain::parameters::POST_BLOSSOM_POW_TARGET_SPACING; diff --git a/zebra-network/src/protocol/external/codec.rs b/zebra-network/src/protocol/external/codec.rs index a2a267b2338..1c99b33621f 100644 --- a/zebra-network/src/protocol/external/codec.rs +++ b/zebra-network/src/protocol/external/codec.rs @@ -13,7 +13,7 @@ use tokio_util::codec::{Decoder, Encoder}; use zebra_chain::{ block::{self, Block}, - parameters::Network, + parameters::{Magic, Network}, serialization::{ sha256d, zcash_deserialize_bytes_external_count, zcash_deserialize_string_external_count, CompactSizeMessage, FakeWriter, ReadZcashExt, SerializationError as Error, @@ -163,7 +163,7 @@ impl Encoder for Codec { let start_len = dst.len(); { let dst = &mut dst.writer(); - dst.write_all(&self.builder.network.magic_value().0[..])?; + dst.write_all(&self.builder.network.magic().0[..])?; dst.write_all(command)?; dst.write_u32::(body_length as u32)?; @@ -389,7 +389,7 @@ impl Decoder for Codec { "read header from src buffer" ); - if magic != self.builder.network.magic_value() { + if magic != self.builder.network.magic() { return Err(Parse("supplied magic did not meet expectations")); } if body_len > self.builder.max_len { diff --git a/zebra-network/src/protocol/external/codec/tests/vectors.rs b/zebra-network/src/protocol/external/codec/tests/vectors.rs index 74f46ec7f52..da6b3ce5830 100644 --- a/zebra-network/src/protocol/external/codec/tests/vectors.rs +++ b/zebra-network/src/protocol/external/codec/tests/vectors.rs @@ -587,3 +587,23 @@ fn reject_command_and_reason_size_limits() { }; } } + +/// Check that the version test vector deserialization fails when there's a network magic mismatch. +#[test] +fn message_with_wrong_network_magic_returns_error() { + let _init_guard = zebra_test::init(); + let mut codec = Codec::builder().finish(); + let mut bytes = BytesMut::new(); + + codec + .encode(VERSION_TEST_VECTOR.clone(), &mut bytes) + .expect("encoding should succeed"); + + let mut codec = Codec::builder() + .for_network(&Network::new_default_testnet()) + .finish(); + + codec + .decode(&mut bytes) + .expect_err("decoding message with mismatching network magic should return an error"); +} diff --git a/zebra-network/src/protocol/external/types.rs b/zebra-network/src/protocol/external/types.rs index 0e35698a711..f15275d3b3a 100644 --- a/zebra-network/src/protocol/external/types.rs +++ b/zebra-network/src/protocol/external/types.rs @@ -8,35 +8,11 @@ use zebra_chain::{ }, }; -use crate::constants::{self, magics, CURRENT_NETWORK_PROTOCOL_VERSION}; +use crate::constants::{self, CURRENT_NETWORK_PROTOCOL_VERSION}; #[cfg(any(test, feature = "proptest-impl"))] use proptest_derive::Arbitrary; -/// A magic number identifying the network. -#[derive(Copy, Clone, Eq, PartialEq)] -#[cfg_attr(any(test, feature = "proptest-impl"), derive(Arbitrary))] -pub struct Magic(pub [u8; 4]); - -impl fmt::Debug for Magic { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("Magic").field(&hex::encode(self.0)).finish() - } -} -pub(crate) trait ParameterMagic { - fn magic_value(&self) -> Magic; -} -impl ParameterMagic for Network { - /// Get the magic value associated to this `Network`. - fn magic_value(&self) -> Magic { - match self { - Network::Mainnet => magics::MAINNET, - // TODO: Move `Magic` struct definition to `zebra-chain`, add it as a field in `testnet::Parameters`, and return it here. - Network::Testnet(_params) => magics::TESTNET, - } - } -} - /// A protocol version number. #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Version(pub u32); @@ -168,34 +144,6 @@ impl Default for Tweak { #[cfg_attr(any(test, feature = "proptest-impl"), derive(Arbitrary))] pub struct Filter(pub Vec); -#[cfg(test)] -mod proptest { - - use proptest::prelude::*; - - use super::Magic; - - use crate::constants::magics; - - #[test] - fn magic_debug() { - let _init_guard = zebra_test::init(); - - assert_eq!(format!("{:?}", magics::MAINNET), "Magic(\"24e92764\")"); - assert_eq!(format!("{:?}", magics::TESTNET), "Magic(\"fa1af9bf\")"); - } - - proptest! { - - #[test] - fn proptest_magic_from_array(data in any::<[u8; 4]>()) { - let _init_guard = zebra_test::init(); - - assert_eq!(format!("{:?}", Magic(data)), format!("Magic({:x?})", hex::encode(data))); - } - } -} - #[cfg(test)] mod test { use super::*; diff --git a/zebra-state/src/service/read/address/utxo.rs b/zebra-state/src/service/read/address/utxo.rs index d045bd4d3eb..76a42ac838d 100644 --- a/zebra-state/src/service/read/address/utxo.rs +++ b/zebra-state/src/service/read/address/utxo.rs @@ -33,7 +33,7 @@ pub const ADDRESS_HEIGHTS_FULL_RANGE: RangeInclusive = Height(1)..=Heigh /// A convenience wrapper that efficiently stores unspent transparent outputs, /// and the corresponding transaction IDs. -#[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] +#[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct AddressUtxos { /// A set of unspent transparent outputs. utxos: BTreeMap, diff --git a/zebrad/tests/common/configs/v1.8.0.toml b/zebrad/tests/common/configs/v1.8.0.toml new file mode 100644 index 00000000000..6c70283715c --- /dev/null +++ b/zebrad/tests/common/configs/v1.8.0.toml @@ -0,0 +1,91 @@ +# Default configuration for zebrad. +# +# This file can be used as a skeleton for custom configs. +# +# Unspecified fields use default values. Optional fields are Some(field) if the +# field is present and None if it is absent. +# +# This file is generated as an example using zebrad's current defaults. +# You should set only the config options you want to keep, and delete the rest. +# Only a subset of fields are present in the skeleton, since optional values +# whose default is None are omitted. +# +# The config format (including a complete list of sections and fields) is +# documented here: +# https://docs.rs/zebrad/latest/zebrad/config/struct.ZebradConfig.html +# +# zebrad attempts to load configs in the following order: +# +# 1. The -c flag on the command line, e.g., `zebrad -c myconfig.toml start`; +# 2. The file `zebrad.toml` in the users's preference directory (platform-dependent); +# 3. The default config. +# +# The user's preference directory and the default path to the `zebrad` config are platform dependent, +# based on `dirs::preference_dir`, see https://docs.rs/dirs/latest/dirs/fn.preference_dir.html : +# +# | Platform | Value | Example | +# | -------- | ------------------------------------- | ---------------------------------------------- | +# | Linux | `$XDG_CONFIG_HOME` or `$HOME/.config` | `/home/alice/.config/zebrad.toml` | +# | macOS | `$HOME/Library/Preferences` | `/Users/Alice/Library/Preferences/zebrad.toml` | +# | Windows | `{FOLDERID_RoamingAppData}` | `C:\Users\Alice\AppData\Local\zebrad.toml` | + +[consensus] +checkpoint_sync = true + +[mempool] +eviction_memory_time = "1h" +tx_cost_limit = 80000000 + +[metrics] + +[mining] +debug_like_zcashd = true + +[network] +cache_dir = true +crawl_new_peer_interval = "1m 1s" +initial_mainnet_peers = [ + "dnsseed.z.cash:8233", + "dnsseed.str4d.xyz:8233", + "mainnet.seeder.zfnd.org:8233", + "mainnet.is.yolo.money:8233", +] +initial_testnet_peers = [] +listen_addr = "0.0.0.0:8233" +max_connections_per_ip = 1 +network = "Testnet" +peerset_initial_target_size = 25 + +[network.testnet_parameters] +network_name = "ConfiguredTestnet_1" +network_magic = [0, 0, 0, 0] + +[network.testnet_parameters.activation_heights] +BeforeOverwinter = 1 +Overwinter = 207_500 +Sapling = 280_000 +Blossom = 584_000 +Heartwood = 903_800 +Canopy = 1_028_500 +NU5 = 1_842_420 + +[rpc] +debug_force_finished_sync = false +parallel_cpu_threads = 0 + +[state] +cache_dir = "cache_dir" +delete_old_database = true +ephemeral = false + +[sync] +checkpoint_verify_concurrency_limit = 1000 +download_concurrency_limit = 50 +full_verify_concurrency_limit = 20 +parallel_cpu_threads = 0 + +[tracing] +buffer_limit = 128000 +force_use_color = false +use_color = true +use_journald = false From c494aa7bd1796be4d5cf4fd88921c0f6982eaa20 Mon Sep 17 00:00:00 2001 From: Arya Date: Mon, 20 May 2024 09:11:34 -0400 Subject: [PATCH 3/4] change(network): Allow custom testnets to make peer connections and configure more parameters (#8528) * Allow custom testnets to define more parameters and to make peer connections based on the initial_testnet_peer config field * Updates latest stored test config * Update zebra-network/src/config.rs Co-authored-by: Arya --------- Co-authored-by: Marek --- zebra-chain/src/parameters/network/testnet.rs | 8 ++- zebra-network/src/config.rs | 54 +++++++++++++++---- zebrad/tests/common/configs/v1.8.0.toml | 3 ++ 3 files changed, 53 insertions(+), 12 deletions(-) diff --git a/zebra-chain/src/parameters/network/testnet.rs b/zebra-chain/src/parameters/network/testnet.rs index e4f69d4feef..7e7a56729fa 100644 --- a/zebra-chain/src/parameters/network/testnet.rs +++ b/zebra-chain/src/parameters/network/testnet.rs @@ -284,8 +284,12 @@ impl ParametersBuilder { /// Sets the target difficulty limit to be used in the [`Parameters`] being built. // TODO: Accept a hex-encoded String instead? - pub fn with_target_difficulty_limit(mut self, target_difficulty_limit: U256) -> Self { - self.target_difficulty_limit = ExpandedDifficulty::from(target_difficulty_limit) + pub fn with_target_difficulty_limit( + mut self, + target_difficulty_limit: impl Into, + ) -> Self { + self.target_difficulty_limit = target_difficulty_limit + .into() .to_compact() .to_expanded() .expect("difficulty limits are valid expanded values"); diff --git a/zebra-network/src/config.rs b/zebra-network/src/config.rs index 9ab27cc961c..63700f4fa18 100644 --- a/zebra-network/src/config.rs +++ b/zebra-network/src/config.rs @@ -14,9 +14,12 @@ use tempfile::NamedTempFile; use tokio::{fs, io::AsyncWriteExt}; use tracing::Span; -use zebra_chain::parameters::{ - testnet::{self, ConfiguredActivationHeights}, - Magic, Network, NetworkKind, +use zebra_chain::{ + parameters::{ + testnet::{self, ConfiguredActivationHeights}, + Magic, Network, NetworkKind, + }, + work::difficulty::U256, }; use crate::{ @@ -235,10 +238,8 @@ impl Config { pub fn initial_peer_hostnames(&self) -> IndexSet { match &self.network { Network::Mainnet => self.initial_mainnet_peers.clone(), - Network::Testnet(params) if params.is_default_testnet() => { - self.initial_testnet_peers.clone() - } - // TODO: Add a `disable_peers` field to `Network` to check instead of `is_default_testnet()` (#8361) + Network::Testnet(params) if !params.is_regtest() => self.initial_testnet_peers.clone(), + // TODO: Add a `disable_peers` field to `Network` to check instead of `is_regtest()` (#8361) Network::Testnet(_params) => IndexSet::new(), } } @@ -250,6 +251,11 @@ impl Config { /// /// If a configured address is an invalid [`SocketAddr`] or DNS name. pub async fn initial_peers(&self) -> HashSet { + // Return early if network is regtest in case there are somehow any entries in the peer cache + if self.network.is_regtest() { + return HashSet::new(); + } + // TODO: do DNS and disk in parallel if startup speed becomes important let dns_peers = Config::resolve_peers(&self.initial_peer_hostnames().iter().cloned().collect()).await; @@ -636,8 +642,11 @@ impl<'de> Deserialize<'de> for Config { { #[derive(Deserialize)] struct DTestnetParameters { - network_magic: Option<[u8; 4]>, network_name: Option, + network_magic: Option<[u8; 4]>, + slow_start_interval: Option, + target_difficulty_limit: Option, + disable_pow: Option, activation_heights: Option, } @@ -720,12 +729,19 @@ impl<'de> Deserialize<'de> for Config { Some(DTestnetParameters { network_name, network_magic, + slow_start_interval, + target_difficulty_limit, + disable_pow, activation_heights, }), ) => { let mut params_builder = testnet::Parameters::build(); - let should_avoid_default_peers = - network_magic.is_some() || activation_heights.is_some(); + // TODO: allow default peers when fields match default testnet values? + let should_avoid_default_peers = network_magic.is_some() + || slow_start_interval.is_some() + || target_difficulty_limit.is_some() + || disable_pow == Some(true) + || activation_heights.is_some(); // Return an error if the initial testnet peers includes any of the default initial Mainnet or Testnet // peers while activation heights or a custom network magic is configured. @@ -745,6 +761,24 @@ impl<'de> Deserialize<'de> for Config { params_builder = params_builder.with_network_magic(Magic(network_magic)); } + if let Some(slow_start_interval) = slow_start_interval { + params_builder = params_builder.with_slow_start_interval( + slow_start_interval.try_into().map_err(de::Error::custom)?, + ); + } + + if let Some(target_difficulty_limit) = target_difficulty_limit { + params_builder = params_builder.with_target_difficulty_limit( + target_difficulty_limit + .parse::() + .map_err(de::Error::custom)?, + ); + } + + if let Some(disable_pow) = disable_pow { + params_builder = params_builder.with_disable_pow(disable_pow); + } + // Retain default Testnet activation heights unless there's an empty [testnet_parameters.activation_heights] section. if let Some(activation_heights) = activation_heights { params_builder = params_builder.with_activation_heights(activation_heights) diff --git a/zebrad/tests/common/configs/v1.8.0.toml b/zebrad/tests/common/configs/v1.8.0.toml index 6c70283715c..8a769aa14d0 100644 --- a/zebrad/tests/common/configs/v1.8.0.toml +++ b/zebrad/tests/common/configs/v1.8.0.toml @@ -59,6 +59,9 @@ peerset_initial_target_size = 25 [network.testnet_parameters] network_name = "ConfiguredTestnet_1" network_magic = [0, 0, 0, 0] +slow_start_interval = 0 +target_difficulty_limit = "0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f" +disable_pow = true [network.testnet_parameters.activation_heights] BeforeOverwinter = 1 From 0cceb6abda45468e13171694306c8ea385654a5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 19:50:59 +0000 Subject: [PATCH 4/4] build(deps): bump the prod group with 7 updates (#8557) Bumps the prod group with 7 updates: | Package | From | To | | --- | --- | --- | | [serde](https://github.com/serde-rs/serde) | `1.0.201` | `1.0.202` | | [toml](https://github.com/toml-rs/toml) | `0.8.12` | `0.8.13` | | [thiserror](https://github.com/dtolnay/thiserror) | `1.0.60` | `1.0.61` | | [insta](https://github.com/mitsuhiko/insta) | `1.38.0` | `1.39.0` | | [prost](https://github.com/tokio-rs/prost) | `0.12.4` | `0.12.6` | | [itertools](https://github.com/rust-itertools/itertools) | `0.12.1` | `0.13.0` | | [syn](https://github.com/dtolnay/syn) | `2.0.63` | `2.0.65` | Updates `serde` from 1.0.201 to 1.0.202 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.201...v1.0.202) Updates `toml` from 0.8.12 to 0.8.13 - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.12...toml-v0.8.13) Updates `thiserror` from 1.0.60 to 1.0.61 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.60...1.0.61) Updates `insta` from 1.38.0 to 1.39.0 - [Release notes](https://github.com/mitsuhiko/insta/releases) - [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md) - [Commits](https://github.com/mitsuhiko/insta/compare/1.38.0...1.39.0) Updates `prost` from 0.12.4 to 0.12.6 - [Release notes](https://github.com/tokio-rs/prost/releases) - [Commits](https://github.com/tokio-rs/prost/compare/v0.12.4...v0.12.6) Updates `itertools` from 0.12.1 to 0.13.0 - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/compare/v0.12.1...v0.13.0) Updates `syn` from 2.0.63 to 2.0.65 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.63...2.0.65) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch dependency-group: prod - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch dependency-group: prod - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: prod - dependency-name: insta dependency-type: direct:production update-type: version-update:semver-minor dependency-group: prod - dependency-name: prost dependency-type: direct:production update-type: version-update:semver-patch dependency-group: prod - dependency-name: itertools dependency-type: direct:production update-type: version-update:semver-minor dependency-group: prod - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch dependency-group: prod ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 134 ++++++++++++++++----------------- zebra-chain/Cargo.toml | 6 +- zebra-consensus/Cargo.toml | 4 +- zebra-grpc/Cargo.toml | 6 +- zebra-network/Cargo.toml | 8 +- zebra-node-services/Cargo.toml | 4 +- zebra-rpc/Cargo.toml | 6 +- zebra-scan/Cargo.toml | 6 +- zebra-script/Cargo.toml | 2 +- zebra-state/Cargo.toml | 8 +- zebra-test/Cargo.toml | 6 +- zebra-utils/Cargo.toml | 8 +- zebrad/Cargo.toml | 10 +-- 13 files changed, 104 insertions(+), 104 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd7c77a960c..9fb4cd9ffaa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -240,7 +240,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -251,7 +251,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -406,7 +406,7 @@ dependencies = [ "bitflags 2.5.0", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools 0.10.5", "lazy_static", "lazycell", "log", @@ -416,7 +416,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.63", + "syn 2.0.65", "which", ] @@ -814,7 +814,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -1075,7 +1075,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -1099,7 +1099,7 @@ dependencies = [ "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -1116,7 +1116,7 @@ checksum = "7743446286141c9f6d4497c493c01234eb848e14d2e20866ae9811eae0630cb9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -1164,7 +1164,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -1186,7 +1186,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core 0.20.8", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -1259,7 +1259,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -1564,7 +1564,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -2214,9 +2214,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.38.0" +version = "1.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eab73f58e59ca6526037208f0e98851159ec1633cf17b6cd2e1f2c3fd5d53cc" +checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" dependencies = [ "console", "lazy_static", @@ -2271,9 +2271,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -2625,7 +2625,7 @@ checksum = "38b4faf00617defe497754acde3024865bc143d44a86799b24e191ecff91354f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -3090,7 +3090,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -3131,7 +3131,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -3232,7 +3232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" dependencies = [ "proc-macro2", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -3330,9 +3330,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", "prost-derive", @@ -3346,7 +3346,7 @@ checksum = "80b776a1b2dc779f5ee0641f8ade0125bc1298dd41a9a0c16d8bd57b42d222b1" dependencies = [ "bytes", "heck 0.5.0", - "itertools 0.12.1", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -3355,21 +3355,21 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.63", + "syn 2.0.65", "tempfile", ] [[package]] name = "prost-derive" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.10.5", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -4085,9 +4085,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.201" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] @@ -4103,13 +4103,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.201" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -4126,9 +4126,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -4194,7 +4194,7 @@ dependencies = [ "darling 0.20.8", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -4423,9 +4423,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.63" +version = "2.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" +checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" dependencies = [ "proc-macro2", "quote", @@ -4509,22 +4509,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -4647,7 +4647,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -4723,21 +4723,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.12", + "toml_edit 0.22.13", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -4755,9 +4755,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap 2.2.6", "serde", @@ -4830,7 +4830,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -4843,7 +4843,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -4973,7 +4973,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -5411,7 +5411,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", "wasm-bindgen-shared", ] @@ -5445,7 +5445,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6008,7 +6008,7 @@ dependencies = [ "hex", "humantime", "incrementalmerkletree", - "itertools 0.12.1", + "itertools 0.13.0", "jubjub", "lazy_static", "num-integer", @@ -6129,7 +6129,7 @@ dependencies = [ "howudoin", "humantime-serde", "indexmap 2.2.6", - "itertools 0.12.1", + "itertools 0.13.0", "lazy_static", "metrics 0.22.3", "num-integer", @@ -6147,7 +6147,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util 0.7.11", - "toml 0.8.12", + "toml 0.8.13", "tower", "tracing", "tracing-error", @@ -6212,7 +6212,7 @@ dependencies = [ "group", "indexmap 2.2.6", "insta", - "itertools 0.12.1", + "itertools 0.13.0", "jubjub", "proptest", "proptest-derive", @@ -6263,7 +6263,7 @@ dependencies = [ "humantime-serde", "indexmap 2.2.6", "insta", - "itertools 0.12.1", + "itertools 0.13.0", "jubjub", "lazy_static", "metrics 0.22.3", @@ -6300,7 +6300,7 @@ dependencies = [ "humantime", "indexmap 2.2.6", "insta", - "itertools 0.12.1", + "itertools 0.13.0", "lazy_static", "once_cell", "owo-colors 4.0.0", @@ -6324,7 +6324,7 @@ version = "1.0.0-beta.37" dependencies = [ "color-eyre", "hex", - "itertools 0.12.1", + "itertools 0.13.0", "jsonrpc", "quote", "regex", @@ -6333,7 +6333,7 @@ dependencies = [ "serde_json", "serde_yaml", "structopt", - "syn 2.0.63", + "syn 2.0.65", "thiserror", "tinyvec", "tokio", @@ -6392,7 +6392,7 @@ dependencies = [ "tinyvec", "tokio", "tokio-stream", - "toml 0.8.12", + "toml 0.8.13", "tonic 0.11.0", "tonic-build 0.11.0", "tower", @@ -6434,7 +6434,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] @@ -6454,7 +6454,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.65", ] [[package]] diff --git a/zebra-chain/Cargo.toml b/zebra-chain/Cargo.toml index 6deeff82e12..9e84065371c 100644 --- a/zebra-chain/Cargo.toml +++ b/zebra-chain/Cargo.toml @@ -108,18 +108,18 @@ humantime = "2.1.0" # Error Handling & Formatting displaydoc = "0.2.4" static_assertions = "1.1.0" -thiserror = "1.0.60" +thiserror = "1.0.61" tracing = "0.1.39" # Serialization hex = { version = "0.4.3", features = ["serde"] } -serde = { version = "1.0.201", features = ["serde_derive", "rc"] } +serde = { version = "1.0.202", features = ["serde_derive", "rc"] } serde_with = "3.7.0" serde-big-array = "0.5.1" # Processing futures = "0.3.30" -itertools = "0.12.1" +itertools = "0.13.0" rayon = "1.10.0" # ZF deps diff --git a/zebra-consensus/Cargo.toml b/zebra-consensus/Cargo.toml index 0c869f30dd3..8994ad7d487 100644 --- a/zebra-consensus/Cargo.toml +++ b/zebra-consensus/Cargo.toml @@ -47,12 +47,12 @@ chrono = { version = "0.4.38", default-features = false, features = ["clock", "s displaydoc = "0.2.4" lazy_static = "1.4.0" once_cell = "1.18.0" -serde = { version = "1.0.201", features = ["serde_derive"] } +serde = { version = "1.0.202", features = ["serde_derive"] } futures = "0.3.30" futures-util = "0.3.28" metrics = "0.22.3" -thiserror = "1.0.60" +thiserror = "1.0.61" tokio = { version = "1.37.0", features = ["time", "sync", "tracing", "rt-multi-thread"] } tower = { version = "0.4.13", features = ["timeout", "util", "buffer"] } tracing = "0.1.39" diff --git a/zebra-grpc/Cargo.toml b/zebra-grpc/Cargo.toml index b016cf84cfb..63b53bffd32 100644 --- a/zebra-grpc/Cargo.toml +++ b/zebra-grpc/Cargo.toml @@ -19,8 +19,8 @@ categories = ["cryptography::cryptocurrencies"] futures-util = "0.3.28" tonic = "0.11.0" tonic-reflection = "0.11.0" -prost = "0.12.4" -serde = { version = "1.0.201", features = ["serde_derive"] } +prost = "0.12.6" +serde = { version = "1.0.202", features = ["serde_derive"] } tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"] } tokio-stream = "0.1.15" tower = { version = "0.4.13", features = ["util", "buffer"] } @@ -35,7 +35,7 @@ zebra-chain = { path = "../zebra-chain" , version = "1.0.0-beta.37" } tonic-build = "0.11.0" [dev-dependencies] -insta = { version = "1.38.0", features = ["redactions", "json", "ron"] } +insta = { version = "1.39.0", features = ["redactions", "json", "ron"] } zebra-chain = { path = "../zebra-chain", features = ["proptest-impl"] } zebra-state = { path = "../zebra-state" } diff --git a/zebra-network/Cargo.toml b/zebra-network/Cargo.toml index 636e97f26b7..833357f7b32 100644 --- a/zebra-network/Cargo.toml +++ b/zebra-network/Cargo.toml @@ -48,7 +48,7 @@ dirs = "5.0.1" hex = "0.4.3" humantime-serde = "1.1.1" indexmap = { version = "2.2.6", features = ["serde"] } -itertools = "0.12.1" +itertools = "0.13.0" lazy_static = "1.4.0" num-integer = "0.1.46" ordered-map = "0.4.2" @@ -56,9 +56,9 @@ pin-project = "1.1.5" rand = "0.8.5" rayon = "1.10.0" regex = "1.10.4" -serde = { version = "1.0.201", features = ["serde_derive"] } +serde = { version = "1.0.202", features = ["serde_derive"] } tempfile = "3.10.1" -thiserror = "1.0.60" +thiserror = "1.0.61" futures = "0.3.30" tokio = { version = "1.37.0", features = ["fs", "io-util", "net", "time", "tracing", "macros", "rt-multi-thread"] } @@ -91,7 +91,7 @@ proptest-derive = "0.4.0" static_assertions = "1.1.0" tokio = { version = "1.37.0", features = ["full", "tracing", "test-util"] } -toml = "0.8.11" +toml = "0.8.13" zebra-chain = { path = "../zebra-chain", features = ["proptest-impl"] } zebra-test = { path = "../zebra-test/" } diff --git a/zebra-node-services/Cargo.toml b/zebra-node-services/Cargo.toml index 15fb21c8126..c2a49746b2c 100644 --- a/zebra-node-services/Cargo.toml +++ b/zebra-node-services/Cargo.toml @@ -46,7 +46,7 @@ color-eyre = { version = "0.6.3", optional = true } jsonrpc-core = { version = "18.0.0", optional = true } # Security: avoid default dependency on openssl reqwest = { version = "0.11.26", default-features = false, features = ["rustls-tls"], optional = true } -serde = { version = "1.0.201", optional = true } +serde = { version = "1.0.202", optional = true } serde_json = { version = "1.0.117", optional = true } tokio = { version = "1.37.0", features = ["time"], optional = true } @@ -55,5 +55,5 @@ tokio = { version = "1.37.0", features = ["time"], optional = true } color-eyre = "0.6.3" jsonrpc-core = "18.0.0" reqwest = { version = "0.11.26", default-features = false, features = ["rustls-tls"] } -serde = "1.0.201" +serde = "1.0.202" serde_json = "1.0.117" diff --git a/zebra-rpc/Cargo.toml b/zebra-rpc/Cargo.toml index 88450a49338..59762cd681f 100644 --- a/zebra-rpc/Cargo.toml +++ b/zebra-rpc/Cargo.toml @@ -62,7 +62,7 @@ tower = "0.4.13" tracing = "0.1.39" hex = { version = "0.4.3", features = ["serde"] } -serde = { version = "1.0.201", features = ["serde_derive"] } +serde = { version = "1.0.202", features = ["serde_derive"] } # Experimental feature getblocktemplate-rpcs rand = { version = "0.8.5", optional = true } @@ -80,11 +80,11 @@ zebra-script = { path = "../zebra-script", version = "1.0.0-beta.37" } zebra-state = { path = "../zebra-state", version = "1.0.0-beta.37" } [dev-dependencies] -insta = { version = "1.38.0", features = ["redactions", "json", "ron"] } +insta = { version = "1.39.0", features = ["redactions", "json", "ron"] } proptest = "1.4.0" -thiserror = "1.0.60" +thiserror = "1.0.61" tokio = { version = "1.37.0", features = ["full", "tracing", "test-util"] } zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.37", features = ["proptest-impl"] } diff --git a/zebra-scan/Cargo.toml b/zebra-scan/Cargo.toml index 3af4ccaee75..ac03765ae9c 100644 --- a/zebra-scan/Cargo.toml +++ b/zebra-scan/Cargo.toml @@ -43,9 +43,9 @@ proptest-impl = [ color-eyre = "0.6.3" indexmap = { version = "2.2.6", features = ["serde"] } -itertools = "0.12.1" +itertools = "0.13.0" semver = "1.0.23" -serde = { version = "1.0.201", features = ["serde_derive"] } +serde = { version = "1.0.202", features = ["serde_derive"] } tokio = { version = "1.37.0", features = ["time"] } tower = "0.4.13" tracing = "0.1.39" @@ -75,7 +75,7 @@ zcash_note_encryption = { version = "0.4.0", optional = true } zebra-test = { path = "../zebra-test", version = "1.0.0-beta.37", optional = true } [dev-dependencies] -insta = { version = "1.38.0", features = ["ron", "redactions"] } +insta = { version = "1.39.0", features = ["ron", "redactions"] } tokio = { version = "1.37.0", features = ["test-util"] } proptest = "1.4.0" diff --git a/zebra-script/Cargo.toml b/zebra-script/Cargo.toml index 17834f54662..e3789f609ba 100644 --- a/zebra-script/Cargo.toml +++ b/zebra-script/Cargo.toml @@ -19,7 +19,7 @@ zcash_script = "0.1.15" zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.37" } -thiserror = "1.0.60" +thiserror = "1.0.61" displaydoc = "0.2.4" [dev-dependencies] diff --git a/zebra-state/Cargo.toml b/zebra-state/Cargo.toml index a601feadc88..08b4fd294f2 100644 --- a/zebra-state/Cargo.toml +++ b/zebra-state/Cargo.toml @@ -55,7 +55,7 @@ hex-literal = "0.4.1" humantime-serde = "1.1.1" human_bytes = { version = "0.4.3", default-features = false } indexmap = "2.2.6" -itertools = "0.12.1" +itertools = "0.13.0" lazy_static = "1.4.0" metrics = "0.22.3" mset = "0.1.1" @@ -63,9 +63,9 @@ regex = "1.10.4" rlimit = "0.10.1" rocksdb = { version = "0.22.0", default-features = false, features = ["lz4"] } semver = "1.0.23" -serde = { version = "1.0.201", features = ["serde_derive"] } +serde = { version = "1.0.202", features = ["serde_derive"] } tempfile = "3.10.1" -thiserror = "1.0.60" +thiserror = "1.0.61" rayon = "1.10.0" tokio = { version = "1.37.0", features = ["rt-multi-thread", "sync", "tracing"] } @@ -97,7 +97,7 @@ once_cell = "1.18.0" spandoc = "0.2.2" hex = { version = "0.4.3", features = ["serde"] } -insta = { version = "1.38.0", features = ["ron", "redactions"] } +insta = { version = "1.39.0", features = ["ron", "redactions"] } proptest = "1.4.0" proptest-derive = "0.4.0" diff --git a/zebra-test/Cargo.toml b/zebra-test/Cargo.toml index f42664b3ec1..e8ece79f901 100644 --- a/zebra-test/Cargo.toml +++ b/zebra-test/Cargo.toml @@ -18,8 +18,8 @@ categories = ["command-line-utilities", "cryptography::cryptocurrencies"] hex = "0.4.3" indexmap = "2.2.6" lazy_static = "1.4.0" -insta = "1.38.0" -itertools = "0.12.1" +insta = "1.39.0" +itertools = "0.13.0" proptest = "1.4.0" once_cell = "1.18.0" rand = "0.8.5" @@ -37,7 +37,7 @@ tinyvec = { version = "1.6.0", features = ["rustc_1_55"] } humantime = "2.1.0" owo-colors = "4.0.0" spandoc = "0.2.2" -thiserror = "1.0.60" +thiserror = "1.0.61" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } tracing-error = "0.2.0" diff --git a/zebra-utils/Cargo.toml b/zebra-utils/Cargo.toml index 12840cc1da7..7ea94729d6b 100644 --- a/zebra-utils/Cargo.toml +++ b/zebra-utils/Cargo.toml @@ -98,7 +98,7 @@ hex = "0.4.3" serde_json = "1.0.117" tracing-error = "0.2.0" tracing-subscriber = "0.3.18" -thiserror = "1.0.60" +thiserror = "1.0.61" zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.37" } zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.37" } @@ -108,7 +108,7 @@ zebra-scan = { path = "../zebra-scan", version = "0.1.0-alpha.6", optional = tru zebra-rpc = { path = "../zebra-rpc", version = "1.0.0-beta.37", optional = true } # These crates are needed for the zebra-checkpoints binary -itertools = { version = "0.12.1", optional = true } +itertools = { version = "0.13.0", optional = true } # These crates are needed for the search-issue-refs binary regex = { version = "1.10.4", optional = true } @@ -124,7 +124,7 @@ zcash_primitives = { version = "0.13.0", optional = true } zcash_client_backend = {version = "0.10.0-rc.1", optional = true} # For the openapi generator -syn = { version = "2.0.63", features = ["full"], optional = true } +syn = { version = "2.0.65", features = ["full"], optional = true } quote = { version = "1.0.36", optional = true } serde_yaml = { version = "0.9.34+deprecated", optional = true } -serde = { version = "1.0.201", features = ["serde_derive"], optional = true } +serde = { version = "1.0.202", features = ["serde_derive"], optional = true } diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index 6311721663d..56138015c1c 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -178,8 +178,8 @@ humantime-serde = "1.1.1" indexmap = "2.2.6" lazy_static = "1.4.0" semver = "1.0.23" -serde = { version = "1.0.201", features = ["serde_derive"] } -toml = "0.8.11" +serde = { version = "1.0.202", features = ["serde_derive"] } +toml = "0.8.13" futures = "0.3.30" rayon = "1.10.0" @@ -193,7 +193,7 @@ color-eyre = { version = "0.6.3", default-features = false, features = ["issue-u # Enable a feature that makes tinyvec compile much faster. tinyvec = { version = "1.6.0", features = ["rustc_1_55"] } -thiserror = "1.0.60" +thiserror = "1.0.61" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } tracing-appender = "0.2.3" @@ -258,7 +258,7 @@ hex-literal = "0.4.1" jsonrpc-core = "18.0.0" once_cell = "1.18.0" regex = "1.10.4" -insta = { version = "1.38.0", features = ["json"] } +insta = { version = "1.39.0", features = ["json"] } # zebra-rpc needs the preserve_order feature, it also makes test results more stable serde_json = { version = "1.0.117", features = ["preserve_order"] } @@ -271,7 +271,7 @@ tokio = { version = "1.37.0", features = ["full", "tracing", "test-util"] } tokio-stream = "0.1.15" # test feature lightwalletd-grpc-tests -prost = "0.12.4" +prost = "0.12.6" tonic = "0.11.0" proptest = "1.4.0"