From b7376aea5ca8b3c772f4b69f193724ea2a881106 Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 10 Mar 2019 13:49:37 +0100 Subject: [PATCH 1/2] Disallow duplicate voluntary exits Stricter processing of voluntary exits to remove an edge case --- specs/core/0_beacon-chain.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index c88155f77..4979eb91a 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -2460,7 +2460,9 @@ def process_exit(state: BeaconState, exit: VoluntaryExit) -> None: """ validator = state.validator_registry[exit.validator_index] # Verify the validator has not yet exited - assert validator.exit_epoch > get_delayed_activation_exit_epoch(get_current_epoch(state)) + assert validator.exit_epoch == FAR_FUTURE_EPOCH + # Verify the validator has not initiated an exit + assert validator.initiated_exit is False # Exits must specify an epoch when they become valid; they are not valid before then assert get_current_epoch(state) >= exit.epoch # Verify signature From d425ea26e2cb5cabc5e6288dc2ca2f8c77753923 Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 10 Mar 2019 13:50:28 +0100 Subject: [PATCH 2/2] Update 0_beacon-chain.md --- specs/core/0_beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 4979eb91a..0de38f219 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -2453,7 +2453,7 @@ Verify that `len(block.body.voluntary_exits) <= MAX_VOLUNTARY_EXITS`. For each `exit` in `block.body.voluntary_exits`, run the following function: ```python -def process_exit(state: BeaconState, exit: VoluntaryExit) -> None: +def process_voluntary_exit(state: BeaconState, exit: VoluntaryExit) -> None: """ Process ``VoluntaryExit`` transaction. Note that this function mutates ``state``.