invalidateblock goes back one block at a time, and doesn't reorg properly #86

Open
opened 2022-08-16 02:02:39 +02:00 by roylee17 · 1 comment
roylee17 commented 2022-08-16 02:02:39 +02:00 (Migrated from github.com)

For example,

100 -> 101 -> 102 -> 103  (main chain)
     \ 101a (side chain)
  1. invalidate one block at a time from the tip works.
$ getbestblock
{
  hash: HASH_OF_103
  height: 103
}

$ invalidateblock HASH_OF_103
$ invalidateblock HASH_OF_102

$ getbestblock
{
  hash: HASH_OF_101
  height: 101
}
  1. However, even if we invalidate block 101, the main chain doesn't reorg properly to block 101a
$ invalidateblock HASH_OF_101 
$ getbestblock
{
  hash: HASH_OF_101a
  height: 101a
}
$ getblock HASH_OF_101a
block HASH_OF_101a is not in the main chain
  1. invalidate more than one block at a time cause lbcd goes rogue. Starting to exhaust CPU and memory.
$ getbestblock
{
  hash: HASH_OF_103
  height: 103
}

$ invalidateblock HASH_OF_101
(lbcd goes rogue...)
For example, ``` 100 -> 101 -> 102 -> 103 (main chain) \ 101a (side chain) ``` 1. invalidate one block at a time from the tip works. ```sh $ getbestblock { hash: HASH_OF_103 height: 103 } $ invalidateblock HASH_OF_103 $ invalidateblock HASH_OF_102 $ getbestblock { hash: HASH_OF_101 height: 101 } ``` 2. However, even if we invalidate block 101, the main chain doesn't reorg properly to block 101a ```sh $ invalidateblock HASH_OF_101 $ getbestblock { hash: HASH_OF_101a height: 101a } $ getblock HASH_OF_101a block HASH_OF_101a is not in the main chain ``` 3. invalidate more than one block at a time cause lbcd goes rogue. Starting to exhaust CPU and memory. ```sh $ getbestblock { hash: HASH_OF_103 height: 103 } $ invalidateblock HASH_OF_101 (lbcd goes rogue...) ```
roylee17 commented 2022-09-12 18:20:01 +02:00 (Migrated from github.com)
https://github.com/lbryio/lbry-sdk/issues/3520
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbcd#86
No description provided.