-
Notifications
You must be signed in to change notification settings - Fork 902
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
Restore any missing psbt metadata that resource constrained signers strip #6767
Restore any missing psbt metadata that resource constrained signers strip #6767
Conversation
@vincenzopalazzo The CI failure I'm seeing here doesn't seem related to us? Wonder if everyone is seeing it ... |
fc0d706
to
0837e86
Compare
if (wally_psbt_clone_alloc(psbt0, 0, &combined_psbt) != WALLY_OK) | ||
abort(); | ||
if (wally_psbt_combine(combined_psbt, psbt1) != WALLY_OK) { | ||
tal_wally_end_onto(ctx, combined_psbt, struct wally_psbt); |
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.
Is this the right thing to do here? Should we free the memory immediately instead?
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 this is right, because from the docs of tal_wally_end_onto
I found that
this method iterates over an object allocated by libwally. So I guess it is the safe way to delete an object that wally worked on?
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.
This works, but leaks the combined_psbt. You should return tal_free(combined_psbt);
after this (of course, this code shouldn't happen at all, since the HSM said the PSBT was 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.
ACK 0837e86
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.
Ack 0837e86
if (wally_psbt_clone_alloc(psbt0, 0, &combined_psbt) != WALLY_OK) | ||
abort(); | ||
if (wally_psbt_combine(combined_psbt, psbt1) != WALLY_OK) { | ||
tal_wally_end_onto(ctx, combined_psbt, struct wally_psbt); |
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.
This works, but leaks the combined_psbt. You should return tal_free(combined_psbt);
after this (of course, this code shouldn't happen at all, since the HSM said the PSBT was good!).
…trip Fixes ([ElementsProject#6764]) Changelog-Fixed: Restore any missing metadata that resource constrained signers stripped
0837e86
to
f86efbe
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.
ACK f86efbe
39e17ff
into
ElementsProject:master
Fixes #6764
This is an alternate approach to #6766 . By combining the signed psbt back into the
pre-signed psbt any metadata that a resource constrained signer (VLS) strips (
input.utxo
) will be restored.