Repository navigation
waved: pay asset deposits from the daemon wallet - #1533
Conversation
1f62236 to
303547d
Compare
|
/gateway review |
|
Cannot run |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 303547d8c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6bbf195 to
554549b
Compare
95ea542 to
72b8437
Compare
The lnd, lwwallet and btcwallet adapters gain FundTemplate, which adds wallet inputs and change to an outputs-only PSBT at a sat/kWU rate and leases all of its inputs or none, without signing. SignInputs signs and finalizes only the inputs whose derivation info the wallet can derive. FundPsbt funds through FundTemplate and then finalizes.
The Onboarder commits a caller-funded exact transaction: an OnboardingFunder pays, from native SegWit coins, what the spent tapd anchors leave uncovered plus the fee, and signs only its own inputs, while tapd signs its anchors at publish. The funded template is journaled with its inputs leased before tapd commits, and its leases are renewed until it publishes, so a retry spends the same coins. A refused commit releases them.
EstimateFeePerKW returns the fee estimator's rate at full precision, which EstimateFee truncates to whole sat/vB.
DepositAsset pays and signs the deposit's Bitcoin from the daemon wallet, and tapd signs its own asset inputs at publish. The daemon connects only to tapd, and a tapd that tap-sdk does not report as signing those inputs fails the deposit with FailedPrecondition. Nested SegWit coins are leased away from coin selection while the wallet funds, and a confirmation target resolves through the chain backend's sat/kWU estimate.
DepositAsset needs the tapd backend and a tapd that signs its own asset inputs at publish. It does not connect to the lnd behind tapd.
The deposit tests run waved on a funded lnd of its own, apart from the lnd behind tapd, and check that a deposit spends only tapd's anchors and the daemon wallet's coins.
72b8437 to
cf3f739
Compare
The daemon wallet pays and signs the Bitcoin side of an asset deposit, and tapd signs its own asset anchors when it publishes the transfer. waved talks only to tapd: the
assets.lndconnection to the lnd behind tapd is removed.FundTemplate, which adds inputs and change and leases the inputs without signing. Nested SegWit coins are kept out of selection, because their scriptSig would change the txid tapd seals.max_fee_sat, releases them; releases and the journal write outlive a cancelled RPC.SignInputs), on a copy in which the anchors carry no derivation info, so a wallet sharing tapd's lnd cannot sign them. tapd signs the anchors at publish.EstimateFee.Needs a tapd that signs its own anchor inputs at publish (lightninglabs/taproot-assets#2383, on tapd main), and tap-sdk reporting that capability (lightninglabs/tap-sdk#199).
go.modpins tap-sdk main, which pins tapd main. waved refuses a deposit withFailedPreconditionbefore recording it when tapd is older than v0.9.0 (development builds report 0.8.99), and the asset deposit systests skip on such a tapd: they skip on the harness's v0.8.5 and pass locally against tapd main. A backend that tap-sdk does not report as signing its anchors fails a deposit withFailedPreconditionbefore anything is sealed, and the wallet's leased coins are released. Defaults are unchanged. The ledger books the boarded VTXOs as transfers in; booking them like a Bitcoin boarding deposit is a follow-up.