Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label Consensus Rules #323

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ impl Flags {
///
/// [txencoding]: https://zips.z.cash/protocol/protocol.pdf#txnencoding
pub fn from_byte(value: u8) -> Option<Self> {
// https://p.z.cash/TCR:bad-txns-v5-reserved-bits-nonzero
if value & FLAGS_EXPECTED_UNSET == 0 {
Some(Self::from_parts(
value & FLAG_SPENDS_ENABLED != 0,
Expand Down Expand Up @@ -371,6 +372,7 @@ impl<T: Authorization, V: Copy + Into<i64>> Bundle<T, V> {
/// This can be used to validate the [`Authorized::binding_signature`] returned from
/// [`Bundle::authorization`].
pub fn binding_validating_key(&self) -> redpallas::VerificationKey<Binding> {
// https://p.z.cash/TCR:bad-txns-orchard-binding-signature-invalid?partial
(self
.actions
.iter()
Expand Down
2 changes: 2 additions & 0 deletions src/bundle/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ impl BatchValidator {
/// figure out which of the accumulated bundles might be invalid; if that information
/// is desired, construct separate [`BatchValidator`]s for sub-batches of the bundles.
pub fn validate<R: RngCore + CryptoRng>(self, vk: &VerifyingKey, rng: R) -> bool {
// https://p.z.cash/TCR:bad-txns-orchard-binding-signature-invalid?partial

if self.signatures.is_empty() {
// An empty batch is always valid, but is not free to run; skip it.
// Note that a transaction has at least a binding signature, so if
Expand Down