Skip to content

Add Ironwood support to zcash_client_memory - #17

Open
craftsoldier wants to merge 20 commits into
zcash:mainfrom
zcashme:craftsoldier/ironwood-parity
Open

Add Ironwood support to zcash_client_memory#17
craftsoldier wants to merge 20 commits into
zcash:mainfrom
zcashme:craftsoldier/ironwood-parity

Conversation

@craftsoldier

Copy link
Copy Markdown

Closes #16

Summary

Adds Ironwood support to zcash_client_memory across:

  • protobuf and in-memory serialization;
  • account birthdays and chain state;
  • commitment-tree storage, advancement, truncation, and subtree roots;
  • compact-block scanning, received-note storage, and nullifier tracking;
  • anchor computation, spendability metadata, and input selection;
  • Ironwood pool-test integration.

This also updates the crate for the corresponding zcash_client_backend API changes.

Deliberately unchanged

MemoryWalletDb has a pre-existing incomplete API surface and a set of ignored tests. This PR does not attempt a broad backend rehabilitation.

Two newly wired Ironwood tests remain ignored because they exercise shared, pre-existing transaction-enhancement limitations:

  • enhancement can replace a stored fee with None;
  • store_decrypted_tx does not yet persist Incoming shielded outputs.

These limitations already exist for the older shielded pools.

Verification

  • cargo test --all-features
  • cargo clippy --all-features --all-targets -- -D warnings
  • cargo check --all-features
  • git diff --check

AI assistance disclosure: This PR description was drafted with Codex (OpenAI).

craftsoldier and others added 20 commits August 21, 2026 18:28
Update dependencies to current crates.io versions and remove the
[patch.crates-io] overrides. Also bumps the Rust toolchain to 1.88.

Co-Authored-By: Claude <noreply@anthropic.com>
The upstream Recipient enum was restructured in 0.24.0-rc.7: InternalAccount was split into InternalShielded and InternalTransparent.

Co-Authored-By: Claude <noreply@anthropic.com>
…ction

Replaces manual Note construction, note_value(), and hardcoded pool types
with the upstream's pool-agnostic API from ReceivedShieldedOutput.

Co-Authored-By: Claude <noreply@anthropic.com>
Ironwood outputs are Orchard-shaped but belong to a distinct pool; this
processes them via the same to_wallet_note() API adopted in the prior
commit. The Incoming branch stays todo!().

Co-Authored-By: Claude <noreply@anthropic.com>
Upstream renamed TransparentOutputFilter to CoinbaseFilter and added
NonCoinbaseOnly; this adapts our InputSource impl, implementing the new
variant as the complement of CoinbaseOnly.

Co-Authored-By: Claude <noreply@anthropic.com>
Adapts balance construction to upstream's split regular/coinbase
buckets, adds ironwood_balance handling, and stubs
next_ironwood_subtree_index.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Add lock_expiry_height and lock_owner fields to ReceivedNote and
ReceivedTransparentOutput. Update all constructors and serialization round-trips
for the new lock state. Add optional proto fields to notes.proto and
transparent.proto, regenerate src/proto/memwallet.rs, and add focused
round-trip tests for locked and unlocked variants.

Co-Authored-By: Claude <noreply@anthropic.com>
Add lock helpers (is_output_locked_at, output_lock_owner_at,
is_output_eligible_under_lock_filter, account_for_output_ref,
is_output_lockable_by) and implement the OutputLockStore trait methods by
mutating the lock fields on received notes and transparent outputs. Fix the
Self::Error / Self::AccountId ambiguity in the WalletWrite impl that results
from OutputLockStore becoming a supertrait of WalletWrite.

Co-Authored-By: Claude <noreply@anthropic.com>
Add lock_filter: LockFilter<'_> to InputSource spendable-note and
transparent-output queries, and thread it through note_is_spendable and
utxo_is_spendable via is_output_eligible_under_lock_filter. This ensures locked
outputs are excluded from (or selectively included in) input selection per the
caller's LockedInputPolicy.

Co-Authored-By: Claude <noreply@anthropic.com>
Classify locked notes and transparent UTXOs as add_locked_value instead of
add_spendable_value in get_wallet_summary and get_transparent_balances. Balance
queries use LockFilter::Unfiltered because classification is based on raw lock
state, not the caller's selection policy.

Co-Authored-By: Claude <noreply@anthropic.com>
Adds Ironwood variants to PoolType and ShieldedProtocol and Ironwood fields to ChainState,
MemoryWallet, and WalletBlock. Updates existing serialization glue and renames
RecipientType.InternalAccount to RecipientType.InternalShielded.

Co-Authored-By: Claude <noreply@anthropic.com>
Adds an Ironwood ShardTree with serialization, summary integration, and WalletCommitmentTrees
methods. Also fixes put_orchard_subtree_roots to use ORCHARD_SHARD_HEIGHT and adds the missing
Sapling/Orchard subtree-root accessors.

Co-Authored-By: Claude <noreply@anthropic.com>
Extend MemoryWalletDb to track Ironwood nullifiers; this detects funding accounts, marks notes spent, persists per-block nullifier maps, and recognizes Ironwood bundles for scan detection.

Co-Authored-By: Claude <noreply@anthropic.com>
Add the Ironwood path through block ingestion: spent-note marking, received
output insertion, and block metadata. Include helper constructors for received
Ironwood notes. Tree advancement is deferred to the next commit.

Co-Authored-By: Claude <noreply@anthropic.com>
Wire the Ironwood ShardTree into put_blocks: collect Ironwood
commitments, build subtrees, reconcile three-pool checkpoint heights,
and insert the frontier and subtrees into the Ironwood tree. Also
include Ironwood checkpoints in truncate_to_height reorg handling.

Co-Authored-By: Claude <noreply@anthropic.com>
Implement anchor computability for the Ironwood pool and include
Ironwood note metadata in InputSource::get_account_metadata.

Co-Authored-By: Claude <noreply@anthropic.com>
Wire three upstream Ironwood-specific test wrappers into a new
src/testing/pool/ironwood.rs module. Two are marked #[ignore] due to
pre-existing bugs in store_decrypted_tx (fee overwrite on enhancement,
and unimplemented TransferType::Incoming path) that affect all pools.
@craftsoldier
craftsoldier marked this pull request as ready for review August 21, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Ironwood support to zcash_client_memory

1 participant