Page MenuHomePhabricator

[backport#15655] Resolve the checkpoints <-> validation circular dependency
AbandonedPublic

Authored by majcosta on Jul 21 2020, 20:36.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

418d3230f8 Resolve the checkpoints <-> validation CD. (251)

Pull request description:

This pull request attempts to resolve the `checkpoints -> validation -> checkpoints` circular dependency.

The circular dependency is resolved by moving the `CheckPoints::GetLastCheckpoint(const CCheckpointData& data)` function to `validation.cpp` where it used exclusively by the private function `ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& params, const CBlockIndex* pindexPrev, int64_t nAdjustedTime)`.

https://github.com/bitcoin/bitcoin/pull/15655/commits/418d3230f86f77dde6e817f502baff8a54b707fa


Depends on D6970

Backport of Core PR15655

Test Plan
ninja check check-functional
./test/lint/lint-circular-dependencies.py

Diff Detail

Event Timeline

update lint-circular-dependencies.sh

Fabien requested changes to this revision.Jul 22 2020, 06:40
Fabien added a subscriber: Fabien.

Please run the circular dependency script as part of the test plan.

src/validation.cpp
40 ↗(On Diff #22411)

Not needed, you need blockhash.h instead

This revision now requires changes to proceed.Jul 22 2020, 06:40

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Aug 4 2020, 19:01

don't plan on landing this, so abandoning