Page MenuHomePhabricator

[electrum] fix handling of a single block reorg
ClosedPublic

Authored by PiRK on Dec 7 2023, 14:45.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC9ca62d66b75c: [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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK retitled this revision from [electrum] test the block heights in the reorg test to [electrum] fix handling of a single block reorg.
PiRK edited the summary of this revision. (Show Details)

fix the issue, fix the tests accordingly

PiRK published this revision for review.Dec 12 2023, 10:31
PiRK edited the summary of this revision. (Show Details)
PiRK edited the test plan for this revision. (Show Details)
PiRK edited the test plan for this revision. (Show Details)
PiRK edited the test plan for this revision. (Show Details)

remove another debugging print

This revision is now accepted and ready to land.Dec 12 2023, 14:17