* dev: (112 commits)
Minor copyedit
Fix typo
minor typo
fix genesis tests; sign deposit-datas, and lower min validator count for testing
add comments to make variations in genesis initialization clear, and about the mix-in in verification
Refactor
Update 0_beacon-chain.md
quick comment on avoiding underflow
fix basic test
Make timestamp a uint64
Fixes
typo
Fix genesis balance bug (git add -u)
Cleanups and fixes
fix finalize on double justification in 123 rule
Merge is_genesis_trigger into get_genesis_state
Cleanups; think about merging is_genesis_trigger into get_genesis_state
Renames:
fix typo in justification wording
rename/fix roots in justification tests for consistency
...
1. Rename the current `get_genesis_beacon_state(...)` to `initialize_beacon_state_from_eth1(...)`
2. Extract `is_valid_genesis_state(state: BeaconState) -> bool` from `initialize_beacon_state_from_eth1(...)`
If the exit queue is very long, then a validator may take many months to exit. With the code as currently written, however, self-slashing is a potentially lucrative route to get one's money out faster, because one can exit in 36 days.
This PR changes it so that slashing can only extend your withdrawal time, not contract it. Also, instead of the slashed balances used to calculate one's slashing penalty being those in `[withdrawal - 54 days ... withdrawal - 18 days]`, we now run the penalization algorithm once every 36 days that a validator is slashed but not withdrawn, so that it covers the 36-day period where the validator was actually slashed. It also moves the minimum slashing penalty to the `slash_validator` function so that it is only applied once.
We also simplify the `slashed_balances` logic to be per-epoch.