Skip to content

wallet: adopt chia_query::mempool_refusal and correct the is_definitive_rejection doc #556

Description

@MichaelTaylor3d

Task

Two coupled changes in dig-wallet, both landing on the next chia-query bump.

1. Adopt chia_query::mempool_refusal — do not keep a second copy

chia-query #50 moves the intrinsic-refusal classifier down into chia_query::mempool_refusal, byte-identical, including its exclusion rationale.

The list originates here: crates/dig-wallet/src/sage/chain.rs:241 BUNDLE_INTRINSIC_REFUSALS — 11 names, exact-match, ~60 lines of reasoning about what was deliberately excluded.

Once chia-query publishes it, re-export from there and delete the local definition. Two copies of this list is a rival implementation of a money decision: they would drift, and the drift decides whether a user's spend is reported refused or retried. The list moved down rather than being duplicated precisely so that cannot happen.

chia-query is currently pinned at 0.20.0 here while main is past 0.22.0, so this rides the version bump that closes that gap.

2. Correct the is_definitive_rejection doc

crates/dig-wallet/src/sage/rpc.rs:2326-2335 describes the old peer_then_coinset push routing. #50 changes that: coinset is never consulted on a refusal.

The new policy: an intrinsic refusal is final; anything else gets exactly one more peer; never more than two transmissions; the refuser is not ejected.

A doc asserting behaviour the code no longer has is a defect in its own right — it is what a future reader will build against.

Why the retry is safe, so the doc says the right thing

Two protocol facts, not optimism:

  • an identical re-send shares the tx id, so it is not a double-spend;
  • a peer answering NotAdmitted/Failed did not relay, so the second peer's verdict is clean.

The timeout-after-transmit race stays on the unchanged Err path.

A constraint that will bite if missed

TxStatus gets NO new field. dig-wallet builds it as a struct literal at chain.rs:876, so adding one breaks compilation here. The chia-query side was designed around that.

Blocked until

chia-query publishes the version carrying mempool_refusal (the #24/#27/#33/#34/#50/#56 batch). Release-first: the crate ships, then this adopts. Do not start before the version exists — the bump cannot resolve.

Also verify, do not assume

Whether anything else in dig-wallet reads the local list or depends on subscribe(capacity), which #34 removes in favour of source-scoped subscribe_frames(address, capacity). The measured future adopter of the fan-out is run_update_loop (sync.rs:1274), which follows exactly one session — consistent with the new shape, but confirm it rather than trusting this sentence.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:maintenancereal work that changes nothing a user can perceive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions