Merge pull request #5429 from str4d/pre-4.6.0-rc1-changes

Pre-4.6.0-rc1 changes
This commit is contained in:
str4d 2021-12-18 04:07:03 +00:00 committed by GitHub
commit 75b539400c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 93 additions and 54 deletions

87
Cargo.lock generated
View File

@ -104,7 +104,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0944d18a9a37691b87733b39c9360c9950af9aa5f97e2455bc108d8eb64fc1c1" checksum = "0944d18a9a37691b87733b39c9360c9950af9aa5f97e2455bc108d8eb64fc1c1"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"blake2s_simd", "blake2s_simd 0.5.11",
"byteorder", "byteorder",
"crossbeam-channel", "crossbeam-channel",
"ff", "ff",
@ -171,6 +171,17 @@ dependencies = [
"constant_time_eq", "constant_time_eq",
] ]
[[package]]
name = "blake2b_simd"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127"
dependencies = [
"arrayref",
"arrayvec 0.7.2",
"constant_time_eq",
]
[[package]] [[package]]
name = "blake2s_simd" name = "blake2s_simd"
version = "0.5.11" version = "0.5.11"
@ -182,6 +193,17 @@ dependencies = [
"constant_time_eq", "constant_time_eq",
] ]
[[package]]
name = "blake2s_simd"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4"
dependencies = [
"arrayref",
"arrayvec 0.7.2",
"constant_time_eq",
]
[[package]] [[package]]
name = "block-buffer" name = "block-buffer"
version = "0.9.0" version = "0.9.0"
@ -444,18 +466,18 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
[[package]] [[package]]
name = "equihash" name = "equihash"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=53d0a51d33a421cb76d3e3124d1e4c1c9036068e#53d0a51d33a421cb76d3e3124d1e4c1c9036068e" source = "git+https://github.com/zcash/librustzcash.git?rev=5622b060b1f57de7afc3d0b4e425b9b4b22482a0#5622b060b1f57de7afc3d0b4e425b9b4b22482a0"
dependencies = [ dependencies = [
"blake2b_simd", "blake2b_simd 1.0.0",
"byteorder", "byteorder",
] ]
[[package]] [[package]]
name = "f4jumble" name = "f4jumble"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=53d0a51d33a421cb76d3e3124d1e4c1c9036068e#53d0a51d33a421cb76d3e3124d1e4c1c9036068e" source = "git+https://github.com/zcash/librustzcash.git?rev=5622b060b1f57de7afc3d0b4e425b9b4b22482a0#5622b060b1f57de7afc3d0b4e425b9b4b22482a0"
dependencies = [ dependencies = [
"blake2b_simd", "blake2b_simd 1.0.0",
] ]
[[package]] [[package]]
@ -579,7 +601,7 @@ version = "0.1.0-beta.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f186b85ed81082fb1cf59d52b0111f02915e89a4ac61d292b38d075e570f3a9" checksum = "0f186b85ed81082fb1cf59d52b0111f02915e89a4ac61d292b38d075e570f3a9"
dependencies = [ dependencies = [
"blake2b_simd", "blake2b_simd 0.5.11",
"ff", "ff",
"group", "group",
"pasta_curves", "pasta_curves",
@ -680,8 +702,9 @@ dependencies = [
[[package]] [[package]]
name = "incrementalmerkletree" name = "incrementalmerkletree"
version = "0.1.0" version = "0.2.0"
source = "git+https://github.com/zcash/incrementalmerkletree?rev=b7bd6246122a6e9ace8edb51553fbf5228906cbb#b7bd6246122a6e9ace8edb51553fbf5228906cbb" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "186fd3ab92aeac865d4b80b410de9a7b341d31ba8281373caed0b6d17b2b5e96"
dependencies = [ dependencies = [
"serde", "serde",
] ]
@ -763,8 +786,8 @@ name = "librustzcash"
version = "0.2.0" version = "0.2.0"
dependencies = [ dependencies = [
"bellman", "bellman",
"blake2b_simd", "blake2b_simd 1.0.0",
"blake2s_simd", "blake2s_simd 1.0.0",
"bls12_381", "bls12_381",
"byteorder", "byteorder",
"ed25519-zebra", "ed25519-zebra",
@ -1018,14 +1041,15 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]] [[package]]
name = "orchard" name = "orchard"
version = "0.0.0" version = "0.1.0-beta.1"
source = "git+https://github.com/zcash/orchard.git?rev=2c8241f25b943aa05203eacf9905db117c69bd29#2c8241f25b943aa05203eacf9905db117c69bd29" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e31f03b6d0aee6d993cac35388b818e04f076ded0ab284979e4d7cd5a8b3c2be"
dependencies = [ dependencies = [
"aes", "aes",
"arrayvec 0.7.2", "arrayvec 0.7.2",
"bigint", "bigint",
"bitvec", "bitvec",
"blake2b_simd", "blake2b_simd 1.0.0",
"ff", "ff",
"fpe", "fpe",
"group", "group",
@ -1102,7 +1126,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d647d91972bad78120fd61e06b225fcda117805c9bbf17676b51bd03a251278b" checksum = "d647d91972bad78120fd61e06b225fcda117805c9bbf17676b51bd03a251278b"
dependencies = [ dependencies = [
"blake2b_simd", "blake2b_simd 0.5.11",
"ff", "ff",
"group", "group",
"lazy_static", "lazy_static",
@ -1311,10 +1335,11 @@ dependencies = [
[[package]] [[package]]
name = "reddsa" name = "reddsa"
version = "0.0.0" version = "0.1.0"
source = "git+https://github.com/str4d/redjubjub.git?rev=416a6a8ebf8bd42c114c938883016c04f338de72#416a6a8ebf8bd42c114c938883016c04f338de72" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a90e2c94bca3445cae0d55dff7370e29c24885d2403a1665ce19c106c79455e6"
dependencies = [ dependencies = [
"blake2b_simd", "blake2b_simd 0.5.11",
"byteorder", "byteorder",
"digest", "digest",
"group", "group",
@ -1790,10 +1815,10 @@ dependencies = [
[[package]] [[package]]
name = "zcash_address" name = "zcash_address"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=53d0a51d33a421cb76d3e3124d1e4c1c9036068e#53d0a51d33a421cb76d3e3124d1e4c1c9036068e" source = "git+https://github.com/zcash/librustzcash.git?rev=5622b060b1f57de7afc3d0b4e425b9b4b22482a0#5622b060b1f57de7afc3d0b4e425b9b4b22482a0"
dependencies = [ dependencies = [
"bech32", "bech32",
"blake2b_simd", "blake2b_simd 1.0.0",
"bs58", "bs58",
"f4jumble", "f4jumble",
"zcash_encoding", "zcash_encoding",
@ -1802,7 +1827,7 @@ dependencies = [
[[package]] [[package]]
name = "zcash_encoding" name = "zcash_encoding"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=53d0a51d33a421cb76d3e3124d1e4c1c9036068e#53d0a51d33a421cb76d3e3124d1e4c1c9036068e" source = "git+https://github.com/zcash/librustzcash.git?rev=5622b060b1f57de7afc3d0b4e425b9b4b22482a0#5622b060b1f57de7afc3d0b4e425b9b4b22482a0"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"nonempty", "nonempty",
@ -1811,24 +1836,20 @@ dependencies = [
[[package]] [[package]]
name = "zcash_history" name = "zcash_history"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=53d0a51d33a421cb76d3e3124d1e4c1c9036068e#53d0a51d33a421cb76d3e3124d1e4c1c9036068e" source = "git+https://github.com/zcash/librustzcash.git?rev=5622b060b1f57de7afc3d0b4e425b9b4b22482a0#5622b060b1f57de7afc3d0b4e425b9b4b22482a0"
dependencies = [ dependencies = [
"bigint", "bigint",
"blake2b_simd", "blake2b_simd 1.0.0",
"byteorder", "byteorder",
] ]
[[package]] [[package]]
name = "zcash_note_encryption" name = "zcash_note_encryption"
version = "0.0.0" version = "0.1.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=53d0a51d33a421cb76d3e3124d1e4c1c9036068e#53d0a51d33a421cb76d3e3124d1e4c1c9036068e" source = "git+https://github.com/zcash/librustzcash.git?rev=5622b060b1f57de7afc3d0b4e425b9b4b22482a0#5622b060b1f57de7afc3d0b4e425b9b4b22482a0"
dependencies = [ dependencies = [
"blake2b_simd",
"byteorder",
"chacha20", "chacha20",
"chacha20poly1305", "chacha20poly1305",
"ff",
"group",
"rand_core 0.6.3", "rand_core 0.6.3",
"subtle", "subtle",
] ]
@ -1836,13 +1857,13 @@ dependencies = [
[[package]] [[package]]
name = "zcash_primitives" name = "zcash_primitives"
version = "0.5.0" version = "0.5.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=53d0a51d33a421cb76d3e3124d1e4c1c9036068e#53d0a51d33a421cb76d3e3124d1e4c1c9036068e" source = "git+https://github.com/zcash/librustzcash.git?rev=5622b060b1f57de7afc3d0b4e425b9b4b22482a0#5622b060b1f57de7afc3d0b4e425b9b4b22482a0"
dependencies = [ dependencies = [
"aes", "aes",
"bip0039", "bip0039",
"bitvec", "bitvec",
"blake2b_simd", "blake2b_simd 1.0.0",
"blake2s_simd", "blake2s_simd 1.0.0",
"bls12_381", "bls12_381",
"byteorder", "byteorder",
"chacha20poly1305", "chacha20poly1305",
@ -1870,10 +1891,10 @@ dependencies = [
[[package]] [[package]]
name = "zcash_proofs" name = "zcash_proofs"
version = "0.5.0" version = "0.5.0"
source = "git+https://github.com/zcash/librustzcash.git?rev=53d0a51d33a421cb76d3e3124d1e4c1c9036068e#53d0a51d33a421cb76d3e3124d1e4c1c9036068e" source = "git+https://github.com/zcash/librustzcash.git?rev=5622b060b1f57de7afc3d0b4e425b9b4b22482a0#5622b060b1f57de7afc3d0b4e425b9b4b22482a0"
dependencies = [ dependencies = [
"bellman", "bellman",
"blake2b_simd", "blake2b_simd 1.0.0",
"bls12_381", "bls12_381",
"byteorder", "byteorder",
"directories", "directories",

View File

@ -27,17 +27,17 @@ crate-type = ["staticlib"]
[dependencies] [dependencies]
bellman = "0.11" bellman = "0.11"
blake2b_simd = "0.5" blake2b_simd = "1"
blake2s_simd = "0.5" blake2s_simd = "1"
bls12_381 = "0.6" bls12_381 = "0.6"
byteorder = "1" byteorder = "1"
group = "0.11" group = "0.11"
incrementalmerkletree = "0.1" incrementalmerkletree = "0.2"
libc = "0.2" libc = "0.2"
jubjub = "0.8" jubjub = "0.8"
memuse = "0.2" memuse = "0.2"
nonempty = "0.7" nonempty = "0.7"
orchard = "0.0" orchard = "=0.1.0-beta.1"
subtle = "2.2" subtle = "2.2"
rand_core = "0.6" rand_core = "0.6"
tracing = "0.1" tracing = "0.1"
@ -45,7 +45,7 @@ tracing-core = "0.1"
tracing-appender = "0.2" tracing-appender = "0.2"
zcash_address = "0.0" zcash_address = "0.0"
zcash_history = "0.2" zcash_history = "0.2"
zcash_note_encryption = "0.0" zcash_note_encryption = "0.1"
zcash_primitives = "0.5" zcash_primitives = "0.5"
zcash_proofs = "0.5" zcash_proofs = "0.5"
ed25519-zebra = "3" ed25519-zebra = "3"
@ -69,10 +69,8 @@ panic = 'abort'
codegen-units = 1 codegen-units = 1
[patch.crates-io] [patch.crates-io]
incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree", rev = "b7bd6246122a6e9ace8edb51553fbf5228906cbb" } zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
orchard = { git = "https://github.com/zcash/orchard.git", rev = "2c8241f25b943aa05203eacf9905db117c69bd29" } zcash_history = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" } zcash_note_encryption = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
zcash_history = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" } zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
zcash_note_encryption = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" } zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" }
zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" }

View File

@ -4,6 +4,23 @@ release-notes at release time)
Notable changes Notable changes
=============== ===============
Wallet
------
From this release, newly-created wallets will save the chain name ("Zcash") and
network identifier (e.g. "main") to the `wallet.dat` file. This will enable the
`zcashd` node to check on subsequent starts that the `wallet.dat` file matches
the node's configuration. Existing wallets will start saving this information in
a later release.
`libzcash_script`
-----------------
Two new APIs have been added to this library (`zcash_script_legacy_sigop_count`
and `zcash_script_legacy_sigop_count_precomputed`), for counting the number of
signature operations in the transparent inputs and outputs of a transaction.
The presence of these APIs is indicated by a library API version of 2.
Updated RPCs Updated RPCs
------------ ------------

View File

@ -5,7 +5,10 @@ use std::{
}; };
use libc::{c_char, c_void}; use libc::{c_char, c_void};
use zcash_address::{unified, FromAddress, Network, ToAddress, ZcashAddress}; use zcash_address::{
unified::{self, Container, Encoding},
FromAddress, Network, ToAddress, ZcashAddress,
};
use zcash_primitives::sapling; use zcash_primitives::sapling;
pub type UnifiedAddressObj = NonNull<c_void>; pub type UnifiedAddressObj = NonNull<c_void>;
@ -69,8 +72,8 @@ impl UnifiedAddressHelper {
} }
self.ua self.ua
.receivers() .items_as_parsed()
.into_iter() .iter()
.map(|receiver| match receiver { .map(|receiver| match receiver {
unified::Receiver::Orchard(data) => { unified::Receiver::Orchard(data) => {
// ZIP 316: Senders MUST reject Unified Addresses in which any // ZIP 316: Senders MUST reject Unified Addresses in which any
@ -92,7 +95,7 @@ impl UnifiedAddressHelper {
// ZIP 316: Senders MUST reject Unified Addresses in which any // ZIP 316: Senders MUST reject Unified Addresses in which any
// constituent address does not meet the validation requirements of // constituent address does not meet the validation requirements of
// its Receiver Encoding. // its Receiver Encoding.
if sapling::PaymentAddress::from_bytes(&data).is_none() { if sapling::PaymentAddress::from_bytes(data).is_none() {
tracing::error!("Unified Address contains invalid Sapling receiver"); tracing::error!("Unified Address contains invalid Sapling receiver");
false false
} else { } else {
@ -106,7 +109,7 @@ impl UnifiedAddressHelper {
(p2pkh_cb.unwrap())(ua_obj, data.as_ptr()) (p2pkh_cb.unwrap())(ua_obj, data.as_ptr())
}, },
unified::Receiver::Unknown { typecode, data } => unsafe { unified::Receiver::Unknown { typecode, data } => unsafe {
(unknown_cb.unwrap())(ua_obj, typecode, data.as_ptr(), data.len()) (unknown_cb.unwrap())(ua_obj, *typecode, data.as_ptr(), data.len())
}, },
}) })
.all(|b| b) .all(|b| b)
@ -209,7 +212,7 @@ pub extern "C" fn zcash_address_serialize_unified(
} }
}; };
let ua: unified::Address = match receivers.try_into() { let ua = match unified::Address::try_from_items_preserving_order(receivers) {
Ok(ua) => ua, Ok(ua) => ua,
Err(e) => { Err(e) => {
tracing::error!("{}", e); tracing::error!("{}", e);

View File

@ -1089,9 +1089,9 @@ pub extern "C" fn librustzcash_zip32_xfvk_address(
.expect("valid ExtendedFullViewingKey"); .expect("valid ExtendedFullViewingKey");
let j = zip32::DiversifierIndex(unsafe { *j }); let j = zip32::DiversifierIndex(unsafe { *j });
let addr = match xfvk.address(j) { let addr = match xfvk.find_address(j) {
Ok(addr) => addr, Some(addr) => addr,
Err(_) => return false, None => return false,
}; };
let j_ret = unsafe { &mut *j_ret }; let j_ret = unsafe { &mut *j_ret };