Skip to content

Commit c55a121

Browse files
authored
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.
1 parent 3e48e07 commit c55a121

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

beacon/params/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ func (c *ChainConfig) LoadForks(file []byte) error {
103103
epochs["GENESIS"] = 0
104104

105105
for key, value := range config {
106+
if value == nil {
107+
continue
108+
}
106109
if strings.HasSuffix(key, "_FORK_VERSION") {
107110
name := key[:len(key)-len("_FORK_VERSION")]
108111
switch version := value.(type) {

beacon/params/config_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ ALTAIR_FORK_EPOCH: 1
1515
EIP7928_FORK_VERSION: 0xb0000038
1616
EIP7928_FORK_EPOCH: 18446744073709551615
1717
18+
EIP7XXX_FORK_VERSION:
19+
EIP7XXX_FORK_EPOCH:
20+
1821
BLOB_SCHEDULE: []
1922
`
2023
c := &ChainConfig{}

0 commit comments

Comments
 (0)