Skip to content

Conversation

@jgriffiths
Copy link
Contributor

@jgriffiths jgriffiths commented Feb 24, 2025

This completes moving signature hash generation to the new, caching interface. Although pre-segwit transactions do not benefit from caching, the new impl is cleaner and uses less stack. Additionally, it allows removing all signature hash generation code from the transaction serialization code, making it easier to reason about.

Pre-segwit hashing requires these so split them out for re-use.
@jgriffiths jgriffiths force-pushed the signature_hash_pre_segwit branch from fe1aa4a to afa8167 Compare February 26, 2025 00:56
@jgriffiths jgriffiths changed the title WIP: Update pre-segwit signature hashing to use the new caching implementation Update pre-segwit signature hashing to use the new caching implementation Feb 26, 2025
Caching is not possible for pre-segwit txs since there are no sub-hashes
used in signature hash generation. We get the other benefits of
the new impl by migrating though - i.e. reduced stack/memory use, faster
hashing and clearer/more consistent code.
…hashes

Now that signature hashes are generated by tx_io, this logic can be
reverted to just the tx serialization.
@jgriffiths jgriffiths force-pushed the signature_hash_pre_segwit branch from f0bbe7a to 139bc54 Compare February 27, 2025 02:25
@jgriffiths jgriffiths merged commit 139bc54 into master Feb 27, 2025
4 checks passed
@jgriffiths jgriffiths deleted the signature_hash_pre_segwit branch February 27, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants