Commit Graph

6 Commits

Author SHA1 Message Date
Hodlinator
cc5dda1de3 headerssync: Make HeadersSyncState more flexible and move constants
Move calculated constants from the top of src/headerssync.cpp into src/kernel/chainparams.cpp.

Instead of being hardcoded to mainnet parameters, HeadersSyncState can now vary depending on chain or test. (This means we can reset TARGET_BLOCKS back to the nice round number of 15'000).

Signet and testnets got new HeadersSyncParams constants through temporarily altering headerssync-params.py with corresponding GENESIS_TIME and MINCHAINWORK_HEADERS (based off defaultAssumeValid block height comments, corresponding to nMinimumChainWork). Regtest doesn't have a default assume valid block height, so the values are copied from Testnet 4. Since the constants only affect memory usage, and have very low impact unless dealing with a largely malicious chain, it's not that critical to keep updating them for non-mainnet chains.

GENESIS_TIMEs (UTC):
Testnet3: 1296688602 = datetime(2011, 2, 2)
Testnet4: 1714777860 = datetime(2024, 5, 3)
Signet: 1598918400 = datetime(2020, 9, 1)
2025-09-12 22:28:41 +02:00
fanquake
943de66b50 kernel: update headersync params 2025-09-02 11:59:48 +01:00
glozow
11a2d3a63e [headerssync] update headerssync config for v29 2025-03-04 14:23:18 -05:00
Ava Chow
221809b81c headerssync: Update headerssync configuration 2024-08-16 11:23:23 -04:00
fanquake
b2ede22395 headerssync: update params for 26.x 2023-10-05 11:36:03 +01:00
Pieter Wuille
7899402cff Add headerssync-params.py script to the repository 2023-09-28 12:05:52 -04:00