tapassets: wallet fund onboarding carriers#1034
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 255d5d6aa9
ℹ️ 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".
| carrierValue := req.GetCarrierValueSat() | ||
| if carrierValue == 0 { | ||
| carrierValue = uint64(minimumCarrier) | ||
| } |
There was a problem hiding this comment.
Freeze the default carrier value for retries
When callers use the documented zero default, this substitutes the operator's current minimum into the request that is hashed and persisted. If the operator raises or lowers its minimum while the published anchor is awaiting confirmation, the caller can resend the same byte-identical RPC/CLI request but it now hashes differently and loadState rejects it as an idempotency-key rewrite. Since the original asset input has already been committed, the onboarding cannot be resumed. Persist the resolved default for the request ID or return it to the caller and require it on subsequent retries.
Useful? React with 👍 / 👎.
| _ = binary.Write(&value, binary.BigEndian, request.CarrierValueSat) | ||
| _ = binary.Write( | ||
| &value, binary.BigEndian, request.FeeRateSatPerVByte, | ||
| ) | ||
| _ = binary.Write(&value, binary.BigEndian, request.TargetConf) | ||
| _ = binary.Write(&value, binary.BigEndian, request.MaxFeeSat) |
There was a problem hiding this comment.
Preserve journals created by the prior onboarding format
This changes the bytes included in the durable request digest but leaves onboardingStateVersion at 0. Any pre-upgrade onboarding that has already committed/published a package will load as version 0, then fail the digest comparison on every retry because its stored digest was built with AnchorFeeSat; it can therefore never reach operator registration after deployment. Add a state migration/legacy resume path (or otherwise retain the old digest semantics for existing journals) before changing the digest format.
Useful? React with 👍 / 👎.
Summary
This is stack 2 of the Wavelength Taproot Assets PoC and depends on #1033.
Motivation
Onboarding an asset-bearing VTXO needs a deliberate carrier-satoshi value while transaction fees should come from the shared LND/tapd wallet. The previous exact-fee prototype reduced the asset anchor value by the fee and did not model change. Wallet-funded tap-sdk mode gives the output its requested carrier value and lets the wallet select ordinary Bitcoin inputs and change.
Validation
The live bitcoind/LND/tapd/operator confirmation loop remains in the later Lumos integration test.