Commit Graph

4338 Commits

Author SHA1 Message Date
Danny Ryan 34cea67b91
ValidatorFlags -> ValidatorFlag 2021-02-04 08:45:25 -07:00
Aditya Asgaonkar 8b217d9277
Fix typo
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-02-02 12:17:56 -08:00
Danny Ryan 1c1ba5cba2
minor PR feedback 2021-02-02 12:35:00 -07:00
protolambda b4ba6c57de
linter: first tuple element type is ValidatorFlags, not just int 2021-02-01 22:02:12 +01:00
protolambda 71c28e67a1
toc update 2021-02-01 21:48:55 +01:00
protolambda 3677073812
bitvector[8] -> uint8, for efficient packing in flags merkle tree 2021-02-01 21:46:27 +01:00
Danny Ryan b029c75d88
must be correct target to get correct head 2021-02-01 07:52:06 -07:00
Danny Ryan ad01c85ff6
minor reorder to process_epoch calls 2021-02-01 07:06:29 -07:00
Danny Ryan 007a6f0ecc
a couple of hf1 notes 2021-01-29 10:37:19 -07:00
Danny Ryan 46848e4202
Merge branch 'dev' into accounting-reform 2021-01-29 08:49:51 -07:00
Aditya Asgaonkar a28f52729d Rename variables for clarity 2021-01-27 15:58:19 -08:00
Aditya Asgaonkar 742d21e914 Updates based on review 2021-01-27 15:16:15 -08:00
Hsiao-Wei Wang 1b00c10ed3
Apply @michaelsproul's feedback 2021-01-27 14:47:52 +08:00
Hsiao-Wei Wang ae218015b7
Merge branch 'dev' into re_process_final_updates_fix 2021-01-27 03:02:24 +08:00
Hsiao-Wei Wang 15e48f712b
Fix Phase 1 epoch_processing and fix epoch_processing testgen 2021-01-27 03:02:12 +08:00
Danny Ryan b47f083168
Merge pull request #2181 from ethereum/adjust_minimal_config
Adjust minimal config and fix sync committee tests
2021-01-26 08:05:28 -06:00
Aditya Asgaonkar c932fc2798 Fix linter errors 2021-01-21 17:07:45 -08:00
Aditya Asgaonkar 900eb4a83c Fixed CI errors 2021-01-20 19:33:25 -08:00
Hsiao-Wei Wang e53213a585
Minor refactor 2021-01-20 13:06:24 +08:00
Hsiao-Wei Wang fa6094837b
Update lightclient patch and phase1 specs 2021-01-19 22:03:00 +08:00
Hsiao-Wei Wang daa4798704
Break down process_final_updates 2021-01-19 21:41:55 +08:00
Justin 12593e8782
Update comments 2021-01-19 12:52:40 +00:00
Hsiao-Wei Wang f3d7dee71f
Apply @djrtwo's suggestion 2021-01-19 20:44:21 +08:00
Hsiao-Wei Wang fb0c6d54f8
Add @ralexstokes's fix 2021-01-19 20:27:18 +08:00
Hsiao-Wei Wang c877d142bd
Add duplicate elements warning to the docstring 2021-01-19 20:24:25 +08:00
Aditya Asgaonkar 93c4c62900
Remove python tag from fenced code block 2021-01-19 02:04:55 -08:00
Aditya Asgaonkar 37874f9b79 Update WS calc 2021-01-19 01:53:12 -08:00
protolambda 65696ca68b
fix typo: same condition, but non-aggregate attestation here 2021-01-16 22:48:22 +01:00
Danny Ryan 2ad8fdb818
add ability for node to randomly request and descore if not serving blocks on WS period 2021-01-14 06:53:04 -07:00
Hsiao-Wei Wang 2a6699290f
Revert "Fix SyncCommittee"
This reverts commit b2658f1091.
2021-01-14 01:47:40 +08:00
Hsiao-Wei Wang b2658f1091
Fix SyncCommittee
1. Make `get_sync_committee_indices` do not return duplicate indices
2. Pad default values to Vectors
2021-01-13 20:12:52 +08:00
Hsiao-Wei Wang a340f30e61
Merge branch 'dev' into accounting-reform 2021-01-13 14:44:17 +08:00
Hsiao-Wei Wang f113413e5b
Fix ToC 2021-01-11 18:06:37 +08:00
Hsiao-Wei Wang ce87914326
Fix the 2/3 threshold calculation
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-01-07 11:14:32 +08:00
Alex Stokes a3bf632b4f
Bugfix in sync committee proposer rewards
The variable used to accumulate proposer rewards across the sync committee processing was shadowed by the per-participant proposer reward.

This means the total proposer reward would simply be twice the output of `get_proposer_reward` for the last participant in the sync committee.

I believe we want to sum all contributions to the proposer reward across sync committee participants which is what this PR does.
2021-01-06 08:39:21 -08:00
Victor Farazdagi 70e25e6390
Update specs/phase0/weak-subjectivity.md
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2021-01-05 21:13:35 -08:00
Danny Ryan 271b9dff83
toc 2021-01-05 14:17:34 -07:00
Danny Ryan b8d3589b46
remove global quotient penalties from fork spec [temp] 2021-01-05 13:48:26 -07:00
Hsiao-Wei Wang 9c75c3819d
Fix `previous_epoch_participation` and `current_epoch_participation` initialization 2021-01-06 02:09:39 +08:00
Hsiao-Wei Wang 53ad66a4e8
Arrange constants and configurations 2021-01-06 01:11:46 +08:00
Hsiao-Wei Wang 39d3a18d48
Fix `upgrade_to_lightclient_patch` 2021-01-06 00:42:01 +08:00
Hsiao-Wei Wang 958173b5bf
Fix typo 2021-01-05 22:19:08 +08:00
Hsiao-Wei Wang 5cf0514816
Fix ToC and minor linter issues 2021-01-05 22:10:02 +08:00
Victor Farazdagi 7d60e482b9 fix typo 2021-01-05 08:48:25 +03:00
Danny Ryan 86f616b607
Merge pull request #2162 from ethereum/ralexstokes-patch-1
Refactor sync committee rewards to use helper
2021-01-03 11:00:14 -06:00
multisignature cc80dd758c
Update README.md (#2164)
* Update README.md

I've removed an incorrectly placed comma.

Since the comma is placed before 'and', and the conjunction isn't being used to either a) denote the last element of a list with more than two elements or b) separate two independent clauses, it's not necessary here.

* Update validator.md

Fixed a couple of minor errors.
2020-12-26 14:53:42 +08:00
Alex Stokes edfd04c212
Refactor sync committee rewards to use helper
This change is functionally equivalent but uses the helper we already have for proposer rewards.

The argument for this change is better encapsulation of the reward which makes it easier in general to reason about properties of the spec ("are the attestation proposer rewards and the sync committee proposer rewards equivalent?") and a single point of maintenance in the event that rewards get refactored in the future (which makes refactoring safer overall).
2020-12-22 10:42:59 -08:00
Ben Edgington 452e3301be Fix typo 2020-12-21 10:22:04 +00:00
vbuterin 682f6c02c7
Update specs/lightclient/beacon-chain.md 2020-12-20 18:54:57 +08:00
vbuterin 9e2fa30567
Complete HF1 beacon-chain.md 2020-12-19 07:22:11 +08:00
Danny Ryan f137bb037a
Merge pull request #2130 from ethereum/vbuterin-patch-2
Added standalone light client patch
2020-12-17 07:53:33 -06:00
Danny Ryan cc9a4cdc46
add base sanity light client tests 2020-12-16 17:14:42 -07:00
Hsiao-Wei Wang e63c96416a
Add a FIXME comment. 2020-12-16 15:10:54 +08:00
Hsiao-Wei Wang d01a4ad823
Fix depth calculation...again(!) and add unittests 2020-12-16 15:01:22 +08:00
Hsiao-Wei Wang cf6933ac45
Fix depth calculation and add `get_subtree_index` helper 2020-12-15 13:24:53 +08:00
Hsiao-Wei Wang bcde37c39f
Make `sync-protocol.md` pass the linter 2020-12-15 13:24:43 +08:00
Hsiao-Wei Wang acfe49e3f3
executable light client patch: beacon-chain.md (#2141)
* Bump remerkleable to 0.1.18

* Disable `sync-protocol.md` for now. Make linter pass

* Enable lightclient tests

* Use *new* `optional_fast_aggregate_verify`

* Fix ToC and codespell

* Do not run phase1 tests with Lightclient patch

* Fix the Eth1Data casting bug. Add a workaround.

* Fix `run_on_attestation` testing helper

* Revert

* Rename `optional_fast_aggregate_verify` to `eth2_fast_aggregate_verify`

* Apply Proto's suggestion

* Apply Danny's suggestion

* Fixing tests

* Fix after rebasing

* Rename `LIGHTCLIENT` -> `LIGHTCLIENT_PATCH`

* New doctoc

* Add lightclient patch configs

* fix gitignore light client patch generator output

* Upgrade state for light client patch

* Add `lightclient-fork.md` to deal the fork boundary and fix
`process_block_header`

* Misc cleanups

1) Add a summary note for every function that is changed.
2) Avoid changing `process_block` (instead only change `process_block_header`).
3) Rename `G2_INFINITY_POINT_SIG` to `G2_POINT_AT_INFINITY` to avoid `SIG` contraction.
4) Misc cleanups

* Update block.py

* Update beacon-chain.md

* Fix typo "minimal" -> "mainnet"

Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>

* Use the new `BeaconBlockHeader` instead of phase 0 version

* Update config files

* Move `sync_committee_bits` and `sync_committee_signature` back to `BeaconBlockBody`

Co-authored-by: protolambda <proto@protolambda.com>
Co-authored-by: Justin <drakefjustin@gmail.com>
Co-authored-by: Marin Petrunić <mpetrunic@users.noreply.github.com>
2020-12-15 13:18:20 +08:00
Danny Ryan 2c90ffa2f4
copy edits 2020-12-14 13:09:25 -07:00
Justin 645a3851af
Update deposit-contract.md 2020-12-12 22:02:56 +00:00
Justin 85c1347ffc
Update validator.md 2020-12-12 21:57:58 +00:00
Justin f9edecf23c
Update validator.md 2020-12-12 21:56:30 +00:00
Justin b085436f2f
Update validator.md 2020-12-12 21:51:21 +00:00
Justin ae0b10edb7
Update validator.md 2020-12-12 21:46:39 +00:00
Justin 2cc9a12c98
Copy-edit deposit-contract.md 2020-12-12 20:50:10 +00:00
Justin ef3802b8e7
Cleaner section title
"Withdrawal prefixes" matches `[BLS]/[ETH1_ADDRESS]_WITHDRAWAL_PREFIX`
2020-12-12 20:40:59 +00:00
Justin 784e567d4b
Fix table for withdrawal credentials prefixes
Minor cosmetic fixes (misformated table, section title).
2020-12-12 20:38:40 +00:00
Danny Ryan 6b728c1880
add eth1 withdrawal credentials to spec 2020-12-11 15:03:58 -07:00
Danny Ryan 56aafbe533
add note about signature check when backfilling beaconblocks 2020-12-09 12:37:56 -07:00
Danny Ryan 17221c8065
more clearly define min epoch range for blocksbyrange requests 2020-12-09 12:27:01 -07:00
Justin f2fe390638
secret_key => privkey 2020-12-08 09:20:50 +00:00
Hsiao-Wei Wang 1a30ea9da9
Merge branch 'dev' into vbuterin-patch-2 2020-12-08 00:24:55 +08:00
Justin 0b9e80d1eb
grammar 2020-12-07 23:15:34 +08:00
Danny Ryan 3b7c02514b
straightforward light client edits 2020-12-07 08:10:39 -07:00
Justin 56048cbf56
Cosmetic cleanups to BLS signatures section
Miscellaneous cosmetic cleanups to the " BLS signatures" section:

1) fix section capitalisation for spec consistency
2) avoid uncapitalised "eth2" for spec consistency
3) avoid contractions (such as `PK` for `pubkey`) for spec consistency
4) various copyedits
2020-12-07 07:28:01 -07:00
Hsiao-Wei Wang 64412be0d7
Minor update ToC 2020-12-07 11:10:19 +08:00
Justin b2d25f7454
Nitpicks 2020-11-25 11:59:01 +00:00
vbuterin 5bfe61f865
Embiggened sync committee size and added sub-aggregates 2020-11-25 19:38:45 +08:00
Justin 09ec58131d
Optimised updates as suggested by @vbuterin 2020-11-18 10:33:42 +00:00
Justin d16900a753
Fixes from @ralexstokes 2020-11-18 09:31:41 +00:00
Justin 664bc4b42e
Polish and fixes including fixed-size sync committees 2020-11-18 09:19:32 +00:00
vbuterin 171b21301b
Added support for updates that point to finalized ancestors 2020-11-18 16:27:19 +08:00
vbuterin 830efa496a
Removed compact validators, make committee balance-based 2020-11-18 16:15:30 +08:00
Justin 5e717a456d
More polish and fixes 2020-11-17 15:30:09 +00:00
Justin 7ffc9c5bc0
More polish and fixes to the sync protocol 2020-11-17 14:18:58 +00:00
Justin 99219c874f
Revamp minimal light client (lots of polish and some bug fixes) 2020-11-17 12:42:09 +00:00
vbuterin 692a0aaaa5
Update specs/lightclient/sync-protocol.md
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2020-11-17 13:26:26 +08:00
vbuterin 5e5d03d56f
Update specs/lightclient/sync-protocol.md
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2020-11-17 13:26:18 +08:00
vbuterin 1c146b2c03
Update specs/lightclient/sync-protocol.md
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2020-11-17 13:26:08 +08:00
vbuterin a5e6d77165
Update specs/lightclient/sync-protocol.md
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2020-11-17 13:25:59 +08:00
vbuterin 117d31985f
Update specs/lightclient/sync-protocol.md
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2020-11-17 10:45:16 +08:00
vbuterin f9e9d7cabf
Update specs/lightclient/sync-protocol.md
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2020-11-17 10:45:02 +08:00
Hsiao-Wei Wang 4df3547edf
Make `lightclient` patch pass the linter (#2133)
* Make `lightclient` an executable patch fork

* fix conflicts

* Fix ToC

* Lightclient -> Light client

* Try protolambda/remerkleable#8

* Fix sync-protocol.md ToC

* Build lightclient/sync-protocol

* Fix typo

Co-authored-by: vbuterin <v@buterin.com>

Co-authored-by: vbuterin <v@buterin.com>
2020-11-17 10:41:26 +08:00
Justin cbb3856ab9
Fix ToC (cherry-picked from @hwwhww's PR) 2020-11-16 09:09:04 +00:00
vbuterin ca88dd6922
Removed extraneous data 2020-11-16 15:08:43 +08:00
vbuterin 97dc916c9e
Python syntax highlighted updates 2020-11-16 15:07:40 +08:00
vbuterin 1f210fd1f8
Added light client syncing protocol 2020-11-16 15:02:11 +08:00
Justin 114e388d12
Fix bugs—thanks @hwwhww 2020-11-15 17:23:44 +00:00
Justin e7d52d9056
Significant polishing and a few substantive fixes
See discussion for further details.
2020-11-15 10:56:24 +00:00
vbuterin 555e131e2c
Small changes to make Justin happy 2020-11-14 13:56:00 +08:00
vbuterin 620b812c2e
Reduce reward by SLOTS_PER_EPOCH 2020-11-13 10:21:30 +08:00
vbuterin 9e3690ad17
Update specs/lightclient/beacon-chain.md
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2020-11-13 10:19:37 +08:00
vbuterin 7c6ede5eac
Added standalone light client patch 2020-11-12 17:28:05 +08:00
Danny Ryan 7589af8e8d
remove wip notice on phase 0 specs 2020-11-04 09:30:29 -06:00
Danny Ryan cd7b1056b4
add mainnet deposit contract address and min genesis time 2020-11-04 09:11:52 -06:00
Danny Ryan 2aa827c07f
Merge pull request #2107 from bloxapp/honest_val_time_attack
added best practices section according to https://github.com/ethereum
2020-11-04 07:36:27 -06:00
Alon Muroch 6996a897b5
Apply suggestions from code review
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-11-04 15:29:06 +02:00
Alon Muroch 5b95219d18
Apply suggestions from code review
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-11-04 15:19:41 +02:00
Danny Ryan cfc91cdef7
Merge pull request #2121 from AgeManning/gossipsub-mesh
Increase gossipsub mesh degree
2020-11-04 06:59:59 -06:00
Age Manning 82cdbba703
Increase mesh degree 2020-11-04 11:27:35 +11:00
Danny Ryan c4ccdc90de
Merge branch 'dev' into v1.0-candidate 2020-11-03 17:09:48 -06:00
Danny Ryan 6b44f63751
Merge pull request #2104 from ethereum/state_transition_patch
Make `state_transition` not return post-state
2020-11-03 14:57:29 -06:00
Danny Ryan bfaef689e4
Merge pull request #2092 from ethereum/ralexstokes-patch-1
Simplify fork choice spec
2020-11-03 06:58:35 -07:00
Danny Ryan b356f52c5c
ensure aggregate attestation's slot and target are consistent 2020-10-28 17:54:46 -06:00
Alon Muroch 0835c78b56
Apply suggestions from Dankrad's code review
Co-authored-by: dankrad <mail@dankradfeist.de>
2020-10-27 08:38:54 +02:00
Alon Muroch fe5e2f6a8b table of content 2020-10-20 12:07:54 +03:00
Alon Muroch 73cd1a84fd added best practices section according to https://github.com/ethereum/eth2.0-specs/issues/2085 2020-10-20 12:00:40 +03:00
Hsiao-Wei Wang f1e4b3c88b
Refactor shard_state_transition 2020-10-15 16:14:01 +08:00
Hsiao-Wei Wang 7fb9226ec6
Make `state_transition` not return post state; the given pre state should have been mutated to post state. 2020-10-15 15:58:26 +08:00
Danny Ryan c17a95a175
add note about how slashings and exits can interact. add test 2020-10-14 17:33:14 -06:00
Danny Ryan 427c7bb236
fix minor typo in validator guide 2020-10-08 10:18:15 -06:00
Danny Ryan 91deacbf9c
double eth1data params 2020-10-07 18:52:47 -06:00
Alex Stokes 663af77737
Clean up unused variable for linter 2020-10-07 17:11:13 -07:00
Alex Stokes d0cf4e7bad
Simplify fork choice spec
This change should be non-substantive as any blocks in `blocks` should be descendants (inclusive) of the `store.justified_checkpoint` (refer `get_filtered_block_tree`) so that in `get_head` all blocks considered as potential heads will have `slot > justified_slot`. Considering this condition universally applies, adding the `and ...` arm to the conditional is unnecessary overhead.
2020-10-07 16:52:51 -07:00
Danny Ryan d3d9bbd479
add note about coming gs v1.1 params 2020-10-07 17:46:20 -06:00
Danny Ryan 45de8198ca
Merge branch 'dev' into v1.0-candidate 2020-10-07 13:42:23 -06:00
Danny Ryan 64b34b5ca6
Merge pull request #2089 from ethereum/fix-message-id
fix message-id issues
2020-10-07 12:40:51 -06:00
Danny Ryan 8cda237884
note v5.1 in discv5 p2p spec 2020-10-07 12:13:32 -06:00
Danny Ryan 6287875baf
use domain byte to isolate message-id domains 2020-10-07 11:59:39 -06:00
Danny Ryan a365fcb03b
fix message-id issues 2020-10-06 16:18:12 -06:00
Hsiao-Wei Wang d264ad8af7
Merge pull request #2080 from ethereum/bls_v4
Bump IETF BLS spec version draft 03 -> draft 04
2020-10-05 22:12:52 +08:00
Danny Ryan 5f9e6599e9
Merge pull request #2060 from protolambda/signing-policy
Use gossip signing policy in p2p spec, see libp2p/specs#294
2020-09-30 12:03:21 -06:00
Danny Ryan 157f7e8ef4
upgrade config to mainnet values 2020-09-28 12:56:08 -06:00
protolambda 62d596a910
update signature policy link 2020-09-25 17:59:09 +02:00
Hsiao-Wei Wang ad4ad2d8b4
Bump IETF BLS spec version draft 03 -> draft 04 2020-09-25 15:01:41 +08:00
protolambda 708827413f
cleanup phase1 TOC contents 2020-09-23 22:55:22 +02:00
Danny Ryan 8c9c943845
Merge pull request #2054 from ethereum/ralexstokes-patch-1
Typos in: p2p-interface.md
2020-09-22 17:32:10 -06:00
Danny Ryan a232efbeb7
revert incorrect type fix 2020-09-22 17:20:55 -06:00
ericsson 104b83aab3 use integer division (//) instead of non-integer (/) 2020-09-22 18:54:44 +03:00
Danny Ryan 177f88962e
Merge pull request #2073 from ethereum/weak-subjectivity-guide
Weak subjectivity guide
2020-09-17 12:07:19 -06:00
Danny Ryan 8bb05827ab
add weak-subjectivity.md to setup.py build and do final lint cleanups 2020-09-17 12:01:25 -06:00
Aditya Asgaonkar 58d225c9be Added WIP note, explanation for WS period calculation 2020-09-17 10:34:37 -07:00
Aditya Asgaonkar 6b33c766f2
Apply suggestions from Danny's code review
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-09-17 10:26:49 -07:00
Aditya Asgaonkar 2023b24d72
Small change to CLI input description 2020-09-16 19:52:21 -07:00
Aditya Asgaonkar 3fd0eaa67a Fix in WS guide 2020-09-15 17:37:38 -07:00
Aditya Asgaonkar 2b81ec9337 Added TOC to WS guide 2020-09-15 17:33:01 -07:00
Aditya Asgaonkar dc841d4bf6 Cosmetic changes to WS guide 2020-09-15 17:21:38 -07:00
Aditya Asgaonkar d71bb856e7 Added weak subjectivity guide 2020-09-15 17:10:39 -07:00
Danny Ryan 33cfcc4eb3
Merge pull request #2067 from ethereum/bls_v3_patch
Remove outdated BLS standard note
2020-09-15 10:12:15 -06:00
Danny Ryan 7c685d490e
Merge pull request #2061 from ethereum/anchor_block_header_3
Pass `anchor_block` to `get_forkchoice_store`
2020-09-15 10:10:29 -06:00
Hsiao-Wei Wang 899927af30
Remove note 2020-09-15 23:43:07 +08:00
Hsiao-Wei Wang 1e29563242
Pass `anchor_block` to `get_forkchoice_store` 2020-09-15 12:51:11 +08:00
protolambda 8ad0865424
Use gossip signing policy in p2p spec, see libp2p/specs#294 2020-09-15 01:15:16 +02:00
Danny Ryan 59cb56b564
Merge pull request #2044 from blacktemplar/use-raw-sha-as-message-id
use raw SHA256 as message-id
2020-09-14 11:25:34 -06:00
Danny Ryan 5a9fe89089
remove extraneous parens 2020-09-14 10:58:48 -06:00
Danny Ryan 89be1f5bc8
favor pythonic notation for array slices 2020-09-14 10:57:35 -06:00
blacktemplar deb58fd21e only use first 8 bytes of hash as message id 2020-09-14 10:09:48 +02:00
Alex Stokes 3cb15806be
Update p2p-interface.md
Typo fixes
2020-09-11 17:08:37 -07:00
Hsiao-Wei Wang cfc69e47e6
Bump IETF BLS standard version to -03 2020-09-11 17:17:51 +08:00
blacktemplar 8f0b15f9f7 remove dot 2020-09-11 06:44:36 +02:00
Danny Ryan 8948f92def
Merge branch 'dev' into more_gossip_validations 2020-09-10 14:33:48 -06:00
Danny Ryan 42bf435c54
rearrange gossip conditions 2020-09-10 14:10:09 -06:00
Danny Ryan 54f1abc943
Merge pull request #2036 from ethereum/typing_clean
Non-substantive typing clean-up
2020-09-10 14:07:32 -06:00
blacktemplar 9cbc7c37f4 use raw SHA256 as message-id 2020-09-09 15:02:47 +02:00
Hsiao-Wei Wang 6e900f4fcc
Add more typings, no substantive change 2020-09-03 19:27:16 +08:00
Hsiao-Wei Wang eed2df37f4
Make linter happy 2020-09-03 17:27:20 +08:00
vbuterin b35f8fff74
Add a constant for slash penalty multiplier
Make the multipler on slashed penalties (if portion `p` of validators are slashed each one loses `k*p` an explicit constant).
2020-09-02 12:26:27 +08:00
lsankar4033 a156f3821f Add two more attestation gossip validations 2020-08-26 16:18:38 -07:00
lsankar4033 a4acd38981 fix typo 2020-08-26 16:11:42 -07:00
tintinweb c3ff87461f fix typo 2020-08-21 12:10:10 +02:00
Danny Ryan e56b7cb4c0
Merge pull request #2022 from ethereum/state-for-block
clarify what 'state' is for block proposals in validator guide
2020-08-20 17:39:57 -06:00
Danny Ryan e323260a4a
fix some confusing language in validtor guide 2020-08-20 17:03:49 -06:00
Danny Ryan 444cd0249a
minot typo fix
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2020-08-20 16:53:09 -06:00
Danny Ryan 9742b3a157
clarify what 'state' is for block proposals in validator guide 2020-08-19 09:58:02 -06:00
Hsiao-Wei Wang adf8698778
Update the docs and remove unused code 2020-08-18 00:58:08 +08:00
Hsiao-Wei Wang 643611aa6d
Merge pull request #2010 from ethereum/fix-shard-count
Fix active shard count issues
2020-08-12 03:05:16 +08:00
Danny Ryan 2a41c516d3
Merge pull request #2001 from lsankar4033/attestation-epoch-consistency
Add self-consistency check to attestation gossip validation
2020-08-11 12:59:19 -06:00
vbuterin 1f767ca8b9
Remove AttestationCustodyBitWrapper
Seems like this class is extraneous ever since we added Dankrad's 0.001 bit custody game.
2020-08-11 12:35:31 +08:00
Danny Ryan 8b39d41145
PR feedback 2020-08-10 13:06:20 -06:00
terence tsao 77b933035c
Update apply_shard_transition comments 2020-08-10 07:15:54 -07:00
terence tsao d22e02f20a
Update specs/phase1/beacon-chain.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-08-10 06:26:52 -07:00
terence tsao 729e21cbcf
apply_shard_transition: copy shard state 2020-08-08 09:29:04 -07:00
Danny Ryan c3ae85387c
add larger validator set test for regression test for active_shard_count issue 2020-08-05 13:26:21 -06:00
Danny Ryan 56dbc17793
fix active shard count bugs 2020-08-05 12:44:31 -06:00
Danny Ryan bf6d5ce3b6
port #2005 and rearrange conditions 2020-08-03 09:42:52 -06:00
Hsiao-Wei Wang e3bbf3c702
Merge branch 'dev' into shard-fork-choice-fix 2020-07-29 23:55:30 +08:00
Hsiao-Wei Wang bd5346b624
Merge pull request #1989 from ethereum/enable-bls-citest
Enable Milagro BLS in CI
2020-07-29 23:54:53 +08:00
lsankar4033 3a0dd2b253 Add self-consistency check to attestation gossip validation 2020-07-28 17:51:32 -07:00
Hsiao-Wei Wang b58633ce5d
Quick fix the phase 1 configurations and tests (#1990)
* Quick fix the configurations

* Remove the unused `CUSTODY_RESPONSE_DEADLINE`
2020-07-29 02:06:25 +08:00
Danny Ryan f6da7323fe
Merge pull request #1999 from ethereum/genesis-comments
add clarifying comment for genesis skip conditions
2020-07-28 12:31:54 -04:00
Hsiao-Wei Wang f6fd151872
Merge branch 'dev' into shard-fork-choice-fix 2020-07-29 00:15:41 +08:00
Hsiao-Wei Wang b1eb157539
Merge branch 'dev' into hwwhww/phase-1-fork-slot 2020-07-28 23:59:19 +08:00
Danny Ryan b529d47a3b
pr feedback 2020-07-28 11:48:45 -04:00
Hsiao-Wei Wang a8370f7448
Apply refactoring suggestions from Danny 2020-07-28 21:51:00 +08:00
Danny Ryan 235fb7e2a5
add clarifying comment for genesis skip conditions 2020-07-28 06:48:16 -04:00
Danny Ryan 049e087da0
Merge pull request #1996 from status-im/epoch-check
process_attestation: Validate epoch before using it
2020-07-24 08:04:06 -06:00
Jacek Sieka 6f7652d330
process_attestation: Validate epoch before using it
`data.target.epoch` is used to count the active validator set.

Because `get_committee_count_per_slot` is extremely inefficient the way
the spec is written, clients cache it, or the underlying active
validator set.

Performing the checks in the given order leads to a (very unlikely)
security issue where the a cold and above all, distant value may get
used which may be costly - reordering the checks brings the value into a
more reasonable range before using it.
2020-07-24 07:26:37 +02:00
Danny Ryan 607041225f
split config vs constants in deposit-contract spec 2020-07-23 15:05:25 -06:00
Danny Ryan 4c3f866a0f
add links for network and chain id 2020-07-23 12:25:44 -06:00
Hsiao-Wei Wang e7f070d525
Use `hash_tree_root` to generate `ShardBlockHeader.body_root`
Include the mix-in length to the proof.
2020-07-24 02:09:25 +08:00
Danny Ryan 9193a23f8e
add chain id and netowrk id to config 2020-07-23 12:05:22 -06:00
Diederik Loerakker 247da83e62
Merge pull request #1985 from ethereum/non-viable-gossip
add that current block is in the same chain as finalized ancestor
2020-07-23 19:18:53 +02:00
Danny Ryan 3cf6832198
Apply suggestions from code review
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
2020-07-23 10:46:31 -06:00
Danny Ryan b3e49ff0d3
add finalized ancestor checks to attestation gossip 2020-07-23 10:39:04 -06:00
Danny Ryan fb13f67cca
add that current block is in the same chain as finalized ancestor 2020-07-23 10:13:42 -06:00
Danny Ryan 289564aec0
pr feedback 2020-07-23 10:03:43 -06:00
Danny Ryan a64b8eba6e
remove 'ssz' format from req/resp. now only ssz_snappy 2020-07-23 09:37:16 -06:00
Hsiao-Wei Wang cd8bb3d85a
Update v-guide: Shard head root 2020-07-22 23:39:18 +08:00
Hsiao-Wei Wang 33e56b5742
Apply Terence's suggestion: refactor on_shard_block interface 2020-07-22 22:48:52 +08:00
Danny Ryan 435f70208b
Merge pull request #1958 from ethereum/gossip-params
Match gossip v1.1 D_low, extend gossip_history param, add FAQ section
2020-07-21 18:18:25 -06:00
Danny Ryan 50cd0b2b31
Update specs/phase0/p2p-interface.md
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
2020-07-21 17:49:39 -06:00
Danny Ryan edcce7bfef
format 2020-07-21 17:00:11 -06:00
Danny Ryan ec7be11c06
mod gossip params and rename to reflect spec names 2020-07-21 16:45:25 -06:00
Hsiao-Wei Wang c981fc4411
Apply mkalinin's suggestion 2020-07-20 16:47:21 +08:00
Hsiao-Wei Wang 74aa027e38
Apply suggestions from @mkalinin
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
2020-07-20 16:37:43 +08:00
Hsiao-Wei Wang 0b81c967fa
Add notes 2020-07-17 00:46:25 +08:00
Hsiao-Wei Wang cf42fd4828
Rename `PHASE_1_GENESIS_SLOT` to `PHASE_1_FORK_SLOT` and set it to `Slot(0)` for testing. 2020-07-16 23:58:47 +08:00
Hsiao-Wei Wang 8e82ca5d1a
Merge branch 'dev' into hwwhww/new_int_to_bytes_dev 2020-07-16 01:36:19 +08:00
Hsiao-Wei Wang 6e3a7ad8f2
Merge branch 'dev' into hwwhww/strict-uint64-2 2020-07-15 23:02:51 +08:00
Hsiao-Wei Wang f6b1fe6172
Refactor tests and avoiding passing `shart_store` to helper functions 2020-07-15 19:07:39 +08:00
Hsiao-Wei Wang 43ef9aa294
Make ShardLatestMessage per shard per validator
1. Add `ShardLatestMessage` dataclass
2. To make it compatible with phase 0 tests and APIs, add `Store.shard_stores: Dict[Shard, ShardStore]`
3. Update `get_forkchoice_store` and `update_latest_messages`
2020-07-14 17:44:01 +08:00
Danny Ryan 7b43a3d772
Merge pull request #1956 from ethereum/queue-att
add queueing possibility to p2p messages in gossip
2020-07-08 10:53:19 -06:00
Danny Ryan 22b72180f7
Merge pull request #1962 from mkalinin/patch-1
Fix epoch_boundary_block_root computation
2020-07-08 10:52:57 -06:00
Mikhail Kalinin b785c97051
Fix epoch_boundary_block_root computation 2020-07-08 21:58:20 +06:00
ericsson 3e9556202a change `get_custody_period_for_validator()` return type to `uint64` 2020-07-08 18:19:41 +03:00
protolambda 07274736b9
Match gossip v1.1 D_low, extend gossip_history param, add FAQ section 2020-07-08 01:42:09 +02:00
Danny Ryan 334947f523
rearrange queuing conditions 2020-07-07 16:20:31 -06:00
Danny Ryan 4c1fa7fa6f
add note about max queue sizes in gossip 2020-07-07 12:41:41 -06:00
Danny Ryan 953d106163
add queueing possibility to p2p messages in gossip 2020-07-07 12:34:39 -06:00
Danny Ryan 6195e027f1
working through new-lines 2020-07-03 09:19:15 -06:00
Danny Ryan 04a6c96cdf
break p2p topics into separate md headers for better linking 2020-07-03 07:50:30 -06:00
Danny Ryan e5f3b5dded
Merge pull request #1952 from status-im/no-tls
Update faq for tls
2020-07-03 07:37:38 -06:00
Jacek Sieka 30e0438d49
Update faq for tls
we're not using tls1.3 (yet?)
2020-07-03 10:47:17 +02:00
terence tsao 27fa15eb76 A few light client typos 2020-07-02 16:46:31 -07:00
Danny Ryan c3350f4477
Merge pull request #1946 from ericsson49/fix_is_valid_fraud_proof2
Fix `is_valid_fraud_proof` which tries to access `message` field of a `ShardBlock` instance
2020-07-02 09:58:14 -06:00
Danny Ryan 5a9dd44ff4
Merge pull request #1943 from ethereum/avoid-neg-op
Avoid negative values and minor refactoring
2020-07-02 09:37:16 -06:00
Hsiao-Wei Wang d608be72c3
Merge pull request #1937 from ethereum/hwwhww/custody-block-test
Fix `ShardTransition.shard_data_roots` and add custody game block-level tests
2020-07-02 13:24:07 +08:00
ericsson dafbd98f2b Merge branch 'dev' into fix_is_valid_fraud_proof2 2020-07-01 23:04:37 +03:00
ericsson 7674c76b61 get rid of `.message` as `block` is `ShardBlock` already 2020-07-01 17:23:05 +03:00
terence tsao 36339de511
Lint 2020-06-30 09:11:13 -07:00
terence tsao c8752956ed
use next epoch for new_committee? 2020-06-30 08:44:09 -07:00
terence tsao 1876c9591b
Update light committee for next slot 2020-06-30 08:16:28 -07:00
Hsiao-Wei Wang 966363890b
PR feedback from @ericsson49: fix when `len(bytez) > BYTES_PER_CUSTODY_ATOM` 2020-06-30 19:16:18 +08:00
Hsiao-Wei Wang eaae70b3b3
Minor refactoring 2020-06-30 17:16:48 +08:00
Hsiao-Wei Wang 96b71a19de
Avoid Python-specific negative operation 2020-06-30 16:58:56 +08:00
Hsiao-Wei Wang 2c0595da01
PR feedback from Danny 2020-06-30 00:11:43 +08:00
Hsiao-Wei Wang 4b239e94b7
Mix PR feedback from Danny and Proto 2020-06-29 12:50:01 +08:00
Hsiao-Wei Wang 1d954ee9bd
PR feedback from @ericsson49
Co-authored-by: Alex Vlasov <avv49@mail.ru>
2020-06-29 12:33:52 +08:00
protolambda 3b7617f51a
make extracted byte uint8 for bitshift, do not use negative slice indexing, avoid negative comparison in test 2020-06-26 16:14:27 +02:00
protolambda 531184f42b
Infer types where possible, e.g. uint64+uint64=uint64 2020-06-26 15:41:47 +02:00
Hsiao-Wei Wang a159a2da82
Merge pull request #1928 from ethereum/hwwhww/shard-block-tests
Add tests for `shard_state_transition` and some refactorings
2020-06-26 11:54:23 +08:00
Hsiao-Wei Wang 94c231cf98
Fix `ShardTransition.shard_data_roots` and add test
1. Fix `ShardTransition.shard_data_roots`: use `get_block_data_merkle_root` helper to calculate it.
2. Rework `get_valid_custody_chunk_response` testing helper: accept
`block_length_or_custody_data`
3. Add `test_with_custody_challenge_and_response` test
2020-06-26 01:46:45 +08:00
Hsiao-Wei Wang a061758a66
Use `encode_bytes` to implement `int_to_bytes`
Rename `bytes_to_int` to `bytes_to_uint64`

Use `encode_bytes` to implement `int_to_bytes`

Rename `int_to_bytes` to `uint_to_bytes` and move it to `ssz_impl.py`
2020-06-25 20:20:39 +08:00
Hsiao-Wei Wang b239f6108c
Merge branch 'dev' into hwwhww/strict-uint64 2020-06-25 17:18:16 +08:00
Hsiao-Wei Wang 2a7b5f7e68
PR feedback from Danny: nuke optional beacon_parent_state 2020-06-25 11:14:25 +08:00
Hsiao-Wei Wang 79b6bc616d
PR feedback from danny 2020-06-25 10:58:04 +08:00
terence tsao 7e04c70ca1
Update beacon-chain.md 2020-06-24 16:53:53 -07:00
Hsiao-Wei Wang 661959c13e
Add `process_shard_block` verification 2020-06-24 18:18:50 +08:00
Hsiao-Wei Wang 4a46fb2a8a
Refactor phase 1 block tests a bit and add `shard_state_transition`
tests

1. Refacotr phase1/sanity/test_blocks.py
2. Add phase1/sanity/test_shard_blocks.py for testing `verify_shard_block_message` and `verify_shard_block_signature`
2020-06-24 18:08:26 +08:00
Hsiao-Wei Wang c4973792e2
Make `get_pending_shard_blocks` return `Sequence[SignedShardBlock]` 2020-06-24 12:50:27 +08:00
Hsiao-Wei Wang 021788a634
Merge pull request #1925 from ethereum/hwwhww/shard_state_transition
Rework `shard_state_transition` interface + fix #1922
2020-06-24 12:29:31 +08:00
Hsiao-Wei Wang dbd1d4e589
PR feedback: Enable `verify_shard_block_signature` 2020-06-24 12:22:24 +08:00
Hsiao-Wei Wang e4d4527845
Merge pull request #1921 from ethereum/hwwhww/shard-tests
Fix no winning root case + add tests + fix #1881
2020-06-24 11:21:23 +08:00
Hsiao-Wei Wang e52c19896d
Update
1. Check on-time attestations fit `attestation.data.shard_transition_root != hash_tree_root(ShardTransition())`
2. Move `attestation.data.shard_head_root` check to after winning root
2020-06-23 18:22:18 +08:00
Hsiao-Wei Wang db5da9dc97
Fix return type
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-06-23 10:50:41 +08:00
Danny Ryan 05dc8fe9a0
Merge pull request #1922 from terencechain/patch-105
Remove shard check in `verify_shard_block_message`
2020-06-22 12:05:32 -06:00
Danny Ryan e61efc14a3
Merge pull request #1886 from ethereum/fix_store_target_checkpoint_state
Fix store_target_checkpoint_state
2020-06-22 11:38:40 -06:00
Hsiao-Wei Wang eec1442417
Reorg `shard_state_transition` argument and fix `get_shard_transition_fields` 2020-06-22 23:41:02 +08:00
Hsiao-Wei Wang 4f618fc62d
Rework `shard_state_transition` interface
To make `shard_state_transition` similar to phase 0
`state_transition` function

1. Rename old `shard_state_transition` to `process_shard_block`
2. Add `shard_state_transition` with `validate_message` flag, we only
validate it in shard fork choice
2020-06-22 23:21:24 +08:00
ericsson 723784b408 replace `[[]]*num` with `[()]*num` to avoild problems with mutability, as [] or () is copied 2020-06-20 01:02:19 +03:00
ericsson 40b397f53f use [[]] * num instead of just [] * num 2020-06-20 00:09:59 +03:00
terence tsao 769e1d0339
Update shard-transition.md 2020-06-19 09:06:37 -07:00
Hsiao-Wei Wang 1a5016157a
Fix
1. To make it more compatible, update `is_on_time_attestation` argument: replace `attestation: Attestation` with `attestation_data:
AttestationData`
2. Fix `get_sample_shard_transition`
2020-06-19 23:46:01 +08:00
Hsiao-Wei Wang c28857e4e1
Fix `attestation.data.shard_head_root` bug 2020-06-19 23:34:51 +08:00
Hsiao-Wei Wang c2c2b4c444
Crosslink bugfix
1. Fix `is_winning_attestation` condition
2. Fix `process_crosslink_for_shard`: we can only check
`shard_data_roots` if `shard_transition != ShardTransition()`
2020-06-19 22:19:21 +08:00
Hsiao-Wei Wang 76840c9178
Merge branch 'dev' into hwwhww/strict-uint64 2020-06-19 17:01:04 +08:00
terence tsao 3888dc27a9
@djrtwo's feedback 2020-06-18 12:39:48 -07:00
terence tsao db81f88c4e
Update beacon-chain.md 2020-06-18 10:59:37 -07:00
Danny Ryan bd61c2686b
PR feedback 2020-06-18 09:45:10 -06:00
Danny Ryan 948ad23f96
Merge branch 'dev' into epochwise_committee_count_per_slot 2020-06-18 09:44:02 -06:00
Danny Ryan 05453b786d
Merge pull request #1895 from ethereum/hwwhww/attestation-shard
Add `shard: Shard` field to `AttestationData`
2020-06-18 09:37:07 -06:00
Danny Ryan 02d518c9e3
Merge pull request #1919 from ethereum/hwwhww/shard_block_length
Fix shard_block_length type in `compute_updated_gasprice`
2020-06-18 09:35:59 -06:00
Danny Ryan 13e7e7986d
Merge pull request #1915 from ethereum/hwwhww/fix-validator-arguments
Fix missing arguments of validator guide
2020-06-18 09:34:45 -06:00
Hsiao-Wei Wang fe47869d5f
Revert `process_crosslinks` and add comment 2020-06-18 23:32:23 +08:00
Hsiao-Wei Wang 35bf3b5290
Refactor `validate_attestation`
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-06-18 23:20:24 +08:00
Hsiao-Wei Wang 8cf0774290
Fix shard_block_length type in `compute_updated_gasprice` 2020-06-18 20:39:29 +08:00
Hsiao-Wei Wang 6aca7afd81
Add notes of active shard count 2020-06-18 17:35:24 +08:00
Hsiao-Wei Wang 7dbecdf904
Fix some missing arguments 2020-06-18 17:35:16 +08:00
Hsiao-Wei Wang c0b6df8fd0
Merge pull request #1906 from terencechain/patch-102
Fix links in phase1 validator doc
2020-06-18 15:10:43 +08:00
Hsiao-Wei Wang 4428a6aedf
Fix table 2020-06-18 13:50:10 +08:00
Hsiao-Wei Wang 0ae11cd70c
Merge pull request #1911 from terencechain/patch-103
get_shard_winning_roots uses on_time_slot
2020-06-18 12:28:23 +08:00
Hsiao-Wei Wang 0eeffc47bc
Merge pull request #1909 from ericsson49/fix_process_custody_game_operations
Fix typing error in `process_custody_game_operations`
2020-06-18 12:22:35 +08:00
protolambda 41ebd51aff
Merge branch 'dev' into hwwhww/strict-uint64 2020-06-18 02:49:09 +02:00
ericsson 9dc43957e2 a fix according to @protolambda comments 2020-06-18 03:39:51 +03:00
ericsson e479e96480 lint fix 2020-06-18 02:46:06 +03:00
terence tsao cc84b49d13
on_time_attestation_slot instead of current_slot 2020-06-17 16:20:46 -07:00
ericsson adced70c54 use `aggregate.data` instead of hust `data` 2020-06-18 02:04:16 +03:00
ericsson 17c86177d9 Change types of BeaconBlockBody chunk_challenges and
chunk_challenge_responses to List[CustodyChunkChallenge, ...]
2020-06-18 01:43:41 +03:00
terence tsao 3eabcddb4c
Update validator.md 2020-06-17 13:24:00 -07:00
protolambda ce0371a66b
fix comment: committees per slot for given *epoch* 2020-06-17 20:23:26 +02:00
protolambda 9b60a9b799
Avoid state usage in p2p validation, compute committee count per slot for epoch as a whole 2020-06-17 20:19:32 +02:00
Danny Ryan fbf10a0db3
fix tests 2020-06-16 22:32:09 -06:00
Hsiao-Wei Wang 23cbbb1d08
Fix shard number assertion and refactor it 2020-06-17 09:48:47 +08:00
Hsiao-Wei Wang c8ae7d99f9
Fix after auto-merge 2020-06-17 09:05:44 +08:00
Danny Ryan a21f93646c
Merge pull request #1878 from ethereum/hwwhww/remove_digest
Remove `ShardState.transition_digest`
2020-06-16 16:40:52 -06:00
Danny Ryan 759185632f
Merge branch 'dev' into phase1-validator 2020-06-16 16:07:20 -06:00
Danny Ryan 2e0950560b
PR feedback 2020-06-16 16:03:36 -06:00
Hsiao-Wei Wang 7fba94a73d
Merge branch 'dev' into hwwhww/attestation-shard 2020-06-17 01:58:05 +08:00
Dankrad Feist e6e694fad9
Fix toc 2020-06-16 17:35:33 +01:00
Dankrad Feist 58935c19d6
Move constant 2020-06-16 17:23:09 +01:00
Dankrad Feist df1a932534
Rename misleading variable all_secrets_are_revealed 2020-06-16 15:19:45 +01:00
dankrad 4bc849bcc2
Update specs/phase1/custody-game.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-06-16 15:05:12 +01:00
dankrad 4b8b3f2cbc
Update specs/phase1/custody-game.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-06-16 15:05:01 +01:00
Dankrad Feist a4c2950c4a
Phase 1 validator guide stub. This is to start collecting important details with correct validator operation. 2020-06-16 14:48:00 +01:00
Danny Ryan a0175ca1b3
Merge branch 'dankrad-custody-256bit' into dankrad-custody-0.01bit 2020-06-16 07:15:00 -06:00
Hsiao-Wei Wang 3ee0761d17
Add `shard: Shard` field to `AttestationData` 2020-06-16 00:17:49 +08:00
Hsiao-Wei Wang 50ac8ebb0c
Fix DOMAIN_CUSTODY_BIT_SLASHING 2020-06-15 21:25:40 +08:00
Hsiao-Wei Wang 458d343497
Fix configs and put domain types to the same table 2020-06-15 21:15:11 +08:00
Hsiao-Wei Wang be607e97f6
Merge branch 'dev' into phase1-validator 2020-06-15 21:09:43 +08:00
Danny Ryan f62125eaa6
add phase 1 on-time aggregation 2020-06-15 06:54:48 -06:00
Hsiao-Wei Wang 8697b30eea
Fix configuration 2020-06-15 15:30:32 +08:00
Hsiao-Wei Wang e80f6727dc
Merge branch 'dev' into dankrad-custody-256bit 2020-06-15 15:13:45 +08:00
Danny Ryan e955e6f6e1
Merge pull request #1884 from paulhauner/patch-25
Use parent_root for finalized chain check
2020-06-13 16:09:16 -05:00
Danny Ryan fdb6f15867
unhandled exceptions do not modify forkchoice store 2020-06-13 15:59:04 -05:00
Danny Ryan df9b5f18a4
Merge pull request #1885 from paulhauner/patch-26
Fork choice: minor formatting change
2020-06-13 15:51:03 -05:00
Dankrad Feist f6d7dac30c
Change to 2**14 epoch (73 day) custody periods as per #1888 2020-06-13 15:15:37 +01:00
Paul Hauner 7ad1bb508d
Ensure parent is checked before store lookup 2020-06-13 16:04:16 +10:00
Dankrad Feist 42a9f1afdf
Fix Legendre bit computations 2020-06-12 23:44:36 +01:00
Aditya Asgaonkar 993ed5c2c6 Resetting branch to dev and adding single commit 2020-06-12 14:37:07 -07:00
Dankrad Feist 04fb9926e8
Remove custody bits from phase 1 and tests 2020-06-12 17:16:08 +01:00
Dankrad Feist 29c1569251
Merge branch 'dev' into dankrad-custody-256bit
# Conflicts:
#	specs/phase1/beacon-chain.md
2020-06-12 12:29:57 +01:00
Dankrad Feist 398fc833b8
Fix TOC 2020-06-12 12:07:31 +01:00
Dankrad Feist 59b35afcd9
Refactor universal hash function 2020-06-12 12:04:30 +01:00
Dankrad Feist 65c3417f90
Fix replace_empty_or_append, remove assert False & test 2020-06-12 11:53:32 +01:00
dankrad 7bf491d49d
Update specs/phase1/custody-game.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-06-12 11:28:49 +01:00
dankrad 0e8bba2ce3
Update specs/phase1/custody-game.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-06-12 11:28:30 +01:00
dankrad d41b6a5775
Update specs/phase1/custody-game.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-06-12 11:18:07 +01:00
dankrad 31654d8bf4
Update specs/phase1/custody-game.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-06-12 11:17:44 +01:00
dankrad 7c6280aa8e
Update specs/phase1/custody-game.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-06-12 11:16:19 +01:00
Danny Ryan 67c9c062e0
Merge pull request #1880 from paulhauner/patch-24
Fork choice: avoid redundant call to get_ancestor
2020-06-11 10:23:27 -05:00
Paul Hauner a1a75a38fe
Tidy, add comment 2020-06-11 11:51:18 +10:00
Danny Ryan 85b227da78
Merge branch 'dev' into phase1-validator 2020-06-10 11:34:55 -05:00
Danny Ryan 4b8f132957
pr feedback 2020-06-10 11:32:02 -05:00
Dankrad Feist e46d5effe4
Add test for slashing after failing to respond to custody chunk challenge 2020-06-10 17:20:42 +01:00
Danny Ryan 1dc6b55617
rearrange fork choice condition for clarity 2020-06-10 09:40:34 -05:00
Hsiao-Wei Wang 479c40450d
Friendly lint fix 2020-06-10 18:16:26 +08:00
Paul Hauner 29d968bb2e
Use parent_root for finalized chain check 2020-06-10 15:09:40 +10:00
Paul Hauner 378d249487
Avoid redundant call to get_ancestor 2020-06-10 11:02:10 +10:00
terence tsao 0f6efcd50d
Update toc 2020-06-09 15:38:40 -07:00
terence tsao ef11e924fa
Update phase1 beacon-chain config table 2020-06-09 13:34:46 -07:00
Hsiao-Wei Wang dacf86a5c0
Remove `transition_digest` 2020-06-10 02:43:59 +08:00
Danny Ryan 65a739fe41
Merge branch 'dev' into phase1-validator 2020-06-08 15:50:51 -06:00
Hsiao-Wei Wang 41cfa7fdf6
Merge branch 'dev' into dankrad-custody-256bit 2020-06-09 01:39:51 +08:00
Hsiao-Wei Wang 2d895e9388
PR feedback from danny 2020-06-09 00:13:27 +08:00
Hsiao-Wei Wang 3b749d72c8
Merge branch 'dev' into hwwhww/shard_fork_choice 2020-06-08 23:57:19 +08:00
Hsiao-Wei Wang 9b3f45dfd0
Merge pull request #1875 from ethereum/hwwhww/shard_fork_choice_part2
Handle `beacon_parent_root` checks
2020-06-08 23:53:31 +08:00
Hsiao-Wei Wang e03a970eaf
PR feedback from danny: simplify `verify_shard_block_message` params 2020-06-08 23:49:24 +08:00
Danny Ryan dce82e76bc
Merge pull request #1870 from ethereum/hwwhww-patch-1
Use shard_block.slot to get seed for proposer selection
2020-06-08 09:19:23 -06:00
Hsiao-Wei Wang 435505746c
PR feedback from Terence: fix `get_shard_latest_attesting_balance`
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2020-06-08 17:12:46 +08:00
Hsiao-Wei Wang a4cc189f2b
Apply PR feedback from Danny 2020-06-06 05:19:46 +08:00
Hsiao-Wei Wang a71c0a5ccc
Per #1704 discussion, remove `on_time_slot`: the given `beacon_state`
should be transitioned.
2020-06-06 02:39:47 +08:00
Hsiao-Wei Wang 2d4788fe7d
Fix `verify_shard_block_message`
Add check for `block.beacon_parent_root` per Terence's suggestion

Update `get_shard_transition`

1. Disable verification: it will be fix in v-guide
2. Use `on_time_slot` to compute offset_slots

Rework tests
2020-06-06 02:39:47 +08:00
Hsiao-Wei Wang a154d0c22b
Fix typo 2020-06-06 02:39:11 +08:00
Hsiao-Wei Wang 6f9c290bfb
Add TODO flag of latest message 2020-06-06 02:39:11 +08:00
Hsiao-Wei Wang f8597d2965
Add `get_pendings_shard_blocks` 2020-06-06 02:39:10 +08:00
Hsiao-Wei Wang 727353c054
Verify shard_block.slot fits the expected offset_slots 2020-06-06 02:39:10 +08:00
Danny Ryan 8a9ccc4f34
clarify attestations as coming from block.body when getting winning roots in validator guide 2020-06-05 12:12:12 -06:00
Danny Ryan 8e5c98ef3c
PR feedback 2020-06-05 12:01:53 -06:00
Danny Ryan 7e44456be5
mod compute_subnet_for_attestation to be usable for lookahead 2020-06-05 09:50:49 -06:00
Danny Ryan 52de25048a
fix lihth client refs in val guide 2020-06-05 09:35:09 -06:00
Michael Sproul c2b7ff7422
Re-clarify proposer slashing check
Fixes a typo from #1871
2020-06-04 16:16:37 +10:00
Hsiao-Wei Wang 8afb93f5a3
Add `shard_block.slot` to seed 2020-06-04 11:19:04 +08:00
Michael Sproul 376c836190
Clarify proposer slashing gossip conditions 2020-06-04 12:51:17 +10:00
Hsiao-Wei Wang 26aae40941
Use epoch of the shard_block.slot for generating seed 2020-06-04 05:31:53 +08:00
Hsiao-Wei Wang d344521741
Bugfix: should set `shard` for empty proposal 2020-06-04 05:30:13 +08:00
Hsiao-Wei Wang c0108afe77
Use shard_block.slot to get seed for proposer selection 2020-06-04 05:06:04 +08:00
Danny Ryan b1ff00aab0
Merge branch 'dev' into phase1-validator 2020-06-03 12:18:17 -06:00
Danny Ryan 74204f795d
udpate validator guide to work with all updated phase 1 constructions 2020-06-03 12:16:39 -06:00
Hsiao-Wei Wang e1981a7bfd
`head_shard_root` -> `shard_head_root` 2020-06-04 01:00:52 +08:00
Hsiao-Wei Wang 58e75c27ed
Merge branch 'dev' into hwwhww/shard_fork_choice 2020-06-04 00:56:25 +08:00
Hsiao-Wei Wang eb21648146
Merge pull request #1858 from ethereum/hwwhww/get_start_shard
`get_start_shard` proposal
2020-06-04 00:46:12 +08:00
Danny Ryan d1647c28e0
Merge branch 'dev' into phase1-validator 2020-06-03 10:43:42 -06:00
Hsiao-Wei Wang 5c5cedd60d
Apply PR feedback from Danny and Terence 2020-06-03 22:31:16 +08:00
Danny Ryan cc5116bf33
Merge pull request #1837 from status-im/ssz-string
Use SSZ types in p2p spec
2020-06-02 16:35:31 -06:00
Danny Ryan 09b387bdc9
Merge pull request #1862 from terencechain/patch-100
Tidying up `shard_state_transition`
2020-06-02 14:19:31 -06:00
Diederik Loerakker e814d52ee5
Merge pull request #1866 from ethereum/tunable-genesis
Tunable genesis
2020-06-02 22:19:13 +02:00
Danny Ryan cf7b9993b5
clarify `head_root` is for a `BeaconBlock`
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
2020-06-02 13:51:43 -06:00
Danny Ryan 06dfff022b
add comment about default of 0x00 for genesis finalized checkpoint in p2p spec 2020-06-02 11:22:09 -06:00
Danny Ryan 671fae6efe
change note about genesis delay in p2p spec to match new GENESIS_DELAY config value; fix tests 2020-06-02 11:09:42 -06:00
Raw Pong Ghmoa 34412130c5
phase0: enable a tunable genesis time 2020-06-02 10:55:13 -06:00
terence tsao 24427947b1
Moved transition_digest to last 2020-06-02 08:09:43 -07:00
Hsiao-Wei Wang 142ba17451
PR review from Danny 2020-06-02 18:08:28 +08:00
Paul Hauner 2a125e8497
Update fork-choice.md 2020-06-02 17:22:33 +10:00
Paul Hauner c6aac16506
Reword fork choice comment 2020-06-02 17:16:25 +10:00
Danny Ryan d6435d0cbf
Merge branch 'dev' into dankrad-custody-256bit 2020-06-01 18:49:11 -06:00
Danny Ryan 3a4db69a20
Merge branch 'dev' into dankrad-custody-256bit 2020-06-01 18:45:22 -06:00
terence tsao 2a218520a1
Tidying up `shard_state_transition` 2020-06-01 14:31:45 -07:00
Hsiao-Wei Wang 5f10ac13bf
PR feedback from Terence and Danny: refactor `get_committee_count_delta` 2020-06-01 23:22:59 +08:00
Hsiao-Wei Wang 30f72dd696
Fix `get_shard` and `compute_shard_from_committee_index` calls 2020-06-01 23:15:16 +08:00
Hsiao-Wei Wang 9567c238d4
Merge branch 'dev' into hwwhww/get_start_shard 2020-06-01 18:17:58 +08:00
Hsiao-Wei Wang 92db6da508
Apply suggestions from Terence
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2020-06-01 17:56:22 +08:00
Hsiao-Wei Wang 31127b7024
Merge branch 'dev' into hwwhww/phase1_refactor_part2 2020-06-01 17:50:49 +08:00
Hsiao-Wei Wang 6317bd68aa
PR feedback from Danny
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-06-01 17:47:47 +08:00
Hsiao-Wei Wang 8e5db1b49f
Merge pull request #1856 from ethereum/hwwhww/verify_empty_shard_transition
Rework `Shard transition processing`
2020-06-01 17:47:00 +08:00
Hsiao-Wei Wang 8f570b461d
Merge pull request #1854 from ethereum/hwwhww/phase1_refactor
Some phase1 refactoring
2020-06-01 17:46:16 +08:00
Jacek Sieka 33e115f8c6
Clean up remaining `[]` List syntax
..and use List[byte, 256] for error message
2020-05-30 20:59:12 +02:00
Alex Stokes 437b2ebb90
Update fork choice spec comment for clarity
I think this change more clearly specifies the intended behavior. Given the terseness of the spec's code representation, I think we should aim for as much clarity as possible.
2020-05-29 18:16:06 -07:00
Hsiao-Wei Wang 63de59d5f6
Merge branch 'dev' into hwwhww/shard_fork_choice_3 2020-05-30 03:57:17 +08:00
Hsiao-Wei Wang 327deb40b2
Adjust function blocks 2020-05-30 03:14:51 +08:00
Hsiao-Wei Wang cceeab2657
Combine `process_crosslinks` and `verify_empty_shard_transition` into `process_shard_transitions` 2020-05-30 03:13:20 +08:00
Hsiao-Wei Wang 9b9507c138
Merge branch 'dev' into hwwhww/phase1_refactor_part2 2020-05-30 03:11:28 +08:00
Hsiao-Wei Wang f70224b84e
Extract `compute_committee_source_epoch` 2020-05-30 03:09:42 +08:00
Hsiao-Wei Wang 2dc041807a
Implement `get_start_shard` 2020-05-30 01:26:00 +08:00
Hsiao-Wei Wang b16e6d7a86
PR feedback from Danny
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-05-29 12:58:19 +08:00
Hsiao-Wei Wang bd9f983eea
Minor fix 2020-05-29 02:20:38 +08:00
Hsiao-Wei Wang 8ae7f5b6fa
Refactor `is_valid_indexed_attestation`: extract `verify_attestation_custody` 2020-05-29 01:24:17 +08:00
Hsiao-Wei Wang 7509ecb742
Add comments, minor refactoring 2020-05-29 00:13:08 +08:00
Hsiao-Wei Wang 19262888e4
Rename `verify_shard_transition_false_positives` to `verify_empty_shard_transition` 2020-05-28 21:55:49 +08:00
Hsiao-Wei Wang 8c9bbc48d8
Rework `is_shard_attestation`
Change it to `is_on_time_attestation` so that it could be reused in
`validate_attestation`.
2020-05-28 21:49:36 +08:00
Hsiao-Wei Wang ca48963032
Rename `head_shard_root` to `shard_head_root` 2020-05-28 21:38:11 +08:00
Hsiao-Wei Wang c437578280
Add `shard` field to `ShardBlock` 2020-05-28 21:32:27 +08:00
Alex Stokes 75633cfcf1
Update link so gossipsub encodings match the correct section 2020-05-26 11:00:02 -07:00
Danny Ryan 8eb1d2e940
Merge pull request #1844 from ericsson49/ericsson49/fix_shard_state_transition
`compute_shard_transition_digest` expects `Root` as a fourth parameter
2020-05-26 10:17:55 -06:00
Danny Ryan 753a25e5db
Merge pull request #1843 from terencechain/patch-99
Use `compute_previous_slot` for `slot - 1` occurrences
2020-05-26 10:02:14 -06:00
Ali Atiia 75787d92a8
broken link
broken link to custory-game.md
2020-05-25 16:45:44 -04:00
ericsson d3c26d6b8b `compute_shard_transition_digest` expects `Root` as a fourth parameter 2020-05-25 18:45:38 +03:00
terence tsao ce1d22d71c
Use helper `compute_previous_slot` 2020-05-23 15:22:49 -07:00
Jacek Sieka 56309342c0
Use `Bytes32` for `error_message`
`ErrorMessage.error_message` is a leftover from an older version of SSZ
that was able to encode unbounded lists. This is no longer the case -
all collection types now have a fixed upper bound on length.

In general, the `error_message`, just like the `graffitti` field, should
not be interpreted in any particular way except for debugging and vanity
- as such, using the same type, a `Bytes32`, seems reasonable.

An alternative would be `List[byte, 256]` which maybe could be
"reasonably backwards compatible" with whatever clients are are doing
now - depending on how they are dealing with this field type that no
longer exists in the SSZ spec :) It would however be the only place
where `List[uintN, N]` is used in the current spec.

As an exercise, this could be considered a security issue since it's
essentially unbounded and undefined behaviour.
2020-05-21 15:33:47 +02:00
Danny Ryan 96f785e84b
ensure only forward progress with eth1data voting 2020-05-20 13:56:43 -06:00
Danny Ryan aa6352608e
Merge pull request #1835 from ethereum/strict-block-range
Strict block range (Rebase and extend #1827)
2020-05-20 13:00:29 -06:00
protolambda 522e34efcf
Fix markdown, use multiple lines for change-control, and add step >= 1 case 2020-05-20 20:46:08 +02:00
Danny Ryan a6d4566f51
Merge pull request #1834 from ethereum/clarify-genesis-safety
clarify that eth1 block follow distance for genesis
2020-05-20 12:44:29 -06:00
protolambda 59a43142c2
Rebased on latest BlocksByRange spec, fix conflicts, clarify single chain, even with higher step 2020-05-20 20:39:52 +02:00
Jacek Sieka a29cbebc0e
cover `step` parameter in stricter range request 2020-05-20 20:29:43 +02:00
Jacek Sieka 607e23949c
require blocks to be ordered consecutively in block range request
Per the spec, if I request range 5-10, it is permissible for a client to
answer with block 7, 9 - even if the blocks 5, 6 and 8 exist.

Because blocks 7 and 9 cannot be validated as they arrive in such a
request, it seems better to close this gap - this update adds the spec
language that forbids well-behaving clients from answering this way.
2020-05-20 20:29:37 +02:00
Danny Ryan 4ac2fc7eff
add missing column description fo SECONDS_PER_ETH1_BLOCK
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
2020-05-20 12:28:08 -06:00
Danny Ryan c9f21f1f43
clarify that eth1 blocks must be at a safe fllow distance before being considered for genesis 2020-05-20 10:44:08 -06:00
Danny Ryan 943e51aef1
hww feedback for finality rewards fix 2020-05-20 10:12:57 -06:00
Danny Ryan 95c3295eeb
move proposer negation to inactivity_penalty deltas 2020-05-19 17:17:20 -06:00
Danny Ryan 85e78223dd
ensure when performing optimally that you don't lose money during a leak 2020-05-19 16:51:46 -06:00
Hsiao-Wei Wang cd91380d80
PR feedback from proto: set `length` back to `int` 2020-05-20 03:05:03 +08:00
Hsiao-Wei Wang 8f70453aef
PR feedback from Proto 2020-05-20 03:04:52 +08:00
Hsiao-Wei Wang 9f340d5fd1
(i) Fix leftover (ii) `SHARD_COMMITTEE_PERIOD` should be uint64 2020-05-20 03:04:41 +08:00
Hsiao-Wei Wang 88d7315739
Fix typing 2020-05-20 03:04:29 +08:00
Hsiao-Wei Wang 2bf020d49d
Apply strict uint64 casting 2020-05-20 03:04:15 +08:00
Danny Ryan fdc7e846df
remove incorrect table format 2020-05-19 10:37:42 -06:00
Danny Ryan 724139a1f8
change gossipsub protocol ID to /meshsub/1.1.0 2020-05-19 10:23:12 -06:00
Danny Ryan 095b87c2a2
Merge branch 'dev' into v012x 2020-05-19 10:02:18 -06:00
Danny Ryan de03ebb143
many custody game formatting cleanups 2020-05-19 09:58:33 -06:00
Danny Ryan 78947548e6
add process_challenge_deadlines to process_epoch 2020-05-19 08:31:01 -06:00
Danny Ryan 1623086088
make get_validator_from_deposit for better code reuse across phase 0 and 1 2020-05-19 08:14:04 -06:00
Danny Ryan 7fc9dbf297
clarify comment for ShardTransition.shard_data_roots 2020-05-19 07:52:26 -06:00
Danny Ryan 3f0e58a8ed
add chunk challenge and response to block and operations 2020-05-19 07:50:05 -06:00
Danny Ryan 3851a26a0f
add phase 1 custody objects to custody-game.md 2020-05-19 07:34:06 -06:00
Danny Ryan 665538253a
Merge pull request #1807 from ericsson49/ericcson49/fix_is_valid_fraud_proof
is_valid_fraud_proof bug fixes
2020-05-18 13:37:13 -06:00
Danny Ryan c5367295c3
Merge branch 'dev' into v012x 2020-05-18 13:32:24 -06:00
Danny Ryan b7cfa94cb4
Merge branch 'dev' into v0113-dev-merge 2020-05-18 13:22:16 -06:00
Danny Ryan 6f685a97e2
Merge branch 'dev' into v012x 2020-05-18 09:29:47 -06:00
Danny Ryan 7daa6c0039
Merge pull request #1810 from terencechain/patch-97
Make obvious that  `source_epoch` does not underflow
2020-05-18 08:12:50 -06:00
Danny Ryan 4a86c39712
Merge pull request #1799 from ethereum/bls_v2
Update to IETF BLS draft-irtf-cfrg-bls-signature-02 + draft-irtf-cfrg-hash-to-curve-07
2020-05-18 07:35:49 -06:00
Danny Ryan 74c900f814
add conditoin that block must be later than latest_block_header 2020-05-15 16:43:53 -06:00
terence tsao 6f5cbe6182
Update shard-transition.md 2020-05-14 14:55:29 -07:00
Danny Ryan 96ab76dcb2
Merge pull request #1804 from ethereum/use-all-attnets
[for discussion] Use all attestation subnets in phase 0
2020-05-14 14:29:05 -06:00
Danny Ryan 483f9a1d7b
Update specs/phase0/p2p-interface.md
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
2020-05-14 14:25:32 -06:00
Hsiao-Wei Wang ab3cbdae75
Add a note of `len(attestations) > 0` 2020-05-15 04:05:51 +08:00
Danny Ryan 3dd168335b
reformat compute_subnet_for_attestation to not use for loop 2020-05-14 13:50:29 -06:00
Danny Ryan 689a6955b0
Merge pull request #1812 from ethereum/no_signature
Handle phase 1 `PKs == []` cases
2020-05-14 11:15:06 -06:00
Hsiao-Wei Wang f0c4623871
Apply PR feedback: add docstring 2020-05-15 01:05:32 +08:00
Danny Ryan c91e017b1f
Merge pull request #1801 from ethereum/non-aggregator-att
Loosen restrictions for aggregate propogation
2020-05-14 11:01:32 -06:00
Hsiao-Wei Wang 6a3241be61
Remove leading space
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-05-15 00:48:53 +08:00
Hsiao-Wei Wang aa436d91b2
Use NO_SIGNATURE (0x00...) approach 2020-05-14 22:25:55 +08:00
Hsiao-Wei Wang 183b197888
Update specs/phase1/beacon-chain.md 2020-05-14 21:25:36 +08:00
terence tsao 23e2b83e20
Update specs/phase1/beacon-chain.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-05-14 06:21:44 -07:00
terence tsao f3448e51dd
Update specs/phase1/beacon-chain.md
Co-authored-by: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-05-14 06:21:36 -07:00
terence tsao aef564733a
Update beacon-chain.md 2020-05-13 10:56:52 -07:00
protolambda 68442c2eef
Update testing and restrict to incremental block transitions 2020-05-13 16:46:28 +02:00
ericsson b41410eade lint problem fixed 2020-05-13 16:25:16 +03:00
ericsson 4431e399b1 Fix bugs:
- `range(len(col))`` instead of `range(col)`
- `beacon_parent_block.body.shard_transitions` instead of `beacon_parent_block.shard_transitions`
- `shard_states[len(shard_states)-1]` instead of `shard_states[-1]`
2020-05-13 16:13:33 +03:00
Hsiao-Wei Wang 4a246ba5ac
Apply feedback from Danny, add a note of the hash to curve configuration 2020-05-13 13:01:08 +08:00
Hsiao-Wei Wang 3c11a4dc02
Fix `AggregateVerify` param name: `message` -> `messages`
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2020-05-13 12:56:50 +08:00
Hsiao-Wei Wang 2718dcc4ab
Update IETF standard description 2020-05-13 02:34:10 +08:00
Danny Ryan 511f803496
use all attnets across the epoch even when not max committees per slot 2020-05-11 12:52:52 -06:00
Danny Ryan ef18010778
Merge pull request #1800 from ethereum/reqresp-sizes
Update p2p reqresp with explicit handling of reqresp size bounds
2020-05-11 11:48:31 -06:00
Danny Ryan ca1876e12f
Merge pull request #1795 from ethereum/clarify-blocks-request
Clarify BlocksByRange request
2020-05-11 11:39:10 -06:00
Danny Ryan 30ecd9b602
p2p PR feedback 2020-05-11 11:22:34 -06:00
Danny Ryan 17f656cefe
Merge branch 'dev' into v012x 2020-05-11 10:41:35 -06:00
protolambda fcf003859d
remove duplicate response diagram 2020-05-11 17:01:18 +02:00
Danny Ryan b4bc2038e1
clarify that clients MAY stop block requests if fork choice changes 2020-05-11 08:39:30 -06:00
Danny Ryan 7d4d3e43ef
remove aggregate clarifiyng text that is not longer valid
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
2020-05-11 08:38:22 -06:00
Paul Hauner b3dd99f4f4
Loosen restrictions for aggregate propogation 2020-05-11 08:28:21 -06:00
Danny Ryan 3fb4c43fae
Merge pull request #1794 from ethereum/2x-attester-slashings
MAX_ATTESTER_SLASHINGS == 2 and add multiple slashings per block tests
2020-05-11 08:12:23 -06:00
protolambda a8e3fe7551
Update p2p reqresp with explicit handling of reqresp size bounds 2020-05-09 21:44:28 +02:00
Hsiao-Wei Wang cdd0ed0f7b
Update to IETF BLS draft-irtf-cfrg-bls-signature-02 2020-05-09 11:48:48 +08:00
Danny Ryan fdcc6d65bc
gossipsub v1.1 and extended validators for gossip conditions 2020-05-08 12:00:05 -06:00
Danny Ryan 01eaf6cc99
Clarify the response of BlocksByRange to address #1765 2020-05-08 11:09:12 -06:00
Danny Ryan 7a130606ac
hww feedback 2020-05-08 10:51:41 -06:00
Danny Ryan 1137e0332d
move MAX_ATTESTER_SLASHINGS to 2, add multiple slashings per block tests 2020-05-08 10:43:11 -06:00
Danny Ryan 08652f543b
Merge branch 'v012x' into empty-bits-case 2020-05-07 10:17:26 -06:00
Danny Ryan 7625728fb8
Merge pull request #1742 from ethereum/ffg_lmd_vote_consistency
Added FFG-LMD vote consistency checks
2020-05-07 09:36:52 -06:00
Danny Ryan 4f401133e1
address PR feedback from @protolambda 2020-05-05 15:37:14 -06:00
Danny Ryan b71a0ee6b9
Merge branch 'v012x' into ffg_lmd_vote_consistency 2020-05-05 13:40:27 -06:00
Danny Ryan 38f29ba0a8
remove PERSISTENT_COMMITTEE_PERIOD in favor of SHARD_COMMITTEE_PERIOD 2020-05-05 11:44:53 -06:00
Danny Ryan b2c36112f6
Merge branch 'dev' into v012x 2020-05-05 09:44:27 -06:00
Hsiao-Wei Wang 79b1b4bdbe
Add `(shard, shard_root)` to `LatestMessage` 2020-05-05 21:42:18 +08:00
Hsiao-Wei Wang fca1bbccb9
Remove `get_filtered_shard_block_tree` 2020-05-05 21:42:13 +08:00
Hsiao-Wei Wang 8fafb6a9e5
Make `ShardStore` an independent object 2020-05-05 21:42:06 +08:00
Hsiao-Wei Wang cddf9cf114
Refactor 2020-05-05 21:42:00 +08:00
Hsiao-Wei Wang dab5a936c4
wip shard fork choice rule 2020-05-05 21:41:46 +08:00
Hsiao-Wei Wang ee4c866575
Merge branch 'dev' into dankrad-custody-256bit-merging 2020-05-05 15:22:36 +08:00
Danny Ryan 3f250f7dd3
PR feedback 2020-05-04 21:05:10 -06:00
Danny Ryan a7354bd358
Merge branch 'dev' into rewards-rework 2020-05-04 13:34:35 -06:00
Danny Ryan 71dc744f42
Merge pull request #1703 from ethereum/hwwhww/signed_pattern
Rework shard block and fraud proof (shard state transition) spec
2020-05-04 10:39:47 -06:00
Hsiao-Wei Wang 7a770186b5
Reorg beacon-chain spec a bit 2020-05-02 02:32:37 +08:00
Hsiao-Wei Wang 4558c7db4e
Reorg the file structure 2020-05-02 02:32:37 +08:00
Hsiao-Wei Wang b43e24acb6
specs/phase1/fraud-proofs.md -> specs/phase1/shard-transition.md 2020-05-02 02:32:37 +08:00
Hsiao-Wei Wang ff85025113
PR feedback from terence 2020-05-02 02:32:37 +08:00
Hsiao-Wei Wang e758fb76c2
Check `head_shard_root` of all `transition_attestations` 2020-05-02 02:32:36 +08:00
Hsiao-Wei Wang 524ba166d1
[squashed] shard chain updates wip
Fix wrong field names

Fix `build_attestation_data` and other PR feedback from Danny and
Terence

1. Rename `get_previous_slot` to `compute_previous_slot`
2. Break down `build_empty_block` into
`get_state_and_beacon_parent_root_at_slot`, use it in
`build_shard_block`
3. Set defult `slot` to `shard_state.slot + 1` in `build_shard_block`

Update `verify_shard_block_message`: check beacon_parent_root at fork
choice rule stage instead of state transition

Fix  `beacon-chain.md`

1. Fix typo `attestation.slot == state.slot` -> `attestation.data.slot == state.slot` in `is_winning_attestation`
2. Check `verify_shard_transition_false_positives` **after** `process_operations`
3. Fix `shard_attestations` filter in `process_crosslinks`: since attestations come from block, should use `attestation.data.slot + MIN_ATTESTATION_INCLUSION_DELAY == state.slot`
4. [TBD] Allow empty `light_client_signature` to make the tests pass
5. [TBD] Add `is_shard_attestation`, filter out empty `ShardTransition()`

Rework `test_process_crosslink`

Add basic phase 1 `test_blocks`

Add more test cases

Revert `is_shard_attestation` and fix test cases backward compatibility.

Remove `test_process_beacon_block_no_shard_transition` and consider it as invalid case.
2020-05-02 02:32:31 +08:00
Hsiao-Wei Wang c8a473ba24
Apply suggestions from code review
Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>
2020-05-02 02:32:30 +08:00
Hsiao-Wei Wang 40483b587b
[squashed] shard chain updates wip
Use `ShardBlock` in `shard_state_transition`

PR feedback

1. Rename `ShardState.data` -> `ShardState.transition_digest`
2. Rename `compute_shard_transition_data` to `compute_shard_transition_digest`
3. Add `assert state.slot > PHASE_1_GENESIS_SLOT` just in case, may move it later

Add `get_post_shard_state` as a pure function wrapper
2020-05-02 02:32:24 +08:00
Hsiao-Wei Wang 85d5a9abaf
[squashed] shard chain updates wip
PR feedback from Danny and some refactor

1. Add stub `PHASE_1_GENESIS_SLOT`
2. Rename `get_updated_gasprice`  to `compute_updated_gasprice`
3. Rename `compute_shard_data_roots` to `compute_shard_body_roots`

Apply shard transition for the skipped slots

Refactor `shard_state_transition`

Get `beacon_parent_root` from offset slot

Add more test

Add `verify_shard_block_message`

Add `> 0`

Keep `beacon_parent_block` unchanged in `is_valid_fraud_proof`

Remove some lines

Fix type

Refactor + simplify skipped slot processing
2020-05-02 02:31:54 +08:00
Hsiao-Wei Wang 9724cb832d
Apply suggestions from code review from @djrtwo
Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>
2020-05-02 02:31:53 +08:00
Hsiao-Wei Wang afa12caf1f
Refactor `get_shard_state_transition_result` 2020-05-02 02:31:53 +08:00
Hsiao-Wei Wang 4e8a7ff115
[squashed] shard transition wip
Fix the wrong `get_shard_proposer_index` parameters order

Phase 1 WIP

Add shard transition basic test

Fix lint error

Fix
2020-05-02 02:31:10 +08:00
Hsiao-Wei Wang 849d3f83bf
Apply @terencechain 's review feedback
Co-Authored-By: terence tsao <terence@prysmaticlabs.com>
2020-05-02 02:31:09 +08:00
Hsiao-Wei Wang 247a6c8fca
Add `verify_fraud_proof` function 2020-05-02 02:31:09 +08:00
Hsiao-Wei Wang be50020bf8
Refactor `get_light_client_committee` to similar to
`get_shard_committee`
2020-05-02 02:31:08 +08:00
Hsiao-Wei Wang 5f69afea38
Make `shard_state_transition` more like beacon state_transition function 2020-05-02 02:31:08 +08:00
Hsiao-Wei Wang e9f1e4186d
Add `proposer_index` to shard block 2020-05-02 02:31:08 +08:00
Hsiao-Wei Wang feb27a14be
beacon-chain.md: Replace block wrapper with signable pattern 2020-05-02 02:31:08 +08:00
Danny Ryan c2c27791c5
Merge branch 'dev' into rewards-rework 2020-05-01 10:52:19 -06:00
protolambda 09cae4b3cc
Handle empty-aggregation-bits case, and add tests. See #1713 2020-05-01 15:17:41 +02:00
Dankrad Feist 964bf42335
Fix type 2020-05-01 00:32:02 +01:00
Dankrad Feist d30f11a781
Fix lint 2020-05-01 00:16:00 +01:00
Dankrad Feist d58d7627b7
Fix toc 2020-04-30 19:25:18 +01:00
Danny Ryan 4b4fc32f9c
Merge pull request #1755 from paulhauner/patch-23
Fork choice: Remove redundant check in validate_on_attestation
2020-04-30 11:06:29 -06:00
Paul Hauner 2dc5156651
Add message about delaying consideration 2020-04-30 16:27:02 +10:00
Danny Ryan 6a40f71a31
add note about beacon committees not going into attnets 2020-04-29 20:29:48 -06:00
Danny Ryan cd27e5e045
add tests for source, target, head 2020-04-29 10:23:12 -06:00
Danny Ryan 5f18dd778c
add baseline get_target_deltas tests 2020-04-28 19:26:14 -06:00
Danny Ryan 4a086fba5c
Merge branch 'dev' into rewards-rework 2020-04-28 17:24:45 -06:00
Dankrad Feist 0e2931b9b3
All tests passed 2020-04-28 01:09:20 +01:00
Danny Ryan 87586837c3
remove interop from phase 0 p2p specs 2020-04-27 17:39:39 -06:00
Danny Ryan d128400da5
remove interop from header and gossip sections in network spec 2020-04-27 17:39:31 -06:00
Danny Ryan 553a33cd2d
Merge pull request #1766 from ethereum/dev
backport dev to v012x
2020-04-27 17:35:28 -06:00
Diederik Loerakker 9d39c292e0
Merge pull request #1763 from ethereum/master
Backport v0.11.2 hotfixes from master to dev
2020-04-28 00:18:52 +02:00
Danny Ryan dae623b097
Merge pull request #1756 from byz-f/q9-genesis-eth1
genesis: clarify that eth1 timestamp can be less than min genesis time
2020-04-27 10:15:18 -06:00
Dankrad Feist 2449db1bb6
Phase 1 block tests are working 2020-04-27 16:08:49 +01:00
Hsiao-Wei Wang 2dbc333270
Make `compute_new_state_root` a pure function 2020-04-27 22:18:43 +08:00
Hsiao-Wei Wang 4d980aec71
Fix validator guide
1. Avoid negative computation in `is_candidate_block`
2. Fix `get_block_signature`: avoid extra casting; it's simpler to use BeaconBlock instead of
BeaconHeader
2020-04-27 21:47:24 +08:00
Raw Pong Ghmoa c841aa102b
genesis: clarify that eth1 timestamp can be less than min genesis time 2020-04-26 10:09:22 +02:00
Paul Hauner 1a81c873af
Remove redundant check in fork choice 2020-04-26 16:24:16 +10:00
Aditya Asgaonkar 9acea51938 Simplified by re-using get_ancestor() 2020-04-25 14:17:28 -07:00
protolambda 0c67aaa68e
Include fork digest in example gossip topic name 2020-04-25 00:05:37 +02:00
Danny Ryan fde9b410f0
Merge pull request #1752 from ethereum/dev
sync v0.11.2 to `v012x`
2020-04-24 11:36:17 -06:00
Dankrad Feist ab2ee0e2c2
Restoring chunk challenges and testing 2020-04-24 17:06:27 +01:00
Paul Hauner bf806b9efa
Require "seen" aggregates to be valid 2020-04-24 15:01:18 +10:00
Danny Ryan 7612667bbe
minor feedback and fixes on rewards/penalites proposal
Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
2020-04-23 11:13:09 -06:00
Danny Ryan fe13bab338
rework rewards/penalties to be more granular 2020-04-23 10:26:34 -06:00
Danny Ryan 11d164748c
add 'valid' when de-deduplication of attestations on gossip subnets 2020-04-22 14:45:01 -06:00
Danny Ryan d8662d49ea
Merge pull request #1730 from ethereum/bootnode-enr
add note about distributing bootnode ENRs prior to genesis
2020-04-22 14:38:38 -06:00
Danny Ryan 3d4122a2f6
add note about distributing bootnode ENRs prior to genesis 2020-04-22 14:33:57 -06:00
Aditya Asgaonkar 9bbac0d2cc Added consistency check for FFG & LMD vote in validate_on_atttestation(), fixes #1636, fixes #1456, fixes #1408 2020-04-21 23:56:44 -07:00
Justin 5929aac799
Cosmetic changes from #1737 2020-04-22 11:40:10 +08:00
Danny Ryan a6b2679cb0
Merge pull request #1739 from ethereum/JustinDrake-patch-4
Partial fix for #1701
2020-04-21 08:44:22 -06:00
Justin 3436021e72
Update beacon-chain.md 2020-04-21 15:34:55 +01:00
Danny Ryan ebf888bcf7
Merge pull request #1736 from status-im/rannge-req
simplify block range request description
2020-04-21 08:21:57 -06:00
Justin e2a320ef32
Partial fix for #1701
Clarify that state transitions with `uint64` overflows are invalid.
2020-04-21 08:59:53 +01:00
Justin 508811d641
Fix #1735—remove redundant check
As per #1735 the check `if not len(indices) <= MAX_VALIDATORS_PER_COMMITTEE: return False` is redundant. As such this PR should be purely cosmetic.
2020-04-21 08:50:42 +01:00
Jacek Sieka 4915014a19
simplify block range request description
There's room for ambiguity as to what `count` means - this clarifies
that it always relates to the slot, and not the number of blocks in the
response which allows clients to request ranges epoch by epoch (for
example) without worrying about overlaps caused by empty slots.
2020-04-20 20:03:15 +02:00
Hsiao-Wei Wang 6fdee75475
Fix phase0 types 2020-04-17 23:55:25 +08:00
Danny Ryan e58cfedb68
clarify ssz_snappy for gossip 2020-04-16 11:12:24 -06:00
Danny Ryan 4a94200c0b
Merge pull request #1712 from ethereum/hwwhww/inactivity_penalty_quotient_bug
Fix `INACTIVITY_PENALTY_QUOTIENT`
2020-04-14 11:53:43 -06:00
Hsiao-Wei Wang b2f6325db3
Fix `compute_committee` 2020-04-09 17:50:23 +08:00
Hsiao-Wei Wang 890c27d091
The input parameter `index` in `compute_shuffled_index` is the position of the given list, not `ValidatorIndex` 2020-04-09 17:33:14 +08:00
Hsiao-Wei Wang c10e59bdf7
Fix `INACTIVITY_PENALTY_QUOTIENT`
The amount of inactivity penalty was adjusted to half since we were applying penalty for missing FFG target and source. But now we only apply it for missing target, so `INACTIVITY_PENALTY_QUOTIENT` should be `2**24`.
2020-04-08 10:32:16 +08:00
Danny Ryan 2a36f366ef
Merge pull request #1710 from paulhauner/patch-20
Tighten aggregate attn propogation condition
2020-04-07 18:56:04 -06:00
Danny Ryan 26492651b6
Merge pull request #1706 from paulhauner/patch-19
Redefine attestation propogation condition
2020-04-07 18:55:41 -06:00
Paul Hauner c96a3366fa
Tighten aggregate attn propogation condition 2020-04-07 16:07:41 +10:00
Paul Hauner 616385a094
Fix spelling mistake 2020-04-07 07:45:15 +10:00
Paul Hauner 021cb98dbb
Use epoch for attestation subnet seen-ness. 2020-04-07 07:05:51 +10:00
Danny Ryan bdf087d7f3
add notes about how to handle peer discovery and gossip topics prior to genesis 2020-04-06 09:57:23 -06:00
Paul Hauner 7d4b97240b
Redefine attestation propogation condition 2020-04-06 17:46:33 +10:00
Dankrad Feist 907c56dabd
Fix ToC 2020-04-05 15:47:59 +01:00
Dankrad Feist c3c24b4fc4
Fix lint 2020-04-05 15:35:11 +01:00
Dankrad Feist bf34fdf023
Fix ToC 2020-04-05 15:10:09 +01:00
Dankrad Feist ca6af0c2e9
256-bit custody atoms for better alignment with rest of the spec and greater efficiency 2020-04-05 14:39:00 +01:00
Danny Ryan f135eff021
add lookahed for shard subnets for beacon committee in validator guide 2020-04-03 13:23:38 -06:00
Danny Ryan e86c5ef41d
final PR nitpicks 2020-04-03 10:29:35 -06:00
Danny Ryan c3e5ddaabc
Merge branch 'dev' into phase1-tests 2020-04-03 09:54:34 -06:00
Danny Ryan 246b46771e
address @hwwhww feedback 2020-04-03 09:46:57 -06:00
Danny Ryan f2c2da95ed
add compute_offset_slots 2020-04-03 09:19:56 -06:00
Danny Ryan d61b2991a0
fix lint 2020-04-02 16:58:39 -06:00
Danny Ryan 6067c511c5
add light client to phase 1 validator 2020-04-02 16:48:02 -06:00
Danny Ryan d789f3d32d
getting phase 1 val guide in place 2020-04-02 15:09:45 -06:00
Danny Ryan 613f368c00
fix call to get_beacon_committee in process_crosslink_for_shard 2020-04-01 12:20:32 -06:00
Danny Ryan 16208790a5
Merge pull request #1699 from ethereum/hwwhww/unpack_compact_validator
Add `unpack_compact_validator` back
2020-03-31 10:40:45 -06:00
Hsiao-Wei Wang f82cdb7e68
beacon-chain.md: add `unpack_compact_validator` for `light-client-sync.md` 2020-03-31 22:13:48 +08:00
Hsiao-Wei Wang 071f6b5126
Gasprice rework: use `MIN_GASPRICE` as the initial gasprice and change `MIN_GASPRICE` to 8 gwei 2020-03-31 22:09:20 +08:00
Paul Hauner 2daa26442b
Tighten restriction on a "seen" attestation
Declares that only a verified block can stop an attestation from being propagated.

This achieves two things:

1. Ensures that clients don't need to scan invalid blocks for attestations and then modify their state based upon them.
1. Disallows "muting" attestations by sending around a junk block with that attestation in it.
2020-03-30 10:44:46 +11:00
Danny Ryan 073f78efa1
Merge branch 'dev' into phase1-tests 2020-03-29 17:04:25 -06:00