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

Stagger reveal slots #869

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion specs/core/1_custody-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ def process_custody_reveal(state: BeaconState,
# Case 1: non-masked non-punitive non-early reveal
if reveal.mask == ZERO_HASH:
assert reveal.period == epoch_to_custody_period(revealer.activation_epoch) + revealer.custody_reveal_index
min_reveal_slot = (
vbuterin marked this conversation as resolved.
Show resolved Hide resolved
EPOCHS_PER_CUSTODY_PERIOD * reveal.period +
get_switchover_epoch(state, get_current_epoch(state), reveal.revealer_index)
)
assert state.slot >= min_reveal_slot
vbuterin marked this conversation as resolved.
Show resolved Hide resolved
# Revealer is active or exited
assert is_active_validator(revealer, get_current_epoch(state)) or revealer.exit_epoch > get_current_epoch(state)
revealer.custody_reveal_index += 1
Expand All @@ -288,7 +293,7 @@ def process_custody_reveal(state: BeaconState,

# Case 2: masked punitive early reveal
else:
assert reveal.period > current_custody_period
assert reveal.period >= current_custody_period and is_active_validator(revealer, get_current_epoch(state))
assert revealer.slashed is False
slash_validator(state, reveal.revealer_index, reveal.masker_index)
```
Expand Down