Move BlockManager to node/blockstorage #23581

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:2111-blockstorage changing 4 files +455 −453
  1. MarcoFalke commented at 7:55 pm on November 23, 2021: member
    BlockManager is responsible for reading and writing block(headers). So move it to the existing blockstorage module in node. Also, move validation code unrelated to block-storage out from BlockManager.
  2. MarcoFalke added the label Refactoring on Nov 23, 2021
  3. MarcoFalke force-pushed on Nov 23, 2021
  4. MarcoFalke force-pushed on Nov 24, 2021
  5. DrahtBot commented at 2:17 pm on November 24, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #23810 (refactor: destroy all C-style casts; use modern C++ casts, enforce via -Wold-style-cast by PastaPastaPasta)
    • #22932 (Guard CBlockIndex::nStatus by cs_main, require GetBlockPos/GetUndoPos to hold cs_main by jonatack)
    • #21726 (Improve Indices on pruned nodes via prune blockers by fjahr)
    • #20827 (During IBD, prune as much as possible until we get close to where we will eventually keep blocks by luke-jr)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. in src/validation.cpp:721 in fa646a5ae9 outdated
    717@@ -718,7 +718,9 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
    718     if (!CheckSequenceLocks(m_active_chainstate.m_chain.Tip(), m_view, tx, STANDARD_LOCKTIME_VERIFY_FLAGS, &lp))
    719         return state.Invalid(TxValidationResult::TX_PREMATURE_SPEND, "non-BIP68-final");
    720 
    721-    if (!Consensus::CheckTxInputs(tx, state, m_view, m_active_chainstate.m_blockman.GetSpendHeight(m_view), ws.m_base_fees)) {
    722+    assert(m_active_chainstate.m_blockman.LookupBlockIndex(m_view.GetBestBlock()) == m_active_chainstate.m_chain.Tip());
    


    promag commented at 9:36 am on November 25, 2021:

    fa646a5ae9b39b7987d5701aec55a54ae4ec80ed

    nit, move after L706.


    MarcoFalke commented at 11:35 am on November 25, 2021:
    thx, done
  7. in src/validation.h:431 in faabaa8654 outdated
    427@@ -427,6 +428,7 @@ class BlockManager
    428      *                                     which we've downloaded all transactions.
    429      */
    430     bool LoadBlockIndex(
    431+        CBlockIndex*& best_invalid,
    


    promag commented at 9:46 am on November 25, 2021:

    faabaa8654c9446846e79ac5ae2edf70e0ae6d98

    Update doc above? Make it the 2nd arg?


    MarcoFalke commented at 11:36 am on November 25, 2021:
    thx, done
  8. promag commented at 9:48 am on November 25, 2021: member
    Concept ACK.
  9. MarcoFalke force-pushed on Nov 25, 2021
  10. DrahtBot added the label Needs rebase on Dec 3, 2021
  11. MarcoFalke force-pushed on Dec 3, 2021
  12. DrahtBot removed the label Needs rebase on Dec 3, 2021
  13. DrahtBot added the label Needs rebase on Dec 15, 2021
  14. MarcoFalke force-pushed on Jan 2, 2022
  15. Move BlockManager to node/blockstorage
    Can be reviewed with --color-moved=dimmed-zebra
    fade2a44f4
  16. Fixup style of moved code
    Can be reviewed with --word-diff-regex=. -U0 --ignore-all-space
    fa7efc915b
  17. MarcoFalke force-pushed on Jan 2, 2022
  18. MarcoFalke commented at 5:00 pm on January 2, 2022: member
    Rebased
  19. DrahtBot removed the label Needs rebase on Jan 2, 2022
  20. ryanofsky approved
  21. ryanofsky commented at 8:29 pm on January 3, 2022: member
    Code review obvious ACK fa7efc915b87ec56ca1cc0bad7d8f79591bfa099
  22. fanquake merged this on Jan 4, 2022
  23. fanquake closed this on Jan 4, 2022

  24. MarcoFalke deleted the branch on Jan 4, 2022
  25. sidhujag referenced this in commit 81d78ac374 on Jan 4, 2022
  26. Fabcien referenced this in commit 65330d5b88 on Nov 16, 2022
  27. DrahtBot locked this on Jan 4, 2023

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-07-03 10:13 UTC

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