beacon/config: ignore nil values in config file (#33065)

YAML supports leaving out the value, so we should handle this condition
in our limited parser.
This commit is contained in:
Klimov Sergei 2025-11-26 23:19:33 +08:00 committed by GitHub
parent 3e48e0779c
commit c55a12197e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -103,6 +103,9 @@ func (c *ChainConfig) LoadForks(file []byte) error {
epochs["GENESIS"] = 0
for key, value := range config {
if value == nil {
continue
}
if strings.HasSuffix(key, "_FORK_VERSION") {
name := key[:len(key)-len("_FORK_VERSION")]
switch version := value.(type) {

View file

@ -15,6 +15,9 @@ ALTAIR_FORK_EPOCH: 1
EIP7928_FORK_VERSION: 0xb0000038
EIP7928_FORK_EPOCH: 18446744073709551615
EIP7XXX_FORK_VERSION:
EIP7XXX_FORK_EPOCH:
BLOB_SCHEDULE: []
`
c := &ChainConfig{}