From 4c5a57d8ee6cc149b49e5db16a01e89b3a55575e Mon Sep 17 00:00:00 2001 From: protolambda Date: Fri, 26 Apr 2019 14:30:14 +0800 Subject: [PATCH 1/2] fix test-generators --- test_generators/operations/deposits.py | 2 +- test_generators/operations/genesis.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test_generators/operations/deposits.py b/test_generators/operations/deposits.py index bd523abe41..075ccbd5ba 100644 --- a/test_generators/operations/deposits.py +++ b/test_generators/operations/deposits.py @@ -77,7 +77,7 @@ def build_deposit_for_index(initial_validator_count: int, index: int) -> Tuple[s keys.pubkeys[index], keys.withdrawal_creds[index], keys.privkeys[index], - spec.MAX_DEPOSIT_AMOUNT, + spec.MAX_EFFECTIVE_BALANCE, ) state.latest_eth1_data.deposit_root = get_merkle_root(tuple(deposit_data_leaves)) diff --git a/test_generators/operations/genesis.py b/test_generators/operations/genesis.py index decb822f8e..f4d63c10ec 100644 --- a/test_generators/operations/genesis.py +++ b/test_generators/operations/genesis.py @@ -26,7 +26,7 @@ def create_deposits(pubkeys: List[spec.BLSPubkey], withdrawal_cred: List[spec.By spec.DepositData( pubkey=pubkeys[i], withdrawal_credentials=spec.BLS_WITHDRAWAL_PREFIX_BYTE + withdrawal_cred[i][1:], - amount=spec.MAX_DEPOSIT_AMOUNT, + amount=spec.MAX_EFFECTIVE_BALANCE, proof_of_possession=proof_of_possession, ) for i in range(len(pubkeys)) ] From 15ad1fca079155398d3afd4540418cd7c86d4f69 Mon Sep 17 00:00:00 2001 From: protolambda Date: Fri, 26 Apr 2019 15:57:20 +0800 Subject: [PATCH 2/2] update configs --- configs/constant_presets/mainnet.yaml | 14 +++++++++----- configs/constant_presets/minimal.yaml | 15 +++++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/configs/constant_presets/mainnet.yaml b/configs/constant_presets/mainnet.yaml index d63c617b74..72d0fdc8f2 100644 --- a/configs/constant_presets/mainnet.yaml +++ b/configs/constant_presets/mainnet.yaml @@ -15,6 +15,8 @@ MAX_INDICES_PER_ATTESTATION: 4096 MIN_PER_EPOCH_CHURN_LIMIT: 4 # 2**16 (= 65,536) CHURN_LIMIT_QUOTIENT: 65536 +# Normalizes base rewards +BASE_REWARDS_PER_EPOCH: 5 # See issue 563 SHUFFLE_ROUND_COUNT: 90 @@ -36,7 +38,7 @@ MAX_EFFECTIVE_BALANCE: 32000000000 # 2**4 * 10**9 (= 16,000,000,000) Gwei EJECTION_BALANCE: 16000000000 # 2**0 * 10**9 (= 1,000,000,000) Gwei -HIGH_BALANCE_INCREMENT: 1000000000 +EFFECTIVE_BALANCE_INCREMENT: 1000000000 # Initial values @@ -71,6 +73,8 @@ MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256 PERSISTENT_COMMITTEE_PERIOD: 2048 # 2**6 (= 64) epochs ~7 hours MAX_CROSSLINK_EPOCHS: 64 +# 2**2 (= 4) epochs 25.6 minutes +MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4 # State list lengths @@ -91,14 +95,14 @@ BASE_REWARD_QUOTIENT: 32 WHISTLEBLOWING_REWARD_QUOTIENT: 512 # 2**3 (= 8) PROPOSER_REWARD_QUOTIENT: 8 -# 2**24 (= 16,777,216) -INACTIVITY_PENALTY_QUOTIENT: 16777216 +# 2**25 (= 33,554,432) +INACTIVITY_PENALTY_QUOTIENT: 33554432 +# 2**5 (= 32) +MIN_SLASHING_PENALTY_QUOTIENT: 32 # Max operations per block # --------------------------------------------------------------- -# 2**5 (= 32) -MIN_PENALTY_QUOTIENT: 32 # 2**4 (= 16) MAX_PROPOSER_SLASHINGS: 16 # 2**0 (= 1) diff --git a/configs/constant_presets/minimal.yaml b/configs/constant_presets/minimal.yaml index 711f6737d7..0a6cab6872 100644 --- a/configs/constant_presets/minimal.yaml +++ b/configs/constant_presets/minimal.yaml @@ -6,7 +6,6 @@ # [customized] Just 8 shards for testing purposes SHARD_COUNT: 8 - # [customized] unsecure, but fast TARGET_COMMITTEE_SIZE: 4 # 2**12 (= 4,096) @@ -15,6 +14,8 @@ MAX_INDICES_PER_ATTESTATION: 4096 MIN_PER_EPOCH_CHURN_LIMIT: 4 # 2**16 (= 65,536) CHURN_LIMIT_QUOTIENT: 65536 +# Normalizes base rewards +BASE_REWARDS_PER_EPOCH: 5 # [customized] Faster, but unsecure. SHUFFLE_ROUND_COUNT: 10 @@ -36,7 +37,7 @@ MAX_EFFECTIVE_BALANCE: 32000000000 # 2**4 * 10**9 (= 16,000,000,000) Gwei EJECTION_BALANCE: 16000000000 # 2**0 * 10**9 (= 1,000,000,000) Gwei -HIGH_BALANCE_INCREMENT: 1000000000 +EFFECTIVE_BALANCE_INCREMENT: 1000000000 # Initial values @@ -71,6 +72,8 @@ MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256 PERSISTENT_COMMITTEE_PERIOD: 2048 # 2**6 (= 64) epochs ~7 hours MAX_CROSSLINK_EPOCHS: 64 +# 2**2 (= 4) epochs 25.6 minutes +MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4 # State list lengths @@ -91,14 +94,14 @@ BASE_REWARD_QUOTIENT: 32 WHISTLEBLOWING_REWARD_QUOTIENT: 512 # 2**3 (= 8) PROPOSER_REWARD_QUOTIENT: 8 -# 2**24 (= 16,777,216) -INACTIVITY_PENALTY_QUOTIENT: 16777216 +# 2**25 (= 33,554,432) +INACTIVITY_PENALTY_QUOTIENT: 33554432 +# 2**5 (= 32) +MIN_SLASHING_PENALTY_QUOTIENT: 32 # Max operations per block # --------------------------------------------------------------- -# 2**5 (= 32) -MIN_PENALTY_QUOTIENT: 32 # 2**4 (= 16) MAX_PROPOSER_SLASHINGS: 16 # 2**0 (= 1)