Validate lock times in the transaction verifier #2389
Labels
A-consensus
Area: Consensus rule updates
A-rust
Area: Updates to Rust code
C-enhancement
Category: This is an improvement
NU Sprout
Network Upgrade: Sprout specific tasks (before Overwinter)
NU-0 Overwinter
Network Upgrade: Overwinter specific tasks (Sprout after Overwinter)
S-needs-spec-update
Status: Not in the Zcash spec, but it should be
Milestone
Motivation
Zebra's transaction verifier needs to check the Transaction
lock_time
field.Specifications
The
lock_time
(ornLockTime
) andtx_in.sequence
fields are defined in the transaction encoding specification.https://zips.z.cash/protocol/protocol.pdf#consensusfrombitcoin
https://developer.bitcoin.org/devguide/transactions.html#non-standard-transactions
Zcash-specific clarification:
zcash/zips#539
Interaction with Input Sequence Numbers
https://developer.bitcoin.org/devguide/transactions.html#locktime-and-sequence-number
Clarification:
zcash/zips#539
Interaction with Expiry Height
This rule is in ZIP 203, but we don't think it was ever implemented in
zcashd
:If used in combination with nLockTime, both nLockTime and nExpiryHeight must be block heights.Designs
Zebra already parses the lock time:
zebra/zebra-chain/src/transaction.rs
Lines 173 to 174 in 22f2f06
zebra/zebra-chain/src/transaction/lock_time.rs
Lines 21 to 26 in 22f2f06
And input sequence numbers:
zebra/zebra-chain/src/transparent.rs
Lines 73 to 92 in 22f2f06
But
lock_time
returns zero lock times asHeight(0)
, rather thanNone
.Similarly, Zebra does not check sequence numbers. If there are no sequence numbers, or they are all
u32::MAX
,lock_time
should returnNone
.Missing Information in Transaction Verifier Request
The block time is not currently sent as part of the transaction verifier request.
The text was updated successfully, but these errors were encountered: