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

EIP-7044: Lock voluntary exit domain on capella #3288

Merged
merged 14 commits into from
Jun 14, 2023
2 changes: 2 additions & 0 deletions specs/deneb/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi

#### Modified `process_voluntary_exit`
dapplion marked this conversation as resolved.
Show resolved Hide resolved

*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:
voluntary_exit = signed_voluntary_exit.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from eth2spec.test.helpers.constants import (
BELLATRIX,
CAPELLA,
DENEB,
)
from eth2spec.test.helpers.keys import pubkey_to_privkey
from eth2spec.test.helpers.state import (
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand All @@ -37,9 +38,48 @@ def test_voluntary_exit_with_previous_fork_version_not_is_before_fork_epoch(spec
"""
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
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`
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
"""
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,
)

This file was deleted.

1 change: 0 additions & 1 deletion tests/generators/operations/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@

_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)

Expand Down