-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi: anchor fee test coverage #605
Conversation
Will split out the caretaker shutdown issue discovered here into a separate PR. I think we can move testing for that fix into the existing unit tests for the planter, where we trigger the error with a different mock wallet anchor that always fails. |
4b0bcd5
to
a8c6988
Compare
a8c6988
to
93fb244
Compare
Split caretaker fixes into #693 , the fee estimation itest here depends on fixes added there. |
93fb244
to
1a530c0
Compare
5ae0a56
to
83d5141
Compare
93ca166
to
c19f2d6
Compare
1a530c0
to
372e47e
Compare
c19f2d6
to
2b6900c
Compare
372e47e
to
6af7724
Compare
I think I've narrowed this down to possible issues with inputs that are older types like P2PKH. In the minter we don't adjust the fee, but we still record it. In the freighter, we use a weight estimator unique to this repo to calculate TX weight, and then adjust the change output. We could instead reuse weight & fee logic that IIUC is already being used as part of Most of this logic is already publicly exposed by these packages. We could also then unify fee estimation across the minter and freighter. I think the old user issues about bad fee estimates on testnet during minting were just due to bad fee estimates. |
Acceptance Criteria:
|
2b6900c
to
05b82da
Compare
There's a round issue that has caused the tests to fail. @jharveyb has identified root cause and addressing it. |
Specifically this unit conversion from sat/kw to sat/vB when constructing the taproot-assets/wallet_anchor.go Line 61 in 564795a
Where e.x. a feerate of 3125 sat/kw or 12.5 sat/vB is rounded down to 12 sat/vB. |
6af7724
to
935db82
Compare
Pushed up my latest state; discovered a separate issue about dust change handling in the freighter. |
935db82
to
b646d2f
Compare
Made tracking issue for dusty change: #738. Going to defer that for a separate PR. |
5f4543e
to
9b7d58d
Compare
From offline discussion: the standard for fee unit handling is to use sat/kW on the RPC interface, but expose sat/vB as the unit on the CLI. We then convert from sat/vB to sat/kW before making our RPC call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice improvements and test additions!
Needs one change for the RPC to remain at sat/kw, the rest looks good 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great itest and clear changes. Nice work.
I can only think of small things that might need addressing. My second review should be quick.
|
||
// ResetNodeWallet sets the wallet state of the given node to own 100 P2TR UTXOs | ||
// of BTC, which matches the wallet state when initializing the itest harness. | ||
func ResetNodeWallet(t *harnessTest, wallet *node.HarnessNode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should call this function when initializing the itest harness to be certain that it's the default state.
(Can't reply to comment directly) - the rounding up here is a difference of 3 sat/kw or 12 sat/kvB; so extremely small, even for a hypothetical large transfer TX. This is also what we do in Pool: Without the rounding, the TX would get rejected later on by LND before broadcast anyways, so the alternative (no rounding) is not allowing the user to specify a fee below 2 sat/vB. |
92957ce
to
e1e20fd
Compare
Updated, would like to resolve the detail on possible inputs for transfers that don't have |
e1e20fd
to
7ee40f5
Compare
Made final updates re: non-witness inputs, ready for final approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this is very close! CLI needs to be updated since the parseFeeRate()
is used for other commands too. Other than that this looks good.
7ee40f5
to
1d8b487
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎆
In this commit, we add extra logging of fee rates to the minter, and also remove a reimplementation of psbt.GetTxFee(). We also deduplicate some dummy PkScript generation.
In this commit, we remove the amount of tap-specific code handling fee estimation by replacing EstimateWeight() with EstimateFee(). This is a thin wrapper around txsizes.EstimateVirttualSize(), and is very similar to the implementation in txauthor/NewUnsignedTransaction.
In this commit, we add a new itest that exercises the minter and freighter when using multiple input types like P2WKH and various fee rates.
1d8b487
to
9a47eb8
Compare
Fixes #671
Verifies fixes for various issues with fee estimation.
There are also some issues with cleaning up caretaker state if the caretaker returns an error, which is not recoverable from inside the caretaker.
Batch finalization could be manually reattempted by the user.
Also added extra logging of fee rates and transaction weights.
Should also change units exposed to the user.