-
Notifications
You must be signed in to change notification settings - Fork 122
static loop in: More fee versions for sweepless sweep #845
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
static loop in: More fee versions for sweepless sweep #845
Conversation
60ff75b to
ec3070f
Compare
48f95e0 to
dd13f33
Compare
dd13f33 to
5adf6a8
Compare
hieblmi
left a comment
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.
Thanks for the support @sputn1ck 🎖️
Code lgtm, I've done some reordering an naming changes.
8143266 to
356b673
Compare
This commit changes the loopin sweepless sweep handling, by changing the hardcoded fee messages to a map of fee versions.
bhandras
left a comment
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.
LGTM, just two nits 🎉
| // sigs. | ||
| ServerSweeplessSigningInfo extreme_fee_info = 4; | ||
| // A map of fee rate to the nonces. | ||
| map<uint64, ServerSweeplessSigningInfo> fee_rate_to_nonces = 2; |
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.
nit: i'd call this server_signing_info (and the one in the PushStaticAddressSweeplessSigsRequest client_signing_info.
| // The info the client used to generate the extreme fee partial sweepless | ||
| // tx sigs. | ||
| ClientSweeplessSigningInfo extreme_fee_signing_info = 4; | ||
| // A map of fee rate to the nonces. |
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.
nit: comment could be updated as it's not just the nonces but also the sigs.
starius
left a comment
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.
LGTM! Great improvement!
I added a couple of comments.
| // The info the server used to generate the extreme fee partial sweepless tx | ||
| // sigs. | ||
| ServerSweeplessSigningInfo extreme_fee_info = 4; | ||
| // A map of fee rate to the nonces. |
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.
I propose to add units of fee rate to godoc and/or to the name of the field. Also in PushStaticAddressSweeplessSigsRequest client_signing_info.
| err = fmt.Errorf("unable to sign sweepless sweep tx: %w", err) | ||
| return f.HandleError(err) | ||
| } | ||
| sessions, nonces, err = f.loopIn.createMusig2Sessions( |
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.
I think, resources represented by sessions leak in the signer. We should close them. It is not related to this PR, therefore let's add TODO here to clean sessions in the future.
| if err != nil { | ||
| return f.HandleError(err) | ||
| } | ||
| clientResponse := make(map[uint64]*looprpc.ClientSweeplessSigningInfo) |
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.
I propose to preallocate the space in the map:
clientResponse := make(
map[uint64]*looprpc.ClientSweeplessSigningInfo,
len(fetchResp.FeeRateToNonces),
)|
closing, as superceeded by #844 |
This PR changes the loopin sweepless sweep
handling, by changing the hardcoded fee messages to
a map of fee versions.