2022-09-19 09:07:46 +00:00
|
|
|
# beacon_chain
|
2024-01-06 14:26:56 +00:00
|
|
|
# Copyright (c) 2018-2024 Status Research & Development GmbH
|
2021-03-17 18:46:45 +00:00
|
|
|
# Licensed and distributed under either of
|
|
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
2022-01-08 20:06:34 +00:00
|
|
|
import stew/[byteutils, base10], chronicles
|
2021-10-19 14:09:26 +00:00
|
|
|
import ".."/beacon_node,
|
2021-08-23 10:41:48 +00:00
|
|
|
".."/spec/forks,
|
|
|
|
"."/rest_utils
|
2021-03-17 18:46:45 +00:00
|
|
|
|
2021-10-27 12:01:11 +00:00
|
|
|
export rest_utils
|
|
|
|
|
2021-03-17 18:46:45 +00:00
|
|
|
logScope: topics = "rest_config"
|
|
|
|
|
|
|
|
proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
2022-03-29 07:15:42 +00:00
|
|
|
template cfg(): auto = node.dag.cfg
|
2021-08-23 10:41:48 +00:00
|
|
|
let
|
|
|
|
cachedForkSchedule =
|
2022-03-29 07:15:42 +00:00
|
|
|
RestApiResponse.prepareJsonResponse(getForkSchedule(cfg))
|
2021-08-23 10:41:48 +00:00
|
|
|
cachedConfigSpec =
|
|
|
|
RestApiResponse.prepareJsonResponse(
|
|
|
|
(
|
2023-06-04 10:32:50 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-alpha.1/presets/mainnet/phase0.yaml
|
2021-08-23 10:41:48 +00:00
|
|
|
MAX_COMMITTEES_PER_SLOT:
|
|
|
|
Base10.toString(MAX_COMMITTEES_PER_SLOT),
|
|
|
|
TARGET_COMMITTEE_SIZE:
|
|
|
|
Base10.toString(TARGET_COMMITTEE_SIZE),
|
|
|
|
MAX_VALIDATORS_PER_COMMITTEE:
|
|
|
|
Base10.toString(MAX_VALIDATORS_PER_COMMITTEE),
|
|
|
|
SHUFFLE_ROUND_COUNT:
|
|
|
|
Base10.toString(SHUFFLE_ROUND_COUNT),
|
|
|
|
HYSTERESIS_QUOTIENT:
|
|
|
|
Base10.toString(HYSTERESIS_QUOTIENT),
|
|
|
|
HYSTERESIS_DOWNWARD_MULTIPLIER:
|
|
|
|
Base10.toString(HYSTERESIS_DOWNWARD_MULTIPLIER),
|
|
|
|
HYSTERESIS_UPWARD_MULTIPLIER:
|
|
|
|
Base10.toString(HYSTERESIS_UPWARD_MULTIPLIER),
|
|
|
|
MIN_DEPOSIT_AMOUNT:
|
|
|
|
Base10.toString(MIN_DEPOSIT_AMOUNT),
|
|
|
|
MAX_EFFECTIVE_BALANCE:
|
|
|
|
Base10.toString(MAX_EFFECTIVE_BALANCE),
|
|
|
|
EFFECTIVE_BALANCE_INCREMENT:
|
|
|
|
Base10.toString(EFFECTIVE_BALANCE_INCREMENT),
|
|
|
|
MIN_ATTESTATION_INCLUSION_DELAY:
|
|
|
|
Base10.toString(MIN_ATTESTATION_INCLUSION_DELAY),
|
|
|
|
SLOTS_PER_EPOCH:
|
|
|
|
Base10.toString(SLOTS_PER_EPOCH),
|
|
|
|
MIN_SEED_LOOKAHEAD:
|
|
|
|
Base10.toString(MIN_SEED_LOOKAHEAD),
|
|
|
|
MAX_SEED_LOOKAHEAD:
|
|
|
|
Base10.toString(MAX_SEED_LOOKAHEAD),
|
|
|
|
EPOCHS_PER_ETH1_VOTING_PERIOD:
|
|
|
|
Base10.toString(EPOCHS_PER_ETH1_VOTING_PERIOD),
|
|
|
|
SLOTS_PER_HISTORICAL_ROOT:
|
|
|
|
Base10.toString(SLOTS_PER_HISTORICAL_ROOT),
|
|
|
|
MIN_EPOCHS_TO_INACTIVITY_PENALTY:
|
|
|
|
Base10.toString(MIN_EPOCHS_TO_INACTIVITY_PENALTY),
|
|
|
|
EPOCHS_PER_HISTORICAL_VECTOR:
|
|
|
|
Base10.toString(EPOCHS_PER_HISTORICAL_VECTOR),
|
|
|
|
EPOCHS_PER_SLASHINGS_VECTOR:
|
|
|
|
Base10.toString(EPOCHS_PER_SLASHINGS_VECTOR),
|
|
|
|
HISTORICAL_ROOTS_LIMIT:
|
|
|
|
Base10.toString(HISTORICAL_ROOTS_LIMIT),
|
|
|
|
VALIDATOR_REGISTRY_LIMIT:
|
|
|
|
Base10.toString(VALIDATOR_REGISTRY_LIMIT),
|
|
|
|
BASE_REWARD_FACTOR:
|
|
|
|
Base10.toString(BASE_REWARD_FACTOR),
|
|
|
|
WHISTLEBLOWER_REWARD_QUOTIENT:
|
|
|
|
Base10.toString(WHISTLEBLOWER_REWARD_QUOTIENT),
|
|
|
|
PROPOSER_REWARD_QUOTIENT:
|
|
|
|
Base10.toString(PROPOSER_REWARD_QUOTIENT),
|
|
|
|
INACTIVITY_PENALTY_QUOTIENT:
|
|
|
|
Base10.toString(INACTIVITY_PENALTY_QUOTIENT),
|
|
|
|
MIN_SLASHING_PENALTY_QUOTIENT:
|
|
|
|
Base10.toString(MIN_SLASHING_PENALTY_QUOTIENT),
|
|
|
|
PROPORTIONAL_SLASHING_MULTIPLIER:
|
|
|
|
Base10.toString(PROPORTIONAL_SLASHING_MULTIPLIER),
|
|
|
|
MAX_PROPOSER_SLASHINGS:
|
|
|
|
Base10.toString(MAX_PROPOSER_SLASHINGS),
|
|
|
|
MAX_ATTESTER_SLASHINGS:
|
|
|
|
Base10.toString(MAX_ATTESTER_SLASHINGS),
|
|
|
|
MAX_ATTESTATIONS:
|
|
|
|
Base10.toString(MAX_ATTESTATIONS),
|
|
|
|
MAX_DEPOSITS:
|
|
|
|
Base10.toString(MAX_DEPOSITS),
|
|
|
|
MAX_VOLUNTARY_EXITS:
|
|
|
|
Base10.toString(MAX_VOLUNTARY_EXITS),
|
2021-11-02 18:23:31 +00:00
|
|
|
|
2023-12-05 02:34:45 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/presets/mainnet/altair.yaml
|
2021-11-02 18:23:31 +00:00
|
|
|
INACTIVITY_PENALTY_QUOTIENT_ALTAIR:
|
|
|
|
Base10.toString(INACTIVITY_PENALTY_QUOTIENT_ALTAIR),
|
|
|
|
MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR:
|
|
|
|
Base10.toString(MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR),
|
|
|
|
PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR:
|
|
|
|
Base10.toString(PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR),
|
|
|
|
SYNC_COMMITTEE_SIZE:
|
|
|
|
Base10.toString(uint64(SYNC_COMMITTEE_SIZE)),
|
|
|
|
EPOCHS_PER_SYNC_COMMITTEE_PERIOD:
|
|
|
|
Base10.toString(EPOCHS_PER_SYNC_COMMITTEE_PERIOD),
|
|
|
|
MIN_SYNC_COMMITTEE_PARTICIPANTS:
|
|
|
|
Base10.toString(uint64(MIN_SYNC_COMMITTEE_PARTICIPANTS)),
|
2022-05-06 07:51:28 +00:00
|
|
|
UPDATE_TIMEOUT:
|
|
|
|
Base10.toString(UPDATE_TIMEOUT),
|
|
|
|
|
2023-12-05 02:34:45 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/presets/mainnet/bellatrix.yaml
|
2022-05-06 07:51:28 +00:00
|
|
|
INACTIVITY_PENALTY_QUOTIENT_BELLATRIX:
|
|
|
|
Base10.toString(INACTIVITY_PENALTY_QUOTIENT_BELLATRIX),
|
|
|
|
MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX:
|
|
|
|
Base10.toString(MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX),
|
|
|
|
PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX:
|
|
|
|
Base10.toString(PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX),
|
|
|
|
MAX_BYTES_PER_TRANSACTION:
|
|
|
|
Base10.toString(uint64(MAX_BYTES_PER_TRANSACTION)),
|
|
|
|
MAX_TRANSACTIONS_PER_PAYLOAD:
|
|
|
|
Base10.toString(uint64(MAX_TRANSACTIONS_PER_PAYLOAD)),
|
|
|
|
BYTES_PER_LOGS_BLOOM:
|
|
|
|
Base10.toString(uint64(BYTES_PER_LOGS_BLOOM)),
|
|
|
|
MAX_EXTRA_DATA_BYTES:
|
|
|
|
Base10.toString(uint64(MAX_EXTRA_DATA_BYTES)),
|
2021-11-02 18:23:31 +00:00
|
|
|
|
2023-12-05 02:34:45 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/presets/mainnet/capella.yaml
|
2023-05-11 10:53:02 +00:00
|
|
|
MAX_BLS_TO_EXECUTION_CHANGES:
|
|
|
|
Base10.toString(uint64(MAX_BLS_TO_EXECUTION_CHANGES)),
|
|
|
|
MAX_WITHDRAWALS_PER_PAYLOAD:
|
|
|
|
Base10.toString(uint64(MAX_WITHDRAWALS_PER_PAYLOAD)),
|
|
|
|
MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP:
|
|
|
|
Base10.toString(uint64(MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP)),
|
|
|
|
|
2023-12-05 02:34:45 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/presets/mainnet/deneb.yaml
|
2023-11-03 13:54:21 +00:00
|
|
|
FIELD_ELEMENTS_PER_BLOB:
|
|
|
|
Base10.toString(deneb_preset.FIELD_ELEMENTS_PER_BLOB),
|
|
|
|
MAX_BLOB_COMMITMENTS_PER_BLOCK:
|
|
|
|
Base10.toString(MAX_BLOB_COMMITMENTS_PER_BLOCK),
|
|
|
|
MAX_BLOBS_PER_BLOCK:
|
|
|
|
Base10.toString(MAX_BLOBS_PER_BLOCK),
|
|
|
|
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH:
|
|
|
|
Base10.toString(uint64(KZG_COMMITMENT_INCLUSION_PROOF_DEPTH)),
|
|
|
|
|
2023-12-05 02:34:45 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/configs/mainnet.yaml
|
2021-11-02 18:23:31 +00:00
|
|
|
PRESET_BASE:
|
2022-03-29 07:15:42 +00:00
|
|
|
cfg.PRESET_BASE,
|
2022-05-06 07:51:28 +00:00
|
|
|
CONFIG_NAME:
|
|
|
|
cfg.name(),
|
2021-11-02 18:23:31 +00:00
|
|
|
TERMINAL_TOTAL_DIFFICULTY:
|
2022-03-29 07:15:42 +00:00
|
|
|
toString(cfg.TERMINAL_TOTAL_DIFFICULTY),
|
2021-11-02 18:23:31 +00:00
|
|
|
TERMINAL_BLOCK_HASH:
|
2022-03-29 07:15:42 +00:00
|
|
|
$cfg.TERMINAL_BLOCK_HASH,
|
2022-05-06 07:51:28 +00:00
|
|
|
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH:
|
2023-09-08 05:53:27 +00:00
|
|
|
Base10.toString(uint64(cfg.TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH)),
|
2021-11-02 18:23:31 +00:00
|
|
|
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT),
|
2021-11-02 18:23:31 +00:00
|
|
|
MIN_GENESIS_TIME:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.MIN_GENESIS_TIME),
|
2021-11-02 18:23:31 +00:00
|
|
|
GENESIS_FORK_VERSION:
|
2022-03-29 07:15:42 +00:00
|
|
|
"0x" & $cfg.GENESIS_FORK_VERSION,
|
2021-11-02 18:23:31 +00:00
|
|
|
GENESIS_DELAY:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.GENESIS_DELAY),
|
2021-11-02 18:23:31 +00:00
|
|
|
ALTAIR_FORK_VERSION:
|
2022-03-29 07:15:42 +00:00
|
|
|
"0x" & $cfg.ALTAIR_FORK_VERSION,
|
2021-11-02 18:23:31 +00:00
|
|
|
ALTAIR_FORK_EPOCH:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(uint64(cfg.ALTAIR_FORK_EPOCH)),
|
2022-01-20 08:30:33 +00:00
|
|
|
BELLATRIX_FORK_VERSION:
|
2022-03-29 07:15:42 +00:00
|
|
|
"0x" & $cfg.BELLATRIX_FORK_VERSION,
|
2022-02-02 13:06:55 +00:00
|
|
|
BELLATRIX_FORK_EPOCH:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(uint64(cfg.BELLATRIX_FORK_EPOCH)),
|
2022-06-03 14:42:40 +00:00
|
|
|
CAPELLA_FORK_VERSION:
|
|
|
|
"0x" & $cfg.CAPELLA_FORK_VERSION,
|
|
|
|
CAPELLA_FORK_EPOCH:
|
|
|
|
Base10.toString(uint64(cfg.CAPELLA_FORK_EPOCH)),
|
2023-02-15 14:44:09 +00:00
|
|
|
DENEB_FORK_VERSION:
|
|
|
|
"0x" & $cfg.DENEB_FORK_VERSION,
|
|
|
|
DENEB_FORK_EPOCH:
|
|
|
|
Base10.toString(uint64(cfg.DENEB_FORK_EPOCH)),
|
2021-11-02 18:23:31 +00:00
|
|
|
SECONDS_PER_SLOT:
|
|
|
|
Base10.toString(SECONDS_PER_SLOT),
|
|
|
|
SECONDS_PER_ETH1_BLOCK:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.SECONDS_PER_ETH1_BLOCK),
|
2021-11-02 18:23:31 +00:00
|
|
|
MIN_VALIDATOR_WITHDRAWABILITY_DELAY:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.MIN_VALIDATOR_WITHDRAWABILITY_DELAY),
|
2021-11-02 18:23:31 +00:00
|
|
|
SHARD_COMMITTEE_PERIOD:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.SHARD_COMMITTEE_PERIOD),
|
2021-11-02 18:23:31 +00:00
|
|
|
ETH1_FOLLOW_DISTANCE:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.ETH1_FOLLOW_DISTANCE),
|
2021-11-02 18:23:31 +00:00
|
|
|
INACTIVITY_SCORE_BIAS:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.INACTIVITY_SCORE_BIAS),
|
2021-11-02 18:23:31 +00:00
|
|
|
INACTIVITY_SCORE_RECOVERY_RATE:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.INACTIVITY_SCORE_RECOVERY_RATE),
|
2021-11-02 18:23:31 +00:00
|
|
|
EJECTION_BALANCE:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.EJECTION_BALANCE),
|
2021-11-02 18:23:31 +00:00
|
|
|
MIN_PER_EPOCH_CHURN_LIMIT:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.MIN_PER_EPOCH_CHURN_LIMIT),
|
2021-11-02 18:23:31 +00:00
|
|
|
CHURN_LIMIT_QUOTIENT:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.CHURN_LIMIT_QUOTIENT),
|
2023-09-20 11:39:56 +00:00
|
|
|
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:
|
|
|
|
Base10.toString(cfg.MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT),
|
2022-05-06 07:51:28 +00:00
|
|
|
PROPOSER_SCORE_BOOST:
|
2022-09-19 09:07:46 +00:00
|
|
|
Base10.toString(PROPOSER_SCORE_BOOST),
|
2023-11-09 20:41:17 +00:00
|
|
|
REORG_HEAD_WEIGHT_THRESHOLD:
|
|
|
|
Base10.toString(REORG_HEAD_WEIGHT_THRESHOLD),
|
|
|
|
REORG_PARENT_WEIGHT_THRESHOLD:
|
|
|
|
Base10.toString(REORG_PARENT_WEIGHT_THRESHOLD),
|
|
|
|
REORG_MAX_EPOCHS_SINCE_FINALIZATION:
|
|
|
|
Base10.toString(uint64(REORG_MAX_EPOCHS_SINCE_FINALIZATION)),
|
2021-11-02 18:23:31 +00:00
|
|
|
DEPOSIT_CHAIN_ID:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.DEPOSIT_CHAIN_ID),
|
2021-11-02 18:23:31 +00:00
|
|
|
DEPOSIT_NETWORK_ID:
|
2022-03-29 07:15:42 +00:00
|
|
|
Base10.toString(cfg.DEPOSIT_NETWORK_ID),
|
2021-11-02 18:23:31 +00:00
|
|
|
DEPOSIT_CONTRACT_ADDRESS:
|
2022-03-29 07:15:42 +00:00
|
|
|
$cfg.DEPOSIT_CONTRACT_ADDRESS,
|
2023-11-09 20:41:17 +00:00
|
|
|
GOSSIP_MAX_SIZE:
|
|
|
|
Base10.toString(GOSSIP_MAX_SIZE),
|
|
|
|
MAX_REQUEST_BLOCKS:
|
|
|
|
Base10.toString(MAX_REQUEST_BLOCKS),
|
|
|
|
EPOCHS_PER_SUBNET_SUBSCRIPTION:
|
|
|
|
Base10.toString(EPOCHS_PER_SUBNET_SUBSCRIPTION),
|
|
|
|
MIN_EPOCHS_FOR_BLOCK_REQUESTS:
|
|
|
|
Base10.toString(cfg.MIN_EPOCHS_FOR_BLOCK_REQUESTS),
|
|
|
|
MAX_CHUNK_SIZE:
|
|
|
|
Base10.toString(MAX_CHUNK_SIZE),
|
|
|
|
TTFB_TIMEOUT:
|
|
|
|
Base10.toString(TTFB_TIMEOUT),
|
|
|
|
RESP_TIMEOUT:
|
|
|
|
Base10.toString(RESP_TIMEOUT),
|
|
|
|
ATTESTATION_PROPAGATION_SLOT_RANGE:
|
|
|
|
Base10.toString(ATTESTATION_PROPAGATION_SLOT_RANGE),
|
|
|
|
MAXIMUM_GOSSIP_CLOCK_DISPARITY:
|
|
|
|
Base10.toString(MAXIMUM_GOSSIP_CLOCK_DISPARITY.milliseconds.uint64),
|
|
|
|
MESSAGE_DOMAIN_INVALID_SNAPPY:
|
|
|
|
to0xHex(MESSAGE_DOMAIN_INVALID_SNAPPY),
|
|
|
|
MESSAGE_DOMAIN_VALID_SNAPPY:
|
|
|
|
to0xHex(MESSAGE_DOMAIN_VALID_SNAPPY),
|
|
|
|
SUBNETS_PER_NODE:
|
|
|
|
Base10.toString(SUBNETS_PER_NODE),
|
|
|
|
ATTESTATION_SUBNET_COUNT:
|
|
|
|
Base10.toString(ATTESTATION_SUBNET_COUNT),
|
|
|
|
ATTESTATION_SUBNET_EXTRA_BITS:
|
|
|
|
Base10.toString(ATTESTATION_SUBNET_EXTRA_BITS),
|
|
|
|
ATTESTATION_SUBNET_PREFIX_BITS:
|
|
|
|
Base10.toString(ATTESTATION_SUBNET_PREFIX_BITS),
|
|
|
|
MAX_REQUEST_BLOCKS_DENEB:
|
|
|
|
Base10.toString(MAX_REQUEST_BLOCKS_DENEB),
|
|
|
|
MAX_REQUEST_BLOB_SIDECARS:
|
|
|
|
Base10.toString(MAX_REQUEST_BLOB_SIDECARS),
|
|
|
|
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:
|
|
|
|
Base10.toString(cfg.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS),
|
|
|
|
BLOB_SIDECAR_SUBNET_COUNT:
|
|
|
|
Base10.toString(BLOB_SIDECAR_SUBNET_COUNT),
|
2021-11-02 18:23:31 +00:00
|
|
|
|
2023-06-13 14:03:49 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-alpha.3/specs/phase0/beacon-chain.md#constants
|
2021-11-02 18:23:31 +00:00
|
|
|
# GENESIS_SLOT
|
|
|
|
# GENESIS_EPOCH
|
|
|
|
# FAR_FUTURE_EPOCH
|
|
|
|
# BASE_REWARDS_PER_EPOCH
|
|
|
|
# DEPOSIT_CONTRACT_TREE_DEPTH
|
|
|
|
# JUSTIFICATION_BITS_LENGTH
|
|
|
|
# ENDIANNESS
|
|
|
|
BLS_WITHDRAWAL_PREFIX:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex([BLS_WITHDRAWAL_PREFIX]),
|
2021-11-02 18:23:31 +00:00
|
|
|
ETH1_ADDRESS_WITHDRAWAL_PREFIX:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex([ETH1_ADDRESS_WITHDRAWAL_PREFIX]),
|
2021-08-23 10:41:48 +00:00
|
|
|
DOMAIN_BEACON_PROPOSER:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_BEACON_PROPOSER.data),
|
2021-08-23 10:41:48 +00:00
|
|
|
DOMAIN_BEACON_ATTESTER:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_BEACON_ATTESTER.data),
|
2021-08-23 10:41:48 +00:00
|
|
|
DOMAIN_RANDAO:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_RANDAO.data),
|
2021-08-23 10:41:48 +00:00
|
|
|
DOMAIN_DEPOSIT:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_DEPOSIT.data),
|
2021-08-23 10:41:48 +00:00
|
|
|
DOMAIN_VOLUNTARY_EXIT:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_VOLUNTARY_EXIT.data),
|
2021-08-23 10:41:48 +00:00
|
|
|
DOMAIN_SELECTION_PROOF:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_SELECTION_PROOF.data),
|
2021-08-23 10:41:48 +00:00
|
|
|
DOMAIN_AGGREGATE_AND_PROOF:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_AGGREGATE_AND_PROOF.data),
|
2021-11-02 18:23:31 +00:00
|
|
|
|
2023-05-05 20:38:51 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/beacon-chain.md#constants
|
2021-11-02 18:23:31 +00:00
|
|
|
TIMELY_SOURCE_FLAG_INDEX:
|
2023-08-30 09:43:25 +00:00
|
|
|
Base10.toString(uint64(ord(TIMELY_SOURCE_FLAG_INDEX))),
|
2021-11-02 18:23:31 +00:00
|
|
|
TIMELY_TARGET_FLAG_INDEX:
|
2023-08-30 09:43:25 +00:00
|
|
|
Base10.toString(uint64(ord(TIMELY_TARGET_FLAG_INDEX))),
|
2021-11-02 18:23:31 +00:00
|
|
|
TIMELY_HEAD_FLAG_INDEX:
|
2023-08-30 09:43:25 +00:00
|
|
|
Base10.toString(uint64(ord(TIMELY_HEAD_FLAG_INDEX))),
|
2021-11-02 18:23:31 +00:00
|
|
|
TIMELY_SOURCE_WEIGHT:
|
|
|
|
Base10.toString(uint64(TIMELY_SOURCE_WEIGHT)),
|
|
|
|
TIMELY_TARGET_WEIGHT:
|
|
|
|
Base10.toString(uint64(TIMELY_TARGET_WEIGHT)),
|
|
|
|
TIMELY_HEAD_WEIGHT:
|
|
|
|
Base10.toString(uint64(TIMELY_HEAD_WEIGHT)),
|
|
|
|
SYNC_REWARD_WEIGHT:
|
|
|
|
Base10.toString(uint64(SYNC_REWARD_WEIGHT)),
|
|
|
|
PROPOSER_WEIGHT:
|
|
|
|
Base10.toString(uint64(PROPOSER_WEIGHT)),
|
|
|
|
WEIGHT_DENOMINATOR:
|
|
|
|
Base10.toString(uint64(WEIGHT_DENOMINATOR)),
|
2021-10-06 13:43:03 +00:00
|
|
|
DOMAIN_SYNC_COMMITTEE:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_SYNC_COMMITTEE.data),
|
2021-10-06 13:43:03 +00:00
|
|
|
DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF.data),
|
2021-11-02 18:23:31 +00:00
|
|
|
DOMAIN_CONTRIBUTION_AND_PROOF:
|
2022-01-08 20:06:34 +00:00
|
|
|
to0xHex(DOMAIN_CONTRIBUTION_AND_PROOF.data),
|
2021-11-02 18:23:31 +00:00
|
|
|
# PARTICIPATION_FLAG_WEIGHTS
|
|
|
|
|
2023-05-11 10:53:02 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/capella/beacon-chain.md#domain-types
|
|
|
|
DOMAIN_BLS_TO_EXECUTION_CHANGE:
|
|
|
|
to0xHex(DOMAIN_BLS_TO_EXECUTION_CHANGE.data),
|
|
|
|
|
2023-05-05 20:38:51 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/validator.md#constants
|
2021-11-02 18:23:31 +00:00
|
|
|
TARGET_AGGREGATORS_PER_COMMITTEE:
|
|
|
|
Base10.toString(TARGET_AGGREGATORS_PER_COMMITTEE),
|
|
|
|
|
2023-08-09 03:58:47 +00:00
|
|
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/altair/validator.md#constants
|
2021-11-02 18:23:31 +00:00
|
|
|
TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE:
|
|
|
|
Base10.toString(uint64(TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE)),
|
|
|
|
SYNC_COMMITTEE_SUBNET_COUNT:
|
|
|
|
Base10.toString(uint64(SYNC_COMMITTEE_SUBNET_COUNT)),
|
2021-08-23 10:41:48 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
cachedDepositContract =
|
|
|
|
RestApiResponse.prepareJsonResponse(
|
|
|
|
(
|
2022-03-29 07:15:42 +00:00
|
|
|
chain_id: $cfg.DEPOSIT_CHAIN_ID,
|
|
|
|
address: $cfg.DEPOSIT_CONTRACT_ADDRESS
|
2021-08-23 10:41:48 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
# https://ethereum.github.io/beacon-APIs/#/Config/getForkSchedule
|
2021-03-17 18:46:45 +00:00
|
|
|
router.api(MethodGet,
|
2022-01-06 07:38:40 +00:00
|
|
|
"/eth/v1/config/fork_schedule") do () -> RestApiResponse:
|
2021-08-23 10:41:48 +00:00
|
|
|
return RestApiResponse.response(cachedForkSchedule, Http200,
|
|
|
|
"application/json")
|
2021-03-17 18:46:45 +00:00
|
|
|
|
2021-08-23 10:41:48 +00:00
|
|
|
# https://ethereum.github.io/beacon-APIs/#/Config/getSpec
|
2021-03-17 18:46:45 +00:00
|
|
|
router.api(MethodGet,
|
2022-01-06 07:38:40 +00:00
|
|
|
"/eth/v1/config/spec") do () -> RestApiResponse:
|
2021-08-23 10:41:48 +00:00
|
|
|
return RestApiResponse.response(cachedConfigSpec, Http200,
|
|
|
|
"application/json")
|
2021-03-17 18:46:45 +00:00
|
|
|
|
2021-08-23 10:41:48 +00:00
|
|
|
# https://ethereum.github.io/beacon-APIs/#/Config/getDepositContract
|
2021-03-17 18:46:45 +00:00
|
|
|
router.api(MethodGet,
|
2022-01-06 07:38:40 +00:00
|
|
|
"/eth/v1/config/deposit_contract") do () -> RestApiResponse:
|
2021-08-23 10:41:48 +00:00
|
|
|
return RestApiResponse.response(cachedDepositContract, Http200,
|
|
|
|
"application/json")
|