Skip to content

fix: report fork_choice validator_count as null when head state missing#1433

Open
zemse wants to merge 2 commits into
ReamLabs:masterfrom
zemse:fix-1429-validator-count-null
Open

fix: report fork_choice validator_count as null when head state missing#1433
zemse wants to merge 2 commits into
ReamLabs:masterfrom
zemse:fix-1429-validator-count-null

Conversation

@zemse

@zemse zemse commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #1429.

When the node does not have the head state, the /fork_choice API used to return validator_count: 0. But 0 is also a real count, so a reader could not tell "no validators" apart from "state is missing".

Now it returns validator_count: null when the head state is missing. null means "unknown".

This matches leanSpec PR leanEthereum/leanSpec#1104.

Two commits:

  1. tests (they fail without the fix)
  2. the fix (tests pass)

@zemse zemse force-pushed the fix-1429-validator-count-null branch from 9d46dbf to 850d565 Compare June 16, 2026 21:09
Comment thread testing/lean-spec-tests/src/fork_choice.rs
@zemse zemse marked this pull request as ready for review June 16, 2026 21:59
@zemse zemse force-pushed the fix-1429-validator-count-null branch from 78e29dd to 10dac6d Compare June 17, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report fork-choice validator_count as null (not 0) when the head state is missing in fork choice API

1 participant