Skip to content

[pull] develop from OffchainLabs:develop#973

Merged
pull[bot] merged 2 commits intoAll-Blockchains:developfrom
OffchainLabs:develop
Apr 7, 2026
Merged

[pull] develop from OffchainLabs:develop#973
pull[bot] merged 2 commits intoAll-Blockchains:developfrom
OffchainLabs:develop

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Apr 6, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…computed effective balance is unchanged. (#16631)

**What type of PR is this?**
Bug fix

**What does this PR do? Why is it needed?**
In (electra) `ProcessEffectiveBalanceUpdates`, a `0x00...` validator
with a balance > 33.25 ETH enters in the
```go
if balance+downwardThreshold < val.EffectiveBalance() || val.EffectiveBalance()+upwardThreshold < balance {
...
}
```

condition.

The validator is copied (`newVal = val.Copy()`) and returned, **even if
the effective balance did not actually change**.
As a consequence, this validator is considered as "dirty" in the
validators field trie, and all the corresponding branches are
re-computed when computing the hash trie root of the the validators
field trie of the beacon state.

This PR adopts the same behavior as before Electra:

https://github.com/OffchainLabs/prysm/blob/6f437b561a794a1f667cf000be0fa10b4234b85a/beacon-chain/core/electra/effective_balance_updates.go#L32-L63

and copies/considers dirty the validator only if its effective balance
changed.

**Which issues(s) does this PR fix?**
- #16630

**Other notes for review**
The first commit only introduces a new metric showing the issue.
The second commit actually solves the issue.

**Before this PR:**
**~9.400 validators** considered as dirty on mainnet every epoch

<img width="942" height="308" alt="image"
src="https://github.com/user-attachments/assets/31da9c92-aa0f-4d71-a402-92ed62738803"
/>


**After this PR:**
**~15 validators** considered as dirty on mainnet every epoch (reduction
of ~x620).

<img width="946" height="312" alt="image"
src="https://github.com/user-attachments/assets/afc5e72a-ccda-4636-87d9-dab2fbbf5c1c"
/>


**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description with sufficient context for reviewers
to understand this PR.
- [x] I have tested that my changes work as expected and I added a
testing plan to the PR description (if applicable).

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
@pull pull bot locked and limited conversation to collaborators Apr 6, 2026
@pull pull bot added the ⤵️ pull label Apr 6, 2026
…oto (#16634)

- Adds `cast_type` annotation to `proposer_lookahead` field in
`BeaconStateFulu` and `BeaconStateGloas` protobuf definitions to use
`primitives.ValidatorIndex` instead of raw `uint64`
- Matches the spec type `Vector[ValidatorIndex, ...]` and is consistent
with how `ptc_window` already uses `cast_type` for its validator indices
- Updates `InitializeProposerLookahead` to return
`[]primitives.ValidatorIndex` directly, removing all `uint64` conversion
boilerplate
- Adds `proposerLookaheadVal()` copy method for `ToProto` consistency
with other slice fields
@pull pull bot merged commit 883d782 into All-Blockchains:develop Apr 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants