Update beacon-chain.md
This commit is contained in:
parent
ef4b2c4542
commit
fedfe61d6c
|
@ -35,6 +35,7 @@ The primary source of load on the beacon chain are "attestations". Attestations
|
||||||
| --- | --- | :---: | - |
|
| --- | --- | :---: | - |
|
||||||
| `SHARD_COUNT` | 2**10 (= 1,024)| shards |
|
| `SHARD_COUNT` | 2**10 (= 1,024)| shards |
|
||||||
| `DEPOSIT_SIZE` | 2**5 (= 32) | ETH |
|
| `DEPOSIT_SIZE` | 2**5 (= 32) | ETH |
|
||||||
|
| `GWEI_PER_ETH` | 10**9 | Gwei/ETH |
|
||||||
| `MIN_COMMITTEE_SIZE` | 2**7 (= 128) | validators |
|
| `MIN_COMMITTEE_SIZE` | 2**7 (= 128) | validators |
|
||||||
| `GENESIS_TIME` | **TBD** | seconds |
|
| `GENESIS_TIME` | **TBD** | seconds |
|
||||||
| `SLOT_DURATION` | 2**4 (= 16) | seconds |
|
| `SLOT_DURATION` | 2**4 (= 16) | seconds |
|
||||||
|
@ -448,7 +449,7 @@ def add_validator(validators, pubkey, proof_of_possession, withdrawal_shard,
|
||||||
withdrawal_shard=withdrawal_shard,
|
withdrawal_shard=withdrawal_shard,
|
||||||
withdrawal_address=withdrawal_address,
|
withdrawal_address=withdrawal_address,
|
||||||
randao_commitment=randao_commitment,
|
randao_commitment=randao_commitment,
|
||||||
balance=DEPOSIT_SIZE * 10**9, # in Gwei
|
balance=DEPOSIT_SIZE * GWEI_PER_ETH, # in Gwei
|
||||||
status=PENDING_LOG_IN,
|
status=PENDING_LOG_IN,
|
||||||
exit_slot=0
|
exit_slot=0
|
||||||
)
|
)
|
||||||
|
@ -522,7 +523,7 @@ For all (`shard`, `shard_block_hash`) tuples, compute the total deposit size of
|
||||||
|
|
||||||
Let `time_since_finality = block.slot - last_finalized_slot`, and let `B` be the balance of any given validator whose balance we are adjusting, not including any balance changes from this round of state recalculation. Let:
|
Let `time_since_finality = block.slot - last_finalized_slot`, and let `B` be the balance of any given validator whose balance we are adjusting, not including any balance changes from this round of state recalculation. Let:
|
||||||
|
|
||||||
* `total_deposits = sum([v.balance for i, v in enumerate(validators) if i in get_active_validator_indices(validators, dynasty)])` and `total_deposits_in_ETH = total_deposits // 10**9`
|
* `total_deposits = sum([v.balance for i, v in enumerate(validators) if i in get_active_validator_indices(validators, dynasty)])` and `total_deposits_in_ETH = total_deposits // GWEI_PER_ETH`
|
||||||
* `reward_quotient = BASE_REWARD_QUOTIENT * int_sqrt(total_deposits_in_ETH)` (`1/reward_quotient` is the per-slot max interest rate)
|
* `reward_quotient = BASE_REWARD_QUOTIENT * int_sqrt(total_deposits_in_ETH)` (`1/reward_quotient` is the per-slot max interest rate)
|
||||||
* `quadratic_penalty_quotient = SQRT_E_DROP_TIME**2` (after `D` slots about `D*D/2/quadratic_penalty_quotient` is the portion lost by offline validators)
|
* `quadratic_penalty_quotient = SQRT_E_DROP_TIME**2` (after `D` slots about `D*D/2/quadratic_penalty_quotient` is the portion lost by offline validators)
|
||||||
|
|
||||||
|
@ -587,7 +588,7 @@ def change_validators(validators):
|
||||||
total_deposits = sum([v.balance for i, v in enumerate(validators) if i in active_validators])
|
total_deposits = sum([v.balance for i, v in enumerate(validators) if i in active_validators])
|
||||||
# The maximum total Gwei that can be deposited and withdrawn
|
# The maximum total Gwei that can be deposited and withdrawn
|
||||||
max_allowable_change = max(
|
max_allowable_change = max(
|
||||||
2 * DEPOSIT_SIZE * 10**9,
|
2 * DEPOSIT_SIZE * GWEI_PER_ETH,
|
||||||
total_deposits // MAX_VALIDATOR_CHURN_QUOTIENT
|
total_deposits // MAX_VALIDATOR_CHURN_QUOTIENT
|
||||||
)
|
)
|
||||||
# Go through the list start to end depositing+withdrawing as many as possible
|
# Go through the list start to end depositing+withdrawing as many as possible
|
||||||
|
|
Loading…
Reference in New Issue