0.18: Granular invalidateblock and RewindBlockIndex #15552

pull MarcoFalke wants to merge 11 commits into bitcoin:0.18 from sipa:201902_limitrewindinvalidate changing 4 files +210 −136
  1. MarcoFalke commented at 10:10 pm on March 6, 2019: member

    Same repo and branch like “Granular invalidateblock and RewindBlockIndex #15402 “, can be merged as is.

    This saves us all the cherry-picks and review of the backport cherry-picks.

  2. Abstract EraseBlockData out of RewindBlockIndex
    Note that the former 'else' branch in RewindBlockIndex is now
    dealt with more naturally inside the EraseBlockData call (by
    checking whether the parent needs to be re-added as candidate
    after deleting a child).
    9d6dcc52c6
  3. Move erasure of non-active blocks to a separate loop in RewindBlockIndex
    This lets us simplify the iteration to just walking back in the chain,
    rather than looping over all of mapBlockIndex.
    32b2696ab4
  4. Merge the disconnection and erasing loops in RewindBlockIndex 1d342875c2
  5. Release cs_main during RewindBlockIndex operation 436f7d735f
  6. Call RewindBlockIndex without cs_main held 880ce7d46b
  7. Make RewindBlockIndex interruptible 241b2c74ac
  8. Call InvalidateBlock without cs_main held 9b1ff5c742
  9. Release cs_main during InvalidateBlock iterations 9bb32eb571
  10. Prevent callback overruns in InvalidateBlock and RewindBlockIndex 9ce9c37004
  11. Optimization: don't add txn back to mempool after 10 invalidates 8d220417cd
  12. Make last disconnected block BLOCK_FAILED_VALID, even when aborted 519b0bc5dc
  13. MarcoFalke added the label Backport on Mar 6, 2019
  14. MarcoFalke added the label Validation on Mar 6, 2019
  15. MarcoFalke added this to the milestone 0.18.0 on Mar 6, 2019
  16. MarcoFalke assigned laanwj on Mar 6, 2019
  17. sipa commented at 10:15 pm on March 6, 2019: member
    correct-trivial-rebase-ACK 519b0bc5dc5155b6f7e2362c2105552bb7618ad0
  18. in src/validation.cpp:2820 in 519b0bc5dc
    2837-        invalid_walk_tip->nStatus |= BLOCK_FAILED_CHILD;
    2838+        DisconnectedBlockTransactions disconnectpool;
    2839+        bool ret = DisconnectTip(state, chainparams, &disconnectpool);
    2840+        // DisconnectTip will add transactions to disconnectpool.
    2841+        // Adjust the mempool to be consistent with the new tip, adding
    2842+        // transactions back to the mempool if disconnecting was succesful,
    


    jonatack commented at 10:22 pm on March 6, 2019:
    Nit: successful.

    Sjors commented at 2:32 pm on March 7, 2019:
    @jonatack that should go in the original #15402 (though probably won’t be fixed in order not to lose existing ACKs)
  19. laanwj merged this on Mar 7, 2019
  20. laanwj closed this on Mar 7, 2019

  21. laanwj referenced this in commit 0fd3632868 on Mar 7, 2019
  22. DrahtBot locked this on Dec 16, 2021

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: 2024-11-21 18:12 UTC

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