diff --git a/consensus/state_processing/src/per_block_processing.rs b/consensus/state_processing/src/per_block_processing.rs index a38382d26..937d04794 100644 --- a/consensus/state_processing/src/per_block_processing.rs +++ b/consensus/state_processing/src/per_block_processing.rs @@ -20,7 +20,7 @@ pub use verify_attestation::{ pub use verify_deposit::{ get_existing_validator_index, verify_deposit_merkle_proof, verify_deposit_signature, }; -pub use verify_exit::{verify_exit, verify_exit_time_independent_only}; +pub use verify_exit::verify_exit; pub mod altair; pub mod block_signature_verifier; diff --git a/consensus/state_processing/src/per_block_processing/verify_exit.rs b/consensus/state_processing/src/per_block_processing/verify_exit.rs index efaf57f6d..f17e5fcd2 100644 --- a/consensus/state_processing/src/per_block_processing/verify_exit.rs +++ b/consensus/state_processing/src/per_block_processing/verify_exit.rs @@ -19,35 +19,10 @@ fn error(reason: ExitInvalid) -> BlockOperationError { /// /// Spec v0.12.1 pub fn verify_exit( - state: &BeaconState, - exit: &SignedVoluntaryExit, - verify_signatures: VerifySignatures, - spec: &ChainSpec, -) -> Result<()> { - verify_exit_parametric(state, exit, verify_signatures, spec, false) -} - -/// Like `verify_exit` but doesn't run checks which may become true in future states. -/// -/// Spec v0.12.1 -pub fn verify_exit_time_independent_only( - state: &BeaconState, - exit: &SignedVoluntaryExit, - verify_signatures: VerifySignatures, - spec: &ChainSpec, -) -> Result<()> { - verify_exit_parametric(state, exit, verify_signatures, spec, true) -} - -/// Parametric version of `verify_exit` that skips some checks if `time_independent_only` is true. -/// -/// Spec v0.12.1 -fn verify_exit_parametric( state: &BeaconState, signed_exit: &SignedVoluntaryExit, verify_signatures: VerifySignatures, spec: &ChainSpec, - time_independent_only: bool, ) -> Result<()> { let exit = &signed_exit.message; @@ -70,7 +45,7 @@ fn verify_exit_parametric( // Exits must specify an epoch when they become valid; they are not valid before then. verify!( - time_independent_only || state.current_epoch() >= exit.epoch, + state.current_epoch() >= exit.epoch, ExitInvalid::FutureEpoch { state: state.current_epoch(), exit: exit.epoch