mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-12 11:44:41 +00:00
upgrade config to mainnet values
This commit is contained in:
parent
6a1813b1d6
commit
157f7e8ef4
@ -1,6 +1,4 @@
|
||||
# Mainnet preset
|
||||
# Note: the intention of this file (for now) is to illustrate what a mainnet configuration could look like.
|
||||
# Some of these constants may still change before the launch of Phase 0.
|
||||
|
||||
CONFIG_NAME: "mainnet"
|
||||
|
||||
@ -28,8 +26,6 @@ HYSTERESIS_QUOTIENT: 4
|
||||
HYSTERESIS_DOWNWARD_MULTIPLIER: 1
|
||||
# 5 (plus 1.25)
|
||||
HYSTERESIS_UPWARD_MULTIPLIER: 5
|
||||
# 3
|
||||
PROPORTIONAL_SLASHING_MULTIPLIER: 3
|
||||
|
||||
|
||||
# Fork Choice
|
||||
@ -82,8 +78,8 @@ BLS_WITHDRAWAL_PREFIX: 0x00
|
||||
|
||||
# Time parameters
|
||||
# ---------------------------------------------------------------
|
||||
# 172800 seconds (2 days)
|
||||
GENESIS_DELAY: 172800
|
||||
# 604800 seconds (7 days)
|
||||
GENESIS_DELAY: 604800
|
||||
# 12 seconds
|
||||
SECONDS_PER_SLOT: 12
|
||||
# 2**0 (= 1) slots 12 seconds
|
||||
@ -126,10 +122,12 @@ BASE_REWARD_FACTOR: 64
|
||||
WHISTLEBLOWER_REWARD_QUOTIENT: 512
|
||||
# 2**3 (= 8)
|
||||
PROPOSER_REWARD_QUOTIENT: 8
|
||||
# 2**24 (= 16,777,216)
|
||||
INACTIVITY_PENALTY_QUOTIENT: 16777216
|
||||
# 2**5 (= 32)
|
||||
MIN_SLASHING_PENALTY_QUOTIENT: 32
|
||||
# 2**26 (= 67,108,864)
|
||||
INACTIVITY_PENALTY_QUOTIENT: 67108864
|
||||
# 2**7 (= 128) (lower safety margin at Phase 0 genesis)
|
||||
MIN_SLASHING_PENALTY_QUOTIENT: 128
|
||||
# 1 (lower safety margin at Phase 0 genesis)
|
||||
PROPORTIONAL_SLASHING_MULTIPLIER: 1
|
||||
|
||||
|
||||
# Max operations per block
|
||||
|
@ -27,8 +27,6 @@ HYSTERESIS_QUOTIENT: 4
|
||||
HYSTERESIS_DOWNWARD_MULTIPLIER: 1
|
||||
# 5 (plus 1.25)
|
||||
HYSTERESIS_UPWARD_MULTIPLIER: 5
|
||||
# 3
|
||||
PROPORTIONAL_SLASHING_MULTIPLIER: 3
|
||||
|
||||
|
||||
# Fork Choice
|
||||
@ -125,10 +123,12 @@ BASE_REWARD_FACTOR: 64
|
||||
WHISTLEBLOWER_REWARD_QUOTIENT: 512
|
||||
# 2**3 (= 8)
|
||||
PROPOSER_REWARD_QUOTIENT: 8
|
||||
# 2**24 (= 16,777,216)
|
||||
INACTIVITY_PENALTY_QUOTIENT: 16777216
|
||||
# 2**5 (= 32)
|
||||
MIN_SLASHING_PENALTY_QUOTIENT: 32
|
||||
# [customized] 2**25 (= 33,554,432)
|
||||
INACTIVITY_PENALTY_QUOTIENT: 33554432
|
||||
# [customized] 2**6 (= 64)
|
||||
MIN_SLASHING_PENALTY_QUOTIENT: 64
|
||||
# [customized] 2 (lower safety margin than Phase 0 genesis but different than mainnet config for testing)
|
||||
PROPORTIONAL_SLASHING_MULTIPLIER: 2
|
||||
|
||||
|
||||
# Max operations per block
|
||||
|
@ -195,7 +195,6 @@ The following values are (non-configurable) constants used throughout the specif
|
||||
| `HYSTERESIS_QUOTIENT` | `uint64(4)` |
|
||||
| `HYSTERESIS_DOWNWARD_MULTIPLIER` | `uint64(1)` |
|
||||
| `HYSTERESIS_UPWARD_MULTIPLIER` | `uint64(5)` |
|
||||
| `PROPORTIONAL_SLASHING_MULTIPLIER` | `uint64(3)` |
|
||||
|
||||
- For the safety of committees, `TARGET_COMMITTEE_SIZE` exceeds [the recommended minimum committee size of 111](http://web.archive.org/web/20190504131341/https://vitalik.ca/files/Ithaca201807_Sharding.pdf); with sufficient active validators (at least `SLOTS_PER_EPOCH * TARGET_COMMITTEE_SIZE`), the shuffling algorithm ensures committee sizes of at least `TARGET_COMMITTEE_SIZE`. (Unbiasable randomness with a Verifiable Delay Function (VDF) will improve committee robustness and lower the safe minimum committee size.)
|
||||
|
||||
@ -219,7 +218,7 @@ The following values are (non-configurable) constants used throughout the specif
|
||||
|
||||
| Name | Value | Unit | Duration |
|
||||
| - | - | :-: | :-: |
|
||||
| `GENESIS_DELAY` | `uint64(172800)` | seconds | 2 days |
|
||||
| `GENESIS_DELAY` | `uint64(604800)` | seconds | 7 days |
|
||||
| `SECONDS_PER_SLOT` | `uint64(12)` | seconds | 12 seconds |
|
||||
| `SECONDS_PER_ETH1_BLOCK` | `uint64(14)` | seconds | 14 seconds |
|
||||
| `MIN_ATTESTATION_INCLUSION_DELAY` | `uint64(2**0)` (= 1) | slots | 12 seconds |
|
||||
@ -248,10 +247,13 @@ The following values are (non-configurable) constants used throughout the specif
|
||||
| `BASE_REWARD_FACTOR` | `uint64(2**6)` (= 64) |
|
||||
| `WHISTLEBLOWER_REWARD_QUOTIENT` | `uint64(2**9)` (= 512) |
|
||||
| `PROPOSER_REWARD_QUOTIENT` | `uint64(2**3)` (= 8) |
|
||||
| `INACTIVITY_PENALTY_QUOTIENT` | `uint64(2**24)` (= 16,777,216) |
|
||||
| `MIN_SLASHING_PENALTY_QUOTIENT` | `uint64(2**5)` (= 32) |
|
||||
| `INACTIVITY_PENALTY_QUOTIENT` | `uint64(2**26)` (= 67,108,864) |
|
||||
| `MIN_SLASHING_PENALTY_QUOTIENT` | `uint64(2**7)` (=128) |
|
||||
| `PROPORTIONAL_SLASHING_MULTIPLIER` | `uint64(1)` |
|
||||
|
||||
- The `INACTIVITY_PENALTY_QUOTIENT` equals `INVERSE_SQRT_E_DROP_TIME**2` where `INVERSE_SQRT_E_DROP_TIME := 2**12` epochs (about 18 days) is the time it takes the inactivity penalty to reduce the balance of non-participating validators to about `1/sqrt(e) ~= 60.6%`. Indeed, the balance retained by offline validators after `n` epochs is about `(1 - 1/INACTIVITY_PENALTY_QUOTIENT)**(n**2/2)`; so after `INVERSE_SQRT_E_DROP_TIME` epochs, it is roughly `(1 - 1/INACTIVITY_PENALTY_QUOTIENT)**(INACTIVITY_PENALTY_QUOTIENT/2) ~= 1/sqrt(e)`.
|
||||
- The `INACTIVITY_PENALTY_QUOTIENT` equals `INVERSE_SQRT_E_DROP_TIME**2` where `INVERSE_SQRT_E_DROP_TIME := 2**13` epochs (about 36 days) is the time it takes the inactivity penalty to reduce the balance of non-participating validators to about `1/sqrt(e) ~= 60.6%`. Indeed, the balance retained by offline validators after `n` epochs is about `(1 - 1/INACTIVITY_PENALTY_QUOTIENT)**(n**2/2)`; so after `INVERSE_SQRT_E_DROP_TIME` epochs, it is roughly `(1 - 1/INACTIVITY_PENALTY_QUOTIENT)**(INACTIVITY_PENALTY_QUOTIENT/2) ~= 1/sqrt(e)`. Note this value will be upgraded to `2**24` after Phase 0 mainnet stabilizes to provide a faster recovery in the event of an inactivity leak.
|
||||
|
||||
- The `PROPORTIONAL_SLASHING_MULTIPLIER` is set to `1` at initial mainnet launch, resulting in one-third of the minimum accountable safety margin in the event of a finality attack. After Phase 0 mainnet stablizes, this value will be upgraded to `3` to provide the maximal minimum accoutable safety margin.
|
||||
|
||||
### Max operations per block
|
||||
|
||||
|
@ -1444,7 +1444,7 @@ ENRs contain `fork_digest` which utilizes the `genesis_validators_root` for a cl
|
||||
so prior to knowing genesis, we cannot use `fork_digest` to cleanly find peers on our intended chain.
|
||||
Once genesis data is known, we can then form ENRs and safely find peers.
|
||||
|
||||
When using an eth1 deposit contract for deposits, `fork_digest` will be known `GENESIS_DELAY` (48hours in mainnet configuration) before `genesis_time`,
|
||||
When using an eth1 deposit contract for deposits, `fork_digest` will be known `GENESIS_DELAY` (7 days in mainnet configuration) before `genesis_time`,
|
||||
providing ample time to find peers and form initial connections and gossip subnets prior to genesis.
|
||||
|
||||
## Compression/Encoding
|
||||
|
@ -26,7 +26,7 @@ def slash_validators(spec, state, indices, out_epochs):
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
def test_max_penalties(spec, state):
|
||||
slashed_count = (len(state.validators) // 3) + 1
|
||||
slashed_count = (len(state.validators) // spec.PROPORTIONAL_SLASHING_MULTIPLIER) + 1
|
||||
out_epoch = spec.get_current_epoch(state) + (spec.EPOCHS_PER_SLASHINGS_VECTOR // 2)
|
||||
|
||||
slashed_indices = list(range(slashed_count))
|
||||
@ -35,7 +35,7 @@ def test_max_penalties(spec, state):
|
||||
total_balance = spec.get_total_active_balance(state)
|
||||
total_penalties = sum(state.slashings)
|
||||
|
||||
assert total_balance // 3 <= total_penalties
|
||||
assert total_balance // spec.PROPORTIONAL_SLASHING_MULTIPLIER <= total_penalties
|
||||
|
||||
yield from run_process_slashings(spec, state)
|
||||
|
||||
@ -91,12 +91,12 @@ def test_scaled_penalties(spec, state):
|
||||
state.slashings[5] = base + (incr * 6)
|
||||
state.slashings[spec.EPOCHS_PER_SLASHINGS_VECTOR - 1] = base + (incr * 7)
|
||||
|
||||
slashed_count = len(state.validators) // 4
|
||||
slashed_count = len(state.validators) // (spec.PROPORTIONAL_SLASHING_MULTIPLIER + 1)
|
||||
|
||||
assert slashed_count > 10
|
||||
|
||||
# make the balances non-uniform.
|
||||
# Otherwise it would just be a simple 3/4 balance slashing. Test the per-validator scaled penalties.
|
||||
# Otherwise it would just be a simple balance slashing. Test the per-validator scaled penalties.
|
||||
diff = spec.MAX_EFFECTIVE_BALANCE - base
|
||||
increments = diff // incr
|
||||
for i in range(10):
|
||||
@ -129,7 +129,7 @@ def test_scaled_penalties(spec, state):
|
||||
v = state.validators[i]
|
||||
expected_penalty = (
|
||||
v.effective_balance // spec.EFFECTIVE_BALANCE_INCREMENT
|
||||
* (3 * total_penalties)
|
||||
* (spec.PROPORTIONAL_SLASHING_MULTIPLIER * total_penalties)
|
||||
// (total_balance)
|
||||
* spec.EFFECTIVE_BALANCE_INCREMENT
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user