mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 10:12:28 +02:00
Merge bitcoin/bitcoin#31649: consensus: Remove checkpoints (take 2)
3c5d1a4681Remove checkpoints (marcofleon)632ae47372update comment on MinimumChainWork check (marcofleon) Pull request description: The headers presync logic (only downloading headers that lead to a chain with sufficient work, implemented in https://github.com/bitcoin/bitcoin/pull/25717) should be enough to prevent memory DoS using low-work headers. Therefore, we no longer have any use for checkpoints. All checkpoints and checkpoint logic are removed in a single commit, to make it easy to revert if necessary. Some previous discussion can be found in https://github.com/bitcoin/bitcoin/pull/25725. The conclusion at the time was that more testing of the presync logic was needed. Now that we have [unit](https://github.com/bitcoin/bitcoin/blob/master/src/test/headers_sync_chainwork_tests.cpp), [functional](https://github.com/bitcoin/bitcoin/blob/master/test/functional/p2p_headers_sync_with_minchainwork.py), and [fuzz](https://github.com/bitcoin/bitcoin/blob/master/src/test/fuzz/p2p_headers_presync.cpp) tests for this logic, it seems safe to move forward with checkpoint removal. ACKs for top commit: Sjors: Code review ACK3c5d1a4681instagibbs: reACK3c5d1a4681dergoegge: ACK3c5d1a4681Tree-SHA512: 051a6f9b82cd0262f4d3be4403906812fc6d1be022731fac16bb1c02bca471f31dfc7fc4b834ab2469e8f087265a6d99e84a1d665823cda1b112363a8e8f337d
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 ?
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user