model.parts.utils.ethereum_spec

model.parts.utils.ethereum_spec#

Relevant methods from the official [eth2.0-specs](ethereum/eth2.0-specs) specification repo.

Functions

get_active_validator_indices(state)

See ethereum/eth2.0-specs

get_awake_validator_indices(params, state)

Simplified Active Validator Cap and Rotation Proposal

get_base_reward(params, state)

Get the base reward for the current epoch

get_base_reward_per_increment(params, state)

Get the base reward per increment (single validator)

get_proposer_reward(params, state)

Get the proposer reward as a proportion of the base reward

get_total_active_balance(params, state)

See ethereum/eth2.0-specs

get_validator_churn_limit(params, state)

Return the validator churn limit for the current epoch.

integer_squareroot(n)

Return the largest integer x such that x**2 <= n.