-
Couldn't load subscription status.
- Fork 5.8k
BIP54: Consensus Cleanup test vectors #2015
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
base: master
Are you sure you want to change the base?
BIP54: Consensus Cleanup test vectors #2015
Conversation
This introduces a set of test vectors for each of the 4 mitigations in the BIP. The sigops and transaction size vectors were generated using the unit tests included with the Bitcoin Core implementation of BIP54, available at https://github.com/darosior/bitcoin/tree/2509_inquisition_consensus_cleanup. The timestamps and coinbases required mainnet blocks for maximum compatibility, and were generated by two dedicated unit tests not included with the Bitcoin Core implementation above but available at https://github.com/darosior/bitcoin/tree/bip54_miner.
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, successfully built the test branch at https://github.com/darosior/bitcoin/blob/2509_inquisition_consensus_cleanup and ran the unit and functional tests.
$ ./build/bin/test_bitcoin --run_test=bip54_tests
Running 4 test cases...
*** No errors detected
$ ./build/test/functional/feature_bip54.py
2025-10-21T16:05:13.483000Z TestFramework (INFO): PRNG seed is: 80635940825195715
2025-10-21T16:05:13.483000Z TestFramework (INFO): Initializing test directory /var/folders/bz/mn3hr6td37bczwp7j89frs4w0000gn/T/bitcoin_func_test_dznr0x1z
2025-10-21T16:05:14.300000Z TestFramework (INFO): BIP54 tests before activation
2025-10-21T16:05:14.558000Z TestFramework (INFO): Activating BIP54
2025-10-21T16:05:14.745000Z TestFramework (INFO): BIP54 tests after activation
2025-10-21T16:05:15.296000Z TestFramework (INFO): Stopping nodes
2025-10-21T16:05:15.460000Z TestFramework (INFO): Cleaning up /var/folders/bz/mn3hr6td37bczwp7j89frs4w0000gn/T/bitcoin_func_test_dznr0x1z on exit
2025-10-21T16:05:15.460000Z TestFramework (INFO): Tests successful
Are the functional tests worth mentioning in the test_vectors README? Perhaps with some of the content in the commit message:
The previously introduced unit tests extensively test the specific implementation of each
mitigation. This functional test complements them by sanity checking all mitigations in a "black
box" manner. For the added timestamp constraints, it mimicks how they would get exploited (by
implementing pseudo timewarp and Murch-Zawy attacks) and demonstrates those exploits are not
possible anymore after BIP54 activates.
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.
Looks good, see nit
2fead0c to
0777a81
Compare
No, i don't think so. The functional test sanity checks the implementation with a blackbox approach, but does not implement test vectors. Hence they don't need to be mentioned in the test vectors README. |
This introduces test vectors for BIP54. There is one set of vectors per each of the 4 mitigations.
The vectors were generated using the BIP54 implementation against Bitcoin Inquisition available here, as well as a custom miner as a Bitcoin Core unit test available here. Documentation is provided with more details about each set of test vectors and describing how to use them.