Add ReorgChain IR operation - #219
Open
NishantBansal2003 wants to merge 3 commits into
Open
Conversation
Adds `reorg_chain(depth)`, which disconnects the top depth blocks with `invalidateblock` and mines depth + 1 empty blocks, causing a natural chain reorg. Since the replacement blocks are empty, disconnected transactions become unconfirmed, Bitcoin Core restores mempool-eligible transactions, while the rest are returned in `ReorgedTxs::rejected_txs`, along with all disconnected non-coinbase txids in block order. Rejected transactions must be queued for direct mining since they typically violate mempool policy. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Adds a `ReorgChain` operation that disconnects the top blocks and mines empty replacement blocks, allowing scenarios to exercise transactions losing their confirmations. After the reorg, the executor restores disconnected transactions to the unmined state and places transactions rejected by Bitcoin Core at the front of the private mempool so they can be mined directly again. This is necessary for transactions that violate mempool policy and would otherwise remain unconfirmed. Supports reorgs of one or two blocks, covering the shallow reorgs a node is expected to handle naturally. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Generates a shallow chain reorganization: mines blocks to confirm any broadcast transaction, then reorgs the chain out from under it, so generated programs exercise a funding transaction losing its confirmations. Depth is 1 or 2, the shallow reorgs that occur naturally on mainnet and that a node is expected to handle. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Contributor
Author
|
CLN results after rebasing onto the manual-sync RPC approach (#211). I assume the likely reason for the improved performance compared to before is that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ReorgChain Performance
The following seed was used to measure performance:
cln
lnd
ldk
eclair