diff --git a/specs/deneb/beacon-chain.md b/specs/deneb/beacon-chain.md index 0d71e4ae7..3189ee190 100644 --- a/specs/deneb/beacon-chain.md +++ b/specs/deneb/beacon-chain.md @@ -270,7 +270,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi #### Modified `process_voluntary_exit` -Note: The function `process_voluntary_exit` is modified to use the a fixed fork version -- `CAPELLA_FORK_VERSION` -- for EIP-7044 +*Note*: The function `process_voluntary_exit` is modified to use the a fixed fork version -- `CAPELLA_FORK_VERSION` -- for EIP-7044 ```python def process_voluntary_exit(state: BeaconState, signed_voluntary_exit: SignedVoluntaryExit) -> None: diff --git a/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_voluntary_exit.py b/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_voluntary_exit.py index 12b554da5..ea3b57a97 100644 --- a/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_voluntary_exit.py +++ b/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_voluntary_exit.py @@ -7,7 +7,6 @@ from eth2spec.test.context import ( from eth2spec.test.helpers.constants import ( BELLATRIX, CAPELLA, - DENEB, ) from eth2spec.test.helpers.keys import pubkey_to_privkey from eth2spec.test.helpers.state import ( @@ -80,7 +79,7 @@ def test_voluntary_exit_with_current_fork_version_not_is_before_fork_epoch(spec, ) -@with_phases([BELLATRIX, CAPELLA, DENEB]) +@with_phases([BELLATRIX, CAPELLA]) @spec_state_test @always_bls def test_voluntary_exit_with_previous_fork_version_is_before_fork_epoch(spec, state): diff --git a/tests/core/pyspec/eth2spec/test/deneb/block_processing/test_process_voluntary_exit.py b/tests/core/pyspec/eth2spec/test/deneb/block_processing/test_process_voluntary_exit.py index 371fcfed4..06a111c86 100644 --- a/tests/core/pyspec/eth2spec/test/deneb/block_processing/test_process_voluntary_exit.py +++ b/tests/core/pyspec/eth2spec/test/deneb/block_processing/test_process_voluntary_exit.py @@ -19,6 +19,7 @@ def test_invalid_voluntary_exit_with_current_fork_version_not_is_before_fork_epo """ Since Deneb, the VoluntaryExit domain is fixed to `CAPELLA_FORK_VERSION` """ + assert state.fork.current_version != spec.config.CAPELLA_FORK_VERSION yield from run_voluntary_exit_processing_test( spec, state, @@ -28,7 +29,7 @@ def test_invalid_voluntary_exit_with_current_fork_version_not_is_before_fork_epo ) -@with_phases([DENEB]) +@with_deneb_and_later @spec_state_test @always_bls def test_voluntary_exit_with_previous_fork_version_not_is_before_fork_epoch(spec, state): @@ -37,9 +38,48 @@ def test_voluntary_exit_with_previous_fork_version_not_is_before_fork_epoch(spec """ assert state.fork.previous_version != state.fork.current_version - yield from run_voluntary_exit_processing_test( - spec, - state, - fork_version=state.fork.previous_version, - is_before_fork_epoch=False, - ) + if spec.fork == DENEB: + assert state.fork.previous_version == spec.config.CAPELLA_FORK_VERSION + yield from run_voluntary_exit_processing_test( + spec, + state, + fork_version=state.fork.previous_version, + is_before_fork_epoch=False, + ) + else: + assert state.fork.previous_version != spec.config.CAPELLA_FORK_VERSION + yield from run_voluntary_exit_processing_test( + spec, + state, + fork_version=state.fork.previous_version, + is_before_fork_epoch=False, + valid=False, + ) + + +@with_deneb_and_later +@spec_state_test +@always_bls +def test_voluntary_exit_with_previous_fork_version_is_before_fork_epoch(spec, state): + """ + Since Deneb, the VoluntaryExit domain is fixed to `CAPELLA_FORK_VERSION` + """ + assert state.fork.previous_version != state.fork.current_version + + if spec.fork == DENEB: + assert state.fork.previous_version == spec.config.CAPELLA_FORK_VERSION + yield from run_voluntary_exit_processing_test( + spec, + state, + fork_version=state.fork.previous_version, + is_before_fork_epoch=True, + ) + else: + assert state.fork.previous_version != spec.config.CAPELLA_FORK_VERSION + yield from run_voluntary_exit_processing_test( + spec, + state, + fork_version=state.fork.previous_version, + is_before_fork_epoch=True, + valid=False, + ) diff --git a/tests/core/pyspec/eth2spec/test/eip6110/block_processing/test_process_voluntary_exit.py b/tests/core/pyspec/eth2spec/test/eip6110/block_processing/test_process_voluntary_exit.py deleted file mode 100644 index 4128a1181..000000000 --- a/tests/core/pyspec/eth2spec/test/eip6110/block_processing/test_process_voluntary_exit.py +++ /dev/null @@ -1,44 +0,0 @@ -from eth2spec.test.context import ( - always_bls, - spec_state_test, - with_eip6110_and_later, -) -from eth2spec.test.bellatrix.block_processing.test_process_voluntary_exit import ( - run_voluntary_exit_processing_test, -) - - -@with_eip6110_and_later -@spec_state_test -@always_bls -def test_invalid_voluntary_exit_with_previous_fork_version_not_is_before_fork_epoch(spec, state): - """ - Since Deneb, the VoluntaryExit domain is fixed to `CAPELLA_FORK_VERSION` - """ - assert state.fork.previous_version != state.fork.current_version - - yield from run_voluntary_exit_processing_test( - spec, - state, - fork_version=state.fork.previous_version, - is_before_fork_epoch=False, - valid=False, - ) - - -@with_eip6110_and_later -@spec_state_test -@always_bls -def test_invalid_voluntary_exit_with_previous_fork_version_is_before_fork_epoch(spec, state): - """ - Since Deneb, the VoluntaryExit domain is fixed to `CAPELLA_FORK_VERSION` - """ - assert state.fork.previous_version != state.fork.current_version - - yield from run_voluntary_exit_processing_test( - spec, - state, - fork_version=state.fork.previous_version, - is_before_fork_epoch=True, - valid=False, - ) diff --git a/tests/generators/operations/main.py b/tests/generators/operations/main.py index 3b4e5d1f7..053236c8d 100644 --- a/tests/generators/operations/main.py +++ b/tests/generators/operations/main.py @@ -45,7 +45,6 @@ if __name__ == "__main__": _new_eip6110_mods = {key: 'eth2spec.test.eip6110.block_processing.test_process_' + key for key in [ 'deposit_receipt', - 'voluntary_exit', ]} eip6110_mods = combine_mods(_new_eip6110_mods, deneb_mods)