Skip to content

Conversation

dongcarl
Copy link
Contributor

@dongcarl dongcarl commented Mar 9, 2022

The only important commit is "Only load BlockMan in BlockMan member functions", everything else is all just small style changes.

Here's the commit message, reproduced:

This commit effectively splits the "load block index itself" logic from
"derive Chainstate variables from loaded block index" logic.

This means that BlockManager::LoadBlockIndex{,DB} will only load what's
relevant to the BlockManager.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ajtowns
Copy link
Contributor

ajtowns commented Mar 10, 2022

(Ditto what @MarcoFalke said)

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 11, 2022

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #24582 (Move txoutproof RPCs to txoutproof.cpp by MarcoFalke)
  • #24456 (blockman: Properly guard blockfile members by dongcarl)
  • #24230 (indexes: Stop using node internal types and locking cs_main, improve sync logic by ryanofsky)
  • #22564 (refactor: Move mutable globals cleared in ::UnloadBlockIndex to BlockManager by dongcarl)
  • #21726 (Improve Indices on pruned nodes via prune blockers by fjahr)

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.

@ryanofsky
Copy link
Contributor

The main thing this PR seems to be doing is moving chainstate->setBlockIndexCandidates filling code out of block-manager to chainstate-manager. This seems like it makes sense because you would expect block manager just to deal with low level blocks and not know anything about chain states or validation. Would be good to have @jamesob concept ACK since he added most of the code that's moving

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK af44e85. Ignore minor comments unless you feel like addressing them

@dongcarl dongcarl force-pushed the 2022-03-kirby-p2.5 branch from af44e85 to 9cb1165 Compare March 15, 2022 23:37
...since the height information in already in CBlockIndex* and we can
use an easy custom sorter.
This commit effectively splits the "load block index itself" logic from
"derive Chainstate variables from loaded block index" logic.

This means that BlockManager::LoadBlockIndex{,DB} will only load what's
relevant to the BlockManager.

I strongly recommend reviewing with the following git-diff flags:
  --color-moved=dimmed_zebra --color-moved-ws=allow-indentation-change
...also use std::sort for clarity
@dongcarl dongcarl force-pushed the 2022-03-kirby-p2.5 branch from 9cb1165 to f865cf8 Compare March 15, 2022 23:47
@dongcarl
Copy link
Contributor Author

Pushed af44e85 to f865cf8

  • Addressed all outstanding minor comments

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review ACK f865cf8 🗂

Show signature

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

review ACK f865cf8ded2b2fbc82a6fbc41226d991909a6880 🗂
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUg0DAv/VZj7G6Rp0qriCmTSDHrk21I938vrPa39hBPwQ9GU3DpaKPoIth5mj2Vl
jMREh59ZzqKKorCPa0RdcVaRyiVPTRup0EOSi0b9qwIQREr1pumfJb1Mir9HJtCY
WbLA/sj1YGuXpIUvWAEUkKE56vpLVahWnSx5jd9QFO0DBWbfQ3iHWj/Soc5EBxEV
5pquK8ceeWyZxN7NKHWwKZegfjMmuPvmrr1HVfFB9qwjzYIsJk7Hv83PXbTHNzMa
OBBxlGy6o/anN1w+iS6tflGCzmTgxXXWKROlm2pCDAgOJZi4FyM2vj/V/9XM4E4F
RghIzqLltFmVJwvRV7x/o0Ahf3QHsez5TIl8JvFxVjBAwPP6WW2cbUQnXJRGrpho
oIUVnBf/r5iZCImOGzCkslm5oBDmWHCGi2jscPcdIQAcQNrusIN2jy4OrWxVAYFw
fjORBHiWF1TnQElKrfBurviwt+LO8SZFcjtTm7ZN4BGFFknCGgUBD9hqP9GB6mzt
Tu78aGDd
=BBgB
-----END PGP SIGNATURE-----

@ajtowns
Copy link
Contributor

ajtowns commented Mar 16, 2022

ACK f865cf8 ; code review only

@maflcko maflcko merged commit 601bfc4 into bitcoin:master Mar 17, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 18, 2022
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 23, 2023
Summary:
This is a partial backport of [[bitcoin/bitcoin#24515 | core#24515]]
bitcoin/bitcoin@5be9ee3

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13020
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 23, 2023
Summary:
...since the height information in already in CBlockIndex* and we can
use an easy custom sorter.

This is a partial backport of [[bitcoin/bitcoin#24515 | core#24515]]
bitcoin/bitcoin@42e56d9

Also includes a comment removal from bitcoin/bitcoin@3bbb6fe
The rest of this commit is already done in Bitcoin ABC (review of D12993 and D12994)

Depends on D13020

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13021
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 23, 2023
Summary:
This commit effectively splits the "load block index itself" logic from
"derive Chainstate variables from loaded block index" logic.

This means that BlockManager::LoadBlockIndex{,DB} will only load what's
relevant to the BlockManager.

I strongly recommend reviewing with the following git-diff flags:
  --color-moved=dimmed_zebra --color-moved-ws=allow-indentation-change

This is a partial backport of [[bitcoin/bitcoin#24515 | core#24515]]
bitcoin/bitcoin@c600ee3

Depends on D13021

The sorting code is deduplicated in D13023

Test Plan:  `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13022
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 23, 2023
Summary:
...also use std::sort for clarity

Add also a simple unit test for coverage.

This is a partial backport of [[bitcoin/bitcoin#24515 | core#24515]]
bitcoin/bitcoin@28ba031

Depends on D13022

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13023
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 23, 2023
Summary:
This concludes backport of [[bitcoin/bitcoin#24515 | core#24515]]
bitcoin/bitcoin@f865cf8
Depends on D13023

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13024
@bitcoin bitcoin locked and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants