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 more Ironwood review findings across chain, consensus, and state (#10886)
* fix: correct Ironwood v6 flag, history-tree, and empty-tree rules
- chain: reject the enableCrossAddress flag (bit 2) on the v6 Orchard
bundle at deserialization, matching orchard::Flags::from_byte, which
reserves it for the Orchard pool in every tx version. Only the Ironwood
bundle uses the FlagsV6 codec. Without this a crafted v6 tx parsed but
then aborted the node in the txid-path expect() when to_librustzcash
rejected the flag.
- state: fall back to the legacy history-tree entry width on any
current-width parse error, not just UnexpectedEof. A multi-peak legacy
record misaligns at the wider width and bincode fails with a varint
error, which the EOF-only gate turned into an upgrade crash-loop.
- state: serve the empty Ironwood tree only before NU6.3 activation; from
activation onward a missing tree is a real invariant violation, so fail
loudly like the Orchard accessor instead of masking corruption.
* refactor(state): thread Ironwood data and trees through named types
- Yield ironwood_shielded_data from the per-transaction version match in
both update_chain_tip_with_block and revert_chain_with, replacing the
two hand-synced `if let V6` blocks. A future tx version now cannot
silently skip Ironwood nullifier tracking in one direction only.
- Pass the note commitment trees to Chain::new and Treestate::new in a
NoteCommitmentTrees struct instead of adjacent positional Arc<orchard::
tree::NoteCommitmentTree> arguments (orchard and ironwood share the
type), so an orchard/ironwood swap is a compile error rather than
silent tree corruption. Drops two too_many_arguments allows.
* perf(consensus): cut per-transaction network-upgrade and bundle work
- Compute NetworkUpgrade::current once in check_structure_and_network_rules
and pass it into orchard_value_balance_non_negative and
coinbase_orchard_component_empty, instead of each rebuilding the
activation-height map per transaction.
- Store the halo2 Item bundle in an Arc so the eager clone tower-fallback
makes for every request shares the bundle instead of deep-copying its
actions and multi-KB proof; add_bundle only needs a reference.
* refactor(chain): deduplicate history-tree rebuild and Ironwood checks
- Share the per-variant InnerHistoryTree rebuild between prune() and the
Clone impl via rebuilt_inner(), so a new history-tree version adds its
arm once.
- Test Ironwood-bundle presence with has_ironwood_shielded_data() instead
of ironwood_actions().count(), which walked the AtLeastOne action list.
- Delegate insert_fake_orchard_shielded_data to fake_v6_orchard_shielded_data.
* fix(state): keep the indexer Spend enum's nullifier imports
The refactor(state) commit dropped sprout/sapling/orchard from the shared
zebra_chain import block (unused without the indexer feature), but the
indexer-only Spend enum and its From impls still reference them, breaking
`cargo check --features indexer` (9 x E0433). Re-add them alongside the
ironwood import, cfg-gated to the indexer feature.
* docs(chain): fix stale v6 Orchard flag comment
The call-site comment still said the v6 Orchard bundle permits
enableCrossAddress; the flag-mask fix reserves it for the Orchard pool
(only Ironwood permits it).
* refactor(chain): imply the v6 Orchard flag codec from the bundle type
Address @arya2 review: tie the flagsOrchard codec to each v6 bundle newtype
via a `V6FlagCodec` associated type (orchard::ShieldedDataV6 -> Flags,
ironwood::ShieldedData -> FlagsV6) so the deserializers imply it instead of
naming it explicitly. No behavior change.
0 commit comments