Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass optionalForks to consensus fork parser #6811

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions beacon_chain/deposits.nim
Original file line number Diff line number Diff line change
@@ -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).
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Loading