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
tests: Speedup feature_pruning test and refactor big transaction logic #14691
Conversation
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. Coverage
Updated at: 2018-11-08T22:02:58.107718. |
Concept ACK Haven't looked at the changes, but I'm seeing a ~1.4x speedup on my machine between
|
c8ef522
to
cf6c3e3
Compare
cf6c3e3
to
ecf8389
Compare
Needs rebase |
@conscott I realise this hasn't seen much traction / concept ACKs, however are you interested in rebasing? |
I almost forgot this was still alive :) I will rebase when I get the chance, hopefully this week! |
Concept ACK |
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.
# Create a spend of each passed-in utxo, splicing in "txout" to each raw | ||
# transaction to make it large. By default, it will splice in | ||
# 128 OP_RETURN outputs of 512 data bytes (see MULTI_OP_RETURN) | ||
def create_lots_of_big_transactions(node, utxos, num, fee, op_return_txout=MULTI_OP_RETURN): |
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 simplify by ditching num
parameter? This way below could be
return [create_big_transaction(node, utxo, fee, op_return_txout) for utxo in utxos]
Concept ACK. Will review on rebase. |
Is this still required after #15686? |
@jnewbery - Looks like you got it covered more elegantly with OP_NOPs :) It was a fun learning experience anyhow. I will go ahead and close this. |
Description
Extended tests like feature_pruning.py create large blocks by making many large transactions with a lot of OP_RETURNS in a single tx. Under this model roughly 14 of these transactions make a full-ish block.
These transactions are already non-standard, so I have just modified the logic to instead just create 1 large output, making a single large transaction, mining a block of roughly the same size (947k). The reduction in tx creation / number of outputs seems to significantly improve performance.
Another optimization is to splice in the OP_RETURN output after transaction signing, since it reduces the copying of the large OP_RETURN portion during signing. All signatures are
SIGHHASH_NONE
, so splicing after is okay.feature_pruning.py has about a 1.5x speedup on my machine (~12 minutes down to ~8 minutes), and
mempool_limit
, andfeature_maxuploadtarget
seem to benefit as well.Refactoring
create_lots_of_big_transactions
no longer requires providing the OP_RETURN splice, and uses the default from before, with an optionalop_return_txout=
keyword args for using the giant OP_RETURN mentioned above.