aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-10-05 11:25:15 +0100
committerfanquake <fanquake@gmail.com>2023-10-05 11:28:29 +0100
commit2eacc61ad74c767f716cff65e958c7ff45f54aed (patch)
tree4c5b197f6472d637e96c7dfefcbfeae42c33423b /doc
parent0e3de3b83e99c29d4e84ae92894e3a9fedfe7bea (diff)
parent3d420d8f28f2d351abf8b0afe90848110e15d50c (diff)
downloadbitcoin-2eacc61ad74c767f716cff65e958c7ff45f54aed.tar.xz
Merge bitcoin/bitcoin#25970: Add headerssync tuning parameters optimization script to repo
3d420d8f28f2d351abf8b0afe90848110e15d50c Add instructions for headerssync-params.py to release-process.md (Pieter Wuille) 53d7d35b5899685cd1577156250068e0cab502f4 Update parameters in headerssync.cpp (Pieter Wuille) 7899402cff708319b1c5181242a97557eefe1ae7 Add headerssync-params.py script to the repository (Pieter Wuille) Pull request description: 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 to `headerssync.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. ACKs for top commit: ajtowns: reACK 3d420d8f28f2d351abf8b0afe90848110e15d50c Tree-SHA512: 03188301c20423c72c1cbd008ccce89b93e2898edcbeecc561b2928a0d64e9a829ab0744dc3b017c23de8b02f3c107ae31e694302d3931f4dc3540e184de1963
Diffstat (limited to 'doc')
-rw-r--r--doc/release-process.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/release-process.md b/doc/release-process.md
index bdef57243b..468efeb7e1 100644
--- a/doc/release-process.md
+++ b/doc/release-process.md
@@ -43,6 +43,14 @@ Release Process
- On mainnet, the selected value must not be orphaned, so it may be useful to set the height two blocks back from the tip.
- Testnet should be set with a height some tens of thousands back from the tip, due to reorgs there.
- `nMinimumChainWork` with the "chainwork" value of RPC `getblockheader` using the same height as that selected for the previous step.
+* Consider updating the headers synchronization tuning parameters to account for the chainparams updates.
+ The optimal values change very slowly, so this isn't strictly necessary every release, but doing so doesn't hurt.
+ - Update configuration variables in [`contrib/devtools/headerssync-params.py`](contrib/devtools/headerssync-params.py):
+ - Set `TIME` to the software's expected supported lifetime -- after this time, its ability to defend against a high bandwidth timewarp attacker will begin to degrade.
+ - Set `MINCHAINWORK_HEADERS` to the height used for the `nMinimumChainWork` calculation above.
+ - Check that the other variables still look reasonable.
+ - Run the script. It works fine in CPython, but PyPy is much faster (seconds instead of minutes): `pypy3 contrib/devtools/headerssync-params.py`.
+ - Paste the output defining `HEADER_COMMITMENT_PERIOD` and `REDOWNLOAD_BUFFER_SIZE` into the top of [`src/headerssync.cpp`](/src/headerssync.cpp).
- Clear the release notes and move them to the wiki (see "Write the release notes" below).
- Translations on Transifex:
- Pull translations from Transifex into the master branch.