Merged
Conversation
The `encode_signing_data_to_inner` function previously constructed a transaction internally, requiring a bunch of allocations, which it'd then consensus-serialize into a writer (hasher). It also used a dummy `TxOut::NULL` value which we want to get rid of. To get rid of both allocations and the NULL value we serialize the transaction on-the-fly. Because the encoding doesn't involve witnesses it's not too complicated and the consensus encoding will never change so there are no desync bugs possible. We may later change this to an abstract transaction though.
03806f3 to
39a16a3
Compare
We want to get rid of this constant, so we replace it in tests with 0 amount, empty script. Notably, the tests were already using it as a dummy value - the exact amount was irrelevant, so this change doesn't break anything.
We've stopped using `TxOut::NULL` in the code and we want to restrict `Amount` to 21M BTC, so we are now deleting this constant without deprecation. Deprecation can be backported if needed.
39a16a3 to
dd2df2b
Compare
tcharding
previously approved these changes
Jan 29, 2025
Member
tcharding
left a comment
There was a problem hiding this comment.
ACK 39a16a3c619be99dfe3bcacce2db7f1dbc63e7b0
Member
|
Mad, thanks. I didn't check that the first patch passes tests leaving that to @apoelstra's CI. |
Pull Request Test Coverage Report for Build 13047441595Details
💛 - Coveralls |
Collaborator
Author
|
OMG, the API shit... I guess if you rebase your PR you can just clump together the API changes and I don't have to deal with that. Otherwise you need to wait until tomorrow. |
Member
|
I did #3979 for you, @apoelstra can just merge it straight on top of this one. |
Member
|
FTR his CI does not do the API checks so this PR will still get past his CI. |
Member
Collaborator
Author
|
I've cherry-picked the commit from #3979 |
tcharding
approved these changes
Jan 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes
TxOut::NULLfrom our API and replaces the very few occurrences in our code. The PR has three commits so that the first one provably doesn't break anything, and the second one could be dropped if anyone complains about not deprecating but I really hope that won't happen.As a side effect this also improves signing performance.
Closes #3975