mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-11 14:54:12 +00:00
initial 0.11.0 spec version update
This commit is contained in:
parent
33687c3e41
commit
6068dd960b
@ -51,43 +51,68 @@ OK: 2/2 Fail: 0/2 Skip: 0/2
|
||||
+ Attestation topics OK
|
||||
```
|
||||
OK: 1/1 Fail: 0/1 Skip: 0/1
|
||||
## Official - 0.10.1 - constants & config [Preset: mainnet]
|
||||
## Official - 0.11.0 - constants & config [Preset: mainnet]
|
||||
```diff
|
||||
+ BASE_REWARD_FACTOR 64 [Preset: mainnet] OK
|
||||
+ BLS_WITHDRAWAL_PREFIX "0x00" [Preset: mainnet] OK
|
||||
+ CHURN_LIMIT_QUOTIENT 65536 [Preset: mainnet] OK
|
||||
+ CUSTODY_PERIOD_TO_RANDAO_PADDING 2048 [Preset: mainnet] OK
|
||||
- DEPOSIT_CONTRACT_ADDRESS "0x1234567890123456789012345678901234567 Fail
|
||||
+ DOMAIN_AGGREGATE_AND_PROOF "0x06000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_BEACON_ATTESTER "0x01000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_BEACON_PROPOSER "0x00000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_CUSTODY_BIT_CHALLENGE "0x06000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_CUSTODY_BIT_SLASHING "0x83000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_DEPOSIT "0x03000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_LIGHT_CLIENT "0x82000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_RANDAO "0x02000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_SHARD_ATTESTER "0x81000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_SHARD_PROPOSER "0x80000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_SELECTION_PROOF "0x05000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_SHARD_COMMITTEE "0x81000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_SHARD_PROPOSAL "0x80000000" [Preset: mainnet] OK
|
||||
+ DOMAIN_VOLUNTARY_EXIT "0x04000000" [Preset: mainnet] OK
|
||||
+ EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS 16384 [Preset: mainnet] OK
|
||||
+ EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE 2 [Preset: mainnet] OK
|
||||
+ EFFECTIVE_BALANCE_INCREMENT 1000000000 [Preset: mainnet] OK
|
||||
+ EJECTION_BALANCE 16000000000 [Preset: mainnet] OK
|
||||
+ EPOCHS_PER_CUSTODY_PERIOD 2048 [Preset: mainnet] OK
|
||||
+ EPOCHS_PER_ETH1_VOTING_PERIOD 32 [Preset: mainnet] OK
|
||||
+ EPOCHS_PER_HISTORICAL_VECTOR 65536 [Preset: mainnet] OK
|
||||
+ EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION 256 [Preset: mainnet] OK
|
||||
+ EPOCHS_PER_SLASHINGS_VECTOR 8192 [Preset: mainnet] OK
|
||||
+ ETH1_FOLLOW_DISTANCE 1024 [Preset: mainnet] OK
|
||||
+ GASPRICE_ADJUSTMENT_COEFFICIENT 8 [Preset: mainnet] OK
|
||||
+ GENESIS_FORK_VERSION "0x00000000" [Preset: mainnet] OK
|
||||
+ HISTORICAL_ROOTS_LIMIT 16777216 [Preset: mainnet] OK
|
||||
+ HYSTERESIS_DOWNWARD_MULTIPLIER 1 [Preset: mainnet] OK
|
||||
+ HYSTERESIS_QUOTIENT 4 [Preset: mainnet] OK
|
||||
+ HYSTERESIS_UPWARD_MULTIPLIER 5 [Preset: mainnet] OK
|
||||
+ INACTIVITY_PENALTY_QUOTIENT 33554432 [Preset: mainnet] OK
|
||||
+ INITIAL_ACTIVE_SHARDS 64 [Preset: mainnet] OK
|
||||
+ INITIAL_GASPRICE 10 [Preset: mainnet] OK
|
||||
+ LIGHT_CLIENT_COMMITTEE_PERIOD 256 [Preset: mainnet] OK
|
||||
+ LIGHT_CLIENT_COMMITTEE_SIZE 128 [Preset: mainnet] OK
|
||||
+ MAX_ATTESTATIONS 128 [Preset: mainnet] OK
|
||||
+ MAX_ATTESTER_SLASHINGS 1 [Preset: mainnet] OK
|
||||
+ MAX_COMMITTEES_PER_SLOT 64 [Preset: mainnet] OK
|
||||
+ MAX_CUSTODY_KEY_REVEALS 256 [Preset: mainnet] OK
|
||||
+ MAX_CUSTODY_SLASHINGS 1 [Preset: mainnet] OK
|
||||
+ MAX_DEPOSITS 16 [Preset: mainnet] OK
|
||||
+ MAX_EARLY_DERIVED_SECRET_REVEALS 1 [Preset: mainnet] OK
|
||||
+ MAX_EFFECTIVE_BALANCE 32000000000 [Preset: mainnet] OK
|
||||
+ MAX_EPOCHS_PER_CROSSLINK 64 [Preset: mainnet] OK
|
||||
+ MAX_GASPRICE 16384 [Preset: mainnet] OK
|
||||
+ MAX_PROPOSER_SLASHINGS 16 [Preset: mainnet] OK
|
||||
+ MAX_REVEAL_LATENESS_DECREMENT 128 [Preset: mainnet] OK
|
||||
+ MAX_SEED_LOOKAHEAD 4 [Preset: mainnet] OK
|
||||
+ MAX_SHARDS 1024 [Preset: mainnet] OK
|
||||
+ MAX_SHARD_BLOCKS_PER_ATTESTATION 12 [Preset: mainnet] OK
|
||||
+ MAX_SHARD_BLOCK_CHUNKS 4 [Preset: mainnet] OK
|
||||
+ MAX_VALIDATORS_PER_COMMITTEE 2048 [Preset: mainnet] OK
|
||||
+ MAX_VOLUNTARY_EXITS 16 [Preset: mainnet] OK
|
||||
+ MINOR_REWARD_QUOTIENT 256 [Preset: mainnet] OK
|
||||
+ MIN_ATTESTATION_INCLUSION_DELAY 1 [Preset: mainnet] OK
|
||||
+ MIN_DEPOSIT_AMOUNT 1000000000 [Preset: mainnet] OK
|
||||
+ MIN_EPOCHS_TO_INACTIVITY_PENALTY 4 [Preset: mainnet] OK
|
||||
+ MIN_GASPRICE 32 [Preset: mainnet] OK
|
||||
+ MIN_GENESIS_ACTIVE_VALIDATOR_COUNT 16384 [Preset: mainnet] OK
|
||||
+ MIN_GENESIS_DELAY 86400 [Preset: mainnet] OK
|
||||
+ MIN_GENESIS_TIME 1578009600 [Preset: mainnet] OK
|
||||
@ -95,22 +120,28 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
|
||||
+ MIN_SEED_LOOKAHEAD 1 [Preset: mainnet] OK
|
||||
+ MIN_SLASHING_PENALTY_QUOTIENT 32 [Preset: mainnet] OK
|
||||
+ MIN_VALIDATOR_WITHDRAWABILITY_DELAY 256 [Preset: mainnet] OK
|
||||
+ ONLINE_PERIOD 8 [Preset: mainnet] OK
|
||||
+ PERSISTENT_COMMITTEE_PERIOD 2048 [Preset: mainnet] OK
|
||||
+ PHASE_1_FORK_VERSION "0x01000000" [Preset: mainnet] OK
|
||||
+ PROPOSER_REWARD_QUOTIENT 8 [Preset: mainnet] OK
|
||||
+ RANDAO_PENALTY_EPOCHS 2 [Preset: mainnet] OK
|
||||
+ RANDOM_SUBNETS_PER_VALIDATOR 1 [Preset: mainnet] OK
|
||||
+ SAFE_SLOTS_TO_UPDATE_JUSTIFIED 8 [Preset: mainnet] OK
|
||||
+ SECONDS_PER_ETH1_BLOCK 14 [Preset: mainnet] OK
|
||||
+ SECONDS_PER_SLOT 12 [Preset: mainnet] OK
|
||||
+ SHARD_BLOCK_CHUNK_SIZE 262144 [Preset: mainnet] OK
|
||||
- SHARD_BLOCK_OFFSETS [1,2,3,5,8,13,21,34,55,89,144,233] [Pres Fail
|
||||
+ SHARD_COMMITTEE_PERIOD 256 [Preset: mainnet] OK
|
||||
+ SHUFFLE_ROUND_COUNT 90 [Preset: mainnet] OK
|
||||
+ SLOTS_PER_EPOCH 32 [Preset: mainnet] OK
|
||||
+ SLOTS_PER_ETH1_VOTING_PERIOD 1024 [Preset: mainnet] OK
|
||||
+ SLOTS_PER_HISTORICAL_ROOT 8192 [Preset: mainnet] OK
|
||||
+ TARGET_AGGREGATORS_PER_COMMITTEE 16 [Preset: mainnet] OK
|
||||
+ TARGET_COMMITTEE_SIZE 128 [Preset: mainnet] OK
|
||||
+ TARGET_SHARD_BLOCK_SIZE 196608 [Preset: mainnet] OK
|
||||
+ VALIDATOR_REGISTRY_LIMIT 1099511627776 [Preset: mainnet] OK
|
||||
+ WHISTLEBLOWER_REWARD_QUOTIENT 512 [Preset: mainnet] OK
|
||||
```
|
||||
OK: 55/56 Fail: 1/56 Skip: 0/56
|
||||
OK: 85/87 Fail: 2/87 Skip: 0/87
|
||||
## PeerPool testing suite
|
||||
```diff
|
||||
+ Access peers by key test OK
|
||||
@ -191,4 +222,4 @@ OK: 4/4 Fail: 0/4 Skip: 0/4
|
||||
OK: 8/8 Fail: 0/8 Skip: 0/8
|
||||
|
||||
---TOTAL---
|
||||
OK: 112/113 Fail: 1/113 Skip: 0/113
|
||||
OK: 142/144 Fail: 2/144 Skip: 0/144
|
||||
|
@ -78,46 +78,68 @@ OK: 2/2 Fail: 0/2 Skip: 0/2
|
||||
+ Attestation topics OK
|
||||
```
|
||||
OK: 1/1 Fail: 0/1 Skip: 0/1
|
||||
## Official - 0.10.1 - constants & config [Preset: minimal]
|
||||
## Official - 0.11.0 - constants & config [Preset: minimal]
|
||||
```diff
|
||||
+ BASE_REWARD_FACTOR 64 [Preset: minimal] OK
|
||||
+ BLS_WITHDRAWAL_PREFIX "0x00" [Preset: minimal] OK
|
||||
+ CHURN_LIMIT_QUOTIENT 65536 [Preset: minimal] OK
|
||||
+ CUSTODY_PERIOD_TO_RANDAO_PADDING 4 [Preset: minimal] OK
|
||||
+ CUSTODY_PERIOD_TO_RANDAO_PADDING 2048 [Preset: minimal] OK
|
||||
- DEPOSIT_CONTRACT_ADDRESS "0x1234567890123456789012345678901234567 Fail
|
||||
+ DOMAIN_AGGREGATE_AND_PROOF "0x06000000" [Preset: minimal] OK
|
||||
+ DOMAIN_BEACON_ATTESTER "0x01000000" [Preset: minimal] OK
|
||||
+ DOMAIN_BEACON_PROPOSER "0x00000000" [Preset: minimal] OK
|
||||
+ DOMAIN_CUSTODY_BIT_CHALLENGE "0x06000000" [Preset: minimal] OK
|
||||
+ DOMAIN_CUSTODY_BIT_SLASHING "0x83000000" [Preset: minimal] OK
|
||||
+ DOMAIN_DEPOSIT "0x03000000" [Preset: minimal] OK
|
||||
+ DOMAIN_LIGHT_CLIENT "0x82000000" [Preset: minimal] OK
|
||||
+ DOMAIN_RANDAO "0x02000000" [Preset: minimal] OK
|
||||
+ DOMAIN_SHARD_ATTESTER "0x81000000" [Preset: minimal] OK
|
||||
+ DOMAIN_SHARD_PROPOSER "0x80000000" [Preset: minimal] OK
|
||||
+ DOMAIN_SELECTION_PROOF "0x05000000" [Preset: minimal] OK
|
||||
+ DOMAIN_SHARD_COMMITTEE "0x81000000" [Preset: minimal] OK
|
||||
+ DOMAIN_SHARD_PROPOSAL "0x80000000" [Preset: minimal] OK
|
||||
+ DOMAIN_VOLUNTARY_EXIT "0x04000000" [Preset: minimal] OK
|
||||
+ EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS 4096 [Preset: minimal] OK
|
||||
+ EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE 2 [Preset: minimal] OK
|
||||
+ EFFECTIVE_BALANCE_INCREMENT 1000000000 [Preset: minimal] OK
|
||||
+ EJECTION_BALANCE 16000000000 [Preset: minimal] OK
|
||||
+ EPOCHS_PER_CUSTODY_PERIOD 4 [Preset: minimal] OK
|
||||
+ EPOCHS_PER_CUSTODY_PERIOD 2048 [Preset: minimal] OK
|
||||
+ EPOCHS_PER_ETH1_VOTING_PERIOD 2 [Preset: minimal] OK
|
||||
+ EPOCHS_PER_HISTORICAL_VECTOR 64 [Preset: minimal] OK
|
||||
+ EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION 256 [Preset: minimal] OK
|
||||
+ EPOCHS_PER_SHARD_PERIOD 4 [Preset: minimal] OK
|
||||
+ EPOCHS_PER_SLASHINGS_VECTOR 64 [Preset: minimal] OK
|
||||
+ ETH1_FOLLOW_DISTANCE 16 [Preset: minimal] OK
|
||||
+ GASPRICE_ADJUSTMENT_COEFFICIENT 8 [Preset: minimal] OK
|
||||
+ GENESIS_FORK_VERSION "0x00000001" [Preset: minimal] OK
|
||||
+ HISTORICAL_ROOTS_LIMIT 16777216 [Preset: minimal] OK
|
||||
+ HYSTERESIS_DOWNWARD_MULTIPLIER 1 [Preset: minimal] OK
|
||||
+ HYSTERESIS_QUOTIENT 4 [Preset: minimal] OK
|
||||
+ HYSTERESIS_UPWARD_MULTIPLIER 5 [Preset: minimal] OK
|
||||
+ INACTIVITY_PENALTY_QUOTIENT 33554432 [Preset: minimal] OK
|
||||
+ INITIAL_ACTIVE_SHARDS 4 [Preset: minimal] OK
|
||||
+ INITIAL_GASPRICE 10 [Preset: minimal] OK
|
||||
+ LIGHT_CLIENT_COMMITTEE_PERIOD 256 [Preset: minimal] OK
|
||||
+ LIGHT_CLIENT_COMMITTEE_SIZE 128 [Preset: minimal] OK
|
||||
+ MAX_ATTESTATIONS 128 [Preset: minimal] OK
|
||||
+ MAX_ATTESTER_SLASHINGS 1 [Preset: minimal] OK
|
||||
+ MAX_COMMITTEES_PER_SLOT 4 [Preset: minimal] OK
|
||||
+ MAX_CUSTODY_KEY_REVEALS 256 [Preset: minimal] OK
|
||||
+ MAX_CUSTODY_SLASHINGS 1 [Preset: minimal] OK
|
||||
+ MAX_DEPOSITS 16 [Preset: minimal] OK
|
||||
+ MAX_EARLY_DERIVED_SECRET_REVEALS 1 [Preset: minimal] OK
|
||||
+ MAX_EFFECTIVE_BALANCE 32000000000 [Preset: minimal] OK
|
||||
+ MAX_EPOCHS_PER_CROSSLINK 4 [Preset: minimal] OK
|
||||
+ MAX_GASPRICE 16384 [Preset: minimal] OK
|
||||
+ MAX_PROPOSER_SLASHINGS 16 [Preset: minimal] OK
|
||||
+ MAX_REVEAL_LATENESS_DECREMENT 128 [Preset: minimal] OK
|
||||
+ MAX_SEED_LOOKAHEAD 4 [Preset: minimal] OK
|
||||
+ MAX_SHARDS 8 [Preset: minimal] OK
|
||||
+ MAX_SHARD_BLOCKS_PER_ATTESTATION 12 [Preset: minimal] OK
|
||||
+ MAX_SHARD_BLOCK_CHUNKS 4 [Preset: minimal] OK
|
||||
+ MAX_VALIDATORS_PER_COMMITTEE 2048 [Preset: minimal] OK
|
||||
+ MAX_VOLUNTARY_EXITS 16 [Preset: minimal] OK
|
||||
+ MINOR_REWARD_QUOTIENT 256 [Preset: minimal] OK
|
||||
+ MIN_ATTESTATION_INCLUSION_DELAY 1 [Preset: minimal] OK
|
||||
+ MIN_DEPOSIT_AMOUNT 1000000000 [Preset: minimal] OK
|
||||
+ MIN_EPOCHS_TO_INACTIVITY_PENALTY 4 [Preset: minimal] OK
|
||||
+ MIN_GASPRICE 32 [Preset: minimal] OK
|
||||
+ MIN_GENESIS_ACTIVE_VALIDATOR_COUNT 64 [Preset: minimal] OK
|
||||
+ MIN_GENESIS_DELAY 300 [Preset: minimal] OK
|
||||
+ MIN_GENESIS_TIME 1578009600 [Preset: minimal] OK
|
||||
@ -125,25 +147,28 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
|
||||
+ MIN_SEED_LOOKAHEAD 1 [Preset: minimal] OK
|
||||
+ MIN_SLASHING_PENALTY_QUOTIENT 32 [Preset: minimal] OK
|
||||
+ MIN_VALIDATOR_WITHDRAWABILITY_DELAY 256 [Preset: minimal] OK
|
||||
+ PERSISTENT_COMMITTEE_PERIOD 2048 [Preset: minimal] OK
|
||||
+ PHASE_1_FORK_EPOCH 8 [Preset: minimal] OK
|
||||
+ PHASE_1_FORK_SLOT 64 [Preset: minimal] OK
|
||||
+ ONLINE_PERIOD 8 [Preset: minimal] OK
|
||||
+ PERSISTENT_COMMITTEE_PERIOD 128 [Preset: minimal] OK
|
||||
+ PHASE_1_FORK_VERSION "0x01000001" [Preset: minimal] OK
|
||||
+ PROPOSER_REWARD_QUOTIENT 8 [Preset: minimal] OK
|
||||
+ RANDAO_PENALTY_EPOCHS 2 [Preset: minimal] OK
|
||||
+ RANDOM_SUBNETS_PER_VALIDATOR 1 [Preset: minimal] OK
|
||||
+ SAFE_SLOTS_TO_UPDATE_JUSTIFIED 2 [Preset: minimal] OK
|
||||
+ SECONDS_PER_ETH1_BLOCK 14 [Preset: minimal] OK
|
||||
+ SECONDS_PER_SLOT 6 [Preset: minimal] OK
|
||||
+ SHARD_SLOTS_PER_BEACON_SLOT 2 [Preset: minimal] OK
|
||||
+ SHARD_BLOCK_CHUNK_SIZE 262144 [Preset: minimal] OK
|
||||
- SHARD_BLOCK_OFFSETS [1,2,3,5,8,13,21,34,55,89,144,233] [Pres Fail
|
||||
+ SHARD_COMMITTEE_PERIOD 256 [Preset: minimal] OK
|
||||
+ SHUFFLE_ROUND_COUNT 10 [Preset: minimal] OK
|
||||
+ SLOTS_PER_EPOCH 8 [Preset: minimal] OK
|
||||
+ SLOTS_PER_ETH1_VOTING_PERIOD 16 [Preset: minimal] OK
|
||||
+ SLOTS_PER_HISTORICAL_ROOT 64 [Preset: minimal] OK
|
||||
+ TARGET_AGGREGATORS_PER_COMMITTEE 16 [Preset: minimal] OK
|
||||
+ TARGET_COMMITTEE_SIZE 4 [Preset: minimal] OK
|
||||
+ TARGET_SHARD_BLOCK_SIZE 196608 [Preset: minimal] OK
|
||||
+ VALIDATOR_REGISTRY_LIMIT 1099511627776 [Preset: minimal] OK
|
||||
+ WHISTLEBLOWER_REWARD_QUOTIENT 512 [Preset: minimal] OK
|
||||
```
|
||||
OK: 61/62 Fail: 1/62 Skip: 0/62
|
||||
OK: 85/87 Fail: 2/87 Skip: 0/87
|
||||
## PeerPool testing suite
|
||||
```diff
|
||||
+ Access peers by key test OK
|
||||
@ -224,4 +249,4 @@ OK: 4/4 Fail: 0/4 Skip: 0/4
|
||||
OK: 8/8 Fail: 0/8 Skip: 0/8
|
||||
|
||||
---TOTAL---
|
||||
OK: 133/134 Fail: 1/134 Skip: 0/134
|
||||
OK: 157/159 Fail: 2/159 Skip: 0/159
|
||||
|
@ -87,11 +87,12 @@ OK: 16/16 Fail: 0/16 Skip: 0/16
|
||||
## Official - Operations - Block header [Preset: mainnet]
|
||||
```diff
|
||||
+ [Invalid] invalid_parent_root OK
|
||||
+ [Invalid] invalid_proposer_index OK
|
||||
+ [Invalid] invalid_slot_block_header OK
|
||||
+ [Invalid] proposer_slashed OK
|
||||
+ [Valid] success_block_header OK
|
||||
```
|
||||
OK: 4/4 Fail: 0/4 Skip: 0/4
|
||||
OK: 5/5 Fail: 0/5 Skip: 0/5
|
||||
## Official - Operations - Deposits [Preset: mainnet]
|
||||
```diff
|
||||
+ [Invalid] bad_merkle_proof OK
|
||||
@ -128,6 +129,8 @@ OK: 9/9 Fail: 0/9 Skip: 0/9
|
||||
## Official - Sanity - Blocks [Preset: mainnet]
|
||||
```diff
|
||||
+ [Invalid] invalid_block_sig OK
|
||||
+ [Invalid] invalid_proposer_index_sig_from_expected_proposer OK
|
||||
+ [Invalid] invalid_proposer_index_sig_from_proposer_index OK
|
||||
+ [Invalid] invalid_state_root OK
|
||||
+ [Invalid] prev_slot_block_transition OK
|
||||
+ [Invalid] zero_block_sig OK
|
||||
@ -137,9 +140,7 @@ OK: 9/9 Fail: 0/9 Skip: 0/9
|
||||
+ [Valid] deposit_top_up OK
|
||||
+ [Valid] empty_block_transition OK
|
||||
+ [Valid] empty_epoch_transition OK
|
||||
+ [Valid] high_proposer_index OK
|
||||
+ [Valid] historical_batch OK
|
||||
+ [Valid] proposer_after_inactive_index OK
|
||||
+ [Valid] proposer_slashing OK
|
||||
+ [Valid] same_slot_block_transition OK
|
||||
+ [Valid] skipped_slots OK
|
||||
@ -157,4 +158,4 @@ OK: 17/17 Fail: 0/17 Skip: 0/17
|
||||
OK: 5/5 Fail: 0/5 Skip: 0/5
|
||||
|
||||
---TOTAL---
|
||||
OK: 107/107 Fail: 0/107 Skip: 0/107
|
||||
OK: 108/108 Fail: 0/108 Skip: 0/108
|
||||
|
@ -87,11 +87,12 @@ OK: 16/16 Fail: 0/16 Skip: 0/16
|
||||
## Official - Operations - Block header [Preset: minimal]
|
||||
```diff
|
||||
+ [Invalid] invalid_parent_root OK
|
||||
+ [Invalid] invalid_proposer_index OK
|
||||
+ [Invalid] invalid_slot_block_header OK
|
||||
+ [Invalid] proposer_slashed OK
|
||||
+ [Valid] success_block_header OK
|
||||
```
|
||||
OK: 4/4 Fail: 0/4 Skip: 0/4
|
||||
OK: 5/5 Fail: 0/5 Skip: 0/5
|
||||
## Official - Operations - Deposits [Preset: minimal]
|
||||
```diff
|
||||
+ [Invalid] bad_merkle_proof OK
|
||||
@ -128,6 +129,8 @@ OK: 9/9 Fail: 0/9 Skip: 0/9
|
||||
## Official - Sanity - Blocks [Preset: minimal]
|
||||
```diff
|
||||
+ [Invalid] invalid_block_sig OK
|
||||
+ [Invalid] invalid_proposer_index_sig_from_expected_proposer OK
|
||||
+ [Invalid] invalid_proposer_index_sig_from_proposer_index OK
|
||||
+ [Invalid] invalid_state_root OK
|
||||
+ [Invalid] prev_slot_block_transition OK
|
||||
+ [Invalid] zero_block_sig OK
|
||||
@ -140,9 +143,7 @@ OK: 9/9 Fail: 0/9 Skip: 0/9
|
||||
+ [Valid] empty_epoch_transition_not_finalizing OK
|
||||
+ [Valid] eth1_data_votes_consensus OK
|
||||
+ [Valid] eth1_data_votes_no_consensus OK
|
||||
+ [Valid] high_proposer_index OK
|
||||
+ [Valid] historical_batch OK
|
||||
+ [Valid] proposer_after_inactive_index OK
|
||||
+ [Valid] proposer_slashing OK
|
||||
+ [Valid] same_slot_block_transition OK
|
||||
+ [Valid] skipped_slots OK
|
||||
@ -160,4 +161,4 @@ OK: 20/20 Fail: 0/20 Skip: 0/20
|
||||
OK: 5/5 Fail: 0/5 Skip: 0/5
|
||||
|
||||
---TOTAL---
|
||||
OK: 110/110 Fail: 0/110 Skip: 0/110
|
||||
OK: 111/111 Fail: 0/111 Skip: 0/111
|
||||
|
@ -1,6 +1,6 @@
|
||||
FixtureSSZConsensus-mainnet
|
||||
===
|
||||
## Official - 0.10.1 - SSZ consensus objects [Preset: mainnet]
|
||||
## Official - 0.11.0 - SSZ consensus objects [Preset: mainnet]
|
||||
```diff
|
||||
+ Testing AggregateAndProof OK
|
||||
+ Testing Attestation OK
|
||||
@ -17,10 +17,12 @@ FixtureSSZConsensus-mainnet
|
||||
+ Testing Eth1Block OK
|
||||
+ Testing Eth1Data OK
|
||||
+ Testing Fork OK
|
||||
+ Testing ForkData OK
|
||||
+ Testing HistoricalBatch OK
|
||||
+ Testing IndexedAttestation OK
|
||||
+ Testing PendingAttestation OK
|
||||
+ Testing ProposerSlashing OK
|
||||
+ Testing SignedAggregateAndProof OK
|
||||
+ Testing SignedBeaconBlock OK
|
||||
+ Testing SignedBeaconBlockHeader OK
|
||||
+ Testing SignedVoluntaryExit OK
|
||||
@ -28,7 +30,7 @@ FixtureSSZConsensus-mainnet
|
||||
+ Testing Validator OK
|
||||
+ Testing VoluntaryExit OK
|
||||
```
|
||||
OK: 25/25 Fail: 0/25 Skip: 0/25
|
||||
OK: 27/27 Fail: 0/27 Skip: 0/27
|
||||
|
||||
---TOTAL---
|
||||
OK: 25/25 Fail: 0/25 Skip: 0/25
|
||||
OK: 27/27 Fail: 0/27 Skip: 0/27
|
||||
|
@ -1,6 +1,6 @@
|
||||
FixtureSSZConsensus-minimal
|
||||
===
|
||||
## Official - 0.10.1 - SSZ consensus objects [Preset: minimal]
|
||||
## Official - 0.11.0 - SSZ consensus objects [Preset: minimal]
|
||||
```diff
|
||||
+ Testing AggregateAndProof OK
|
||||
+ Testing Attestation OK
|
||||
@ -17,10 +17,12 @@ FixtureSSZConsensus-minimal
|
||||
+ Testing Eth1Block OK
|
||||
+ Testing Eth1Data OK
|
||||
+ Testing Fork OK
|
||||
+ Testing ForkData OK
|
||||
+ Testing HistoricalBatch OK
|
||||
+ Testing IndexedAttestation OK
|
||||
+ Testing PendingAttestation OK
|
||||
+ Testing ProposerSlashing OK
|
||||
+ Testing SignedAggregateAndProof OK
|
||||
+ Testing SignedBeaconBlock OK
|
||||
+ Testing SignedBeaconBlockHeader OK
|
||||
+ Testing SignedVoluntaryExit OK
|
||||
@ -28,7 +30,7 @@ FixtureSSZConsensus-minimal
|
||||
+ Testing Validator OK
|
||||
+ Testing VoluntaryExit OK
|
||||
```
|
||||
OK: 25/25 Fail: 0/25 Skip: 0/25
|
||||
OK: 27/27 Fail: 0/27 Skip: 0/27
|
||||
|
||||
---TOTAL---
|
||||
OK: 25/25 Fail: 0/25 Skip: 0/25
|
||||
OK: 27/27 Fail: 0/27 Skip: 0/27
|
||||
|
@ -6,8 +6,7 @@ import
|
||||
func get_eth1data_stub*(deposit_count: uint64, current_epoch: Epoch): Eth1Data =
|
||||
# https://github.com/ethereum/eth2.0-pm/blob/e596c70a19e22c7def4fd3519e20ae4022349390/interop/mocked_eth1data/README.md
|
||||
let
|
||||
epochs_per_period = SLOTS_PER_ETH1_VOTING_PERIOD div SLOTS_PER_EPOCH
|
||||
voting_period = current_epoch.uint64 div epochs_per_period.uint64
|
||||
voting_period = current_epoch.uint64 div EPOCHS_PER_ETH1_VOTING_PERIOD
|
||||
|
||||
Eth1Data(
|
||||
deposit_root: hash_tree_root(voting_period),
|
||||
|
@ -247,6 +247,9 @@ func initialize_beacon_state_from_eth1*(
|
||||
validator.activation_eligibility_epoch = GENESIS_EPOCH
|
||||
validator.activation_epoch = GENESIS_EPOCH
|
||||
|
||||
# Set genesis validators root for domain separation and chain versioning
|
||||
state.genesis_validators_root = hash_tree_root(state.validators)
|
||||
|
||||
state
|
||||
|
||||
func is_valid_genesis_state*(state: BeaconState): bool =
|
||||
@ -283,10 +286,11 @@ func get_block_root*(state: BeaconState, epoch: Epoch): Eth2Digest =
|
||||
# Return the block root at the start of a recent ``epoch``.
|
||||
get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch))
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#get_total_balance
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#get_total_balance
|
||||
func get_total_balance*(state: BeaconState, validators: auto): Gwei =
|
||||
## Return the combined effective balance of the ``indices``. (1 Gwei minimum
|
||||
## to avoid divisions by zero.)
|
||||
## Math safe up to ~10B ETH, afterwhich this overflows uint64.
|
||||
max(1'u64,
|
||||
foldl(validators, a + state.validators[b].effective_balance, 0'u64)
|
||||
)
|
||||
|
@ -1,5 +1,5 @@
|
||||
# beacon_chain
|
||||
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
||||
# Copyright (c) 2018-2020 Status Research & Development GmbH
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
@ -81,23 +81,26 @@ type
|
||||
|
||||
# Domains
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#domain-types
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#domain-types
|
||||
DomainType* {.pure.} = enum
|
||||
DOMAIN_BEACON_PROPOSER = 0
|
||||
DOMAIN_BEACON_ATTESTER = 1
|
||||
DOMAIN_RANDAO = 2
|
||||
DOMAIN_DEPOSIT = 3
|
||||
DOMAIN_VOLUNTARY_EXIT = 4
|
||||
# Phase 1 - Custody game
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase1/custody-game.md#signature-domain-types
|
||||
DOMAIN_CUSTODY_BIT_CHALLENGE = 6
|
||||
DOMAIN_SELECTION_PROOF = 5
|
||||
DOMAIN_AGGREGATE_AND_PROOF = 6
|
||||
# Phase 1 - Sharding
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase1/shard-data-chains.md#signature-domain-types
|
||||
DOMAIN_SHARD_PROPOSER = 128
|
||||
DOMAIN_SHARD_ATTESTER = 129
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase1/beacon-chain.md#misc
|
||||
DOMAIN_SHARD_PROPOSAL = 128
|
||||
DOMAIN_SHARD_COMMITTEE = 129
|
||||
DOMAIN_LIGHT_CLIENT = 130
|
||||
# Phase 1 - Custody game
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase1/custody-game.md#signature-domain-types
|
||||
DOMAIN_CUSTODY_BIT_SLASHING = 0x83
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#custom-types
|
||||
Domain* = array[8, byte]
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#custom-types
|
||||
Domain* = array[32, byte]
|
||||
|
||||
# https://github.com/nim-lang/Nim/issues/574 and be consistent across
|
||||
# 32-bit and 64-bit word platforms.
|
||||
@ -111,9 +114,8 @@ type
|
||||
|
||||
BitList*[maxLen: static int] = distinct BitSeq
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#proposerslashing
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#proposerslashing
|
||||
ProposerSlashing* = object
|
||||
proposer_index*: uint64
|
||||
signed_header_1*: SignedBeaconBlockHeader
|
||||
signed_header_2*: SignedBeaconBlockHeader
|
||||
|
||||
@ -137,6 +139,12 @@ type
|
||||
data*: AttestationData
|
||||
signature*: ValidatorSig
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#forkdata
|
||||
ForkData* = object
|
||||
# TODO: Spec introduced an alias for Version = array[4, byte]
|
||||
current_version*: array[4, byte]
|
||||
genesis_validators_root*: Eth2Digest
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#checkpoint
|
||||
Checkpoint* = object
|
||||
epoch*: Epoch
|
||||
@ -190,6 +198,7 @@ type
|
||||
## is formed.
|
||||
|
||||
slot*: Slot
|
||||
proposer_index*: uint64
|
||||
|
||||
parent_root*: Eth2Digest ##\
|
||||
## Root hash of the previous block
|
||||
@ -202,6 +211,7 @@ type
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#beaconblockheader
|
||||
BeaconBlockHeader* = object
|
||||
slot*: Slot
|
||||
proposer_index*: uint64
|
||||
parent_root*: Eth2Digest
|
||||
state_root*: Eth2Digest
|
||||
body_root*: Eth2Digest
|
||||
@ -223,6 +233,7 @@ type
|
||||
BeaconState* = object
|
||||
# Versioning
|
||||
genesis_time*: uint64
|
||||
genesis_validators_root*: Eth2Digest
|
||||
slot*: Slot
|
||||
fork*: Fork
|
||||
|
||||
@ -238,7 +249,8 @@ type
|
||||
|
||||
# Eth1
|
||||
eth1_data*: Eth1Data
|
||||
eth1_data_votes*: List[Eth1Data, SLOTS_PER_ETH1_VOTING_PERIOD]
|
||||
eth1_data_votes*:
|
||||
List[Eth1Data, EPOCHS_PER_ETH1_VOTING_PERIOD * SLOTS_PER_EPOCH]
|
||||
eth1_deposit_index*: uint64
|
||||
|
||||
# Registry
|
||||
@ -350,6 +362,11 @@ type
|
||||
aggregate*: Attestation
|
||||
selection_proof*: ValidatorSig
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/validator.md#signedaggregateandproof
|
||||
SignedAggregateAndProof* = object
|
||||
message*: AggregateAndProof
|
||||
signature*: ValidatorSig
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/validator.md#eth1block
|
||||
Eth1Block* = object
|
||||
timestamp*: uint64
|
||||
@ -384,10 +401,12 @@ template foreachSpecType*(op: untyped) =
|
||||
op Eth1Block
|
||||
op Eth1Data
|
||||
op Fork
|
||||
op ForkData
|
||||
op HistoricalBatch
|
||||
op IndexedAttestation
|
||||
op PendingAttestation
|
||||
op ProposerSlashing
|
||||
op SignedAggregateAndProof
|
||||
op SignedBeaconBlock
|
||||
op SignedBeaconBlockHeader
|
||||
op SignedVoluntaryExit
|
||||
@ -421,7 +440,8 @@ macro fieldMaxLen*(x: typed): untyped =
|
||||
of "voluntary_exits": MAX_VOLUNTARY_EXITS
|
||||
# BeaconState
|
||||
of "historical_roots": HISTORICAL_ROOTS_LIMIT
|
||||
of "eth1_data_votes": SLOTS_PER_ETH1_VOTING_PERIOD
|
||||
of "eth1_data_votes":
|
||||
EPOCHS_PER_ETH1_VOTING_PERIOD * SLOTS_PER_EPOCH
|
||||
of "validators": VALIDATOR_REGISTRY_LIMIT
|
||||
of "balances": VALIDATOR_REGISTRY_LIMIT
|
||||
of "previous_epoch_attestations",
|
||||
|
@ -13,44 +13,69 @@ type
|
||||
DOMAIN_DEPOSIT
|
||||
DOMAIN_RANDAO
|
||||
DOMAIN_VOLUNTARY_EXIT
|
||||
EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE
|
||||
EFFECTIVE_BALANCE_INCREMENT
|
||||
EJECTION_BALANCE
|
||||
EPOCHS_PER_ETH1_VOTING_PERIOD
|
||||
EPOCHS_PER_HISTORICAL_VECTOR
|
||||
EPOCHS_PER_SLASHINGS_VECTOR
|
||||
ETH1_FOLLOW_DISTANCE
|
||||
GASPRICE_ADJUSTMENT_COEFFICIENT
|
||||
GENESIS_EPOCH
|
||||
GENESIS_SLOT
|
||||
HISTORICAL_ROOTS_LIMIT
|
||||
HYSTERESIS_DOWNWARD_MULTIPLIER
|
||||
HYSTERESIS_QUOTIENT
|
||||
HYSTERESIS_UPWARD_MULTIPLIER
|
||||
INACTIVITY_PENALTY_QUOTIENT
|
||||
INITIAL_ACTIVE_SHARDS
|
||||
INITIAL_GASPRICE
|
||||
JUSTIFICATION_BITS_LENGTH
|
||||
LIGHT_CLIENT_COMMITTEE_PERIOD
|
||||
LIGHT_CLIENT_COMMITTEE_SIZE
|
||||
MAX_ATTESTATIONS
|
||||
MAX_ATTESTER_SLASHINGS
|
||||
MAX_COMMITTEES_PER_SLOT
|
||||
MAX_CUSTODY_KEY_REVEALS
|
||||
MAX_CUSTODY_SLASHINGS
|
||||
MAX_DEPOSITS
|
||||
MAX_EARLY_DERIVED_SECRET_REVEALS
|
||||
MAX_EFFECTIVE_BALANCE
|
||||
MAX_GASPRICE
|
||||
MAX_PROPOSER_SLASHINGS
|
||||
MAX_REVEAL_LATENESS_DECREMENT
|
||||
MAX_SEED_LOOKAHEAD
|
||||
MAX_SHARDS
|
||||
MAX_SHARD_BLOCKS_PER_ATTESTATION
|
||||
MAX_SHARD_BLOCK_CHUNKS
|
||||
MAX_VALIDATORS_PER_COMMITTEE
|
||||
MAX_VOLUNTARY_EXITS
|
||||
MINOR_REWARD_QUOTIENT
|
||||
MIN_ATTESTATION_INCLUSION_DELAY
|
||||
MIN_DEPOSIT_AMOUNT
|
||||
MIN_EPOCHS_TO_INACTIVITY_PENALTY
|
||||
MIN_GASPRICE
|
||||
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT
|
||||
MIN_GENESIS_TIME
|
||||
MIN_PER_EPOCH_CHURN_LIMIT
|
||||
MIN_SEED_LOOKAHEAD
|
||||
MIN_SLASHING_PENALTY_QUOTIENT
|
||||
MIN_VALIDATOR_WITHDRAWABILITY_DELAY
|
||||
ONLINE_PERIOD
|
||||
PERSISTENT_COMMITTEE_PERIOD
|
||||
PHASE_1_FORK_VERSION
|
||||
PROPOSER_REWARD_QUOTIENT
|
||||
RANDAO_PENALTY_EPOCHS
|
||||
SAFE_SLOTS_TO_UPDATE_JUSTIFIED
|
||||
SECONDS_PER_DAY
|
||||
SECONDS_PER_SLOT
|
||||
SHARD_BLOCK_CHUNK_SIZE
|
||||
SHARD_COMMITTEE_PERIOD
|
||||
SHUFFLE_ROUND_COUNT
|
||||
SLOTS_PER_EPOCH
|
||||
SLOTS_PER_ETH1_VOTING_PERIOD
|
||||
SLOTS_PER_HISTORICAL_ROOT
|
||||
TARGET_COMMITTEE_SIZE
|
||||
TARGET_SHARD_BLOCK_SIZE
|
||||
VALIDATOR_REGISTRY_LIMIT
|
||||
WHISTLEBLOWER_REWARD_QUOTIENT
|
||||
|
||||
|
@ -44,6 +44,10 @@ const
|
||||
MIN_GENESIS_TIME* {.intdefine.} = 1578009600
|
||||
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT* {.intdefine.} = 16384
|
||||
|
||||
HYSTERESIS_QUOTIENT* = 4
|
||||
HYSTERESIS_DOWNWARD_MULTIPLIER* = 1
|
||||
HYSTERESIS_UPWARD_MULTIPLIER* = 5
|
||||
|
||||
# Constants (TODO: not actually configurable)
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#constants
|
||||
BASE_REWARDS_PER_EPOCH* = 4
|
||||
@ -106,8 +110,8 @@ const
|
||||
MAX_SEED_LOOKAHEAD* = 4 ##\
|
||||
## epochs (~25.6 minutes)
|
||||
|
||||
SLOTS_PER_ETH1_VOTING_PERIOD* = 1024 ##\
|
||||
## slots (~1.7 hours)
|
||||
EPOCHS_PER_ETH1_VOTING_PERIOD* = 32 ##\
|
||||
## epochs (~3.4 hours)
|
||||
|
||||
SLOTS_PER_HISTORICAL_ROOT* = 8192 ##\
|
||||
## slots (13 hours)
|
||||
@ -124,8 +128,6 @@ const
|
||||
MIN_EPOCHS_TO_INACTIVITY_PENALTY* = 2'u64^2 ##\
|
||||
## epochs (25.6 minutes)
|
||||
|
||||
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS* = 16384
|
||||
|
||||
# State vector lengths
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/configs/mainnet.yaml#L102
|
||||
@ -166,6 +168,50 @@ const
|
||||
EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION* = 256 # epochs ~ 27 hours
|
||||
SECONDS_PER_ETH1_BLOCK* = 14 # estimate from Eth1 mainnet)
|
||||
|
||||
# Phase 1: Upgrade from Phase 0
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/mainnet.yaml#L161
|
||||
PHASE_1_FORK_VERSION* = 1
|
||||
INITIAL_ACTIVE_SHARDS* = 64
|
||||
INITIAL_GASPRICE* = 10
|
||||
|
||||
# Phase 1: General
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/mainnet.yaml#L169
|
||||
MAX_SHARDS* = 1024
|
||||
ONLINE_PERIOD* = 8 # epochs (~51 min)
|
||||
LIGHT_CLIENT_COMMITTEE_SIZE* = 128
|
||||
LIGHT_CLIENT_COMMITTEE_PERIOD* = 256 # epochs (~27 hours)
|
||||
SHARD_COMMITTEE_PERIOD* = 256 # epochs (~27 hours)
|
||||
SHARD_BLOCK_CHUNK_SIZE* = 262144
|
||||
MAX_SHARD_BLOCK_CHUNKS* = 4
|
||||
TARGET_SHARD_BLOCK_SIZE* = 196608
|
||||
MAX_SHARD_BLOCKS_PER_ATTESTATION* = 12
|
||||
MAX_GASPRICE* = 16384 # Gwei
|
||||
MIN_GASPRICE* = 32 # Gwei
|
||||
GASPRICE_ADJUSTMENT_COEFFICIENT* = 8
|
||||
|
||||
# Phase 1: Custody game
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
# Time parameters
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/mainnet.yaml#L202
|
||||
RANDAO_PENALTY_EPOCHS* = 2 # epchs (12.8 minutes)
|
||||
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS* = 16384 # epochs (~73 days)
|
||||
EPOCHS_PER_CUSTODY_PERIOD* = 2048 # epochs (~9 days)
|
||||
CUSTODY_PERIOD_TO_RANDAO_PADDING* = 2048 # epochs (~9 days)
|
||||
MAX_REVEAL_LATENESS_DECREMENT* = 128 # epochs (~14 hours)
|
||||
|
||||
# Max operations
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/mainnet.yaml#L214
|
||||
MAX_CUSTODY_KEY_REVEALS* = 256
|
||||
MAX_EARLY_DERIVED_SECRET_REVEALS* = 1
|
||||
MAX_CUSTODY_SLASHINGS* = 1
|
||||
|
||||
# Reward and penalty quotients
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/mainnet.yaml#L220
|
||||
EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE* = 2
|
||||
MINOR_REWARD_QUOTIENT* = 256
|
||||
|
||||
# Phase 1 - Sharding
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase1/shard-data-chains.md#time-parameters
|
||||
@ -176,11 +222,3 @@ const
|
||||
# PHASE_1_FORK_EPOCH* = 8
|
||||
# PHASE_1_FORK_SLOT* = 64
|
||||
|
||||
# Phase 1 - Custody game
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase1/custody-game.md#constants
|
||||
# TODO those are included in minimal.yaml but not mainnet.yaml
|
||||
# Why?
|
||||
# EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS* = 4096 # epochs
|
||||
# EPOCHS_PER_CUSTODY_PERIOD* = 4
|
||||
# CUSTODY_PERIOD_TO_RANDAO_PADDING* = 4
|
||||
|
@ -36,6 +36,11 @@ const
|
||||
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT* {.intdefine.} = 64
|
||||
MIN_GENESIS_TIME* {.intdefine.} = 1578009600 # 3 Jan, 2020
|
||||
|
||||
# Unchanged
|
||||
HYSTERESIS_QUOTIENT* = 4
|
||||
HYSTERESIS_DOWNWARD_MULTIPLIER* = 1
|
||||
HYSTERESIS_UPWARD_MULTIPLIER* = 5
|
||||
|
||||
# Constants
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#constants
|
||||
@ -85,12 +90,16 @@ const
|
||||
MAX_SEED_LOOKAHEAD* = 4
|
||||
|
||||
# Changed
|
||||
SLOTS_PER_ETH1_VOTING_PERIOD* = 16
|
||||
EPOCHS_PER_ETH1_VOTING_PERIOD* = 2
|
||||
SLOTS_PER_HISTORICAL_ROOT* = 64
|
||||
|
||||
# Unchanged
|
||||
MIN_VALIDATOR_WITHDRAWABILITY_DELAY* = 2'u64^8
|
||||
PERSISTENT_COMMITTEE_PERIOD* = 2'u64^11
|
||||
|
||||
# Changed
|
||||
PERSISTENT_COMMITTEE_PERIOD* = 128
|
||||
|
||||
# Unchanged
|
||||
MAX_EPOCHS_PER_CROSSLINK* = 4
|
||||
|
||||
# Changed
|
||||
@ -146,6 +155,29 @@ const
|
||||
EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION* = 256 # epochs ~ 27 hours
|
||||
SECONDS_PER_ETH1_BLOCK* = 14 # estimate from Eth1 mainnet)
|
||||
|
||||
# Phase 1: Upgrade from Phase 0
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/minimal.yaml#L161
|
||||
PHASE_1_FORK_VERSION* = 16777217
|
||||
INITIAL_ACTIVE_SHARDS* = 4
|
||||
INITIAL_GASPRICE* = 10
|
||||
|
||||
# Phase 1: General
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/minimal.yaml#L171
|
||||
MAX_SHARDS* = 8
|
||||
ONLINE_PERIOD* = 8 # epochs ~ 51 minutes
|
||||
LIGHT_CLIENT_COMMITTEE_SIZE* = 128
|
||||
LIGHT_CLIENT_COMMITTEE_PERIOD* = 256 # epochs
|
||||
SHARD_COMMITTEE_PERIOD* = 256 # epochs
|
||||
SHARD_BLOCK_CHUNK_SIZE* = 262144
|
||||
MAX_SHARD_BLOCK_CHUNKS* = 4
|
||||
TARGET_SHARD_BLOCK_SIZE* = 196608
|
||||
MAX_SHARD_BLOCKS_PER_ATTESTATION* = 12
|
||||
MAX_GASPRICE* = 16384 # Gwei
|
||||
MIN_GASPRICE* = 32 # Gwei
|
||||
GASPRICE_ADJUSTMENT_COEFFICIENT* = 8
|
||||
|
||||
# Phase 1 - Sharding
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/configs/minimal.yaml#L157
|
||||
@ -161,6 +193,22 @@ const
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase1/custody-game.md#constants
|
||||
# TODO those are included in minimal.yaml but not mainnet.yaml
|
||||
# Why?
|
||||
RANDAO_PENALTY_EPOCHS* = 2
|
||||
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS* = 4096 # epochs
|
||||
EPOCHS_PER_CUSTODY_PERIOD* = 4
|
||||
CUSTODY_PERIOD_TO_RANDAO_PADDING* = 4
|
||||
EPOCHS_PER_CUSTODY_PERIOD* = 2048
|
||||
|
||||
# Time parameters
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/minimal.yaml#L204
|
||||
CUSTODY_PERIOD_TO_RANDAO_PADDING* = 2048
|
||||
MAX_REVEAL_LATENESS_DECREMENT* = 128
|
||||
|
||||
# Max operations
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/minimal.yaml#L216
|
||||
MAX_CUSTODY_KEY_REVEALS* = 256
|
||||
MAX_EARLY_DERIVED_SECRET_REVEALS* = 1
|
||||
MAX_CUSTODY_SLASHINGS* = 1
|
||||
|
||||
# Reward and penalty quotients
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/configs/minimal.yaml#L222
|
||||
EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE* = 2
|
||||
MINOR_REWARD_QUOTIENT* = 256
|
||||
|
@ -44,7 +44,7 @@ declareGauge beacon_previous_live_validators, "Number of active validators that
|
||||
declareGauge beacon_pending_deposits, "Number of pending deposits (state.eth1_data.deposit_count - state.eth1_deposit_index)" # On block
|
||||
declareGauge beacon_processed_deposits_total, "Number of total deposits included on chain" # On block
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#block-header
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#block-header
|
||||
proc process_block_header*(
|
||||
state: var BeaconState, blck: BeaconBlock, flags: UpdateFlags,
|
||||
stateCache: var StateCache): bool {.nbench.}=
|
||||
@ -55,6 +55,16 @@ proc process_block_header*(
|
||||
state_slot = shortLog(state.slot)
|
||||
return false
|
||||
|
||||
# Verify that proposer index is the correct index
|
||||
let proposer_index = get_beacon_proposer_index(state, stateCache)
|
||||
if proposer_index.isNone:
|
||||
debug "Block header: proposer missing"
|
||||
return false
|
||||
|
||||
if not (blck.proposer_index.ValidatorIndex == proposer_index.get):
|
||||
notice "Block header: proposer index incorrect"
|
||||
return false
|
||||
|
||||
# Verify that the parent matches
|
||||
if skipBlockParentRootValidation notin flags and not (blck.parent_root ==
|
||||
hash_tree_root(state.latest_block_header)):
|
||||
@ -64,20 +74,16 @@ proc process_block_header*(
|
||||
latest_block_header_root = shortLog(hash_tree_root(state.latest_block_header))
|
||||
return false
|
||||
|
||||
# Save current block as the new latest block
|
||||
# Cache current block as the new latest block
|
||||
state.latest_block_header = BeaconBlockHeader(
|
||||
slot: blck.slot,
|
||||
proposer_index: blck.proposer_index,
|
||||
parent_root: blck.parent_root,
|
||||
# state_root: zeroed, overwritten in the next `process_slot` call
|
||||
body_root: hash_tree_root(blck.body),
|
||||
)
|
||||
|
||||
# Verify proposer is not slashed
|
||||
let proposer_index = get_beacon_proposer_index(state, stateCache)
|
||||
if proposer_index.isNone:
|
||||
debug "Block header: proposer missing"
|
||||
return false
|
||||
|
||||
let proposer = state.validators[proposer_index.get]
|
||||
if proposer.slashed:
|
||||
notice "Block header: proposer slashed"
|
||||
@ -119,48 +125,56 @@ proc process_randao(
|
||||
|
||||
true
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#eth1-data
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#eth1-data
|
||||
func process_eth1_data(state: var BeaconState, body: BeaconBlockBody) {.nbench.}=
|
||||
state.eth1_data_votes.add body.eth1_data
|
||||
if state.eth1_data_votes.count(body.eth1_data) * 2 >
|
||||
SLOTS_PER_ETH1_VOTING_PERIOD:
|
||||
EPOCHS_PER_ETH1_VOTING_PERIOD * SLOTS_PER_EPOCH:
|
||||
state.eth1_data = body.eth1_data
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#is_slashable_validator
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#is_slashable_validator
|
||||
func is_slashable_validator(validator: Validator, epoch: Epoch): bool =
|
||||
# Check if ``validator`` is slashable.
|
||||
(not validator.slashed) and
|
||||
(validator.activation_epoch <= epoch) and
|
||||
(epoch < validator.withdrawable_epoch)
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.9.4/specs/core/0_beacon-chain.md#proposer-slashings
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#proposer-slashings
|
||||
proc process_proposer_slashing*(
|
||||
state: var BeaconState, proposer_slashing: ProposerSlashing,
|
||||
flags: UpdateFlags, stateCache: var StateCache): bool {.nbench.}=
|
||||
if proposer_slashing.proposer_index.int >= state.validators.len:
|
||||
|
||||
let
|
||||
header_1 = proposer_slashing.signed_header_1.message
|
||||
header_2 = proposer_slashing.signed_header_2.message
|
||||
|
||||
# Not from spec
|
||||
if header_1.proposer_index.int >= state.validators.len:
|
||||
notice "Proposer slashing: invalid proposer index"
|
||||
return false
|
||||
|
||||
let proposer = state.validators[proposer_slashing.proposer_index.int]
|
||||
|
||||
# Verify slots match
|
||||
if not (proposer_slashing.signed_header_1.message.slot ==
|
||||
proposer_slashing.signed_header_2.message.slot):
|
||||
# Verify header slots match
|
||||
if not (header_1.slot == header_2.slot):
|
||||
notice "Proposer slashing: slot mismatch"
|
||||
return false
|
||||
|
||||
# But the headers are different
|
||||
if not (proposer_slashing.signed_header_1.message !=
|
||||
proposer_slashing.signed_header_2.message):
|
||||
# Verify header proposer indices match
|
||||
if not (header_1.proposer_index == header_2.proposer_index):
|
||||
notice "Proposer slashing: proposer indices mismatch"
|
||||
return false
|
||||
|
||||
# Verify the headers are different
|
||||
if not (header_1 != header_2):
|
||||
notice "Proposer slashing: headers not different"
|
||||
return false
|
||||
|
||||
# Check proposer is slashable
|
||||
# Verify the proposer is slashable
|
||||
let proposer = state.validators[header_1.proposer_index]
|
||||
if not is_slashable_validator(proposer, get_current_epoch(state)):
|
||||
notice "Proposer slashing: slashed proposer"
|
||||
return false
|
||||
|
||||
# Signatures are valid
|
||||
# Verify signatures
|
||||
if skipBlsValidation notin flags:
|
||||
for i, signed_header in [proposer_slashing.signed_header_1,
|
||||
proposer_slashing.signed_header_2]:
|
||||
@ -174,8 +188,7 @@ proc process_proposer_slashing*(
|
||||
signature_index = i
|
||||
return false
|
||||
|
||||
slashValidator(
|
||||
state, proposer_slashing.proposer_index.ValidatorIndex, stateCache)
|
||||
slashValidator(state, header_1.proposer_index.ValidatorIndex, stateCache)
|
||||
|
||||
true
|
||||
|
||||
|
@ -90,7 +90,7 @@ func get_matching_target_attestations(state: BeaconState, epoch: Epoch):
|
||||
func get_matching_head_attestations(state: BeaconState, epoch: Epoch):
|
||||
seq[PendingAttestation] =
|
||||
filterIt(
|
||||
get_matching_source_attestations(state, epoch),
|
||||
get_matching_target_attestations(state, epoch),
|
||||
it.data.beacon_block_root ==
|
||||
get_block_root_at_slot(state, it.data.slot)
|
||||
)
|
||||
@ -367,22 +367,27 @@ func process_slashings*(state: var BeaconState) {.nbench.}=
|
||||
let penalty = penalty_numerator div total_balance * increment
|
||||
decrease_balance(state, index.ValidatorIndex, penalty)
|
||||
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#final-updates
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.11.0/specs/phase0/beacon-chain.md#final-updates
|
||||
func process_final_updates*(state: var BeaconState) {.nbench.}=
|
||||
let
|
||||
current_epoch = get_current_epoch(state)
|
||||
next_epoch = current_epoch + 1
|
||||
|
||||
# Reset eth1 data votes
|
||||
if (state.slot + 1) mod SLOTS_PER_ETH1_VOTING_PERIOD == 0:
|
||||
if next_epoch mod EPOCHS_PER_ETH1_VOTING_PERIOD == 0:
|
||||
state.eth1_data_votes = @[]
|
||||
|
||||
# Update effective balances with hysteresis
|
||||
for index, validator in state.validators:
|
||||
let balance = state.balances[index]
|
||||
const HALF_INCREMENT = EFFECTIVE_BALANCE_INCREMENT div 2
|
||||
if balance < validator.effective_balance or
|
||||
validator.effective_balance + 3'u64 * HALF_INCREMENT < balance:
|
||||
const
|
||||
HYSTERESIS_INCREMENT =
|
||||
EFFECTIVE_BALANCE_INCREMENT div HYSTERESIS_QUOTIENT
|
||||
DOWNWARD_THRESHOLD =
|
||||
HYSTERESIS_INCREMENT * HYSTERESIS_DOWNWARD_MULTIPLIER
|
||||
UPWARD_THRESHOLD = HYSTERESIS_INCREMENT * HYSTERESIS_UPWARD_MULTIPLIER
|
||||
if balance + DOWNWARD_THRESHOLD < validator.effective_balance or
|
||||
validator.effective_balance + UPWARD_THRESHOLD < balance:
|
||||
state.validators[index].effective_balance =
|
||||
min(
|
||||
balance - balance mod EFFECTIVE_BALANCE_INCREMENT,
|
||||
|
@ -74,10 +74,14 @@ proc mockBlock(
|
||||
state: BeaconState,
|
||||
slot: Slot,
|
||||
flags: UpdateFlags = {}): SignedBeaconBlock =
|
||||
## TODO don't do this gradual construction, for exception safety
|
||||
## Mock a BeaconBlock for the specific slot
|
||||
## Skip signature creation if block should not be signed (skipBlsValidation present)
|
||||
|
||||
var emptyCache = get_empty_per_epoch_cache()
|
||||
let proposer_index = get_beacon_proposer_index(state, emptyCache)
|
||||
result.message.slot = slot
|
||||
result.message.proposer_index = proposer_index.get.uint64
|
||||
result.message.body.eth1_data.deposit_count = state.eth1_deposit_index
|
||||
|
||||
var previous_block_header = state.latest_block_header
|
||||
|
@ -36,7 +36,7 @@ proc readValue*(r: var JsonReader, a: var seq[byte]) {.inline.} =
|
||||
|
||||
const
|
||||
FixturesDir* = currentSourcePath.rsplit(DirSep, 1)[0] / ".." / ".." / "vendor" / "nim-eth2-scenarios"
|
||||
SszTestsDir* = FixturesDir/"tests-v0.10.1"
|
||||
SszTestsDir* = FixturesDir/"tests-v0.11.0"
|
||||
|
||||
proc parseTest*(path: string, Format: typedesc[Json or SSZ], T: typedesc): T =
|
||||
try:
|
||||
|
@ -19,7 +19,7 @@ import
|
||||
const
|
||||
SpecDir = currentSourcePath.rsplit(DirSep, 1)[0] /
|
||||
".."/".."/"beacon_chain"/"spec"
|
||||
Config = FixturesDir/"tests-v0.10.1"/const_preset/"config.yaml"
|
||||
Config = FixturesDir/"tests-v0.11.0"/const_preset/"config.yaml"
|
||||
|
||||
type
|
||||
CheckedType = SomeInteger or Slot or Epoch
|
||||
@ -87,7 +87,8 @@ const
|
||||
|
||||
const IgnoreKeys = [
|
||||
# Ignore all non-numeric types
|
||||
"DEPOSIT_CONTRACT_ADDRESS"
|
||||
"DEPOSIT_CONTRACT_ADDRESS",
|
||||
"SHARD_BLOCK_OFFSETS"
|
||||
]
|
||||
|
||||
func parseU32LEHex(hexValue: string): uint32 =
|
||||
@ -115,11 +116,11 @@ proc checkConfig() =
|
||||
let domain = parseEnum[DomainType](constant)
|
||||
let value = parseU32LEHex(value.getStr())
|
||||
check: uint32(domain) == value
|
||||
elif constant == "GENESIS_FORK_VERSION":
|
||||
elif constant.endsWith("_FORK_VERSION"):
|
||||
let value = parseU32LEHex(value.getStr())
|
||||
check: ConstsToCheck[constant] == value
|
||||
else:
|
||||
check: ConstsToCheck[constant] == value.getBiggestInt().uint64()
|
||||
|
||||
suiteReport "Official - 0.10.1 - constants & config " & preset():
|
||||
suiteReport "Official - 0.11.0 - constants & config " & preset():
|
||||
checkConfig()
|
||||
|
@ -69,7 +69,10 @@ suiteReport "Official - Sanity - Blocks " & preset():
|
||||
[
|
||||
"attester_slashing",
|
||||
# TODO: regression BLS v0.10.1 to fix
|
||||
"expected_deposit_in_block"
|
||||
"expected_deposit_in_block",
|
||||
# TODO: regressions in 0.11.0 for the moment
|
||||
"high_proposer_index",
|
||||
"proposer_after_inactive_index"
|
||||
]
|
||||
|
||||
for kind, path in walkDir(SanityBlocksDir, true):
|
||||
|
@ -25,7 +25,7 @@ import
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
const
|
||||
SSZDir = FixturesDir/"tests-v0.10.1"/const_preset/"phase0"/"ssz_static"
|
||||
SSZDir = FixturesDir/"tests-v0.11.0"/const_preset/"phase0"/"ssz_static"
|
||||
|
||||
type
|
||||
SSZHashTreeRoot = object
|
||||
@ -89,10 +89,13 @@ proc runSSZtests() =
|
||||
of "Eth1Block": checkSSZ(Eth1Block, path, hash)
|
||||
of "Eth1Data": checkSSZ(Eth1Data, path, hash)
|
||||
of "Fork": checkSSZ(Fork, path, hash)
|
||||
of "ForkData": checkSSZ(ForkData, path, hash)
|
||||
of "HistoricalBatch": checkSSZ(HistoricalBatch, path, hash)
|
||||
of "IndexedAttestation": checkSSZ(IndexedAttestation, path, hash)
|
||||
of "PendingAttestation": checkSSZ(PendingAttestation, path, hash)
|
||||
of "ProposerSlashing": checkSSZ(ProposerSlashing, path, hash)
|
||||
of "SignedAggregateAndProof":
|
||||
checkSSZ(SignedAggregateAndProof, path, hash)
|
||||
of "SignedBeaconBlock": checkSSZ(SignedBeaconBlock, path, hash)
|
||||
of "SignedBeaconBlockHeader":
|
||||
checkSSZ(SignedBeaconBlockHeader, path, hash)
|
||||
@ -103,7 +106,7 @@ proc runSSZtests() =
|
||||
else:
|
||||
raise newException(ValueError, "Unsupported test: " & sszType)
|
||||
|
||||
suiteReport "Official - 0.10.1 - SSZ consensus objects " & preset():
|
||||
suiteReport "Official - 0.11.0 - SSZ consensus objects " & preset():
|
||||
runSSZtests()
|
||||
|
||||
summarizeLongTests("FixtureSSZConsensus")
|
||||
|
@ -97,6 +97,7 @@ proc addBlock*(
|
||||
new_block = SignedBeaconBlock(
|
||||
message: BeaconBlock(
|
||||
slot: state.slot + 1,
|
||||
proposer_index: proposer_index.get.uint64,
|
||||
parent_root: previous_block_root,
|
||||
state_root: Eth2Digest(), # we need the new state first
|
||||
body: new_body
|
||||
|
Loading…
x
Reference in New Issue
Block a user