HomePhabricator

make checkpoints_tests work with the same Config as the rest of the validation…

Description

make checkpoints_tests work with the same Config as the rest of the validation code

Summary:
Change ChainTestingSetup and TestingSetup to allow passing a Config to be used when initializing the ChainstateManager. Leverage this in checkpoints_tests to have a consistent custom config throughout the test, instead of passing a custom config to ProcessNewBlockHeaders while the rest of the validation code uses a different global config.

To make it work, I had to change DummyConfig::GetMaxBlockSize to return a value that makes more sense.

Remove the unused DummyConfig::SetChainPairams function.

This diff will allow us to use the chainparam's config in more validation functions: AcceptBlockHeader, AcceptBlock, ProcessNewBlockHeaders, ProcessNewBlock

It is also needed to backport https://github.com/bitcoin/bitcoin/pull/24595/commits/78adef17536edef833a0bfca06b61ce28120e486, which currently causes checkpoints test to fail.

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D15802

Details

Provenance
PiRKAuthored on Mar 28 2024, 19:19
PiRKPushed on Mar 30 2024, 17:23
Reviewer
Restricted Project
Differential Revision
D15802: make checkpoints_tests work with the same Config as the rest of the validation code
Parents
rABC646b22d10827: [Cashtab] Replace all console.log statements with error or info and remove…
Branches
Unknown
Tags
Unknown