Consensys / teku

Open-source Ethereum consensus client written in Java
https://consensys.io/teku
Apache License 2.0
679 stars 284 forks source link

In `SpecVersion`, make `SpecConfig` instance consistent with milestone #8830

Closed tbenr closed 6 days ago

tbenr commented 1 week ago

Currently, we always have the highest configured milestone SpecConfig instance associated to each SpecVersion.

This PR makes sure that SpecConfig version correspond to the SpecVersion for a given milestone. For example, for mainnet network, we have SpecConfigPhase0 is returned when we do spec.atSlot(0).getConfig() even when Electra is configured. Similarly for all milestones.

Fixes a counterintuitive behaviour that we frequently forget, causing wasted time, and enables some advanced usage of the SpecConfig (like abstracting away config params that are updated from a milestone to the next, like max blobs)

Documentation

Changelog

tbenr commented 6 days ago

SpecConfigAndParent or something like SpecConfigAndPreviousVersions ?