Commit Graph

56 Commits

Author SHA1 Message Date
protolambda 5f0e58364f
resolved merge conflicts, take attesters seq->set change from dev, take bits rework from bitlistvector PR 2019-06-28 18:17:13 +02:00
Danny Ryan dcb0244a4f get_attesting_indices set instead of sorted (#1225) 2019-06-28 16:19:59 +01:00
vbuterin c764202a57 Slashing penalty calculation change (#1217)
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.
2019-06-28 14:35:26 +01:00
Justin Drake 196ac42025 Cleanup naming 2019-06-28 12:23:22 +01:00
Dankrad Feist 93ce168862
More linting fixes 2019-06-27 16:47:48 +01:00
Dankrad Feist 80c680e614
Phase 1 to Bitvector/Bitlist 2019-06-27 12:41:22 +01:00
Carl Beekhuizen f29b693a9c
Merge dev -> early_spec_test 2019-06-25 17:11:04 +02:00
protolambda 054a157953
get rid of TypingList, add MutableSequence 2019-06-25 02:58:10 +02:00
Carl Beekhuizen a5b22e13b8
Resolves make masker sign mask 2019-06-22 16:56:16 +02:00
protolambda 3d8466fd6e
make Bit check not use "is", and remove duplicate line 2019-06-20 23:04:19 +02:00
protolambda 5048b9e87a temporary fix for phase-1 spec typing 2019-06-20 20:20:45 +02:00
Hsiao-Wei Wang 9af9bbf42b
Merge branch 'dev' into mypy 2019-06-17 17:51:00 -04:00
Hsiao-Wei Wang e93ba51ef8
More clean up 2019-06-15 18:25:37 -04:00
Hsiao-Wei Wang 48e8164e28
Add phase1 type hinting checks and fix many bugs 2019-06-12 20:08:19 -04:00
Justin Drake 565f61dfaa Cleanup containers 2019-06-09 20:41:21 +01:00
Carl Beekhuizen 35c03c5f3e
Adds review suggestions I missed 2019-06-06 11:45:22 +02:00
Carl Beekhuizen d761b6f041
Implements new SSZ types 2019-06-05 15:29:26 +02:00
Carl Beekhuizen bfa45e06f0
merge dev -> d-p-7 2019-05-28 11:15:17 +02:00
Carl Beekhuizen ac9564c2b7
Adds Insert-into-label functionality 2019-05-24 16:51:21 +02:00
Hsiao-Wei Wang 0f7abfa4ce
Update specs/core/1_custody-game.md
Co-Authored-By: Carl Beekhuizen <carl.beek@gmail.com>
2019-05-24 02:54:41 +08:00
Hsiao-Wei Wang 650c4244bd
Things are different after rebasing #1035 2019-05-24 01:35:51 +08:00
Carl Beekhuizen 9058647b67
flake8v3.7->flake8v3.5 2019-05-22 10:28:03 +02:00
Carl Beekhuizen 24c4d21d5e
Minor edits + PEP8 2019-05-21 12:41:24 +02:00
Carl Beekhuizen 6b062405c9
merge dev -> carl-exec-phase1 2019-05-20 20:59:08 +02:00
Carl Beekhuizen cfed4bb41c
Adds missing functions 2019-05-20 10:50:07 +02:00
Justin 2018dd83f5
Update 1_custody-game.md 2019-05-20 09:29:09 +01:00
Carl Beekhuizen 725dcf27f5
Hella bug-fixes and PEP8 2019-05-20 09:47:44 +02:00
vbuterin c14452bcf4
Updated get_custody_chunk_count
Co-requisite with #1097
2019-05-19 19:44:12 -04:00
Danny Ryan 46d30048a6
Merge pull request #1035 from ethereum/vbuterin-patch-2
Allow multiple bit challenges, and recover withdrawability
2019-05-17 13:56:10 -04:00
vbuterin 24edca3456
Fix to make Danny and hww happy 2019-05-17 13:52:23 -04:00
Carl Beekhuizen c10fb92776
Merge dev -> dankrad-p-7 2019-05-15 10:36:01 +02:00
terence tsao ba1949b2bc
Update 1_custody-game.md 2019-05-12 13:46:17 -07:00
Hsiao-Wei Wang 4db4d87930
Refactor `process_final_updates` 2019-05-09 14:57:36 +08:00
Hsiao-Wei Wang 3203e4f7d7
Merge branch 'dev' into vbuterin-patch-2 2019-05-09 14:52:56 +08:00
Dankrad Feist ec230f443a
Merge branch 'dev' into dankrad-patch-7
# Conflicts:
#	specs/core/1_custody-game.md
#	specs/core/1_shard-data-chains.md
2019-05-09 01:00:25 +01:00
Dankrad Feist 6ab55efd3d
Phase 0 tests work on phase 1, yay :) 2019-05-08 23:30:08 +01:00
Dankrad Feist 4ad92a0989
Fix typing 2019-05-07 13:23:28 +01:00
Dankrad Feist 1db49f4c98
Merge branch 'dev' into dankrad-patch-7
# Conflicts:
#	specs/core/1_custody-game.md
2019-05-07 12:27:24 +01:00
Dankrad Feist a604d03dff
Basic phase 1 pulling + correcting syntax errors in phase 1 2019-05-07 12:13:22 +01:00
Justin Drake f4db9ebae0 Renamings triggered by HW comment 2019-05-06 18:26:14 +01:00
Justin 7ba13aa4c5
Merge branch 'dev' into JustinDrake-patch-21 2019-05-06 17:48:09 +01:00
JSON d1c96c1e0d Doc standardization (#1039) 2019-05-06 16:30:32 +01:00
Justin Drake 5fb32fd19b Fix tests 2019-05-05 12:10:39 +01:00
Hsiao-Wei Wang 2ccd357f0e
Update specs/core/1_custody-game.md
Co-Authored-By: vbuterin <v@buterin.com>
2019-05-03 21:05:54 +08:00
vbuterin 66b152f79e
Allow multiple bit challenges, and recover withdrawability
Resolves #864 items 4, 7, 14
2019-05-03 05:07:11 -05:00
dankrad c0f3453093 RANDAO reveal slashing, custody period staggering and integration of custody and RANDAO reveals (#880)
* Add RandaoRevealSlashing for early Randao reveals

* add some randao reveal slashing tests

* Unifying RANDAO reveal slashing and Custody reveal slashing; implemented more lenient penalty for not-to-early reveals

* Fix custody reveal domain

* Also test exposed_randao_reveals

* Re-add exposed_randao_reveals to validator initialization

* Fix tests

* Unified Randao Reveal slashing mechanism and Custody Reveal,
CUSTODY_PERIOD_TO_RANDAO_PADDING = EPOCHS_PER_CUSTODY_PERIOD

* Move exposed_randao_reveals into separate data structure to keep validator record clean

* new shiny staggered custody periods

* Fixes style and type hinting

* removes whitespace

* Cleans up multi-line conditionals

* Make RANDAO key reveal penalties proportional to block rewards

* Minor typos

* Minor typos

* Fixes off-by one error

* Removes unnecicary whitepsace

* Clean up comments; add test for key reveal too far in the future

* Reduce the CUSTODY_PERIOD_TO_RANDAO_PADDING again

* Fix max_proposer_slot_reward

* Fix types

* Move test

* Fix RandaoKeyReveal tests

* Move all RANDAO key reveal to phase 1

* Factor out signature checking

* Some fixes

* Update specs/core/1_custody-game.md

Co-Authored-By: dankrad <dankrad@ethereum.org>

* Addressing Vitalik's suggestions: Separate RANDAO and Custody key reveals; append the cleanup of RANDAO reveals instead of adding a new function

* Remove remnants of verify_custody_key

* RandaoKeyReveal -> EarlyDerivedSecretReveal

* Make penalty proportional to number of secrets already exposed

* Update specs/core/1_custody-game.md

Co-Authored-By: dankrad <dankrad@ethereum.org>

* Update specs/core/1_custody-game.md

Co-Authored-By: dankrad <dankrad@ethereum.org>

* Update specs/core/1_custody-game.md

Co-Authored-By: dankrad <dankrad@ethereum.org>
2019-05-03 17:30:55 +08:00
vbuterin 4ca2f11827
Custody game changes (#866)
* Custody game changes

1. Don't store the full chunk bits, instead only store a Merkle root. Increased history size complexity from `N` to `N + log(N)` but with the benefit of decreasing storage requirements from `N` to a single 32 byte hash.
2. `custody_bit` is computed as the first bit of the hash of the custody bits, not the xor. This allows us to more safely use functions with more risky security assumptions for computing the chunk mix.

* Update specs/core/1_custody-game.md

* Update specs/core/1_custody-game.md

* Update specs/core/1_custody-game.md

* Update specs/core/1_custody-game.md

* XOR aggregation before SHA256 to reduce number of hashes

* Simplifed get_chunk_bits_root

* standalone -> indexed

* Fix missing "data" and ToC
2019-05-03 17:20:54 +08:00
Danny Ryan 77af610185
Merge pull request #870 from ethereum/vbuterin-patch-10
Replace with empty instead of popping finished challenges
2019-04-22 15:30:18 -06:00
Danny Ryan d4a33dbcaa
add descriptions of typeof and default functions 2019-04-22 15:29:47 -06:00
Justin Drake 40b55cf433 More fixes 2019-04-18 14:43:24 +10:00