-
Notifications
You must be signed in to change notification settings - Fork 107
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
Transaction validation rejects post-Blossom transactions #1367
Labels
A-consensus
Area: Consensus rule updates
A-rust
Area: Updates to Rust code
C-bug
Category: This is a bug
Milestone
Comments
teor2345
added
C-bug
Category: This is a bug
A-consensus
Area: Consensus rule updates
A-rust
Area: Updates to Rust code
S-needs-triage
Status: A bug report needs triage
labels
Nov 24, 2020
teor2345
changed the title
Multiple transaction validation errors
Multiple transaction validation errors blocking sync past Sapling
Nov 24, 2020
teor2345
changed the title
Multiple transaction validation errors blocking sync past Sapling
Transaction validation rejects Blossom and later transactions
Nov 24, 2020
teor2345
changed the title
Transaction validation rejects Blossom and later transactions
Transaction validation rejects post-Blossom transactions
Nov 24, 2020
teor2345
added a commit
to teor2345/zebra
that referenced
this issue
Nov 24, 2020
The transaction verifier and its sub-verifiers need to validate transactions based on the block's network upgrade. To find the network upgrade, we need the block height and network. But the transaction verifier requests and data structures don't provide this information. So we temporarily disable all the transaction verifier checks that depend on a hard-coded network upgrade. Temporary workaround for ZcashFoundation#1367.
There are at least two errors here:
|
hdevalence
added a commit
that referenced
this issue
Nov 24, 2020
Closes #1367 by propagating the network upgrade through the service requests.
1 task
hdevalence
added a commit
that referenced
this issue
Nov 24, 2020
Closes #1367 by propagating the network upgrade through the service requests.
teor2345
pushed a commit
that referenced
this issue
Nov 24, 2020
Closes #1367 by propagating the network upgrade through the service requests.
We didn't write any tests in the PR that closed this issue, so I opened #1378 for the tests. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-consensus
Area: Consensus rule updates
A-rust
Area: Updates to Rust code
C-bug
Category: This is a bug
Version
zebrad
main branch as of 2020-11-24.Description
When I sync
zebrad
usingcheckpoint_sync = true
, the TransactionVerifier fails almost immediately with the following errors:InternalDowncastError("downcast to redjubjub::Error failed, original error: ScriptInvalid")
RedJubjub(InvalidSignature)
Ed25519(InvalidSignature)
Suspected Causes
The sighash function call hard-codes the Sapling network upgrade for each block:
https://github.com/ZcashFoundation/zebra/blob/main/zebra-consensus/src/transaction.rs#L150
Transaction verifier creation hard-codes the Sapling network upgrade:
https://github.com/ZcashFoundation/zebra/blob/main/zebra-consensus/src/block.rs#L86
These hard-coded
Sapling
values mean that full block verification will fail past Sapling. (But the cached state tests will work, because they start at Sapling.)I've checked for other hard-coded network upgrades across Zebra, and they all seem to be correct.
Suggested Solution
To fix these bugs, we need to call
NetworkUpgrade::current(network, height)
for each block, and use that network upgrade's consensus branch ID. This means that the APIs and data structures for the transaction verifier and script verifier are incorrect, because:TODO
Test hint:
Some testnet blocks might only spend UTXOs from a single previous block - look for a testnet block with only 2 transactions, and only 1 transaction input. Then test with that block and its dependent block.
Full Logs
The text was updated successfully, but these errors were encountered: