[bisq-network/bisq] Fix reorg handling (PR #5819)

chimp1984 notifications at github.com
Wed Nov 10 17:56:27 CET 2021


Fixes https://github.com/bisq-network/bisq/issues/5809

How to reproduce:
- Start a new regtest setup with a seed, a full node and a lite node
- Make a backup of that start setup version. Assume block height is 113 here.
- Create 1 block
- Create 1 tx 
- Create 1 block. Block height is 115.
- Stop BTC core replace the blocks and regtest folders in btc core data dir with the folders from the start setup backup. This is used for simulating a reorg. 
- Create 2 blocks. Still no reorg as fork chain has same height 115 as existing chain.
- Create 1 more block triggering the reorg at 116.

In master the nodes get caught in an endless loop requesting new blocks.
With new version there is just the shutdown at seed node and the shutdown popup at desktop apps but no loops.
The litenode will not recognize the new block as the full nodes are shut down or inactive. Only after restarting the seed and creating a new block the lite node will detect the reorg. The block propagation is delayed with a random delay so it can take a bit... 
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/5819

-- Commit Summary --

  * <a href="https://github.com/bisq-network/bisq/pull/5819/commits/450800d101f17198bcd77cefc9dca81182b6b182">Remove startReOrgFromLastSnapshot methods in LiteNode</a>
  * <a href="https://github.com/bisq-network/bisq/pull/5819/commits/42500c03705870defab35b1ca6399e7431b8bfc2">Do not call resultHandler in case of a RequiredReorgFromSnapshotException</a>
  * <a href="https://github.com/bisq-network/bisq/pull/5819/commits/0edccd9fe145848ac4faf57409bbfddfe00609e6">Only call parseBlocksOnHeadHeight if our latest block from</a>

-- File Changes --

    M core/src/main/java/bisq/core/dao/node/full/FullNode.java (28)
    M core/src/main/java/bisq/core/dao/node/lite/LiteNode.java (11)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/5819.patch
https://github.com/bisq-network/bisq/pull/5819.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5819
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20211110/8885fd81/attachment.htm>


More information about the bisq-github mailing list