Remove checkpoints

The headers presync logic should be enough to prevent memory DoS using
low-work headers. Therefore, we no longer have any use for checkpoints.
This commit is contained in:
marcofleon
2025-01-13 15:08:41 +00:00
parent 632ae47372
commit 3c5d1a4681
18 changed files with 10 additions and 731 deletions

View File

@@ -146,7 +146,7 @@ HeadersSyncSetup* g_testing_setup;
void initialize()
{
static auto setup = MakeNoLogFileContext<HeadersSyncSetup>(ChainType::MAIN, {.extra_args = {"-checkpoints=0"}});
static auto setup = MakeNoLogFileContext<HeadersSyncSetup>(ChainType::MAIN);
g_testing_setup = setup.get();
}
} // namespace

View File

@@ -123,7 +123,6 @@ FUZZ_TARGET(partially_downloaded_block, .init = initialize_pdb)
BlockValidationResult::BLOCK_MISSING_PREV,
BlockValidationResult::BLOCK_INVALID_PREV,
BlockValidationResult::BLOCK_TIME_FUTURE,
BlockValidationResult::BLOCK_CHECKPOINT,
BlockValidationResult::BLOCK_HEADER_LOW_WORK});
pdb.m_check_block_mock = FuzzedCheckBlock(
fail_check_block ?

View File

@@ -103,7 +103,7 @@ void IpcPipeTest()
BOOST_CHECK_EQUAL(std::string_view(vec1.begin(), vec1.end()), std::string_view(vec2.begin(), vec2.end()));
BlockValidationState bs1;
bs1.Invalid(BlockValidationResult::BLOCK_CHECKPOINT, "reject reason", "debug message");
bs1.Invalid(BlockValidationResult::BLOCK_MUTATED, "reject reason", "debug message");
BlockValidationState bs2{foo->passBlockState(bs1)};
BOOST_CHECK_EQUAL(bs1.IsValid(), bs2.IsValid());
BOOST_CHECK_EQUAL(bs1.IsError(), bs2.IsError());