Repository navigation
HF16 readiness: count the quorum by schedule slots - #191
Conversation
…ule slots Mainnet schedules 13 validators (null-key validators are not scheduled), so the 17-slot tally cannot promote 4.2.0. The readiness doc counted 'upgraded of the top 21 by vote', which hides that. hardfork_readiness.py repeats the chain's recount from get_validator_schedule and cross-checks next_hardfork; its --selftest runs in CI and pins the quorum constants to config.hpp.
|
Thanks — the core of this is right, and the diagnosis it argues for is confirmed on the live chain. But there are four problems, and two of them are in the tool an operator will use to judge HF16 readiness. 1. "recount at shuffle #N" is not the recount block
Live, a few minutes ago: 84623539 % 21 = 7, so the next recount is #84623553, not #84623548. And 84623548 % 21 = 16 — the printed block is one on which nothing is recounted. Earlier, inside the 21-block window, the same line reported a block four blocks in the past while the actual assembly happened at a different height. Suggested fix — one expression, and it gives MAX_VALIDATORS = 21 # CHAIN_MAX_VALIDATORS
next_recount = (dgp["head_block_number"] // (MAX_VALIDATORS * REPEAT) + 1) * (MAX_VALIDATORS * REPEAT)Or drop the parenthetical entirely: the exit code does not depend on it, and a wrong block number is worse than none. Note where the assumption probably comes from: 2. The docs state the opposite of what
|
… 4; docs: get_active_validators is the tally set, fork applies in the recount block
|
Thanks. Every point checks out against the tree. Fixed in fe842c4:
Minors: a failed selftest now exits 4, and outside the repo tree the config arms are skipped instead of throwing a traceback. Also fixed: the Live at #84634402: 16 slots, 15/17 for 4.2.0, jackvote on 4.1.0, and the chain agrees. It needs one more scheduled slot and two more votes. |
Why
Mainnet (api.viz.world, 2026-10-26) schedules 13 validators. Validators with a null signing key are not scheduled, and the tally in
update_validator_schedulewalks onlycurrent_shuffled_validators[0 .. num_scheduled_validators). So 17 votes for 4.2.0 cannot be reached: 12 of the 13 already vote 4.2.0 andnext_hardforkstays 4.1.0. HF16 does not activate on 2026-10-31 until at least 4 more validators set a key and vote 4.2.0.lindsayandmonsterhighalready run 4.2.0 with a null key, so avalidator_updateis enough for them.jackvoteis scheduled but on 4.1.2.The readiness doc from #184 says "17 of the 21 scheduled" and counts
get_validators_by_vote ["", 21], which also lists null-key validators. No test caught this: testnet builds setCHAIN_HARDFORK_REQUIRED_VALIDATORS = 1.What
scripts/hardfork_readiness.py: repeats the chain's recount fromget_validator_schedule(slots, committee skipped during emergency, grouped by version and time, first group with ≥17 wins). It lists scheduled validators voting otherwise and null-key validators voting the leading version, then cross-checks againstget_next_scheduled_hardfork. Exit 0 = quorum reached, 1 = not yet, 2 = disagrees with the chain, or the API answer is unusable.--selftestcovers 16 vs 17, 13 slots, committee skip, per-slot counting and the hex schedule encoding. It also pinsREQUIRED/REPEATtoconfig.hpp. Runs in the CI offline step.docs/consensus/hf16.md+ ru: quorum is counted in schedule slots; how to run the script; manual check viaget_validator_schedule. zh-CN has no readiness section, so it is unchanged.No chain code touched.
Verification
--selftest: 9/9 pass. SettingREQUIRED = 16fails the config arm.next_hardfork4.1.0.