Ejemplo n.º 1
0
def config(shard_count, target_committee_size, ejection_balance,
           max_balance_churn_quotient, beacon_chain_shard_number,
           max_indices_per_slashable_vote, latest_block_roots_length,
           latest_index_roots_length, latest_randao_mixes_length,
           latest_penalized_exit_length, deposit_contract_address,
           deposit_contract_tree_depth, min_deposit_amount, max_deposit_amount,
           genesis_fork_version, genesis_slot, genesis_epoch,
           genesis_start_shard, bls_withdrawal_prefix_byte, slot_duration,
           min_attestation_inclusion_delay, epoch_length, seed_lookahead,
           entry_exit_delay, eth1_data_voting_period,
           min_validator_withdrawal_time, base_reward_quotient,
           whistleblower_reward_quotient, includer_reward_quotient,
           inactivity_penalty_quotient, max_proposer_slashings,
           max_attester_slashings, max_attestations, max_deposits, max_exits):
    return BeaconConfig(
        SHARD_COUNT=shard_count,
        TARGET_COMMITTEE_SIZE=target_committee_size,
        EJECTION_BALANCE=ejection_balance,
        MAX_BALANCE_CHURN_QUOTIENT=max_balance_churn_quotient,
        BEACON_CHAIN_SHARD_NUMBER=beacon_chain_shard_number,
        MAX_INDICES_PER_SLASHABLE_VOTE=max_indices_per_slashable_vote,
        LATEST_BLOCK_ROOTS_LENGTH=latest_block_roots_length,
        LATEST_INDEX_ROOTS_LENGTH=latest_index_roots_length,
        LATEST_RANDAO_MIXES_LENGTH=latest_randao_mixes_length,
        LATEST_PENALIZED_EXIT_LENGTH=latest_penalized_exit_length,
        DEPOSIT_CONTRACT_ADDRESS=deposit_contract_address,
        DEPOSIT_CONTRACT_TREE_DEPTH=deposit_contract_tree_depth,
        MIN_DEPOSIT_AMOUNT=min_deposit_amount,
        MAX_DEPOSIT_AMOUNT=max_deposit_amount,
        GENESIS_FORK_VERSION=genesis_fork_version,
        GENESIS_SLOT=genesis_slot,
        GENESIS_EPOCH=genesis_epoch,
        GENESIS_START_SHARD=genesis_start_shard,
        BLS_WITHDRAWAL_PREFIX_BYTE=bls_withdrawal_prefix_byte,
        SLOT_DURATION=slot_duration,
        MIN_ATTESTATION_INCLUSION_DELAY=min_attestation_inclusion_delay,
        EPOCH_LENGTH=epoch_length,
        SEED_LOOKAHEAD=seed_lookahead,
        ENTRY_EXIT_DELAY=entry_exit_delay,
        ETH1_DATA_VOTING_PERIOD=eth1_data_voting_period,
        MIN_VALIDATOR_WITHDRAWAL_TIME=min_validator_withdrawal_time,
        BASE_REWARD_QUOTIENT=base_reward_quotient,
        WHISTLEBLOWER_REWARD_QUOTIENT=whistleblower_reward_quotient,
        INCLUDER_REWARD_QUOTIENT=includer_reward_quotient,
        INACTIVITY_PENALTY_QUOTIENT=inactivity_penalty_quotient,
        MAX_PROPOSER_SLASHINGS=max_proposer_slashings,
        MAX_ATTESTER_SLASHINGS=max_attester_slashings,
        MAX_ATTESTATIONS=max_attestations,
        MAX_DEPOSITS=max_deposits,
        MAX_EXITS=max_exits,
    )
Ejemplo n.º 2
0
SERENITY_CONFIG = BeaconConfig(
    # Misc
    SHARD_COUNT=2**10,  # (= 1,024) shards
    TARGET_COMMITTEE_SIZE=2**7,  # (= 128) validators
    EJECTION_BALANCE=Ether(2**4),  # (= 16) ETH
    MAX_BALANCE_CHURN_QUOTIENT=2**5,  # (= 32)
    BEACON_CHAIN_SHARD_NUMBER=ShardNumber(2**64 - 1),
    MAX_CASPER_VOTES=2**10,  # (= 1,024) votes
    LATEST_BLOCK_ROOTS_LENGTH=2**13,  # (= 8,192) block roots
    LATEST_RANDAO_MIXES_LENGTH=2**13,  # (= 8,192) randao mixes
    LATEST_PENALIZED_EXIT_LENGTH=2**13,  # (= 8,192) randao mixes
    # Deposit contract
    DEPOSIT_CONTRACT_ADDRESS=ZERO_ADDRESS,  # TBD
    DEPOSIT_CONTRACT_TREE_DEPTH=2**5,  # (= 32)
    MIN_DEPOSIT=Ether(2**0),  # (= 1) ETH
    MAX_DEPOSIT=Ether(2**5),  # (= 32) ETH
    # Initial values
    GENESIS_FORK_VERSION=0,
    GENESIS_SLOT=SlotNumber(0),
    GENESIS_START_SHARD=ShardNumber(0),
    BLS_WITHDRAWAL_PREFIX_BYTE=b'\x00',
    # Time parameters
    SLOT_DURATION=Second(6),  # seconds
    MIN_ATTESTATION_INCLUSION_DELAY=2**2,  # (= 4) slots
    EPOCH_LENGTH=2**6,  # (= 64) slots
    SEED_LOOKAHEAD=2**6,  # (= 64) slots
    ENTRY_EXIT_DELAY=2**8,  # (= 256) slots
    ETH1_DATA_VOTING_PERIOD=2**10,  # (= 1,024) slots
    MIN_VALIDATOR_WITHDRAWAL_TIME=2**14,  # (= 16,384) slots
    # Reward and penalty quotients
    BASE_REWARD_QUOTIENT=2**10,  # (= 1,024)
    WHISTLEBLOWER_REWARD_QUOTIENT=2**9,  # (= 512)
    INCLUDER_REWARD_QUOTIENT=2**3,  # (= 8)
    INACTIVITY_PENALTY_QUOTIENT=2**24,  # (= 16,777,216)
    # Max operations per block
    MAX_PROPOSER_SLASHINGS=2**4,  # (= 16)
    MAX_CASPER_SLASHINGS=2**4,  # (= 16)
    MAX_ATTESTATIONS=2**7,  # (= 128)
    MAX_DEPOSITS=2**4,  # (= 16)
    MAX_EXITS=2**4,  # (= 16)
)