Page MenuHomePhabricator

validation: Move GetLastCheckpoint to BlockManager
ClosedPublic

Authored by PiRK on Mar 15 2022, 16:18.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC8b9fd2199bda: validation: Move GetLastCheckpoint to BlockManager
Summary

[META] This commit should be followed up by removing the comments and assertions meant only to show that the change is correct.

GetLastCheckPoint mainly acts on BlockManager.

This is a partial backport of core#20749 [7/17] and core#15655
https://github.com/bitcoin/bitcoin/pull/20749/commits/f11d11600ddb0ddff6538250ae2a35df6112c3db
https://github.com/bitcoin/bitcoin/pull/15655/commits/418d3230f86f77dde6e817f502baff8a54b707fa

Depends on D11175

Notes:

  • moving code from checkpoints.cpp to validation.cpp (which is huge already) may not seem great from a code quality perspective, but it will eventually be moved to it separate blockmanager.cpp file anyway.
  • we cannot remove checkpoint.{h,cpp} because of D1308 which resurrected Checkpoints::CheckBlock
Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Mar 15 2022, 16:19
Fabien requested changes to this revision.Mar 15 2022, 17:39
Fabien added a subscriber: Fabien.

Why can't you remove the extra includes like https://github.com/bitcoin/bitcoin/pull/15655/commits/418d3230f86f77dde6e817f502baff8a54b707fa ? It looks like there is no blocker for that ?

This revision now requires changes to proceed.Mar 15 2022, 17:39

Remove unused checkpoints.h includes. Only validation.cpp and checkpoints_tests.cpp still need it.

This revision is now accepted and ready to land.Mar 16 2022, 08:23