Skip to content

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

@QuantumExplorer

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions