-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[tests] make pruning test faster #15686
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
|
Very nice! Do you have any numbers to share? :-) |
~30 minutes -> ~4 minutes on my machine. (I should have mentioned that this is #10591 resurrected) |
test/functional/feature_pruning.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.
one hand clapping: can a coinbase tx ever be "non-standard"? :)
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.
I think all coinbases are "non-standard", since we never relay them. :)
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.
Heh. Would you prefer "A transaction containing this scriptPubKey would be non-standard in a non-coinbase transaction, but is consensus valid"?
I also notice that the comment incorrectly says 'scriptsig' instead of 'scriptPubKey'. I'll update.
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.
just a joke :)
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.
Needed to fix other comments, so I've fixed this too. Thanks.
instagibbs
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.
tACK 3ce84d7 with non-blocking nits.
2019-03-28T18:08:04.929000Z TestFramework (INFO): Warning! This test requires 4GB of disk space and takes over 30 mins (up to 2 hours) no longer true as well for me, took far less than 5 minutes on my debug build.
test/functional/feature_pruning.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.
block_hex? I also think a simple .hex() is kosher on master now(or at least I see many incantations of it!)
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.
Also just as test belt and suspenders, make sure the blocks you are making are actually the size you think they are:
assert_greater_than(len(block_hex), len(big_script)*2)
or there abouts
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.
Thanks. I've changed this to use ToHex() to match other tests.
3ce84d7 to
ba39546
Compare
|
Force pushed some minor fixups. I also tested sending the blocks over P2P, and it's actually slower, so I've removed the comment saying we should do that. |
|
reACK ba39546 |
|
Concept ACK |
That's impressive. Mind to move it to the non-extended tests? |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Sadly, I think this still won't run on travis. Here's my comment on the original PR:
You've also asked that I split out the style changes into a separate commit, which is a fair request. I'll do that tomorrow. |
Minor style fixups. No functional change.
This commit makes the pruning.py much faster. Key insights to do this: - pruning.py doesn't care what kind of transactions make up the big blocks that are pruned in the test. Instead of making blocks with several large, expensive to construct and validate transactions, instead make the large blocks contain a single coinbase transaction with a huge OP_RETURN txout. - avoid stop-starting nodes where possible. This test could probably be made even faster by using the P2P interface for submitting blocks instead of the submitblock RPC.
ba39546 to
03d6d23
Compare
|
I've split style-only changes into their own commit, to make review easier. Pushed branch should be identical to previous. |
|
utACK 03d6d23 |
|
Time: Less than 3 minutes on ssd and about 4 minutes on hdd. 🚀 |
03d6d23 [tests] make pruning test faster (John Newbery) 1c29ac4 [tests] style fixes in feature_pruning.py (John Newbery) Pull request description: This commit makes the pruning.py much faster. Key insights to do this: - pruning.py doesn't care what kind of transactions make up the big blocks that are pruned in the test. Instead of making blocks with several large, expensive to construct and validate transactions, instead make the large blocks contain a single coinbase transaction with a huge OP_RETURN txout. - avoid stop-starting nodes where possible. ACKs for commit 03d6d2: MarcoFalke: utACK 03d6d23 Tree-SHA512: 511642ce0fa294319dce3486fe06d75970d8ab66deda7f692be081d3056b4ce5b4cf91a7b5762eefbba224ba6c848750016454ff1e5d564acc507b1c41213628
|
re-ACK 03d6d23 |
ryanofsky
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.
ACK 03d6d23. Test also took ~3 minutes for me (on ssd)
| WARNING: | ||
| This test uses 4GB of disk space. | ||
| This test takes 30 mins or more (up to 2 hours) |
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 update this comment
| block.nVersion = best_block["version"] | ||
| block.hashPrevBlock = previousblockhash | ||
| block.nTime = mine_large_blocks.nTime | ||
| block.nBits = int('207fffff', 16) |
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 write 0x207fffff
|
Thanks for the review @ryanofsky . This has been merged so I'm not intending to make further changes (happy to review your PR if you want to make the changes though). |
03d6d23 [tests] make pruning test faster (John Newbery) 1c29ac4 [tests] style fixes in feature_pruning.py (John Newbery) Pull request description: This commit makes the pruning.py much faster. Key insights to do this: - pruning.py doesn't care what kind of transactions make up the big blocks that are pruned in the test. Instead of making blocks with several large, expensive to construct and validate transactions, instead make the large blocks contain a single coinbase transaction with a huge OP_RETURN txout. - avoid stop-starting nodes where possible. ACKs for commit 03d6d2: MarcoFalke: utACK 03d6d23 Tree-SHA512: 511642ce0fa294319dce3486fe06d75970d8ab66deda7f692be081d3056b4ce5b4cf91a7b5762eefbba224ba6c848750016454ff1e5d564acc507b1c41213628
03d6d23 [tests] make pruning test faster (John Newbery) 1c29ac4 [tests] style fixes in feature_pruning.py (John Newbery) Pull request description: This commit makes the pruning.py much faster. Key insights to do this: - pruning.py doesn't care what kind of transactions make up the big blocks that are pruned in the test. Instead of making blocks with several large, expensive to construct and validate transactions, instead make the large blocks contain a single coinbase transaction with a huge OP_RETURN txout. - avoid stop-starting nodes where possible. ACKs for commit 03d6d2: MarcoFalke: utACK 03d6d23 Tree-SHA512: 511642ce0fa294319dce3486fe06d75970d8ab66deda7f692be081d3056b4ce5b4cf91a7b5762eefbba224ba6c848750016454ff1e5d564acc507b1c41213628
This commit makes the pruning.py much faster.
Key insights to do this:
blocks that are pruned in the test. Instead of making blocks with
several large, expensive to construct and validate transactions,
instead make the large blocks contain a single coinbase transaction with
a huge OP_RETURN txout.