Commit Graph

168 Commits

Author SHA1 Message Date
Hsiao-Wei Wang 13d6a31c5c
misc fix 2019-08-01 00:27:31 +08:00
Hsiao-Wei Wang fe2adfa0e2
Fix many typos and lint errors 2019-07-31 18:18:07 +08:00
Hsiao-Wei Wang f263b71875
ZERO_HASH -> Hash() 2019-07-31 17:50:55 +08:00
Hsiao-Wei Wang 058e63654d
Fix typo 2019-07-31 17:44:33 +08:00
vbuterin 4b2b5815c9
Add shard state transition function 2019-07-29 16:43:55 -04:00
vbuterin de9b4f2d6d
Attestation changes + persistent committee changes (#1294)
* Minimal attestation simplification

* minor fix

* Make the tests pass

* Decrease `PLACEHOLDER`, Use `compute_epoch_of_shard_slot`

* Fix proposer signature name and use get_seed() to calculate current_shuffling_seed

* Fix linter error

* Add the WIP `test_is_valid_shard_block`

* Add `get_shard_block_attester_committee`

* Simplified committee selection

* Added some helpers and simplified

* Update specs/core/1_shard-data-chains.md

* Update 1_shard-data-chains.md

* Simplified switchover epochs, changed block structure, changed crosslink structure

* Update 1_shard-data-chains.md

* Moved balance dependency to proposer selection

* Update specs/core/1_shard-data-chains.md

Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>

* Update specs/core/1_shard-data-chains.md

Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>

* Update specs/core/1_shard-data-chains.md

Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>

* Update specs/core/1_shard-data-chains.md

Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>

* Update specs/core/1_shard-data-chains.md

Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>

* Update specs/core/1_shard-data-chains.md

Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>

* Update specs/core/1_shard-data-chains.md

Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>

* Update specs/core/1_shard-data-chains.md

* Fixed shard header flattening

* Update specs/core/1_shard-data-chains.md

* Minor fixes

* Update specs/core/1_shard-data-chains.md

* Update specs/core/1_shard-data-chains.md

Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>

* cleanup testing and lint

* return none if not active validators in persistent committee

* only allow active validators as shard proposer
2019-07-29 09:47:35 -04:00
Chih Cheng Liang 9c6ba9cd0f
Fix md table 2019-07-24 13:39:04 +08:00
Hsiao-Wei Wang 733653f169
Update some missing type hinting of phase 1 2019-07-04 20:52:58 +08:00
Hsiao-Wei Wang b3d65368a1
`PERSISTENT_COMMITTEE_PERIOD` has been defined in phase 0 2019-07-04 20:38:18 +08:00
Danny Ryan af5719031c
Merge branch 'dev' into fix-bls-domain-type 2019-06-30 20:28:18 -05:00
Carl Beekhuizen 6e5f43c033
merge in `dev` and resolve conflicts 2019-06-30 23:37:56 +02:00
Carl Beekhuizen 918192cdab
`compute_slot_epoch`->`compute_epoch_of_slot` 2019-06-30 23:35:07 +02:00
Danny Ryan db8bd07eeb
Merge pull request #1249 from ethereum/format_binary_operations
Minor python style tweaks
2019-06-30 16:18:34 -05:00
Carl Beekhuizen 8b10ed598e
Adds a lone space 2019-06-30 23:14:16 +02:00
Carl Beekhuizen fe68a8d1f0
Minor python style tweaks 2019-06-30 22:59:12 +02:00
Hsiao-Wei Wang 67b0b4ad33
Update other spec files 2019-07-01 04:57:42 +08:00
protolambda e53063c08d
type BLS domain and domain type 2019-06-30 22:12:49 +02:00
Carl Beekhuizen 361732f409
merge in dev and resolve conflicts 2019-06-30 21:54:30 +02:00
Carl Beekhuizen e0a0f6e156
Makes markdown comply with linter 2019-06-30 21:25:58 +02:00
Carl Beekhuizen 0fd1d38417
`Misc` function rename 2019-06-30 20:58:02 +02:00
Danny Ryan d1bc2f03ac
remove 'int' types from spec typehints. replace with uint64 2019-06-30 13:00:22 -05:00
Justin Drake 0be2b8e620 Cleanup 2019-06-30 16:10:22 +01:00
Justin Drake d0acd81157 WIP 2019-06-30 10:02:18 +01:00
Justin Drake 196ac42025 Cleanup naming 2019-06-28 12:23:22 +01:00
Dankrad Feist 80c680e614
Phase 1 to Bitvector/Bitlist 2019-06-27 12:41:22 +01:00
protolambda 054a157953
get rid of TypingList, add MutableSequence 2019-06-25 02:58:10 +02:00
protolambda 9fb5806764
be explicit about input for balance sum 2019-06-25 00:24:13 +02:00
protolambda 1408a1ee0d
undo tuple wrapping 2019-06-23 00:17:54 +02:00
protolambda 00aae07d46
type annotation clean up 2019-06-22 18:12:42 +02:00
protolambda 80c40f5e09
merge dev, resolve minor merge conflicts 2019-06-21 21:22:23 +02:00
protolambda 5048b9e87a temporary fix for phase-1 spec typing 2019-06-20 20:20:45 +02:00
protolambda 4b4bf87e47 update shard doc, use new types, avoid List 2019-06-20 20:15:56 +02:00
Carl Beekhuizen 3418c3506f
Merge dev and resolve conflicts (please let the CI tests pass with the new dev) 2019-06-19 20:27:54 +02:00
Hsiao-Wei Wang dd79a0edb5
Merge branch 'dev' into mypy 2019-06-18 08:24:23 -06:00
Carl Beekhuizen 31a4700223
Merge conflicts on `dev` 2019-06-17 22:09:43 -04:00
Hsiao-Wei Wang 9af9bbf42b
Merge branch 'dev' into mypy 2019-06-17 17:51:00 -04:00
Danny Ryan 207eb808a0
split constants vs configuration 2019-06-17 15:19:44 -06:00
Carl Beekhuizen 11edda64ed
Adds fork-choice to spec builder 2019-06-15 18:42:03 -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 fd05b6e364
Minor bugfixes 2019-05-28 09:58:51 +02:00
Carl Beekhuizen f7f069d6b5
Bug fixes and cleanup of 2_shard-data-chains 2019-05-26 19:41:36 +02:00
Carl Beekhuizen a7dbbafc92
Integrates shard-data-chains 2019-05-26 14:14:48 +02:00
Carl Beekhuizen f6ce817f24
merge dev->dankrad-patch-7 2019-05-25 15:57:28 +02:00
Danny Ryan 28b76bcd4c
a number of minor fixes in phsae 1 2019-05-24 11:59:22 -06:00
Carl Beekhuizen 24c4d21d5e
Minor edits + PEP8 2019-05-21 12:41:24 +02: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
Danny Ryan af2bb7d6f6
Merge pull request #1044 from ethereum/JustinDrake-patch-21
Crosslink in AttestationData
2019-05-08 08:35:06 -06: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 22b06d581d Update instances of int_to_bytes 2019-05-07 10:57:41 +01:00
Justin Drake ea60fb632c More renaming 2019-05-06 20:49:46 +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
Justin Drake e85678ac15 restore compute_committee 2019-05-01 15:21:38 +01:00
Justin Drake a0158c606e Expose get_commitee 2019-05-01 09:09:24 +01:00
JSON eeedea2d8c
Update 1_shard-data-chains.md 2019-04-16 12:03:22 -05:00
Alex Stokes 5466a4875d
Update 1_shard-data-chains.md
Fix some typos
2019-04-14 09:54:35 +10:00
Danny Ryan 2468f9fc99
Merge pull request #868 from ethereum/vbuterin-patch-7
Separate out get_switchover_epoch
2019-04-11 18:55:39 +10:00
Chih Cheng Liang ffccf742bd
replace signed_root with signing_root 2019-04-08 09:57:04 +08:00
Justin c4321c7cc7
Update 1_shard-data-chains.md 2019-04-02 22:17:55 +04:00
vbuterin bb990e9892
Separate out get_switchover_epoch
So that we can use it in for subkey reveals as well.
2019-03-31 17:49:02 -05:00
vbuterin f5c5c166af Replace custody challenge game with JABS (#812)
See also #818.

===

* Replace custody challenge game with JABS

Replace the existing proof of custody game with a new game ("Justin's Awesome Bit Sum" or JABS) that works as follows:

* The data `D` is split up into 512-byte chunks `D[0] .... D[n-1]`, and use a mix function `mix(subkey, data) -> {0,1}` (currently the first bit of the hash of `subkey+data`). We calculate `M[i] = (mix(D[0]) + ... + mix(D[i-1])) % 2`, and set the custody bit to `M[n-1]`
* Anyone can challenge by providing the full `M` where `M[n-1]` is not equal to the custody bit
* Anyone can respond to a challenge by providing a specific position in `M` along with a branch of the data where `M[i-1] ^ mix(D[i]) != M[i]`

The maximum size of data is now `2**6` epochs *  `2**6` blocks * `2**14` bytes = `2**26` bytes, so assuming 512-byte mix chunks the maximum mix size is `2**17` bits or `2**14` bytes. The average mix size is `2**8` bytes.
2019-03-28 22:56:43 +00:00
Danny Ryan fd6d80fcb6
remove get_split_offset from phase 1 doc 2019-03-21 08:24:26 -06:00
vbuterin 91a0c1ba5f Persistent committee size per slot reduced to max 128 (#734)
* Persistent committee size per slot target 128 max 256

Cuts down the cost of verifying a shard chain and aggregating signatures for a shard chain, and also makes the shard chain signatures more usable by light clients for verification as they would only need to keep track of a max 256-sized committee.
2019-03-17 11:44:19 +00:00
NIC Lin 1a0938169b Fix `get_split_offset` (#790) 2019-03-16 12:45:39 +00:00
Hsiao-Wei Wang cdd59ae230
add return types to phase 1 functions
Co-Authored-By: djrtwo <dannyjryan@gmail.com>
2019-03-13 09:11:35 -06:00
Danny Ryan b40236685c
phase 1 nitpicks 2019-03-13 09:04:12 -06:00
vbuterin cefe9e995b
Proof of custody game, take 2 (#682)
* Proof of custody game, take 2

Unfortunately not simpler than before, but moves challenges outside of the validator records and so keeps validator records constant-size.

* Removed unneeded challenge codes

* Formatting fixes
2019-03-02 20:36:04 -06:00
vbuterin e9c3af5428
Update 1_shard-data-chains.md 2019-02-26 18:00:20 -06:00
vbuterin 05f6f68028
Made developer notice less committal 2019-02-25 16:45:57 -06:00
vbuterin 6a92407702
Developer notice 2019-02-25 04:16:18 -06:00
Danny Ryan b89cd234f0
change shard_block_root to crosslink_data_root throughout 2019-02-22 08:50:03 -07:00
vbuterin 2540f55c13
Updated phase 1: branch and early subkey reveal challenges (#587)
* Updated phase 1: branch challenges

* Removed unnecessary line

* Added early subkey reveal slashing

* Revealing during the active period is still revealing early

* Added....

* Machinery for publishing old subkeys
* Inability to withdraw until you published all subkeys
* After a validator exits the queue there's still a minimum 1-day delay before they can withdraw (in the future this delay will be used as an opportunity to start a PoC challenge game)

* Update 1_shard-data-chains.md

* formatting

* minor edits

* Added masking scheme for reveals

Secure under the aggregate extraction infeasibility assumption described on pages 11-12 of https://crypto.stanford.edu/~dabo/pubs/papers/aggreg.pdf

* Added rewards going to challengers

* Add ToC and reorg the constant tables

* Remove tags

* fix constant formatting

* normalize domain constants in phase 1

* Update 1_shard-data-chains.md

* Update 1_shard-data-chains.md

* Update 1_shard-data-chains.md

* Added transition logic

* Fix ToC

* Fix ToC

* Adjusted for #615

* Added more helpers

* epoch -> slot

* fix some type hints

* clean up `get_attestation_merkle_depth`
2019-02-19 05:26:35 -06:00
Danny Ryan 375659dc6c
name changes in validator doc and phase 1 doc 2019-02-14 16:02:01 -07:00
Hsiao-Wei Wang f7320ec25b
Fix `compute_commitment`
1. Use `+` to concatenate the merkle roots in `hash` function.
2. Fix `pad_to_power_of_2`: padding with `[b'\x00' * SHARD_BLOCK_SIZE]`,
not `[SHARD_BLOCK_SIZE]`.
2019-02-14 00:30:00 +08:00
Hsiao-Wei Wang 41e95cf9ea Refactor `get_persistent_committee` (#604) 2019-02-12 11:11:45 +00:00
vbuterin db4f99d899
Fixed end of code block 2019-02-10 15:47:26 -06:00
Danny Ryan ab44cbe380
Update specs/core/1_shard-data-chains.md
Co-Authored-By: vbuterin <v@buterin.com>
2019-02-10 15:45:57 -06:00
vbuterin 9bba3362eb
Update specs/core/1_shard-data-chains.md 2019-02-10 15:45:47 -06:00
vbuterin 9e66b069b2
Update specs/core/1_shard-data-chains.md 2019-02-10 15:45:16 -06:00
Danny Ryan ad3f43a4a6
Update specs/core/1_shard-data-chains.md
Co-Authored-By: vbuterin <v@buterin.com>
2019-02-10 15:45:06 -06:00
vbuterin 046119fb2e
Update specs/core/1_shard-data-chains.md 2019-02-10 15:44:58 -06:00
Danny Ryan 181dc183b6
Merge branch 'dev' into vbuterin-patch-6 2019-02-10 13:12:01 -07:00
vbuterin 1f97206dcf Updated phase 1: commitments (#579)
See #338 and #529 for discussion.
2019-02-10 16:17:21 +00:00
vbuterin abed5ffdae Updated phase 1: fork choice rule (#586)
Adds the crosslink committee to the fork choice rule. This is useful because it means that even if a proposal committee is byzantine and attempts to prevent a crosslink via a "balance attack" (alternating between chain A and chain B being the canonical chain), the crosslink committee can force the equilibrium to flip to one side or the other.
2019-02-10 16:16:22 +00:00
vbuterin 8097b2373b
Added deduplication 2019-02-10 00:09:34 -06:00
vbuterin 65c5a1a1b7
Fixed get_persistent_committee 2019-02-08 22:10:54 -06:00
Danny Ryan e0d8cf4268
Update specs/core/1_shard-data-chains.md
Co-Authored-By: vbuterin <v@buterin.com>
2019-02-08 22:07:14 -06:00
Danny Ryan 8dd111b7e6
Update specs/core/1_shard-data-chains.md
Co-Authored-By: vbuterin <v@buterin.com>
2019-02-08 22:06:46 -06:00
Danny Ryan ad0ff80be2
Update specs/core/1_shard-data-chains.md
Co-Authored-By: vbuterin <v@buterin.com>
2019-02-08 22:06:03 -06:00
vbuterin e5bd78e5e6
Persistent committee refactors 2019-02-08 04:08:52 -06:00
vbuterin 65ec418213
A few more cleanups 2019-02-08 03:54:02 -06:00
vbuterin 47c396f3f8
Break lets into separate lines 2019-02-08 03:50:00 -06:00