Following #24865 (review).
This PR adds a helper function to create large blocks for pruning related tests.
Following #24865 (review).
This PR adds a helper function to create large blocks for pruning related tests.
86 | @@ -87,6 +87,14 @@ def create_block(hashprev=None, coinbase=None, ntime=None, *, version=None, tmpl 87 | block.calc_sha256() 88 | return block 89 | 90 | +def create_large_block(hashprev=None, ntime=None, height=None, scriptPubKey=CScript([OP_RETURN] + [OP_TRUE] * 950000)): 91 | + coinbase_tx = create_coinbase(height) 92 | + coinbase_tx.vin[0].nSequence = 2 ** 32 - 1
I wonder if there is reason to change the sequence?
I can make it a parameter if needed.
I don't think the sequence is used anywhere at all, is it?
I removed it in #24865, thanks.
Why not extracting this function as part of the linked PR? Wouldn't this make more sense as that's where you would better show the reasoning for this change?
Also, would it make sense to use this mine_large_block method instead? It's not a drop-in replacement, but my thought is if doing minor changes in order to reuse logic would be more beneficial.
https://github.com/bitcoin/bitcoin/blob/9fb2a2bc6768ab03fcada9155d52a16ce6f6a0cc/test/functional/test_framework/util.py#L532-L538
Why not extracting this function as part of the linked PR? Wouldn't this make more sense as that's where you would better show the reasoning for this change?
Sure, I'll close this PR and continue in #24865.
Also, would it make sense to use this mine_large_block method instead? It's not a drop-in replacement, but my thought is if doing minor changes in order to reuse logic would be more beneficial.
I'll take a look at it but it might not easily fit my use-case as I need to control the block nTime...