Skip to content

Commit

Permalink
Fix deposits to use new fork configuration scheme.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheatfate committed Oct 11, 2024
1 parent 0fb596c commit fecce3c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions beacon_chain/deposits.nim
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,21 @@ proc restValidatorExit(config: BeaconNodeConf) {.async.} =
let forkConfig = response.data.data.getConsensusForkConfig()
if forkConfig.isErr:
raise newException(RestError, "Invalid config: " & forkConfig.error)
let capellaForkVersion = forkConfig.get.capellaVersion.valueOr:
raise newException(RestError,
ConsensusFork.Capella.forkVersionConfigKey() & " missing")
let
capellaForkVersion =
try:
forkConfig.get()[ConsensusFork.Capella].version
except KeyError:
raise newException(RestError,
ConsensusFork.Capella.forkVersionConfigKey() & " missing")
denebEpoch =
try:
forkConfig.get()[ConsensusFork.Deneb].epoch
except KeyError:
raise newException(RestError,
ConsensusFork.Deneb.forkEpochConfigKey() & " missing")
voluntary_exit_signature_fork(
fork, capellaForkVersion, currentEpoch, forkConfig.get.denebEpoch)
fork, capellaForkVersion, currentEpoch, denebEpoch)
else:
raise newException(RestError, "Error response (" & $response.status & ")")
except CatchableError as exc:
Expand Down

0 comments on commit fecce3c

Please sign in to comment.