nested invalidate block doesn't work like I expect #10439

issue gmaxwell opened this issue on May 22, 2017
  1. gmaxwell commented at 9:41 AM on May 22, 2017: contributor

    If I invalidate block 5 it reorgs to block 4 as expected. If I then invalidate block 4 it reorgs to block 3, as expected. If I reconsider 4 I expect it to go back to 4, as 5 is still invalidated, but instead it reorgs back to the best tip.

  2. laanwj added the label RPC/REST/ZMQ on May 22, 2017
  3. sipa commented at 7:07 PM on May 23, 2017: member

    Read the RPC help text from reconsiderblock:

    reconsiderblock "blockhash"
    
    Removes invalidity status of a block and its descendants, reconsider them for activation.
    This can be used to undo the effects of invalidateblock.
    

    reconsiderblock automatically applies to all descendants of a block, so this is working as intended. There is no such thing as priorities when invalidating/reconsidering. Just valid and invalid.

  4. sipa commented at 7:12 PM on May 23, 2017: member

    An alternative would be to have reconsiderblock only apply to the ancestors of a block and not its descendants. That would get you the ability to selectively reconsider, but it would result in a sequence (where the tip block is 10)

    invalidateblock 8
    reconsiderblock 8
    

    to make 8 the new tip instead of 10, as 9 and 10 would remain invalid.

  5. Sjors commented at 2:12 PM on September 30, 2019: member

    Not applying reconsiderblock to descendants seems rather tedious for the "roll back to create UTXO snapshot" use case: #15606. Though there could be an additional argument to include descendants.

    If block 8 can be invalid and block 10 can be invalid, we'd have to change the "children of BLOCK_FAILED_VALID may be BLOCK_FAILED_CHILD, but must not be BLOCK_FAILED_VALID" rule. See #16856.

    I'm fine with the current behavior, though not opposed to changing it.

  6. willcl-ark referenced this in commit 9e367c709f on Apr 18, 2023
  7. pinheadmz assigned willcl-ark on Apr 27, 2023
  8. pinheadmz commented at 4:10 PM on May 12, 2023: member

    While reviewing #26260 I came back here to see if the issue was related at all... I think I agree with Sipa and Sjors that the current behavior is expected and documented and this issue should probably closed as "won't fix"

  9. maflcko commented at 6:30 AM on May 13, 2023: member

    Ok, closing for now due to lack of interest, progress and direction.

    Pull requests with improvements are always welcome. Moreover, it is possible to re-open this issue or create a new issue referencing it, if there is fresh interest.

  10. maflcko closed this on May 13, 2023

  11. bitcoin locked this on May 12, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me