Repository navigation
multi: add labels for static addresses - #1178
GustavoStingelin wants to merge 45 commits into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
ae23a9d to
92270e0
Compare
|
I propose to include the current state of #1139 into this PR, so own label commits go after @hieblmi's commits. Add a note to the PR description not to review the multi-address commits. I attempted to do a rebase using AI, here is my attempt: https://github.com/starius/loop/commits/staticaddr-combined/ It is not functional. Some semantic rebase is needed. For example:
Found some issues in that multi-address + labels branch that I got:
Some of them will be resolved by a proper rebase, but some seem genuine. |
92270e0 to
0537607
Compare
|
just rebased from master |
3172db4 to
af8f2ae
Compare
af8f2ae to
084565d
Compare
|
@hieblmi rebased this on multi-address-core (thanks!). The rebase raised two design questions I'd like to settle before we go further:
|
|
Thanks @GustavoStingelin
I think it is valuable to the user to show these together with the funding outpoitns. The We can then add the fields per entry: What do you think?
Is the intention to find addresses with labels, especially if they don't show up in |
Sounds good 👍
Yes. The main case is a user who generates a few receive addresses but hasn't funded them yet. loop static new always derives a fresh address, so those unfunded addresses don't appear in To keep this PR focused on labels, I'll add |
ad14247 to
5b76079
Compare
|
@hieblmi: review reminder |
03027f4 to
d60dc33
Compare
|
Require one legacy address when deposits exist before migration 23 assigns ownership. Use a regular CHECK-constrained guard table on both backends without an additional PostgreSQL TEMPORARY privilege. Cover backfills, ambiguous ownership, restricted roles, rollback and retry. Document recovery only for a verified rolled-back dirty migration 23, retaining the migration framework's existing dirty-version behavior.
Encode each persisted P2TR script using an explicit network in a free helper. Address rendering does not need the manager or reconstruction of the signing keys and script tree, and does not imply an ownership check.
Quote selected deposits with one exact active-set lookup, retaining presence, state, duplicate and expiry checks without rendering history. Refresh deposits before taking the unspent response snapshot and filter against active Deposited records. Historical database rows cannot revive outputs removed during reconciliation or return stale confirmations.
Keep the lowest-ID active address alongside the script index. Publish it only after successful activation and update it under the index mutex. Serve public root lookups from the cache with independent parameter, script and public-key copies. Cover restart recovery, failed imports and caller mutation so caching preserves readiness and value ownership.
Read wallet UTXOs outside the map lock, then match their scripts directly against the active address index under a short lock. This removes the full-index allocation and copy on each poll while preserving confirmation bounds and allowing address activation during the wallet RPC. Test filtering across addresses and verify wallet RPCs do not hold the map lock.
Load persisted addresses in bounded pages using an ascending ID cursor during startup and root recovery. Read wallet watches once and publish the complete runtime index only after every page and import succeeds. The existing bulk-read API remains available for compatibility. Test sparse IDs, page boundaries, failed-page recovery and restart behavior, including the SQL query on SQLite and PostgreSQL.
Replace the issuance mutex with a context-aware gate so queued callers can cancel without disturbing the current issuer. Keep root creation, recovery and derived issuance serialized and retryable. A private mutex now explicitly guards the active script index and root. Test canceled root and derived waiters, subsequent progress and concurrent first callers sharing one root.
Remove the blank line before the closing brace flagged by CI. This is formatting only; test behavior is unchanged.
Compare lnd counters with persisted address and HTLC indices, verify wallet identity and advance only lagging families before activation. Preserve equal or ahead counters without creating addresses. Allow restoration beyond the manager deadline with RPC timeouts, cancellation and progress logs. Finish listener initialization before shutdown teardown to avoid leaking REST or racing wait groups. Cover restoration, interrupted restarts and shutdown order.
A restored wallet may not have derived a static address key. Pubkey lookup then misses and can fall back to locator (0, 0), producing an invalid expiry signature. Pass the deposit locator and omit PubKey so lndclient sends the locator over the wire. Cover root, receive and change deposits.
Document fresh receive-address derivation, lazy seed initialization, funding-address lookup hardening, and the swap:execute permission required by address creation. Regenerate the CLI, gRPC, Swagger, and man-page documentation and add feature, breaking-change, and recovery release notes.
Cost polling can retain a fee share before discovery stores another static deposit from the same transaction. Different scripts caused the first deposit to receive the entire fee permanently. Recognize every owned static output through the active address index before allocating the fee. Preserve value-based shares, remainder placement, and existing change and unknown-fee behavior.
Recognize legacy root change alongside derived change and preserve accounting when both outputs pay the root. Reuse the persisted change address across fee bumps and restarts while retaining old transactions and creating fresh signing sessions. Compute withdrawal values once. Cover legacy and derived change, root destinations, repeated fee bumps, full withdrawals and unrelated outputs.
a957b74 to
8400ee7
Compare
Add the missing space in the shared --label help, and give listswaps its own --label help since there it filters swaps instead of labeling one.
Add a label column to static_addresses and a query to update it, and select it wherever deposits and change addresses join their address.
Add a Label field to the static address parameters. It is local metadata and not part of the script or server protocol.
Read and write address labels in the address store, and load them with deposits and loop-in change addresses.
Add a label to NewStaticAddress, a new UpdateStaticAddressLabel RPC, and labels on unspent deposits and deposit listings.
d60dc33 to
d9ea83d
Compare
Label new addresses, relabel them without mutating published address snapshots, and fill in address and funding transaction labels in deposit responses.
Add --label to static new and a static updatelabel command.
Change addresses take the distinct labels of the addresses they spend, joined with ", " up to the label limit.
d9ea83d to
e025292
Compare
fac574a to
056e0e1
Compare
Adds local labels for static addresses. Stacked on #1139 (
multi-address-core).loop static new --labellabels a new receive address, andloop static updatelabelchanges or clears a label.loop static listunspentshows each UTXO'saddress_label. Deposits in the deposit, withdrawal and loop-in listings showaddress_labelandfunding_tx_label, the lnd label of the funding transaction.,up to the 500-character limit.--labelhelp text: adds a missing space, and giveslistswapsits own help, since there the flag is a filter.ListStaticAddresses, for finding labeled addresses that haven't been funded yet, will come in a follow-up PR.