Builds upon #25946, as it incorporates changes based on the selected values there.
This adds the headerssync tuning parameters optimization script from https://gist.github.com/sipa/016ae445c132cdf65a2791534dfb7ae1 to the repository, updates the parameters based on its output, and adds release process instructions for doing this update in the future.
A few considerations:
- It would be a bit cleaner to have these parameters be part of
CChainParams
, but due to the nature of the approach, it really only applies to chains with unforgeable proof-of-work, which we really can only reasonably expect from mainnet, so I think it’s fine to keep them local toheaderssync.cpp
. Keeping them as compile-time evaluatable constants also has a (likely negligible) performance impact (avoiding runtime modulo operations). - If we want to make sure the chainparams and headerssync params don’t go out of date, it could be possible to run the script in CI, and and possibly even have the parameters be generated automatically at build time. I think that’s overkill for how unfrequently these need to change, and running the script has non-trivial cost (~minutes in the normal python interpreter).
- A viable alternative is just leaving this out-of-repo entirely, and just do ad-hoc updating from time to time. Having it in the repo and release notes does make sure it’s not forgotten, though adds a cost to contributors/maintainers who follow the process.