diff --git a/configs/constant_presets/mainnet.yaml b/configs/constant_presets/mainnet.yaml index 6ac3f422f..dca2a69ba 100644 --- a/configs/constant_presets/mainnet.yaml +++ b/configs/constant_presets/mainnet.yaml @@ -48,7 +48,7 @@ GENESIS_FORK_VERSION: 0x00000000 GENESIS_SLOT: 0 # 2**64 - 1 FAR_FUTURE_EPOCH: 18446744073709551615 -BLS_WITHDRAWAL_PREFIX_BYTE: 0x00 +BLS_WITHDRAWAL_PREFIX: 0 # Time parameters @@ -90,7 +90,7 @@ LATEST_SLASHED_EXIT_LENGTH: 8192 # Reward and penalty quotients # --------------------------------------------------------------- # 2**5 (= 32) -BASE_REWARD_QUOTIENT: 32 +BASE_REWARD_FACTOR: 32 # 2**9 (= 512) WHISTLEBLOWING_REWARD_QUOTIENT: 512 # 2**3 (= 8) diff --git a/configs/constant_presets/minimal.yaml b/configs/constant_presets/minimal.yaml index 73448c3c6..fa337cfbf 100644 --- a/configs/constant_presets/minimal.yaml +++ b/configs/constant_presets/minimal.yaml @@ -47,7 +47,7 @@ GENESIS_FORK_VERSION: 0x00000000 GENESIS_SLOT: 0 # 2**64 - 1 FAR_FUTURE_EPOCH: 18446744073709551615 -BLS_WITHDRAWAL_PREFIX_BYTE: 0x00 +BLS_WITHDRAWAL_PREFIX: 0 # Time parameters @@ -58,23 +58,23 @@ SECONDS_PER_SLOT: 6 MIN_ATTESTATION_INCLUSION_DELAY: 2 # [customized] fast epochs SLOTS_PER_EPOCH: 8 -# 2**0 (= 1) epochs 6.4 minutes +# 2**0 (= 1) epochs MIN_SEED_LOOKAHEAD: 1 -# 2**2 (= 4) epochs 25.6 minutes +# 2**2 (= 4) epochs ACTIVATION_EXIT_DELAY: 4 # [customized] higher frequency new deposits from eth1 for testing SLOTS_PER_ETH1_VOTING_PERIOD: 16 # [customized] smaller state SLOTS_PER_HISTORICAL_ROOT: 64 -# 2**8 (= 256) epochs ~27 hours +# 2**8 (= 256) epochs MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256 -# 2**11 (= 2,048) epochs 9 days +# 2**11 (= 2,048) epochs PERSISTENT_COMMITTEE_PERIOD: 2048 -# 2**6 (= 64) epochs ~7 hours +# 2**6 (= 64) epochs MAX_EPOCHS_PER_CROSSLINK: 64 -# 2**2 (= 4) epochs 25.6 minutes +# 2**2 (= 4) epochs MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4 -# [customized] 2**12 (= 4,096) epochs 18 days +# [customized] 2**12 (= 4,096) epochs EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS: 4096 @@ -91,7 +91,7 @@ LATEST_SLASHED_EXIT_LENGTH: 64 # Reward and penalty quotients # --------------------------------------------------------------- # 2**5 (= 32) -BASE_REWARD_QUOTIENT: 32 +BASE_REWARD_FACTOR: 32 # 2**9 (= 512) WHISTLEBLOWING_REWARD_QUOTIENT: 512 # 2**3 (= 8) diff --git a/test_libs/pyspec/eth2spec/test/helpers/deposits.py b/test_libs/pyspec/eth2spec/test/helpers/deposits.py index 8f437ec89..1d4761753 100644 --- a/test_libs/pyspec/eth2spec/test/helpers/deposits.py +++ b/test_libs/pyspec/eth2spec/test/helpers/deposits.py @@ -67,7 +67,7 @@ def prepare_state_and_deposit(spec, state, validator_index, amount, withdrawal_c # insecurely use pubkey as withdrawal key if no credentials provided if withdrawal_credentials is None: - withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX_BYTE + spec.hash(pubkey)[1:] + withdrawal_credentials = spec.int_to_bytes(spec.BLS_WITHDRAWAL_PREFIX, length=1) + spec.hash(pubkey)[1:] deposit, root, deposit_data_leaves = build_deposit( spec, diff --git a/test_libs/pyspec/eth2spec/test/helpers/genesis.py b/test_libs/pyspec/eth2spec/test/helpers/genesis.py index 83af56621..a3ca915ef 100644 --- a/test_libs/pyspec/eth2spec/test/helpers/genesis.py +++ b/test_libs/pyspec/eth2spec/test/helpers/genesis.py @@ -5,7 +5,7 @@ from eth2spec.utils.ssz.ssz_impl import hash_tree_root def build_mock_validator(spec, i: int, balance: int): pubkey = pubkeys[i] # insecurely use pubkey as withdrawal key as well - withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX_BYTE + spec.hash(pubkey)[1:] + withdrawal_credentials = spec.int_to_bytes(spec.BLS_WITHDRAWAL_PREFIX, length=1) + spec.hash(pubkey)[1:] return spec.Validator( pubkey=pubkeys[i], withdrawal_credentials=withdrawal_credentials, diff --git a/test_libs/pyspec/eth2spec/test/helpers/transfers.py b/test_libs/pyspec/eth2spec/test/helpers/transfers.py index e619c5569..4d40deee7 100644 --- a/test_libs/pyspec/eth2spec/test/helpers/transfers.py +++ b/test_libs/pyspec/eth2spec/test/helpers/transfers.py @@ -32,7 +32,7 @@ def get_valid_transfer(spec, state, slot=None, sender_index=None, amount=None, f # ensure withdrawal_credentials reproducible state.validator_registry[transfer.sender].withdrawal_credentials = ( - spec.BLS_WITHDRAWAL_PREFIX_BYTE + spec.hash(transfer.pubkey)[1:] + spec.int_to_bytes(spec.BLS_WITHDRAWAL_PREFIX, length=1) + spec.hash(transfer.pubkey)[1:] ) return transfer diff --git a/test_libs/pyspec/eth2spec/test/phase_0/block_processing/test_process_deposit.py b/test_libs/pyspec/eth2spec/test/phase_0/block_processing/test_process_deposit.py index c50b11f2e..603a07c3d 100644 --- a/test_libs/pyspec/eth2spec/test/phase_0/block_processing/test_process_deposit.py +++ b/test_libs/pyspec/eth2spec/test/phase_0/block_processing/test_process_deposit.py @@ -101,7 +101,7 @@ def test_invalid_sig_top_up(spec, state): def test_invalid_withdrawal_credentials_top_up(spec, state): validator_index = 0 amount = spec.MAX_EFFECTIVE_BALANCE // 4 - withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX_BYTE + spec.hash(b"junk")[1:] + withdrawal_credentials = spec.int_to_bytes(spec.BLS_WITHDRAWAL_PREFIX, length=1) + spec.hash(b"junk")[1:] deposit = prepare_state_and_deposit( spec, state,