From 79f98a7cb738228f715cd579eca351ced0e915f9 Mon Sep 17 00:00:00 2001 From: Martin Paulucci Date: Tue, 12 Mar 2024 15:47:08 -0300 Subject: [PATCH] Fix update process voluntary exit. --- .../state_transition/operations.ex | 10 +++++++++- test/spec/runners/operations.ex | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/lambda_ethereum_consensus/state_transition/operations.ex b/lib/lambda_ethereum_consensus/state_transition/operations.ex index 955cf267a..170a98ab1 100644 --- a/lib/lambda_ethereum_consensus/state_transition/operations.ex +++ b/lib/lambda_ethereum_consensus/state_transition/operations.ex @@ -566,7 +566,15 @@ defmodule LambdaEthereumConsensus.StateTransition.Operations do current_epoch < validator.activation_epoch + ChainSpec.get("SHARD_COMMITTEE_PERIOD") -> {:error, "validator cannot exit yet"} - not (Accessors.get_domain(state, Constants.domain_voluntary_exit(), voluntary_exit.epoch) + not ((if HardForkAliasInjection.deneb?() do + Misc.compute_domain( + Constants.domain_voluntary_exit(), + fork_version: ChainSpec.get("CAPELLA_FORK_VERSION"), + genesis_validators_root: state.genesis_validators_root + ) + else + Accessors.get_domain(state, Constants.domain_voluntary_exit(), voluntary_exit.epoch) + end) |> then(&Misc.compute_signing_root(voluntary_exit, &1)) |> then(&Bls.valid?(validator.pubkey, &1, signed_voluntary_exit.signature))) -> {:error, "invalid signature"} diff --git a/test/spec/runners/operations.ex b/test/spec/runners/operations.ex index b4285e51e..96f628b81 100644 --- a/test/spec/runners/operations.ex +++ b/test/spec/runners/operations.ex @@ -73,7 +73,7 @@ defmodule OperationsTestRunner do # "block_header", # "deposit", # "proposer_slashing", - "voluntary_exit" + # "voluntary_exit" # "sync_aggregate", # "execution_payload", # "withdrawals",