Skip to content

key-wallet: update_utxos over-bumps monitor_revision for pure UTXO changes #731

Closed as not planned

Description

@QuantumExplorer

Context

Surfaced by CodeRabbit during review of #711. Pre-existing behavior — moved from ManagedCoreAccount::update_utxos to ManagedCoreFundsAccount::update_utxos by the structural split, no semantic change.

Distinct from #713 (which is about pool-mutating helpers failing to bump monitor_revision); this issue is the opposite direction — bumping it when it shouldn't.

Problem

monitor_revision is documented as tracking changes to the monitored address set (so consumers of bloom_filter / wallet rescan know when their watch list is stale). ManagedCoreFundsAccount::update_utxos currently bumps it whenever any UTXO is inserted or removed:

if utxos_changed {
    self.keys.bump_monitor_revision();
}

A normal receive or spend on already-monitored addresses changes the UTXO set without changing the monitored-address set, so this triggers spurious bloom-filter staleness signals.

Suggested fix

Track only address-set membership changes, not UTXO-set changes. UTXO bookkeeping should not bump monitor_revision. The right places to bump it are still the address-pool-mutating helpers covered by #713.

Files

  • key-wallet/src/managed_account/managed_core_funds_account.rs (update_utxos, ~line 230)

Note

Worth coordinating with the fix for #713 — together they should converge on a single rule: "bump monitor_revision iff the watched address set actually changed."

Original review thread: #711 (review comment 3187368648)

Activity

  1. added
    enhancement
    on May 5, 2026
  2. xdustinface commented on May 5, 2026

    @xdustinface
    Collaborator

    This is not an issue its intentionally bumped because the bloom filter contains utxos for spent transaction detection so we need to bump the revision if the utxo set changes to update the filter.

  3. self-assigned this
    on Nov 5, 2026
  4. ZocoLini commented on Nov 5, 2026

    @ZocoLini
    Collaborator

    The bump in update_utxos is needed. The mempool bloom filter also carries the wallet's outpoints (watched_outpoints), so a UTXO change changes the filter even when the address set stays the same. Without the bump, a payment to an already used address adds an outpoint that never reaches the filter, and a spend of it is missed in the mempool.

    test_monitor_revision_bumps_and_stability (key-wallet-manager/src/process_block.rs) fails without the bump for exactly that case.

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

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions