Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process. 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. |
4ee9b46 to
b6150c2
Compare
|
are you still working on this, or can it be closed? |
Yes resumed the work, will push the update soon! |
b6150c2 to
6dd6819
Compare
6dd6819 to
5947686
Compare
|
Updated the PR description and ready for review |
|
@instagibbs do you want to take a look here? |
|
I think this might be a bit of overengineering. Centralizing code is nice, but really I don't see the value of the added abstraction aside from centralizing trigger_reorg? |
5947686 to
2edf797
Compare
|
Addressed @instagibbs suggestion to only keep |
| @@ -47,8 +44,7 @@ def transaction_graph_test(self, size, *, n_tx_to_mine, fee=100_000): | |||
| """ | |||
| wallet = MiniWallet(self.nodes[0]) | |||
|
|
|||
| # Prep for fork with empty blocks to not use invalidateblock directly | |||
| # for reorg case. The rpc has different codepath | |||
There was a problem hiding this comment.
wondering if there's a good place to add this removed comment to have people not reintroduce this pattern
There was a problem hiding this comment.
Maybe we can add in create_empty_fork docstring?
Details
def create_empty_fork(node, fork_length=FORK_LENGTH):
'''
Creates a fork using node's chaintip as the starting point.
Returns a list of blocks to submit in order.
Prefer this over calling the invalidateblock RPC to simulate a reorg:
invalidateblock takes a different codepath than a reorg caused by a
competing chain arriving, so tests using it are not exercising the
behaviour they mean to.
'''2edf797 to
56e96c0
Compare
|
Thanks for the review @instagibbs I have also updated PR title and the description. |
|
Ping for rebase @yuvicc |
56e96c0 to
ee536ff
Compare
|
Rebased to master |
ee536ff to
e6e14d3
Compare
|
Rebased |
…use proper fork-based approach
e6e14d3 to
d72c022
Compare
|
Addressed ralph llvm review nit: removed unused block-hash indexing in |

Follow-up to #32587.
trigger_reorg()was copy-pasted across several functional tests. This moves it intoblocktools.py, together with the fork construction, as two helpers:create_empty_fork()andtrigger_reorg().The remaining tests that still simulated reorgs with the
invalidateblockRPC are converted to use them, sinceinvalidateblocktakes a different codepath than a reorg caused by a competing chain arriving.