feat(wallet): UTXO pool management for high-frequency transactions#492
Merged
feat(wallet): UTXO pool management for high-frequency transactions#492
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Metadata-only basket reassignment (BRC-66 principle). Raises WalletError if outpoint not found. TOCTOU race documented in StorageAdapter YARD docs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
#489) Background thread that monitors a LocalPool and calls create_action to fund new outputs when the pool falls below its target count. Inlines BRC-29 derivation logic (prefix/suffix/key_id) to avoid coupling to ChangeGenerator's private build_output method. Applies all round-1 bug fixes: auto_fund: true, hex locking_script, derivation metadata fields, structured-zone basket, and explicit Hash wrapping on create_action call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on coverage (#491) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3bb344a to
6817a88
Compare
…er validation - ReplenishmentWorker now replenishes immediately on start before entering the wait loop. Previously, run_loop slept up to 60s before the first cycle, leaving newly created pools empty (chicken-and-egg: acquire raises PoolDepletedError, signal path never reached). - Structured basket validator now rejects non-normalised input (mixed case, leading/trailing whitespace). Previously it normalised internally but callers stored the original string, causing lookup mismatches. - utxo_pool factory eagerly validates the basket name and checks broadcast_enabled? before creating the pool. Previously, invalid names or missing broadcasters caused silent replenishment failures caught by the worker's rescue block. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements the new StorageAdapter method added in the UTXO pool work. Updates both the basket column and the JSONB data blob. Follows the same pattern as update_output_state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pool:doom)UTXOPoolinterface module +LocalPoolconcrete implementation withacquire/release/status/shutdownReplenishmentWorkerbackground thread with inlined BRC-29 derivation for pool output creationupdate_output_basketto StorageAdapter for metadata-only basket reassignmentstore_tracked_outputsto persist derivation metadata for basket outputsutxo_poolfactory intoWalletClientRound-1 bug regressions (all covered by specs)
no_send: true— exempt from 300s stale recoverypool:doomvia BRC-122 structured zone<=watermark (not<)store_tracked_outputspersists derivation metadatacreate_actioncalled with explicit Hash literaloutput_description(25 chars)auto_fund: truepool.storageexposed viaattr_readerTest plan
release_stale_pending!Closes #474
Generated with Claude Code