Skip to content

wallet: migrate LabelTx to db.Store - #1201

Merged
yyforyongyu merged 4 commits into
sql-walletfrom
impl-tx-writer-store
Apr 30, 2026
Merged

yyforyongyu merged 4 commits into
sql-walletfrom
impl-tx-writer-store

Conversation

@yyforyongyu

@yyforyongyu yyforyongyu commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add UpdateTx support to the transitional db.Store
  • route wallet transaction label updates through w.store.UpdateTx
  • keep the remaining legacy tx-manager wrappers isolated from the new writer path

Why

  • wallet label updates are one of the last small tx-writer mutations still going through direct legacy paths
  • moving them behind db.Store makes the tx-writer migration more complete and keeps wallet code off direct walletdb access
  • this also establishes the mutation hook later writer/store migrations can reuse

What Changed

  • added UpdateTx support to db.Store
  • updated wallet label mutation flow to use w.store.UpdateTx
  • kept the migration incremental without changing the external wallet behavior

Testing

  • GOWORK=off scripts/check-each-commit.sh prep-kvdb-deprecate
  • GOWORK=off go test ./wallet/internal/db/... ./wallet
  • GOWORK=off go test ./... in wtxmgr
  • GOWORK=off make lint-check

@yyforyongyu
yyforyongyu changed the base branch from sql-wallet to adr-0006-tests March 30, 2026 13:21
@yyforyongyu
yyforyongyu force-pushed the impl-tx-writer-store branch from cff5271 to a35e9f8 Compare March 30, 2026 13:22
@yyforyongyu
yyforyongyu force-pushed the impl-tx-writer-store branch from a35e9f8 to 61240bd Compare March 30, 2026 14:01
@saubyk saubyk added this to lnd v0.22 Mar 30, 2026
@saubyk saubyk moved this from Backlog to In progress in lnd v0.22 Mar 30, 2026
@yyforyongyu
yyforyongyu force-pushed the impl-tx-writer-store branch from 61240bd to 921f6d3 Compare March 30, 2026 18:57
@yyforyongyu
yyforyongyu force-pushed the adr-0006-tests branch 12 times, most recently from 26b6bf2 to cb27553 Compare April 8, 2026 11:08
@yyforyongyu yyforyongyu added this to the Introduce SQL store milestone Apr 8, 2026
@yyforyongyu
yyforyongyu force-pushed the adr-0006-tests branch 4 times, most recently from 0bf525b to 9d27699 Compare April 9, 2026 11:36
@yyforyongyu
yyforyongyu changed the base branch from adr-0006-tests to prep-address-manager-store April 9, 2026 11:38
@yyforyongyu
yyforyongyu force-pushed the prep-address-manager-store branch from 5787eaa to d428305 Compare April 9, 2026 22:06
@yyforyongyu yyforyongyu changed the title wallet: migrate LabelTx to db.Store wallet: migrate tx writer to db.Store Apr 9, 2026
@yyforyongyu
yyforyongyu force-pushed the impl-tx-writer-store branch 2 times, most recently from effbdde to b4c82e8 Compare April 15, 2026 11:05
@yyforyongyu
yyforyongyu force-pushed the prep-kvdb-deprecate branch from db555b8 to ed7b5a7 Compare April 16, 2026 05:52
@yyforyongyu
yyforyongyu force-pushed the impl-tx-writer-store branch 2 times, most recently from 96021b1 to 887ce75 Compare April 16, 2026 15:28
@yyforyongyu
yyforyongyu force-pushed the prep-kvdb-deprecate branch from ed7b5a7 to b7f6d46 Compare April 16, 2026 15:28
@yyforyongyu
yyforyongyu force-pushed the impl-tx-writer-store branch from 887ce75 to f06cd8a Compare April 16, 2026 15:49
@yyforyongyu
yyforyongyu force-pushed the prep-kvdb-deprecate branch from b7f6d46 to 68863f8 Compare April 16, 2026 15:49
@yyforyongyu
yyforyongyu force-pushed the impl-tx-writer-store branch from f06cd8a to 189cad9 Compare April 16, 2026 16:31
@yyforyongyu
yyforyongyu force-pushed the prep-kvdb-deprecate branch 2 times, most recently from 80b815f to f2cf417 Compare April 17, 2026 09:54
@yyforyongyu
yyforyongyu force-pushed the impl-tx-writer-store branch from 189cad9 to cc3c674 Compare April 17, 2026 09:55
@yyforyongyu
yyforyongyu force-pushed the prep-kvdb-deprecate branch from f2cf417 to 4b2d6b8 Compare April 17, 2026 11:17
@yyforyongyu
yyforyongyu force-pushed the impl-tx-writer-store branch 2 times, most recently from 11e361a to 993e3e5 Compare April 17, 2026 11:27
@yyforyongyu
yyforyongyu force-pushed the prep-kvdb-deprecate branch 2 times, most recently from be4459f to 192947a Compare April 20, 2026 10:04
@yyforyongyu

Copy link
Copy Markdown
Collaborator Author

LGTM 🚀 (minimax-m2.7)

@yyforyongyu

Copy link
Copy Markdown
Collaborator Author

LGTM 🚀 (gemini-3.1-pro-preview)

@yyforyongyu yyforyongyu left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🏷️ (claude-opus-4-7)

@yyforyongyu yyforyongyu left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅ (gpt-5.3-codex)

Comment thread wallet/tx_writer.go
Comment thread wallet/tx_writer.go

@yyforyongyu yyforyongyu left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌼 (gpt-5.4)

@yyforyongyu yyforyongyu left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌼 (gpt-5.4)

Rename the kvdb UTXO adapter files to match the store-oriented
naming used by the new internal database layer.

This is pure code motion with no behavior changes.
Move the touched legacy transaction helper entrypoints into
wtxmgr/deprecated.go without changing their behavior or docs.

This keeps the compatibility-facing wrappers separate from the
canonical implementation paths.
Embed TxStore into db.Store so wallet transaction updates can
move behind the transitional store boundary.

Add the kvdb UpdateTx adapter and tests while preserving the
legacy kvdb label validation behavior.
Route wallet LabelTx through db.Store.UpdateTx so the writer API
no longer opens walletdb transactions directly.

Keep the wallet-facing not-found behavior unchanged by
translating store-layer db.ErrTxNotFound back to
wallet.ErrTxNotFound.

@GustavoStingelin GustavoStingelin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants