HomePhabricator

[electrum] fix handling of a single block reorg

Description

[electrum] fix handling of a single block reorg

Summary:
Fix the network code handling reorgs to not cause the server to be disconnected when a block is parked and the next block takes some time to replace it.

Test how Electrum handles a reorg wrt to the server_height and block_height.
In the new test case, we have one block reorged (parked by Avalanche because of a policy violation) after it was initially accepted by the node, and we test each intermediate step as the chain grows longer again.
In the existing test, we keep testing a multi-block reorg by a longer fork. We adds the checks for the local and server height.

Depends on D14968

Test Plan:

for i in {0..20}; do pytest electrumabc/tests/regtest/test_reorg.py ; done

pytest electrumabc/tests

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14944

Details

Provenance
PiRKAuthored on Dec 7 2023, 14:36
PiRKPushed on Dec 12 2023, 14:54
Reviewer
Restricted Project
Differential Revision
D14944: [electrum] fix handling of a single block reorg
Parents
rABCef4e841765f5: [electrum] resolve past single-block reorg
Branches
Unknown
Tags
Unknown