You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix!: address Ironwood review findings across mempool, consensus, rpc, and state (#10884)
* fix(consensus): enforce coinbase output-decryptability for the Ironwood pool
NU6.3+ routes shielded coinbase value into the Ironwood pool, but
`decrypts_successfully` only iterated the Sapling and Orchard bundles, so
the all-zero-OVK coinbase decryptability rule (ZIP-213) was never applied to
Ironwood coinbase outputs. Add the Ironwood arm using `IronwoodDomain`.
* fix(mempool): track Ironwood nullifiers for spend-conflict detection
`VerifiedSet` tracked sprout/sapling/orchard nullifiers but not Ironwood, so
two mempool txs revealing the same Ironwood nullifier were both admitted, and
`reject_and_remove_same_effects` never evicted a mempool tx double-spending a
just-mined Ironwood nullifier. Either lets `getblocktemplate` build a block
template that every node then rejects. Mirror the Orchard handling for the
Ironwood pool.
* fix(consensus): fail closed instead of panicking on unexpected halo2 batch error
The `RestrictionUnsupportedByKey` arm called `unreachable!` inside the shared,
long-lived halo2 verifier service, so a future routing change or new
`#[non_exhaustive]` `BatchError` variant would crash the node instead of
rejecting one proof. Collapse it into the existing graceful per-item arm; the
routing invariant is kept as a comment.
* fix(state): include the Ironwood pool in supply metrics and spend indexing
`value_pool_metrics`/`chain_supply.total` omitted the Ironwood pool, so total
supply under-reported it every block post-NU6.3; and the `indexer` back-fill's
spend-sampling chain skipped Ironwood-only v6 txs. Add the Ironwood gauge, the
supply sum term, and Ironwood to the sampled spends.
* feat(rpc): expose Ironwood bundles in verbose transaction output
`getrawtransaction <txid> 1` / `getblock <hash> 2` serialized an `orchard`
section but no `ironwood` one, so v6 Ironwood bundles (including Zebra's own
Ironwood coinbase) were invisible to explorers and wallets. Add an `ironwood`
field reusing the Orchard-shaped object, and factor the shared construction
into `orchard_shaped_object` (also dropping an incidental O(n^2) action scan).
* refactor: deduplicate Ironwood/Orchard tree-update and bundle-verify paths
Ironwood reuses the Orchard tree and bundle types, so
`update_ironwood_note_commitment_tree` now delegates to the Orchard version
(re-tagging only the error variant), and `verify_orchard_v6_bundle` /
`verify_orchard_bundle` share a `queue_orchard_bundle` helper. No behavior
change.
* chore: remove the dead ZIP-235 cfg and error variant
The ZIP-235 burn validation and its tests were removed, but the `zip235`
`cfg` value and `SubsidyError::InvalidZip233Amount` (gated on it) remained, so
a `--cfg zcash_unstable="zip235"` build compiled yet enforced nothing. Drop
both; they can return with the NU7 NSM implementation.
* fix(state): fall back to the empty Ironwood tree before the genesis backfill
`ironwood_tree_by_height` panicked when the Ironwood column family was still
empty, which happens in the brief window after a v27->v28 upgrade before the
background `add_ironwood_tree` migration backfills genesis. That window is
always pre-NU6.3, when the Ironwood tree at every height is in fact empty, so
return the empty tree instead of panicking.
* refactor(state): share the Orchard/Ironwood tree-and-anchor add/remove logic
`add_/remove_{orchard,ironwood}_tree_and_anchor` were verbatim copies over
identically-typed field triples, including the reorg `RevertPosition::Root`
invariant-restoration. Extract shared `add_/remove_note_commitment_tree_and_anchor`
helpers parameterized on the target fields and a pool label. No behavior change
(non-finalized-state prop + reorg tests pass).
* refactor(chain): pass block commitment tree roots in a named struct
The history-tree functions took `sapling_root`, `orchard_root`, and
`ironwood_root` as adjacent positional arguments; the Orchard and Ironwood
roots reuse the same `orchard::tree::Root` type, so a swapped pair compiled
cleanly and would silently corrupt the ZIP-221 chain-history commitment.
Group them in a named `BlockCommitmentTreeRoots` struct so a swap can't happen.
* refactor(state): share the Orchard/Ironwood note-commitment DB accessors
The Ironwood tree-range, subtree-list, subtree-for-tip, tree-create, and
subtree-insert accessors were verbatim copies of their Orchard counterparts,
differing only in the column-family name (both pools reuse the `orchard::tree`
types). Route them through CF-parameterized private helpers; the public
signatures are unchanged.
0 commit comments