fix: pass `optionalForks` to consensus fork parser (#6811)

* voluntary exit fix

* ci lint fix
This commit is contained in:
Agnish Ghosh 2025-01-03 21:50:41 +05:30 committed by GitHub
parent 9583ed291f
commit e580fd2b69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2018-2024 Status Research & Development GmbH
# Copyright (c) 2018-2025 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -27,6 +27,16 @@ type
of ValidatorStorageKind.Identifier:
ident: ValidatorIdent
static: doAssert(high(ConsensusFork) == ConsensusFork.Fulu,
"Update OptionalForks constant!")
const
OptionalForks* = {ConsensusFork.Electra, ConsensusFork.Fulu}
## When a new ConsensusFork is added and before this fork is activated on
## `mainnet`, it should be part of `OptionalForks`.
## In this case, the client will ignore missing <FORKNAME>_VERSION
## and <FORKNAME>_EPOCH constants from the data reported by BN via
## `/eth/v1/config/spec` API call.
proc getSignedExitMessage(
config: BeaconNodeConf,
storage: ValidatorStorage,
@ -233,7 +243,8 @@ proc restValidatorExit(config: BeaconNodeConf) {.async.} =
let signingFork = try:
let response = await client.getSpecVC()
if response.status == 200:
let forkConfig = response.data.data.getConsensusForkConfig()
let forkConfig =
response.data.data.getConsensusForkConfig(OptionalForks)
if forkConfig.isErr:
raise newException(RestError, "Invalid config: " & forkConfig.error)
let