Skip to content

Commit

Permalink
chore: Bump zcash_primitives, orchard and zcash_proofs (#8615)
Browse files Browse the repository at this point in the history
* Bump ECC deps

* Remove customizable HRPs

* Update changelog

* Update CHANGELOG.md

Co-authored-by: Arya <aryasolhi@gmail.com>

* Update `Cargo.lock`

* Bump `orchard` from to 0.8 in `zebra-consensus`

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
  • Loading branch information
upbqdn and arya2 committed Jun 19, 2024
1 parent 2d86f5d commit 95e4d09
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 343 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
This means `zebrad` no longer contains users' viewing keys.
- We're no longer using general conditional compilation attributes for `tor`,
but only feature flags instead.
- Fixed a bug with trailing characters in the openapi spec method descriptions((#8597)[https://github.com/ZcashFoundation/zebra/pull/8597])
- Fixed a bug with trailing characters in the openapi spec method descriptions ([#8597](https://github.com/ZcashFoundation/zebra/pull/8597))

## [Zebra 1.7.0](https://github.com/ZcashFoundation/zebra/releases/tag/v1.7.0) - 2024-05-07

Expand Down
95 changes: 15 additions & 80 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2743,36 +2743,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"

[[package]]
name = "orchard"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb255c3ffdccd3c84fe9ebed72aef64fdc72e6a3e4180dd411002d47abaad42"
dependencies = [
"aes",
"bitvec",
"blake2b_simd",
"ff",
"fpe",
"group",
"halo2_gadgets",
"halo2_proofs",
"hex",
"incrementalmerkletree",
"lazy_static",
"memuse",
"nonempty",
"pasta_curves",
"rand 0.8.5",
"reddsa",
"serde",
"subtle",
"tracing",
"zcash_note_encryption",
"zcash_spec",
"zip32",
]

[[package]]
name = "orchard"
version = "0.8.0"
Expand Down Expand Up @@ -5677,7 +5647,7 @@ dependencies = [
"zcash_encoding",
"zcash_keys",
"zcash_note_encryption",
"zcash_primitives 0.15.0",
"zcash_primitives",
"zcash_protocol",
"zip32",
]
Expand Down Expand Up @@ -5724,7 +5694,7 @@ dependencies = [
"tracing",
"zcash_address",
"zcash_encoding",
"zcash_primitives 0.15.0",
"zcash_primitives",
"zcash_protocol",
"zip32",
]
Expand All @@ -5744,9 +5714,9 @@ dependencies = [

[[package]]
name = "zcash_primitives"
version = "0.14.0"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9070e084570bb78aed4f8d71fd6254492e62c87a5d01e084183980e98117092d"
checksum = "b5a8d812efec385ecbcefc862c0005bb1336474ea7dd9b671d5bbddaadd04be2"
dependencies = [
"aes",
"bip0039",
Expand All @@ -5763,7 +5733,7 @@ dependencies = [
"jubjub",
"memuse",
"nonempty",
"orchard 0.7.1",
"orchard",
"rand 0.8.5",
"rand_core 0.6.4",
"redjubjub",
Expand All @@ -5776,51 +5746,16 @@ dependencies = [
"zcash_address",
"zcash_encoding",
"zcash_note_encryption",
"zcash_spec",
"zip32",
]

[[package]]
name = "zcash_primitives"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5a8d812efec385ecbcefc862c0005bb1336474ea7dd9b671d5bbddaadd04be2"
dependencies = [
"aes",
"bip0039",
"blake2b_simd",
"byteorder",
"document-features",
"equihash",
"ff",
"fpe",
"group",
"hex",
"incrementalmerkletree",
"jubjub",
"memuse",
"nonempty",
"orchard 0.8.0",
"rand 0.8.5",
"rand_core 0.6.4",
"redjubjub",
"sapling-crypto",
"sha2",
"subtle",
"tracing",
"zcash_address",
"zcash_encoding",
"zcash_note_encryption",
"zcash_protocol",
"zcash_spec",
"zip32",
]

[[package]]
name = "zcash_proofs"
version = "0.14.0"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8a02eb1f151d9b9a6e16408d2c55ff440bd2fb232b7377277146d0fa2df9bc8"
checksum = "5163a1110f4265cc5f2fdf87ac4497fd1e014b6ce0760ca8d16d8e3853a5c0f7"
dependencies = [
"bellman",
"blake2b_simd",
Expand All @@ -5836,7 +5771,7 @@ dependencies = [
"sapling-crypto",
"tracing",
"xdg",
"zcash_primitives 0.14.0",
"zcash_primitives",
]

[[package]]
Expand Down Expand Up @@ -5895,7 +5830,7 @@ dependencies = [
"jubjub",
"lazy_static",
"num-integer",
"orchard 0.7.1",
"orchard",
"primitive-types",
"proptest",
"proptest-derive",
Expand Down Expand Up @@ -5926,7 +5861,7 @@ dependencies = [
"zcash_encoding",
"zcash_history",
"zcash_note_encryption",
"zcash_primitives 0.14.0",
"zcash_primitives",
"zcash_protocol",
"zebra-test",
]
Expand All @@ -5950,7 +5885,7 @@ dependencies = [
"metrics",
"num-integer",
"once_cell",
"orchard 0.7.1",
"orchard",
"proptest",
"proptest-derive",
"rand 0.8.5",
Expand Down Expand Up @@ -5992,7 +5927,7 @@ dependencies = [
"tonic-build 0.11.0",
"tonic-reflection",
"tower",
"zcash_primitives 0.14.0",
"zcash_primitives",
"zebra-chain",
"zebra-node-services",
"zebra-state",
Expand Down Expand Up @@ -6075,7 +6010,7 @@ dependencies = [
"tower",
"tracing",
"zcash_address",
"zcash_primitives 0.14.0",
"zcash_primitives",
"zebra-chain",
"zebra-consensus",
"zebra-network",
Expand Down Expand Up @@ -6112,7 +6047,7 @@ dependencies = [
"zcash_client_backend",
"zcash_keys",
"zcash_note_encryption",
"zcash_primitives 0.14.0",
"zcash_primitives",
"zebra-chain",
"zebra-grpc",
"zebra-node-services",
Expand Down Expand Up @@ -6227,7 +6162,7 @@ dependencies = [
"tracing-error",
"tracing-subscriber",
"zcash_client_backend",
"zcash_primitives 0.15.0",
"zcash_primitives",
"zcash_protocol",
"zebra-chain",
"zebra-node-services",
Expand Down
4 changes: 0 additions & 4 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ skip-tree = [

# ECC crates

# wait for zcash_client_backend
{ name = "orchard", version = "=0.7.0" },
{ name = "zcash_primitives", version = "=0.14.0" },

# wait for hdwallet to upgrade
{ name = "ring", version = "=0.16.20" },

Expand Down
4 changes: 2 additions & 2 deletions zebra-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ x25519-dalek = { version = "2.0.1", features = ["serde"] }

# ECC deps
halo2 = { package = "halo2_proofs", version = "0.3.0" }
orchard = "0.7.0"
orchard = "0.8.0"
zcash_encoding = "0.2.0"
zcash_history = "0.4.0"
zcash_note_encryption = "0.4.0"
zcash_primitives = { version = "0.14.0", features = ["transparent-inputs"] }
zcash_primitives = { version = "0.15.0", features = ["transparent-inputs"] }
sapling = { package = "sapling-crypto", version = "0.1" }
zcash_protocol = { version = "0.1.1" }
zcash_address = { version = "0.3.2" }
Expand Down
62 changes: 0 additions & 62 deletions zebra-chain/src/parameters/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,68 +305,6 @@ impl FromStr for Network {
#[error("Invalid network: {0}")]
pub struct InvalidNetworkError(String);

impl zcash_primitives::consensus::Parameters for Network {
fn activation_height(
&self,
nu: zcash_primitives::consensus::NetworkUpgrade,
) -> Option<zcash_primitives::consensus::BlockHeight> {
// Heights are hard-coded below Height::MAX or checked when the config is parsed.
NetworkUpgrade::from(nu)
.activation_height(self)
.map(|Height(h)| zcash_primitives::consensus::BlockHeight::from_u32(h))
}

fn coin_type(&self) -> u32 {
match self {
Network::Mainnet => zcash_primitives::constants::mainnet::COIN_TYPE,
// The regtest cointype reuses the testnet cointype,
// See <https://github.com/satoshilabs/slips/blob/master/slip-0044.md>
Network::Testnet(_) => zcash_primitives::constants::testnet::COIN_TYPE,
}
}

fn address_network(&self) -> Option<zcash_address::Network> {
match self {
Network::Mainnet => Some(zcash_address::Network::Main),
// TODO: Check if network is `Regtest` first, and if it is, return `zcash_address::Network::Regtest`
Network::Testnet(_params) => Some(zcash_address::Network::Test),
}
}

fn hrp_sapling_extended_spending_key(&self) -> &str {
match self {
Network::Mainnet => {
zcash_primitives::constants::mainnet::HRP_SAPLING_EXTENDED_SPENDING_KEY
}
Network::Testnet(params) => params.hrp_sapling_extended_spending_key(),
}
}

fn hrp_sapling_extended_full_viewing_key(&self) -> &str {
match self {
Network::Mainnet => {
zcash_primitives::constants::mainnet::HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY
}
Network::Testnet(params) => params.hrp_sapling_extended_full_viewing_key(),
}
}

fn hrp_sapling_payment_address(&self) -> &str {
match self {
Network::Mainnet => zcash_primitives::constants::mainnet::HRP_SAPLING_PAYMENT_ADDRESS,
Network::Testnet(params) => params.hrp_sapling_payment_address(),
}
}

fn b58_pubkey_address_prefix(&self) -> [u8; 2] {
self.kind().b58_pubkey_address_prefix()
}

fn b58_script_address_prefix(&self) -> [u8; 2] {
self.kind().b58_script_address_prefix()
}
}

impl zcash_protocol::consensus::Parameters for Network {
fn network_type(&self) -> zcash_address::Network {
self.kind().into()
Expand Down
Loading

0 comments on commit 95e4d09

Please sign in to comment.