aboutsummaryrefslogtreecommitdiff
path: root/contrib/linearize/linearize-hashes.py
diff options
context:
space:
mode:
authormerge-script <fanquake@gmail.com>2024-06-12 10:32:31 +0100
committermerge-script <fanquake@gmail.com>2024-06-12 10:32:31 +0100
commit5ee6b76c69d51158c13f6ad9ea1b264372e58d4d (patch)
treefeab6f5725952448a30ed3643fce8f2bc17f0927 /contrib/linearize/linearize-hashes.py
parent416e26c1db7769e5de05fae1c07c47991a3447c2 (diff)
parent429ec1aaaaafab150f11e27fcf132a99b57c4fc7 (diff)
Merge bitcoin/bitcoin#29325: consensus: Store transaction nVersion as uint32_t
429ec1aaaaafab150f11e27fcf132a99b57c4fc7 refactor: Rename CTransaction::nVersion to version (Ava Chow) 27e70f1f5be1f536f2314cd2ea42b4f80d927fbd consensus: Store transaction nVersion as uint32_t (Ava Chow) Pull request description: Given that the use of a transaction's nVersion is always as an unsigned int, it doesn't make sense to store it as signed and then cast it to unsigned everywhere it is used and displayed. Since a few alternative implementations have recently been revealed to have made an error with this signedness that would have resulted in consensus failure, I think it makes sense for us to just make this always unsigned to make it clear that the version is treated as unsigned. This would also help us avoid future potential issues with signedness of this value. I believe that this is safe and does not actually change what transactions would or would not be considered both standard and consensus valid. Within consensus, the only use of the version in consensus is in BIP68 validation which was already casting it to uint32_t. Within policy, although it is used as a signed int for the transaction version number check, I do not think that this change would change standardness. Standard transactions are limited to the range [1, 2]. Negative numbers would have fallen under the < 1 condition, but by making it unsigned, they are still non-standard under the > 2 condition. Unsigned and signed ints are serialized and unserialized the same way so there is no change in serialization. ACKs for top commit: maflcko: ACK 429ec1aaaaafab150f11e27fcf132a99b57c4fc7 🐿 glozow: ACK 429ec1aaaa shaavan: ACK 429ec1aaaaafab150f11e27fcf132a99b57c4fc7 💯 Tree-SHA512: 0bcd92a245d7d16c3665d2d4e815a4ef28207ad4a1fb46c6f0203cdafeab1b82c4e95e4bdce7805d80a4f4a46074f6542abad708e970550d38a00d759e3dcef1
Diffstat (limited to 'contrib/linearize/linearize-hashes.py')
0 files changed, 0 insertions, 0 deletions