Skip to content

Spendability exclusion log repeats every scan for designed-gated contracts #735

Description

@tiero

Every getSpendableVtxos pass logs, per VTXO per reason:

[spendability] getSpendableVtxos: a766def1…:0 at 51208df4… (contract type 'vhtlc-v2') is not generically spendable

The exclusion is correct — RFQ lockups register with genericallySpendable: false precisely so generic spending cannot forfeit a live covenant — but logExcludedVtxos (src/contracts/spendability.ts) emits one line per VTXO per reason per call, and getSpendableVtxos runs on every balance refresh and coin-selection pass. A funded lockup is a designed, long-lived gated row, so the wallet console repeats the same line for the swap's whole lifetime: expected steady state reported as if noteworthy, drowning the log the comment says is "the only field-diagnosable signal for why a coin is missing from a spend."

Proposal — dedupe, don't demote. Keep the line (it earns its place the first time: it explains a missing coin) and silence repeats with a module-level seen-set keyed on (source, script, reason) — first occurrence logs, later scans stay quiet, and a new lockup or a new exclusion reason still surfaces. Alternatives considered and why not:

  • Dropping to a quieter channel loses the one field signal the comment defends.
  • Logging only for explicitly-named coins misses the "why is my balance short" case the current design serves.

One nuance worth keeping: if an outpoint's exclusion reason changes (e.g. gate → intent-lock), that's new information and should log again — keying the set on the reason string covers it.

Observed on the wallet's feat/arkade-swap branch with @arkade-os/sdk@0.4.60 during normal Lightning-send operation.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions