-
Notifications
You must be signed in to change notification settings - Fork 38.7k
change default Python block serialization to witness #15664
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
Conversation
c671587 to
f70d0cd
Compare
jnewbery
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.
Concept ACK moving to segwit being the default for the test framework.
Your additional code in mining_basic is testing that the test framework can deserialize and then serialize a block (ie block_hex = serialize(deserialize(block_hex))). I don't think tests of the test framework belong in the individual test cases. Those are supposed to be testing the node.
I'd just drop the changes to mining_basic.py.
|
@jnewbery do we have a place to self-test python serialization/utility code? I've added this before to other tests. I can drop it here for now. |
We don't. I don't think it's worth it to be honest. The python code is pretty simple. If we did add it, I'd suggest adding it to |
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.
Could also remove some bloat with a scripted diff:
sed -i --regexp-extended -e 's/block(_?[2a-z]*)\.serialize\([a-z_]*=?True/block\1.serialize(/g' $(git grep -l serialize ./test)
test/functional/mining_basic.py
Outdated
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.
| assert(block.serialize(with_witness=False).hex() != block_hex) | |
| assert block.serialize(with_witness=False).hex() != block_hex |
f70d0cd to
124ea38
Compare
|
removed round-trip test |
|
ACK 124ea38 |
Unnamed arguments are confusing as to what they mean without looking up the function signature. Since segwit is active by default in regtest, and all blocks are serialized with witness (bitcoin#15664, c459c5f), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`. This diff has been created with a script, but is better reviewed without a scripted diff. sed -i --regexp-extended -e 's/block(_?[2a-z]*)\.serialize\([a-z_]*=?True/block\1.serialize(/g' $(git grep -l serialize ./test)
…ness 124ea38 change default Python block serialization to witness (Gregory Sanders) Pull request description: ACKs for commit 124ea3: stevenroose: ACK 124ea38 Tree-SHA512: 52877934f8a3c761cb89a618daffe73e86b008d9d32d48721392b7626aaa10d3b9aa26e4c59337729e0a2d01fc48648eef5ec3d72de531a685a2cf4f4d7579ab
fa1d766 tests: Make msg_block a witness block (MarcoFalke) fa52eb5 test: Remove True argument to CBlock::serialize (MarcoFalke) Pull request description: Unnamed arguments are confusing as to what they mean without looking up the function signature. Since segwit is active by default in regtest, and all blocks are serialized with witness (bitcoin#15664), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`. ACKs for commit fa1d76: laanwj: code-review ACK fa1d766 Tree-SHA512: 2c550646f99c9ca86a223ca988c61a730f5e6646807adeaa7174fb2424a32cea3fef8bcd3e0b12e162e7ff192877d0c02fd0654df6ee1a9b821b065707c2dcbc
fa1d766 tests: Make msg_block a witness block (MarcoFalke) fa52eb5 test: Remove True argument to CBlock::serialize (MarcoFalke) Pull request description: Unnamed arguments are confusing as to what they mean without looking up the function signature. Since segwit is active by default in regtest, and all blocks are serialized with witness (bitcoin#15664), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`. ACKs for commit fa1d76: laanwj: code-review ACK fa1d766 Tree-SHA512: 2c550646f99c9ca86a223ca988c61a730f5e6646807adeaa7174fb2424a32cea3fef8bcd3e0b12e162e7ff192877d0c02fd0654df6ee1a9b821b065707c2dcbc
Unnamed arguments are confusing as to what they mean without looking up the function signature. Since segwit is active by default in regtest, and all blocks are serialized with witness (bitcoin#15664, c459c5f), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`. This diff has been created with a script, but is better reviewed without a scripted diff. sed -i --regexp-extended -e 's/block(_?[2a-z]*)\.serialize\([a-z_]*=?True/block\1.serialize(/g' $(git grep -l serialize ./test)
No description provided.