Commit Graph

4824 Commits

Author SHA1 Message Date
lsankar4033 df6a834889 Add TERMINAL_BLOCK_HASH override 2021-09-22 11:18:41 -07:00
Mikhail Kalinin f4bd37a108 Fix spelling 2 2021-09-22 23:58:04 +06:00
Mikhail Kalinin 38a4fd907e
Fix spelling
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2021-09-22 23:56:10 +06:00
Mikhail Kalinin 24bacafeee Update consensus_validated description 2021-09-22 23:52:15 +06:00
Anton Nashatyrev df01588464 Return back `proposer_index` validation for Gossip messages 2021-09-22 18:40:10 +03:00
Mikhail Kalinin 06107ce7d8 Polish the description of execution engine functions 2021-09-22 18:29:58 +06:00
Mikhail Kalinin 8cecf405cb Merge branch 'dev' into execution-engine-update 2021-09-22 17:47:02 +06:00
Mikhail Kalinin 18bfe3555f
Apply suggestions from code review
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-09-22 17:45:26 +06:00
Anton Nashatyrev b292f0b7b3 Remove beacon_block_root field from ShardBlob 2021-09-21 18:04:39 +03:00
Danny Ryan e2af59c8cd ensure random is validated for all payloads including transition 2021-09-20 23:18:39 +06:00
Mikhail Kalinin cb9e65ab85 Bring on extra_data field 2021-09-20 23:18:39 +06:00
Mikhail Kalinin b530e01761 Update calls to execution_engine 2021-09-20 20:57:45 +06:00
Mikhail Kalinin 9ca8c592c5 Add TBD for TTD and add the value to the configs 2021-09-18 12:39:54 +06:00
Mikhail Kalinin a48ea83ab8 Fix toc 2021-09-17 16:54:06 +06:00
Mikhail Kalinin d0889b9001 Hardcode terminal total difficulty 2021-09-17 16:20:25 +06:00
Mikhail Kalinin df657f7c93 Merge branch 'dev' into set-random-to-prev-randao-mix 2021-09-17 14:41:43 +06:00
Mikhail Kalinin 6f78e6a3ee Remove randao_reveal from validator.md 2021-09-16 11:28:04 +06:00
Danny Ryan c396ee1e3f
Merge pull request #2595 from mkalinin/terminal-pow-block-verification
Verify terminal PoW block after call to state_transition
2021-09-15 17:11:27 -06:00
Alex Stokes 899bde0873
Rename client_settings.md to client-settings.md 2021-09-13 06:31:11 -07:00
Mikhail Kalinin 960a49afc9 Verify terminal PoW block after call to state_transition 2021-09-10 16:07:26 +06:00
lsankar4033 879a60a169 Run doctoc 2021-09-09 08:45:21 -07:00
Lakshman Sankar 83471fe461
Apply suggestions from code review
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-09-09 08:38:33 -07:00
Lakshman Sankar 252f4ea14a
Wording change
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-09-09 08:37:39 -07:00
Lakshman Sankar 771933d1a7
Stronger language around usage of the setting
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-09-09 08:37:27 -07:00
Lakshman Sankar 385ee12ef0
'should' -> 'must'
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-09-09 08:36:54 -07:00
Lakshman Sankar de1487564a
Wording change
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
2021-09-09 08:36:42 -07:00
Lakshman Sankar 10f4ea4b51
Wording change
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-09-09 08:36:25 -07:00
lsankar4033 a542a07578 Fix links 2021-09-08 13:06:22 -07:00
lsankar4033 0f7d8e5552 Add notes in merge/fork.md 2021-09-08 13:03:05 -07:00
lsankar4033 01fe3cdb08 Add note about default behavior 2021-09-08 12:57:49 -07:00
lsankar4033 49d225bb78 Add new --terminal-total-difficulty-override client_setting 2021-09-08 12:34:33 -07:00
Mikhail Kalinin 02057cb13e Fix spelling 2021-09-01 20:59:16 +06:00
Mikhail Kalinin 6ba1f22404 Set ExecutionPayload.random to the previous randao_mix 2021-09-01 18:42:58 +06:00
Mikhail Kalinin 5a84224d1a Change transition_td to terminal_td in the merge spec 2021-08-30 18:23:25 +06:00
Danny Ryan dfef7fc442
Merge pull request #2565 from ericsson49/ericsson49/fix_typos_in_sharding_2
Fix typos in `sharding/beacon-chain.md`
2021-08-23 12:14:12 -06:00
ericsson 34d42b640d Fix typo in `get_start_shard` 2021-08-23 20:09:41 +03:00
ericsson 33552279bf Fix typos in `get_shard_proposer_index`: `beacon_state` vs `state` 2021-08-23 20:09:01 +03:00
ericsson 96c05adcf8 Fix typing problem: `is_merge_block` accepts `BeaconBlockBody` as a second argument, while `BeaconBlock` is provided 2021-08-23 18:52:09 +03:00
Hsiao-Wei Wang 15a6c48a46
Merge pull request #2518 from ethereum/fix-store-justified-checkpoint
Fix fork choice store checkpoints inconsistency issue
2021-08-23 23:41:11 +08:00
ericsson 43a6beceb6 make doctoc happy 2021-08-23 14:46:06 +03:00
ericsson fe1b9961ff Fix typos in sharding.md 2021-08-23 14:21:38 +03:00
Danny Ryan a3953a10fe
minor format 2021-08-19 10:11:02 -06:00
Hsiao-Wei Wang 206126644f
More fixes 2021-08-19 23:34:54 +08:00
Hsiao-Wei Wang 59d8ee34f9
Update some "1.0" "2.0" wording 2021-08-19 23:24:04 +08:00
Danny Ryan 911a4169fe
spelling
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
2021-08-19 07:59:05 -06:00
Danny Ryan 4c1156d504
rename eth1 and eth2 throughout specs and readme where reasonable 2021-08-18 17:13:24 -06:00
Hsiao-Wei Wang 6ffc735642
Merge branch 'dev' into fix-store-justified-checkpoint 2021-08-17 21:28:42 +08:00
Mikhail Kalinin e3cad13497 Make base_fee_per_gas little-endian 2021-08-16 18:35:11 +06:00
Mikhail Kalinin 301157c027 Change base_fee_per_gas type to Bytes32 2021-08-13 14:21:37 +06:00
Anton Nashatyrev 68db644ae9
Rename DataCommitment.length field to samples_count and fix degree_proof validation 2021-08-11 15:11:37 +02:00
Danny Ryan c404cd144a
Merge pull request #2533 from mkalinin/rebase-with-london
Rebase Merge spec with London
2021-08-10 16:37:32 -06:00
Danny Ryan 08210fe067
Merge pull request #2531 from ethereum/merge-p2p
add base merge p2p spec
2021-08-10 16:29:33 -06:00
Danny Ryan c5b958e9d0
Merge pull request #2486 from ethereum/shard-building
Shard builder <> proposer separation
2021-08-10 16:15:24 -06:00
protolambda da893c123e
update p2p shard blob/header/tx propagation windows 2021-08-10 23:18:59 +02:00
Diederik Loerakker d005fee67d
sharding p2p code review fixes
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-08-10 13:48:26 +02:00
Mikhail Kalinin ef71a4af1d Polishing as per code review 2021-08-10 17:15:07 +06:00
Danny Ryan 600f55ba7f
add basic execution-layer p2p beacon_block validations 2021-08-09 17:50:56 -06:00
Hsiao-Wei Wang 93af122b2d
PR feedback from @ralexstokes and add single pubkey aggregate tests 2021-08-05 12:09:30 +08:00
Hsiao-Wei Wang 56c92136f2
Merge branch 'dev' into altair-bls-tests 2021-08-05 11:18:41 +08:00
protolambda fc3e651817
samples -> samples_length 2021-08-04 23:25:25 +02:00
Hsiao-Wei Wang 43a1617ffa
Ensure that the given PKs are valid PKs + fix typos 2021-08-04 21:25:37 +08:00
Diederik Loerakker 424f838747
Update specs/sharding/beacon-chain.md
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-08-04 12:44:42 +02:00
Hsiao-Wei Wang b262854bb1
Rename the `eth2_*` functions to `eth_` 2021-08-03 21:51:02 +08:00
protolambda 322f072703
sharding: remove outdated comment, timely shard attesters are marked in attestation-processing, no need for epoch processing additions 2021-07-31 13:22:26 +02:00
protolambda 2d17c8c3c4
move back INITIAL_ACTIVE_SHARDS to preset, avoid changing mainnet config 2021-07-30 22:22:43 +02:00
protolambda add5810d71
remove unused pending attestation fields 2021-07-30 22:06:04 +02:00
protolambda ab78339350
fix variable name of summary field 2021-07-30 21:54:55 +02:00
Mikhail Kalinin f1982d4fc3 Replace underflow check with respective comment 2021-07-30 16:18:05 +06:00
Mikhail Kalinin d58ffc7dfc Add genesis settings section 2021-07-30 16:10:33 +06:00
Mikhail Kalinin 5d5a9e392b Rename GAS_LIMIT_DIVISOR to GAS_LIMIT_DENOMINATOR 2021-07-30 12:43:54 +06:00
Mikhail Kalinin c311712bca
Apply suggestions from code review
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2021-07-30 12:36:02 +06:00
protolambda 0daaafbc98
fix union value retrieval, thanks @terencechain 2021-07-28 22:00:23 +02:00
protolambda d47d2f92cc
shard fees: implement review suggestions from @nashatyrev 2021-07-27 14:48:21 +02:00
protolambda 756eb90bfe
consider per-slot sample target adjustment, to avoid racing and ordering problems 2021-07-26 16:27:19 +02:00
Mikhail Kalinin 789e10ea7c Update toc 2021-07-26 20:09:57 +06:00
Mikhail Kalinin 9a1a30c3d4 Rebase Merge spec with London 2021-07-26 19:55:35 +06:00
protolambda 1a966d1e37
work in progress new sharding fee mechanism 2021-07-26 15:26:55 +02:00
Danny Ryan 35df4b2d4f
rephrase context enum for blocks_by requests 2021-07-23 07:54:26 -06:00
protolambda a7f58ef08a
fix comment + handle missing pending headers 2021-07-23 12:56:01 +02:00
protolambda f791fe7d1c
implement review suggestions
Co-authored-by: Anton Nashatyrev <anton.nashatyrev@gmail.com>
2021-07-23 12:56:01 +02:00
protolambda b25afc88fd
update networking spec with aggregate proposer/builder types, update TOCs 2021-07-23 12:56:00 +02:00
protolambda 5034e2d7bc
update shard spec wording + fix shard slashings 2021-07-23 12:56:00 +02:00
protolambda 5726cb9374
aggregate builder and proposer for simplified typing and optimized verification 2021-07-23 12:56:00 +02:00
protolambda 2a105f4581
fix toc 2021-07-23 12:56:00 +02:00
protolambda b3d5858cc9
update data fee payment, todo 2021-07-23 12:55:59 +02:00
protolambda 9e10f58299
update networking spec 2021-07-23 12:55:59 +02:00
protolambda 4b25239617
builders make blobs, proposers make blocks 2021-07-23 12:55:59 +02:00
protolambda bc936768c7
global selection of shard proposers 2021-07-23 12:55:55 +02:00
Anton Nashatyrev 06b8bb1a57
Simplify get_start_shard function 2021-07-23 12:45:03 +02:00
protolambda bf6ad465ce
remove old BeaconState extension 2021-07-22 20:01:50 +02:00
protolambda bb0848b6f6
carry over current and previous_sync_committee in Merge state upgrader, review from @djrtwo 2021-07-22 19:58:10 +02:00
Danny Ryan 3b34f16e5a
add base merge p2p spec 2021-07-22 11:09:36 -06:00
protolambda 17fad2dea2
rebase The Merge onto Altair base functionality 2021-07-22 16:36:41 +02:00
Danny Ryan f7a2a973ac
Update specs/altair/p2p-interface.md
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2021-07-21 15:51:59 -06:00
Danny Ryan 02a9fc460e
require aggregation bits to have at least one participant in sync contributions 2021-07-21 11:10:09 -06:00
Mikhail Kalinin 65f6aa1b33 Replace PyUnion with Optional 2021-07-20 17:37:52 +06:00
Mikhail Kalinin add00ad2e0 Replace get_pow_chain_head with get_pow_block_at_total_difficulty in validator.md 2021-07-17 12:33:06 +06:00
Mikhail Kalinin a4a050e97a Enforce terminal PoW block to be on the cusp 2021-07-16 19:16:32 +06:00
Hsiao-Wei Wang 63ca480ea3
Add condition check in `on_tick` to ensure that `store.justified_checkpoint` is a descendant of `store.finalized_checkpoint` 2021-07-14 20:02:28 +08:00
Danny Ryan 6d0deddbe5
modify target sync committee aggregators to more sound 16 2021-07-12 09:03:43 -06:00
Danny Ryan 8140a789c4
Merge pull request #2509 from terencechain/patch-124
Rename a few instances of `signature` to `message`
2021-07-08 10:09:12 -06:00
Danny Ryan 88bb7562aa
Update specs/altair/beacon-chain.md 2021-07-07 16:11:58 -06:00
terence tsao 6f31077afa
Update `get_next_sync_committee` notes 2021-07-07 10:42:52 -07:00
terence tsao 3a59c1b789
Rename a few instances of signature to message 2021-07-07 10:04:26 -07:00
Justin c8d22b1d91
fix minor cosmetic typo 2021-07-07 13:44:22 +01:00
Danny Ryan 00afb341de
Merge pull request #2479 from mkalinin/randao_in_execution_payload
Add randao to execution payload
2021-06-23 08:30:21 -06:00
Danny Ryan c61eeb8a27
optimize sync committee message gossip and caches 2021-06-22 12:31:02 -06:00
Mikhail Kalinin ac19aa3e2d Accept polishing suggested by Justin 2021-06-22 14:23:26 +06:00
Danny Ryan 8107d0d582
Merge pull request #2485 from nisdas/patch-1
Make The Nature of Validator Sync Committee Assignments Clearer
2021-06-21 16:51:11 -05:00
Danny Ryan fc1012b632
typo 2021-06-21 12:49:41 -06:00
Danny Ryan a61aa7968d
clean up 2021-06-21 12:48:44 -06:00
Mikhail Kalinin 199d6aee58 Merge remote-tracking branch 'origin/dev' into randao_in_execution_payload 2021-06-19 00:28:38 +06:00
Justin 878b15df6a
polish merge/beacon-chain.md (#2472)
Polish `merge/beacon-chain.md` with mostly non-substantive changes.

**Non-substantive changes**

* rename `MAX_EXECUTION_TRANSACTIONS` to `MAX_TRANSACTIONS_PER_PAYLOAD`
	- rename "execution transaction" to just "transaction" as per discussion with Danny
* rename `compute_time_at_slot` to `compute_timestamp_at_slot`
	- the function returns a Unix timestamp
	- "timestamp" matches `execution_payload.timestamp`
* be explicit about `ExecutionEngine.execution_state` for clarity
* rename `ExecutionPayload.number` to `ExecutionPayload.block_number`
	- more specific ("number" is pretty vague)
	- consistent with `ExecutionPayload.block_hash`
* rename `new_block` to `on_payload`
	- the `on_` prefix is consistent with other event handlers (e.g. see `on_tick`, `on_block`, `on_attestation` [here](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/fork-choice.md#handlers))
	- the `_payload` suffix is more to the point given the function accepts an `execution_payload`
	- avoids conflict with `on_block` which is already used in the fork choice
* rework the table of contents for consistency
* order `is_execution_enabled` after `is_transition_completed` and `is_transition_block`
	- `is_execution_enabled` refers to `is_transition_completed` and `is_transition_block`
* rename "transition" to "merge"
	- "transition" is a bit vague—we will have other transitions at future hard forks
	- there is no need for two words to refer to the same concept
* add a bunch of inline comments, e.g. in `process_execution_payload`
* make the `process_execution_payload` signature consistent with the other `process_` functions in `process_block` which take as arguments `state` and `block.body`
* remove `TRANSITION_TOTAL_DIFFICULTY`
	- to be put in `merge/fork-choice.md` where it is used 
* various misc cleanups

**Substantive changes**

* reorder `ExecutionPayload` fields
	- for consistency with yellow paper and Eth1
	- same for `ExecutionPayloadHeader`
	- added comments separating out the execution block header fields from the extra fields (cosmetic)
2021-06-18 11:09:30 +01:00
protolambda dadcb2a06a
Merge branch 'dev' into ericsson49/fix_reset_pending_shard_work 2021-06-17 18:54:29 +02:00
Diederik Loerakker c68ce56407
Merge pull request #2483 from ericsson49/ericsson49/fix_append_in_process_shard_header
Fix typing problem: append is invoked on a ShardWork instance
2021-06-17 18:50:40 +02:00
Mikhail Kalinin 6e86d8a696 Rename randao->random, other fixes as per review 2021-06-17 21:20:17 +06:00
Nishant Das 67f1c2c2bd
Update validator.md 2021-06-17 23:05:23 +08:00
ericsson 22b2a73615 convert `int` to `CommitteeIndex` when passing to `get_beacon_committee` 2021-06-16 19:07:24 +03:00
ericsson 5b4f89875c use `List[PendingShardHeader,...]` instead of `MutableSequence`, since `remerkleable.List` does not implement the latter 2021-06-16 14:06:17 +03:00
ericsson d83ca352d5 Fix typing problem: `append` is invoked on a `ShardWork` instance 2021-06-16 13:33:56 +03:00
ericsson 27889860f0 fix typo: sometimes `change()` invoked on `ShardWork` itself, should be invoked on its `status` field 2021-06-16 12:03:20 +03:00
Mikhail Kalinin cc20b80103 Fix linter, add more test helpers 2021-06-15 14:55:06 +06:00
Mikhail Kalinin 2e87a6b44e Apply review comments 2021-06-11 22:50:11 +06:00
Mikhail Kalinin 7d617bc7c0 Fix timestamp passed to produce_execution_payload 2021-06-11 22:46:24 +06:00
Mikhail Kalinin 95775e1b90 Add randao to execution payload 2021-06-11 16:05:19 +06:00
protolambda 5140b59c57
add missing parenthesis 2021-06-08 21:51:26 +02:00
Diederik Loerakker 8f8b5ab648
Merge pull request #2475 from ralexstokes/discriminate-sync-comm-msg
Add `message.topic` to gossipsub `message-id` in Altair
2021-06-08 21:47:06 +02:00
Alex Stokes a343680fd4
Add implementation note on message id fn 2021-06-08 14:29:08 -05:00
Alex Stokes f60f13964c
Harden topic serialization 2021-06-08 14:15:57 -05:00
Alex Stokes 25a2e3463e
Update specs/altair/p2p-interface.md
Co-authored-by: Diederik Loerakker <proto@protolambda.com>
2021-06-08 12:06:02 -07:00
Alex Stokes d64b4e7d24
Add `message.topic` to gossipsub `message-id` in Altair 2021-06-08 13:44:06 -05:00
Alex Stokes c7980d3cd0
Clarify p2p validation conditions for Altair sync committees 2021-06-08 13:34:16 -05:00
Danny Ryan 5d9d786499
Merge pull request #2462 from mkalinin/merge-transition-with-dynamic-ttd
Merge transition process with computed transition total difficulty
2021-06-08 09:55:10 -06:00
Mikhail Kalinin 5228dc814f Redefine initialize_beacon_state_from_eth1 2021-06-08 18:44:53 +06:00
Mikhail Kalinin 6350e27366 Add difficulty field to PowBlock 2021-06-08 17:56:07 +06:00
Mikhail Kalinin 038edb5b34 Rename SECONDS_SINCE_MERGE_FORK -> TARGET_SECONDS_TO_MERGE 2021-06-08 17:16:52 +06:00
Mikhail Kalinin 3a6a565a8f
Replace fractional division with integer one
Co-authored-by: vbuterin <v@buterin.com>
2021-06-08 15:03:59 +06:00
protolambda 64f217d3e1
update sync aggregate processing reference in validator doc 2021-06-08 01:05:50 +02:00
Danny Ryan cfc66a3794
patch tests 2021-06-07 16:36:18 -06:00
Danny Ryan 09b6fb0e64
ensure consistency about sync committees vs aggregates in naming throughout 2021-06-07 16:17:46 -06:00
Mikhail Kalinin 96334e3ee7 Switch to suggested td computation formula 2021-06-07 22:21:36 +06:00
Danny Ryan 30f2a07637
Merge pull request #2438 from ralexstokes/add-aggregate-pks-fn
Move BLS extensions to new file in Altair
2021-06-07 07:18:31 -06:00
Danny Ryan 335d7ce1dc
Merge pull request #2446 from ethereum/SyncCommitteeSignature-to-SyncCommitteeMessage
Rename `SyncCommitteeSignature` to `SyncCommitteeMessage` to avoid name conflicts
2021-06-07 07:06:14 -06:00
Danny Ryan 1d5c4ecffb
Merge pull request #2453 from ethereum/vbuterin-patch-11
Modify sync committee logic and parameters to reduce variance
2021-06-04 12:23:16 -06:00
Diederik Loerakker 44f6453ce3
Merge pull request #2452 from Nashatyrev/fix/no-committee-for-shard-case
[Sharding] Handle the case when committee count < active shards
2021-06-04 18:19:33 +02:00
Diederik Loerakker f679a0a086
Merge pull request #2455 from ethereum/sharding-state
New union-based shard headers/commitments representation
2021-06-04 18:18:43 +02:00
Anton Nashatyrev 0ae9a85b17 Adopt shard_blob gossip validation on top of PR #2455: here the `compute_committee_index_from_shard` raises an error if no committee assigned to a shard 2021-06-04 18:48:09 +03:00
Anton Nashatyrev 071abfa846 Revert beacon-chain changes as they are handled in PR #2455 2021-06-04 18:44:35 +03:00
Anton Nashatyrev 116c1c0f3a Merge remote-tracking branch 'EF/dev' into fix/no-committee-for-shard-case
# Conflicts:
#	specs/sharding/p2p-interface.md
2021-06-04 18:43:12 +03:00
protolambda 9050897cb2
fix committee work status and commitment references 2021-06-03 19:11:47 +02:00
Diederik Loerakker d4f6459108
Define missing header_root
Co-authored-by: Anton Nashatyrev <Nashatyrev@users.noreply.github.com>
2021-06-03 18:00:51 +02:00
protolambda c0af420130
shard work status enum, prefix instead of suffix + move full committee balance init line 2021-06-03 17:32:35 +02:00
Hsiao-Wei Wang 45d554aee8
Merge branch 'dev' into SyncCommitteeSignature-to-SyncCommitteeMessage 2021-06-03 22:13:53 +08:00
Mikhail Kalinin 7f64757b51 Fix Optional[TransitionStore] issue to satisfy linter 2021-06-03 16:08:56 +06:00
Mikhail Kalinin 6872c01682 Add an extra line between function def 2021-06-03 12:31:59 +06:00
Danny Ryan b3f2635ce7
Merge pull request #2466 from terencechain/patch-123
Altair: missing `block_root` in `SyncCommitteeSignature`
2021-06-02 16:09:13 -06:00
Danny Ryan 45a71eb267
line length lint 2021-06-02 15:58:51 -06:00
terence tsao 65f48178b7
Include block_root in SyncCommitteeSignature 2021-06-02 14:41:24 -07:00
Mikhail Kalinin 6604830729 Apply suggestions after the review 2021-06-02 15:00:01 +06:00
protolambda 417dda8326
fix committee index assertion 2021-06-01 22:38:36 +02:00
Justin d87e076ce3
Minor Altair cosmetic polishing 2021-06-01 17:05:12 +01:00
Hsiao-Wei Wang 65f8d3d296
Merge branch 'dev' into SyncCommitteeSignature-to-SyncCommitteeMessage 2021-06-01 22:05:10 +08:00
Mikhail Kalinin db32c8b013 Fix linter errors 2021-06-01 17:44:58 +06:00
Mikhail Kalinin 6226be9e1e Implement TransitionStore and transition total difficulty computation 2021-06-01 16:28:30 +06:00
protolambda 2545c3e2d0
update pending header weights after epoch transition, fix committee index loop, fix header processing status assert, add todos for Altair-like shard attestation rewards 2021-05-31 18:55:08 +02:00
Diederik Loerakker 5a235d0251
Review suggestions
Co-authored-by: Anton Nashatyrev <Nashatyrev@users.noreply.github.com>
2021-05-31 17:03:06 +02:00
Mikhail Kalinin fd4369dc7c Add merge/fork.md with upgrade_to_merge definition 2021-05-31 19:30:54 +06:00
protolambda bb3d581b13
update shard processing naming and doc structure 2021-05-29 23:55:16 +02:00
protolambda 31f48b7b3b
update sharding presets 2021-05-29 22:39:25 +02:00
protolambda 3665dbea8b
name (slot, shard) union wrapper ShardWork 2021-05-29 21:28:00 +02:00
Diederik Loerakker 482b028b88
Merge pull request #2436 from terencechain/patch-122
Sharding p2p: minor fixes
2021-05-28 22:09:58 +02:00
protolambda 72215412fa
For slow shard confirmation, assuming it is available via DAS, we could confirm the best pending header 2021-05-28 21:56:13 +02:00
protolambda 38a0f4f211
update to wrap the union, clean up initialization and typing 2021-05-28 21:27:05 +02:00
protolambda e5521af1f8
new union-based shard headers/commitments representation 2021-05-28 20:18:29 +02:00
Alex Stokes b0500c3de1
Update specs/altair/beacon-chain.md 2021-05-27 12:06:01 -07:00
Alex Stokes 4d5bc83af4
Re-org files 2021-05-27 11:59:15 -07:00
Alex Stokes 3cd842a94d
Update specs/altair/beacon-chain.md 2021-05-27 11:39:29 -07:00
vbuterin a89ecced1c
Modify sync committee logic and parameters to reduce variance
Sync committee rewards as currently implemented significantly increase variance in proposer rewards: https://github.com/ethereum/eth2.0-specs/issues/2448

For example, if there are 200000 validators (6.4m ETH staked), then during each 1/4-eek (~54 hour) period there is a chance of 512/200000 that a validator will get accepted into the sync committee, so on average that will happen once every 200000/512 * 1/4 = 97.6 eeks, or close to two years. The payout of this "lottery" is 1/8 of that, or ~12.2 eeks (a bit less than four months) of revenue. This is much more severe than block proposing (a chance of 1/200000 per slot, or a lottery worth ~0.38 eeks of revenue once every ~3.05 eeks).

This PR makes three changes to cut make the sync committee lottery less drastic and bring variance closer in line with what is available from block proposing:

* Reduce the `SYNC_REWARD_WEIGHT` from 8 to 2
* Add a penalty for not participating in the sync committee, so that despite the first change the total net reward for participating vs not participating is only cut down by 2x
* Reduce the sync committee period from 1/4 eek to 1/8 eek (~27 hours)

With these three factors combined, the lottery reduces to ~1.5 eeks of revenue, on average occurring every ~48 eeks. Validators who are maximally unlucky (ie. never become part of a sync committee) only lose ~3.12% of their rewards instead of ~12.5%.

The compromises that this approach makes are:

* In the extreme case where >50% of proposers are operating efficiently, being in a sync committee becomes a net burden. However, this should be extremely rare, and in such cases validators would likely be suffering inactivity leak penalties anyway.
* Incentive to participate in a sync committee decreased by 2x (but this is IMO an improvement; sync committees are _not_ as important as proposals and deserve to have lower rewards)
* Minimum data syncing needed to maintain a light client increases by 2x (from 24 kB per 54 hours to 24 kB per 27 hours). A burden for on-chain light clients, but still insignificant for others.
2021-05-27 09:02:51 -06:00
Danny Ryan d50a12cb18
Merge pull request #2449 from ethereum/fix-sharding-comments
add/update comments on shard blob/header/reference body field
2021-05-27 08:06:32 -06:00
Anton Nashatyrev 414ef614cb Handle the case when a shard may not have a committee at slot.
Block is invalid if contains ShardBlobHeader lacking committee
Reject Gossip ShardBlobHeader and ShardBlob messages which lacks committee
2021-05-27 15:13:13 +03:00
Paul Hauner 48f989070d
Remove naughty space 2021-05-27 15:30:44 +10:00
Paul Hauner 103d029a1a
Add clock disparity tolerance for sync subnets 2021-05-27 15:28:51 +10:00
protolambda 1360860d1e
add/update comments on shard blob/header/reference body field 2021-05-27 03:57:59 +02:00
Alex Stokes a08d23189e
Update specs/altair/validator.md
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2021-05-26 15:51:22 -07:00
Hsiao-Wei Wang a25bc832b9
Update section headers 2021-05-26 03:01:38 +08:00
Hsiao-Wei Wang 0142978b60
Rename `SyncCommitteeSignature` to `SyncCommitteeMessage` 2021-05-26 02:36:54 +08:00
Alex Stokes 41ca149429
Explicitly define `bls.AggregatePKs` 2021-05-24 11:56:10 -07:00
terence tsao 71d0d45343
Align table 2021-05-24 06:57:09 -07:00
terence tsao 814c7696d9 shard_blob_header -> shard_header 2021-05-24 06:55:17 -07:00
terence tsao 4a5947d49e Proto's suggestion 2021-05-24 06:54:38 -07:00
terence tsao 96352726bb
Sharding p2p: minor typo fixes 2021-05-22 10:31:10 -07:00
Danny Ryan bca467c926
fmt 2021-05-21 14:36:43 -06:00
Danny Ryan 5bf01c4298
add resourceunavailable error code with more guidance 2021-05-21 14:24:58 -06:00
protolambda e50d8d4391
Merge branch 'dev' into config-rework 2021-05-20 23:31:49 +02:00
protolambda ff021da551
change line formatting, new refence as config var implicitly takes more space 2021-05-19 17:21:30 +02:00
protolambda 291168e1e3
clarify config/preset separation, address review comments by @djrtwo 2021-05-19 17:15:34 +02:00
terence tsao c03c72a543
Altair fork: add a link 2021-05-18 13:50:46 -07:00
Danny Ryan 248363ce21
Merge pull request #2419 from terencechain/patch-120
Fix `PARTICIPATION_FLAG_WEIGHTS` to use correct head weight
2021-05-18 11:27:36 -06:00
ericsson 441992c779 Fix typing problem in `sharding.process_block` 2021-05-18 14:14:43 +03:00
protolambda ef8d6003d3
fix inactivity penalties markdown table 2021-05-18 10:07:35 +02:00
protolambda 2c7a68406f
update config section markdown table header 2021-05-18 09:55:25 +02:00
protolambda e4593d2d0c
update with configs<>presets separation 2021-05-18 09:55:20 +02:00
protolambda c1f1adb4d1
Custody Game constant/preset/config separation 2021-05-18 09:33:07 +02:00
protolambda 4941a97829
Sharding constant/preset/config separation 2021-05-18 09:33:05 +02:00
protolambda 7d59016bb8
Merge constant/preset/config separation 2021-05-18 09:31:07 +02:00
protolambda 7689ebb2bd
Altair constant/preset/config separation 2021-05-18 09:28:09 +02:00
protolambda b9ffd8f640
Phase0 constant/config/preset separation 2021-05-18 09:20:41 +02:00
terence tsao a7344b3ee1
Fix `PARTICIPATION_FLAG_WEIGHTS` to use correct head weight 2021-05-17 21:35:43 -07:00
protolambda fcf37895ba
remove duplicate sharding config var, fix minimal-sharding-config fork epoch name 2021-05-18 00:48:59 +02:00
terence tsao abda2dd5fa
Sharding: move `get_committee_count_per_slot` to the outside 2021-05-14 12:02:46 -07:00
Danny Ryan c87333face
minor review from dankrad on release pr 2021-05-14 10:05:54 -06:00
Danny Ryan 110e6b38ee
remove resourceunavailable for more discussion 2021-05-14 08:07:08 -06:00
Diederik Loerakker 5984fd74b3
Merge pull request #2393 from Nashatyrev/cosmetics/blob-subnet-name
[Sharding] Network: Calculate {subnet_id} for shard_blob_ subnets
2021-05-14 14:49:09 +02:00
Diederik Loerakker a1e64c1ceb
Merge pull request #2368 from Nashatyrev/fix/root-for-empty-shard-header
[Sharding] Calc the right root with respect to (slot, shard) for an empty PendingShardHeader
2021-05-14 14:44:56 +02:00
Danny Ryan 4cd9a6c710
Merge pull request #2385 from ethereum/execution-payload-testing
Execution payload tests
2021-05-14 06:40:40 -06:00
Diederik Loerakker 86792b9232
Merge pull request #2411 from ethereum/order-indices
ensure indices are ordered [source, target, head] everywhere
2021-05-14 14:38:26 +02:00
Danny Ryan 160b704f4a
ensure indices are ordered source, target, head everywhere 2021-05-14 06:19:29 -06:00
Danny Ryan 5dd29b6659
fix tests and minor copy edit 2021-05-14 06:15:48 -06:00
terence tsao 1310105174
Return non-duplicated sync committee subnets 2021-05-13 16:22:28 -07:00
protolambda d3160ba23a
update ExecutionEngine protocol arg references 2021-05-14 01:07:22 +02:00
Danny Ryan d38af7a158
Merge branch 'dev' into vbuterin-patch-11 2021-05-13 13:39:05 -06:00
Danny Ryan 699a3f837e
pr feedback 2021-05-13 13:38:43 -06:00
Danny Ryan a52565aa81
add random altair fork tests for better translation coverage + pr review 2021-05-13 13:21:43 -06:00
Danny Ryan a2c8e0e6c6
Merge branch 'dev' into translate-participation-test 2021-05-13 06:33:06 -06:00
Danny Ryan 4a91c93962
add epoch processing tests for inactivity udpates 2021-05-12 15:06:32 -06:00
Danny Ryan 24f6e1e99f
Merge branch 'dev' into vbuterin-patch-11 2021-05-12 12:42:46 -06:00
Danny Ryan a469b467ff
Merge branch 'dev' into keep-inactivity-function 2021-05-12 12:27:15 -06:00
Danny Ryan 5188671816
Update specs/altair/beacon-chain.md
Co-authored-by: dankrad <dankrad@ethereum.org>
2021-05-12 12:18:35 -06:00
Danny Ryan a0f86d19d3
Merge pull request #2407 from ethereum/ralexstokes-patch-1
Update validator guide with restricted sync committee computation
2021-05-12 12:18:06 -06:00
Danny Ryan 9a0be85b1e
Merge pull request #2406 from ethereum/sync-seed
remove sync committee seed and restrict period calculation boundaries
2021-05-12 12:17:42 -06:00
Alex Stokes 4286f85a68
Update validator guide with restricted sync committee computation 2021-05-12 11:05:41 -07:00
Danny Ryan a8791f04c7
'get_sync_committee -> get_next_sync_committee 2021-05-12 09:44:13 -06:00
Danny Ryan 84830e8f26
Merge pull request #2131 from ethereum/bbr-ws
BlocksByRange under WS
2021-05-12 08:51:16 -06:00
Danny Ryan 1a7aa898ab
Merge branch 'dev' into sync-seed 2021-05-12 08:46:11 -06:00
Danny Ryan dff12dd644
Merge pull request #2400 from ethereum/sync-committee-off-by-1
add logic for handling sync committee off by one issue
2021-05-12 08:45:05 -06:00
Danny Ryan 6371707779
Apply suggestions from code review
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2021-05-12 08:40:34 -06:00
Danny Ryan f52f067b8e
add resourceunavailable error code 2021-05-12 08:36:27 -06:00
Danny Ryan 82b7a7be3b
Apply suggestions from code review
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
Co-authored-by: Jacek Sieka <jacek@status.im>
2021-05-12 08:29:42 -06:00
Hsiao-Wei Wang 8e07ece492
Minor rephrase 2021-05-12 14:11:33 +08:00
protolambda 0390ab819a
Protocols pyspec support + execution payload tests cleanup 2021-05-12 02:40:23 +02:00
Danny Ryan 8bb0531f58
only give counter-weight penalty if leak. TMP 2021-05-11 16:23:31 -06:00
Danny Ryan 09cefa03f3
remov sync signature todo 2021-05-11 16:07:24 -06:00
Danny Ryan 468f42c545
Merge branch 'simplify-sync-committee-calc' into sync-seed 2021-05-11 16:03:19 -06:00
Danny Ryan 200c049778
fix seed calc issue 2021-05-11 15:55:33 -06:00
Danny Ryan 2747882776
use current_Epoch seed when calculating next_sync_committee 2021-05-11 15:18:18 -06:00
Danny Ryan 43ba615b75
Apply suggestions from code review 2021-05-11 14:13:22 -06:00
Alex Stokes 859a7d743e
Only allow sync committee period calculation at period boundaries 2021-05-11 12:42:21 -07:00
Alex Stokes f328f77e65
clarify fork upgrade conditions 2021-05-11 10:58:45 -07:00
Danny Ryan a9cc036184
remove timely_head penalty 2021-05-11 11:48:26 -06:00
Danny Ryan 488ceed4f9
add notes about repeatedly failing tos erve blocks as being disconncetable 2021-05-11 11:29:37 -06:00
Anton Nashatyrev 554f5141d3 Replace the {shard}_{slot} with {subnet_id}. Add {subnet_id} calculation function 2021-05-11 20:16:58 +03:00
Danny Ryan 5792afca46
Merge branch 'dev' into bbr-ws 2021-05-11 09:51:57 -06:00
Danny Ryan e31a2af87b
remove extra if 2021-05-11 08:15:04 -06:00
Danny Ryan b1d0364105
Merge branch 'dev' into vbuterin-patch-11 2021-05-11 08:12:27 -06:00
Danny Ryan 3c609e02ea
pr feedback 2021-05-11 07:28:24 -06:00
Danny Ryan a6b8574962
test 2021-05-10 16:18:42 -06:00
Danny Ryan 85198fabfa
lint 2021-05-10 13:26:43 -06:00
Danny Ryan d8e2d19ecc
spelling 2021-05-10 13:01:31 -06:00
Danny Ryan ff706e5c7a
add logic for handling sync committee off by one issue 2021-05-10 12:57:11 -06:00
Danny Ryan 1494fe6ace
add get_inactivity_penalty_deltas back in 2021-05-10 12:21:49 -06:00
Danny Ryan cd78425570
lint 2021-05-10 10:30:47 -06:00
Danny Ryan 95e2aa6471
Merge branch 'dev' into dankrad-altair-review 2021-05-10 10:23:38 -06:00
Danny Ryan 1564f6217f
Merge pull request #2386 from Nashatyrev/fix/effective-balance-max-deviation
[Sharding] Fix the EFFECTIVE_BALANCE_MAX_DOWNWARD_DEVIATION constant calculation
2021-05-10 10:19:00 -06:00
protolambda f58ba8f5b2
define execution engine protocol 2021-05-10 16:11:12 +02:00
Danny Ryan 71eea1a0f1
Merge pull request #2382 from ethereum/vbuterin-patch-12
Reorganization of config params to put sync committee in one section
2021-05-10 07:48:17 -06:00
Danny Ryan d239b7a59b
Merge pull request #2396 from terencechain/patch-117
Shard fees: `adjustment_quotient` to use `previous_epoch`
2021-05-10 07:44:40 -06:00
Danny Ryan dd9fb06d25
Merge branch 'dev' into vbuterin-patch-12 2021-05-10 07:38:32 -06:00
Danny Ryan 2539d4e11d
Merge pull request #2380 from ethereum/merge-test-vectors
Merge test vectors: enable phase0 tests for Merge + start on new testing
2021-05-10 07:30:21 -06:00
terence tsao e38f758d21
`adjustment_quotient` to use `previous_epoch` 2021-05-09 17:08:54 -07:00
Alex Stokes b336b710e9
Update specs/altair/beacon-chain.md
Co-authored-by: vbuterin <v@buterin.com>
2021-05-07 16:48:16 -07:00
vbuterin d1bedbfbec
Update inactivity penalty deltas processing
Two main changes:

1. Inactivity scores are modified to decrease slowly for inactive validators when we are not in a leak, and quickly for active validators
2. The inactivity penalties are applied even not during a leak (note that inactivity _scores_ decrease when outside of a leak)

This has the effect that the inactivity leak "overshoots" the target of finalizing again, and keeps leaking balances a bit more. For inactive validators, this PR sets post-leak recovery to happen 3x faster than the during-leak increase, so if a validator loses 3% during a leak, if they stay offline they should expect to lose another 1% until their score decreases back to zero.
2021-05-07 11:05:27 -07:00
Alex Stokes 04a9595415
Add notes about sync committee stability 2021-05-07 10:06:44 -07:00
Alex Stokes 86104ea361
Use stable sync committee indices when processing block rewards 2021-05-07 09:55:21 -07:00
Anton Nashatyrev bd376fa649 Fix the table of contents 2021-05-07 17:09:03 +03:00
Anton Nashatyrev 22b7c393cc Include {slot} param to shard_blob_ subnets 2021-05-07 16:52:44 +03:00
dankrad 2fc68c451e
Update specs/altair/beacon-chain.md
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2021-05-06 22:55:55 +01:00
Dankrad Feist ba2c717bf1 Remove PARTICIPATION_FLAGS 2021-05-06 22:55:17 +01:00
Danny Ryan 637cf0743c
Merge pull request #2376 from ralexstokes/adjust-sync-committee-subnet-count
Adjust subnet count to reflect smaller sync committees
2021-05-06 12:51:24 -06:00
Danny Ryan b979ea144a
Merge pull request #2378 from ralexstokes/update-altair-sync-protocol
Updates to Altair light client sync protocol
2021-05-06 12:50:52 -06:00
Danny Ryan 13409dc1bc
Merge branch 'dev' into adjust-sync-comm-params 2021-05-06 12:43:11 -06:00
Danny Ryan 609172d790
Merge pull request #2370 from ralexstokes/simplify-sync-committee-aggregates
Simplify sync committee aggregates
2021-05-06 12:38:49 -06:00
Alex Stokes 4c73fec88e
convert `LightClientStore` to python object instead of SSZ object
this avoids the type overhead of having to define a max size for
the object's data and skips the overhead of serialization/consensus
for a type that does not need it
2021-05-06 10:52:48 -07:00
Dankrad Feist 81a8c2748f Integrate get_inactivity_penalty_deltas into reward computation for better readability 2021-05-06 13:03:26 +01:00
Dankrad Feist cf724daa7a No inactivity penalty for untimely head 2021-05-06 12:42:05 +01:00
Dankrad Feist cbf9f85537 Remove duplicate inactivity leak 2021-05-06 12:28:18 +01:00
Michael Sproul ea6c042918
Altair: carry-over prev epoch participation 2021-05-06 10:55:10 +10:00
protolambda 76b5974d11
is_execution_enabled function + misc review fixes
Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>
2021-05-06 02:23:13 +02:00
Dankrad Feist b041a9b0d6 Further flag_index revert 2021-05-05 22:22:32 +01:00
Dankrad Feist 77524036f5 Revert "Flags to BitVector"
This reverts commit 786e611c71.

# Conflicts:
#	specs/altair/beacon-chain.md
2021-05-05 22:02:37 +01:00
Dankrad Feist 55471bc5d4 Revert "BitVector -> Bitvector"
This reverts commit df6bd1b6c3.
2021-05-05 21:58:03 +01:00
Dankrad Feist 687641a79b Remove extra variable 2021-05-05 21:55:36 +01:00
Dankrad Feist 227d1007e6 Update toc 2021-05-05 20:09:14 +01:00
Dankrad Feist a382cf6d5c Refactor participation flag list 2021-05-05 20:04:06 +01:00
Anton Nashatyrev 2aef63be01 Fix back the EFFECTIVE_BALANCE_MAX_DOWNWARD_DEVIATION constant calculation 2021-05-05 20:17:09 +03:00
Dankrad Feist 238a9b03fc Correct confusing comments in "get_sync_committee_indices" 2021-05-05 18:09:36 +01:00
Alex Stokes a2cf833437
Update specs/altair/beacon-chain.md
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2021-05-05 09:32:28 -07:00
terence tsao ed4b8d5f18
`get_shard_proposer_index` to use `DOMAIN_SHARD_PROPOSER` 2021-05-05 07:40:23 -07:00
protolambda e2be7614cc
introduce merge fork version 2021-05-05 15:35:36 +02:00
Hsiao-Wei Wang ded6d5bad4
Merge pull request #2377 from ralexstokes/altair-whitespace
clean up whitespace on altair files
2021-05-05 20:44:15 +08:00
Hsiao-Wei Wang 6a9b3671f0
Fix the type of `EPOCHS_PER_SYNC_COMMITTEE_PERIOD` and update the config files 2021-05-05 19:53:37 +08:00
Hsiao-Wei Wang d383a14213
Fix ToC 2021-05-05 19:47:26 +08:00
Dankrad Feist df6bd1b6c3 BitVector -> Bitvector 2021-05-05 12:26:37 +01:00
Dankrad Feist 786e611c71 Flags to BitVector 2021-05-05 12:05:32 +01:00
Anton Nashatyrev 3cc1256a72 update_pending_votes: search pending header by header.(root + slot + shard) 2021-05-05 13:31:19 +03:00
Anton Nashatyrev befe4c7db3 Revert "Search winning 'empty' PendingShardHeader index by the empty DataCommitment instead of zero Root"
This reverts commit dca6d337
2021-05-05 13:21:25 +03:00
Anton Nashatyrev ddc59422ba Revert "Calc the right root with respect to (slot, shard) for an empty PendingShardHeader"
This reverts commit 2199b8e0
2021-05-05 13:21:15 +03:00
Mikhail Kalinin 79fc41146d Adjust is_transition_block call in fork-choice 2021-05-05 13:37:07 +06:00
vbuterin b310482bce
Update specs/altair/beacon-chain.md 2021-05-04 17:19:51 -07:00
vbuterin 9dcdbafba3
Reorganization of config params to put sync committee in one section
This may be marginally "cleaner" than the previous approach, keeping constants with the same topic together.
2021-05-04 17:19:15 -07:00
vbuterin a562f2aeb4
"toward" -> "closer to" for penalty adjustments
Makes it clearer that even the Altair values are not final
2021-05-04 17:05:15 -07:00
protolambda 521cffc3e9
update execution-payload processing to isolate payload from block body 2021-05-05 00:17:10 +02:00
Alex Stokes 3b80324119
Compute `LIGHT_CLIENT_UPDATE_TIMEOUT` in lieu of maintaining a constant 2021-05-04 13:47:46 -07:00
Alex Stokes 7a168be862
allow fault tolerance equal to threshold, not just above 2021-05-04 13:25:34 -07:00
Alex Stokes eae64fd18c
clean up whitespace on altair files 2021-05-04 12:43:21 -07:00
Alex Stokes 7d236561bd
adjust subnet count to reflect smaller sync committees 2021-05-04 12:41:19 -07:00
Alex Stokes 9c3d5982cf
add documentation about duplicate pubkeys 2021-05-04 12:20:48 -07:00
Alex Stokes 7b33c1119a
simplify sync committee pubkey aggregation in altair 2021-05-04 12:19:33 -07:00
Alex Stokes 0438f2f27c
whitespace 2021-05-04 12:19:33 -07:00
Diederik Loerakker 8558bd773d
Merge pull request #2367 from Nashatyrev/fix/unknown-shard-count-const
[Sharding] Fix unspecified SHARD_COUNT and DOMAIN_SHARD_HEADER constants
2021-05-04 21:13:29 +02:00
Hsiao-Wei Wang 9980d2098d
Fix lint 2021-05-04 22:21:58 +08:00
Danny Ryan 80df9e6b0b
Merge branch 'dev' into altair-pass 2021-05-04 07:41:25 -06:00
Danny Ryan 053179cee9
comments and tests on altair 2021-05-04 07:39:22 -06:00
terence tsao 930ca61690
Fix lint (124 > 120 characters) 2021-05-02 20:47:57 -07:00
terence tsao 780121f9b0
Add backticks to the arguments in functional comments 2021-05-02 20:31:52 -07:00
Alex Stokes 68d6e4319a
Adjust sync committee size and duration 2021-05-01 16:30:23 -07:00
Anton Nashatyrev dca6d3370a Search winning 'empty' PendingShardHeader index by the empty DataCommitment instead of zero Root 2021-04-30 15:21:51 +03:00
Anton Nashatyrev 2199b8e0f0 Calc the right root with respect to (slot, shard) for an empty PendingShardHeader 2021-04-30 14:58:30 +03:00
Anton Nashatyrev 99d50108d0 Replace unspecified SHARD_COUNT const with get_active_shard_count(previous_epoch) 2021-04-30 14:39:37 +03:00
Anton Nashatyrev 637f232ab3 Need to specify MAX_SHARDS since we are filling the Vector of MAX_SHARDS length 2021-04-30 14:35:34 +03:00
Anton Nashatyrev 36fd9195f3 Replace unspecified DOMAIN_SHARD_HEADER const with DOMAIN_SHARD_PROPOSER 2021-04-30 14:14:09 +03:00
Anton Nashatyrev 86d8a10495 Replace unspecified SHARD_COUNT const with get_active_shard_count(previous_epoch) 2021-04-30 14:09:09 +03:00
protolambda c5986106ca
fix note about sharding beacon state extension 2021-04-29 15:39:57 +02:00
Danny Ryan c3dfc2e085
Merge pull request #2362 from ethereum/sync-cleanup
Minor altair cleanups
2021-04-28 08:42:23 -06:00
Danny Ryan e89fae86a6
Apply suggestions from code review
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2021-04-28 06:52:16 -06:00
Danny Ryan 9f74f1f9e5
minor sync committee cleanups 2021-04-27 15:06:45 -06:00
Danny Ryan 2628721f96
Merge pull request #2323 from ethereum/prepare_state
Simplify Altair "genesis"
2021-04-27 12:32:13 -06:00
Danny Ryan c090d6aa21
Merge pull request #2352 from ralexstokes/add-altair-metadata-updates
Add `syncnets` data to Altair `MetaData`
2021-04-27 12:20:03 -06:00
Danny Ryan ae429a38a0
add Modified comment 2021-04-27 12:11:15 -06:00
Alex Stokes 9bb3444c89
Add `syncnets` data to Altair `MetaData`. 2021-04-27 09:34:24 -07:00
ericsson e3c95e967c use `committee_index` instead of `shard` 2021-04-27 17:09:16 +03:00
ericsson a0c30313fa convert `shard` to `CommitteeIndex` using `compute_committee_index_from_shard`, based on @djrtwo comment 2021-04-27 17:07:56 +03:00
ericsson 4d684bd8d9 convert `shard` to `CommitteeIndex` in `charge_confirmed_header_fees` 2021-04-27 15:44:25 +03:00
ericsson 865a077aa3 convert `shard` and `index` to `CommitteeIndex` in `reset_pending_headers` 2021-04-27 14:14:25 +03:00
ericsson 17bc3c1c72 convert `shard` to `CommitteeIndex` when passing to `get_beacon_committee` 2021-04-27 13:44:22 +03:00
Diederik Loerakker f2c47debb9
Merge pull request #2355 from ericsson49/ericsson49/fix_upgrade_to_altair
Fix: `upgrade_to_altair` should use `phase0.get_current_epoch`
2021-04-26 20:34:33 +02:00
Diederik Loerakker ac98da6c7d
Merge pull request #2359 from ericsson49/ericsson49/fix_pass_set_instead_of_sequence_to_get_total_balance
Fix: pass Set instead of Sequence to get_total_balance
2021-04-26 20:31:15 +02:00
Diederik Loerakker fd9c96d41d
Merge pull request #2358 from ericsson49/ericsson49/fix_process_shard_header
More typos fixes in `sharding`
2021-04-26 20:27:07 +02:00
ericsson d99cfee853 typing problem fixed: `get_total_balance` expected second argument to be of `Set[ValidatorIndex]` type, however, `Sequence` is passed 2021-04-24 18:21:59 +03:00
ericsson 6288252d44 fix typo: `process_confirmed_header_fees` called instead of `charge_confirmed_header_fees` 2021-04-24 17:46:55 +03:00
ericsson e05356893f fix typo: `c` var name used instad of `header` in `process_pending_headers` 2021-04-24 17:38:09 +03:00
ericsson 77bceeae69 fix typo: `SLOTS_IN_EPOCH` used instead of `SLOTS_PER_EPOCH` 2021-04-24 17:33:53 +03:00
ericsson 6814efac2e fix typo: `state` missed in `get_committee_count_per_slot` call 2021-04-24 17:32:59 +03:00
ericsson 47e52a6361 fix typo: `get_shard_proposer_index` vs `get_shard_proposer` 2021-04-24 17:32:05 +03:00
ericsson ee360df689 missed `body_summary` attribute when accessing`ShardBlobBodySummary.beacon_block_root` 2021-04-24 00:12:28 +03:00
ericsson f55b327c51 fix typos in sharding 2021-04-23 18:47:25 +03:00
ericsson 93378afcd0 Fix typing problem: `upgrade_to_altair` should use `phase0.get_current_epoch` 2021-04-23 18:21:29 +03:00
Anton Nashatyrev 8f371f5627 Cleanup: move var calculation down right before its usage 2021-04-22 22:08:44 +03:00
Anton Nashatyrev d7c276bcd5 Remove obsolete var and calculation 2021-04-22 22:06:24 +03:00
Danny Ryan 7f0ea0eb01
Merge pull request #2350 from Nashatyrev/fix/get-active-shard-count-missing-arg
Sarding: missing argument in get_active_shard_count() call
2021-04-22 12:40:38 -06:00
Alex Stokes ebd16e1b79
add helper in p2p document to executable spec 2021-04-22 11:05:06 -07:00
Anton Nashatyrev 917d40b4d3 Fix missing argument in get_active_shard_count() call 2021-04-22 20:38:21 +03:00
Alex Stokes 3c07303c5c
Update specs/altair/p2p-interface.md
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-04-22 10:34:16 -07:00
Alex Stokes 99b2cc2f3e
Clarify usage of field in data 2021-04-22 10:34:16 -07:00
Alex Stokes f992a9ae65
Remove duplicate validation 2021-04-22 10:34:16 -07:00
Alex Stokes 360a1dd598
Respect subcommittees in gossip validations for Altair 2021-04-22 10:34:15 -07:00
Diederik Loerakker 9d0bfec2d6
Merge pull request #2345 from ralexstokes/use-markdown-parser-for-literate-pyspec
Use markdown parser for literate pyspec
2021-04-22 18:05:06 +02:00
Diederik Loerakker 1bd73eaa5e
Merge pull request #2348 from Nashatyrev/fix/shard-proposer-index-seed-slot
get_shard_proposer_index: Use slot instead of beacon_state.slot
2021-04-22 18:04:18 +02:00
Alex Stokes a9e3ecabbd
demo spec comment feature 2021-04-21 18:49:51 -07:00
Alex Stokes b870f92801
Update validator.md 2021-04-21 17:08:38 -07:00
Anton Nashatyrev d09a0c2bce get_shard_proposer_index: Use slot instead of beacon_state.slot 2021-04-21 18:55:05 +03:00
Hsiao-Wei Wang 93f6a541ad
PR feedback from @djrtwo 2021-04-21 16:42:54 +08:00
Hsiao-Wei Wang 2063c96c80
Merge branch 'dev' into prepare_state 2021-04-21 16:34:29 +08:00
Hsiao-Wei Wang 66e1a2858f
Use `ALTAIR_FORK_EPOCH` instead of `ALTAIR_FORK_SLOT` 2021-04-21 00:24:44 +08:00
Hsiao-Wei Wang baf4b73c18
Fix ToC 2021-04-20 23:38:48 +08:00
Hsiao-Wei Wang 666f847354
Update specs and test format note. 2021-04-20 23:37:53 +08:00
terence tsao b49869a784
Use `process_execution_payload` in sharding doc 2021-04-19 21:19:38 -07:00
Paul Hauner c0f1231522
Rename MAX_APPLICATION_TRANSACTIONS 2021-04-19 15:24:06 +10:00
Hsiao-Wei Wang 1961831348
Merge branch 'dev' into prepare_state 2021-04-16 11:36:02 +08:00
Hsiao-Wei Wang 57ac8c3f28
Fix doc 2021-04-16 11:34:50 +08:00
Danny Ryan c7166a37af
change eth1data block_hash type to Hash32 in phase 0 2021-04-15 06:47:11 -05:00
Hsiao-Wei Wang b65566f184
Fix ToC 2021-04-15 15:41:12 +08:00
Mikhail Kalinin 9d79831b56 Rename validate_execution_payload to verify_execution_state_transition 2021-04-14 13:03:58 +06:00
Mikhail Kalinin 292fd604f8 Replace boolean with bool whenever make sense 2021-04-14 12:54:49 +06:00
Mikhail Kalinin 7d8570d488 Warn about potential overflows in compute_time_at_slot 2021-04-14 12:53:30 +06:00
Mikhail Kalinin dbbc63b7a3 Replace execution_state_transition with validate_execution_payload 2021-04-13 19:13:54 +06:00
Mikhail Kalinin ad0f1e5620 Add timestamp field into ExecutionPayload 2021-04-13 19:08:47 +06:00
Mikhail Kalinin 13edd20a36 Change Eth1Data.block_hash type to Hash32 2021-04-13 15:29:07 +06:00
Mikhail Kalinin 44de07fee9
Replace hash: Hash32 with block_hash: Hash32
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2021-04-13 15:20:45 +06:00
Hsiao-Wei Wang 8708ec4bb0
Update doc 2021-04-12 22:02:04 +08:00
Hsiao-Wei Wang a8160f1634
Try to initialize state with pure Altair spec in tests 2021-04-10 00:53:37 +08:00
Mikhail Kalinin c4c4dade27 Add missing timestamp in validator.md/get_execution_payload 2021-04-09 22:50:37 +06:00
Mikhail Kalinin ac175fd325 Replace state with its root in execution_state_transition params 2021-04-09 19:16:52 +06:00
Mikhail Kalinin 334a9b2434 Pass timestamp to execution state transition and payload production 2021-04-09 19:14:58 +06:00
Mikhail Kalinin a1ded22b3a Introduce Hash32 custom type 2021-04-09 19:09:00 +06:00
Danny Ryan af9ea0efb6
Merge branch 'dev' into merge-exe 2021-04-09 07:21:51 -05:00
Danny Ryan f8c4977414
Merge pull request #2319 from mkalinin/merge-terminology
Apply new terminology to the merge spec
2021-04-09 07:11:04 -05:00
Mikhail Kalinin ffe7d6db6a Add pre-merge path to the process_execution_payload 2021-04-09 15:36:45 +06:00
Mikhail Kalinin 68b11ad4ad Fix pre-condition checks in process_execution_payload 2021-04-08 20:14:34 +06:00
Mikhail Kalinin 13586cd9f8 Polishing and fixes according to github comments 2021-04-08 20:14:01 +06:00
Mikhail Kalinin c1101a8181 Apply new terminology to the merge spec 2021-04-08 14:29:05 +06:00
Hsiao-Wei Wang 6e8b4b3ea9
Add eth2spec.merge.spec 2021-04-08 05:57:16 +08:00
Adrian Sutton 08f9f81c1f
Update note about changes to slash_validator. 2021-04-07 11:44:24 +10:00
Danny Ryan 680e264fa9
Merge pull request #2295 from mkalinin/application-payload-fields
New application payload fields
2021-04-06 15:38:40 -06:00
Danny Ryan 0c1fae6079
Merge pull request #2302 from ethereum/shardblobs
Shard blob, headers and slashings
2021-04-06 15:24:58 -06:00
Diederik Loerakker f3dbb8b46f
Merge pull request #2307 from ericsson49/ericsson49/fix_uint64_overflow
Fix uint64 overflow when computing ROOT_OF_UNITY
2021-04-06 23:15:47 +02:00
protolambda cb29a7ed91
Merge branch 'dev' into shardblobs 2021-04-06 19:49:48 +02:00
protolambda 2119efc1bf
change to block-root anchor of shard blob 2021-04-06 19:31:20 +02:00
protolambda ead3510704
update TOC, check slot range to avoid future-slot state-root lookup 2021-04-06 17:07:29 +02:00
Mikhail Kalinin 2a4756da2e Add transactions_root to ApplicationBlockHeader 2021-04-06 11:48:33 +06:00
protolambda 36e871dc88
Enforce state sub-tree in shard blob proposal to avoid inconsistent replays on reorg, and provide context for proposer_index computation 2021-04-06 04:00:55 +02:00
protolambda 2cbc52b9dc
Implement review suggestions
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-04-06 03:17:07 +02:00
Danny Ryan 05581e759c
Merge pull request #2309 from terencechain/fix-spelling
Fix spelling
2021-04-05 18:48:40 -06:00
protolambda f7069510e6
update shard blob and headers types, implement shard blob slashings, update shard gossip validation 2021-04-06 02:23:43 +02:00
terence tsao b2f42bf4d7 broadast -> broadcast 2021-04-05 17:05:59 -07:00
Alex Stokes 746d6453bc
Clean up unnecessary function arguments
Some of the inputs to some functions in the Altair validator guide
were required in earlier iterations of the aggregation scheme but are
no longer required in the current version. This commit cleans up these
functions.
2021-04-05 16:56:13 -07:00
ericsson 37fe8068ca Cast `MAX_SAMPLES_PER_BLOCK * POINTS_PER_SAMPLE` to `int` to avoid `uint64` overflow 2021-04-05 23:13:54 +03:00
Danny Ryan 0b069fbfca
Merge pull request #2303 from ericsson49/ericsson49/fix_typos
Sharding spec typos fixed
2021-04-05 12:27:33 -06:00
Danny Ryan 52e4ce3bcf
Merge pull request #2276 from barnabemonnot/altair_incentives
Modify incentives to preserve invariant
2021-04-05 12:23:17 -06:00
Alex Stokes bf7c61ff30
Merge pull request #2299 from ralexstokes/update-altair-p2p
Fix language with sync committee selection proofs
2021-04-05 11:03:36 -07:00
Hsiao-Wei Wang 8d60614728
Merge branch 'dev' into altair_incentives 2021-04-06 00:01:11 +08:00
Meredith Baxter 4a1126d916 Fix table formatting 2021-04-05 11:34:06 -04:00
ericsson 01dc8c6624 Type fixed: `boolean` instead of `bool` in `PendingShardHeader` 2021-04-05 18:22:53 +03:00
ericsson c0a2ab54f1 Type fixed: made BLSCommitment descending from Bytes48 instead of bytes48 2021-04-05 17:39:04 +03:00
ericsson 99c1b75e59 More backquotes to make DocToc happy 2021-04-05 17:08:38 +03:00
ericsson 71a609464c fixed some typos, which blocks Python parser 2021-04-05 16:53:03 +03:00
ericsson 1a8ff79a18 Add backquotes around DASSample, since setup.py/get_spec fails w/o them 2021-04-05 16:51:26 +03:00
Alex Stokes 9aaf548c37
Fix language with sync committee selection proofs 2021-04-02 18:37:30 -07:00
Mikhail Kalinin 79aee8645d Implement ApplicationBlockHeader 2021-04-02 21:01:49 +06:00
Justin 48fb9c39c2
Update beacon-chain.md 2021-04-02 15:05:54 +01:00
Justin 88d8f80957
Fix two bugs (and some cleanups)
Fix two bugs:

1) The participant reward (previously known as "inclusion reward") should not be proportional to `effective_balance` because a sync committee member is already chosen with probability proportional to the effective balance. Credit to @vbuterin.
2) The participant reward (previously known as "inclusion reward") was too large by a factor of `len(participant_indices)`, not taking into account the `for` loop.

Fixing these two bugs actually makes the code significantly simpler and cleaner :)

@barnabemonnot: Could you check the logic? :) If confirmed happy to update the tests.
2021-04-02 14:52:32 +01:00
Danny Ryan acfbd9375e
Merge pull request #2293 from ralexstokes/reorder-aggregation-conditions
Reorder Altair gossip validation conditions
2021-04-01 11:25:10 -06:00
Danny Ryan b81c64fa15
Merge pull request #2287 from mbaxter/altair/change-altair-fork-default
Set tmp ALTAIR_FORK_SLOT to max value
2021-04-01 06:39:14 -06:00
Danny Ryan b3f72075cb
Merge pull request #2294 from michaelsproul/sync-committee-balance
Simplify balance calc in `process_sync_committee`
2021-04-01 06:36:41 -06:00
Adrian Sutton 45c764618a
Fix missed rename from aggregate_and_proof to contribution_and_proof 2021-04-01 15:18:31 +10:00
Danny Ryan 28216cbcda
fix lint
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2021-03-31 13:22:45 -06:00
Mikhail Kalinin 106e1b98ba Add parent_hash, number to ApplicationPayload 2021-03-31 16:10:02 +06:00
Mikhail Kalinin b52cde0c86 Fix redundant application_parent_hash in validator.md 2021-03-31 15:06:32 +06:00
Michael Sproul e8b758f9a6
Simplify balance calc in `process_sync_committee` 2021-03-31 17:21:51 +11:00
Alex Stokes b151adbd4e
Reorder Altair gossip validation conditions
Validate the `selection_proof` selects the incoming validator as an
aggregator before doing other checks like committee inclusion and
(relatively) expensive signature checks.
2021-03-30 16:18:14 -07:00
Hsiao-Wei Wang 2def461298
Merge branch 'dev' into altair_incentives 2021-03-31 00:53:58 +08:00
Danny Ryan ed6358a719
Merge pull request #2248 from hukkinj1/dev
Fix list indentation
2021-03-30 07:32:35 -06:00
Danny Ryan 51db49988a
Merge pull request #2254 from ethereum/phase1-rebased
Modularize Phase1 into post-Merge features: Sharding, Custody Game, Data Availability Sampling
2021-03-30 07:24:26 -06:00
protolambda 07b7774241
misc. phase1 modules refactor updates 2021-03-30 01:46:02 +02:00
protolambda 9420c29899
custody game doc naming updates 2021-03-30 01:39:01 +02:00
Diederik Loerakker 430627f290
Apply suggestions from @djrtwo
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
2021-03-30 01:33:17 +02:00
Meredith Baxter 4b81cc21f4 Update altair/fork.md 2021-03-29 15:15:53 -04:00
terence tsao eca6bd7d62 Fix merge beacon chain spec's toc 2021-03-29 11:56:43 -07:00
Danny Ryan 41c5f1c4d6
Merge pull request #2279 from ethereum/ralexstokes-patch-2
Fix aggregation bits example in Altair validator guide
2021-03-29 12:37:47 -06:00
Danny Ryan 6f07448883
Merge pull request #2282 from benjaminion/altair-1
Make if condition more precise
2021-03-29 07:59:19 -06:00
Danny Ryan 48d619d299
Merge pull request #2277 from ralexstokes/fix-altair-val-guide
Fix use of block root in Altair validator guide
2021-03-29 07:59:02 -06:00