Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions beacon_chain/rpc/rest_config_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
PROPOSER_SCORE_BOOST:
Base10.toString(PROPOSER_SCORE_BOOST),
REORG_HEAD_WEIGHT_THRESHOLD:
Base10.toString(REORG_HEAD_WEIGHT_THRESHOLD),
Base10.toString(cfg.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)),
Base10.toString(cfg.REORG_MAX_EPOCHS_SINCE_FINALIZATION),

DEPOSIT_CHAIN_ID:
Base10.toString(cfg.DEPOSIT_CHAIN_ID),
Expand Down
4 changes: 1 addition & 3 deletions beacon_chain/spec/datatypes/constants.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# * 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.

{.push raises: [].}
{.push raises: [], gcsafe.}

import chronos/timer

Expand Down Expand Up @@ -64,9 +64,7 @@ const

# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/fork-choice.md#configuration
PROPOSER_SCORE_BOOST*: uint64 = 40
REORG_HEAD_WEIGHT_THRESHOLD*: uint64 = 20
REORG_PARENT_WEIGHT_THRESHOLD*: uint64 = 160
REORG_MAX_EPOCHS_SINCE_FINALIZATION* = Epoch(2)

# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.1/specs/phase0/p2p-interface.md#configuration
MAX_REQUEST_BLOCKS* = 1024'u64
Expand Down
22 changes: 16 additions & 6 deletions beacon_chain/spec/presets.nim
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ type

# Fork choice
# TODO PROPOSER_SCORE_BOOST*: uint64
# TODO REORG_HEAD_WEIGHT_THRESHOLD*: uint64
REORG_HEAD_WEIGHT_THRESHOLD*: uint64
# TODO REORG_PARENT_WEIGHT_THRESHOLD*: uint64
# TODO REORG_MAX_EPOCHS_SINCE_FINALIZATION*: uint64
REORG_MAX_EPOCHS_SINCE_FINALIZATION*: uint64

# Deposit contract
DEPOSIT_CHAIN_ID*: uint64
Expand Down Expand Up @@ -270,7 +270,6 @@ when const_preset == "mainnet":
# 2**11 (= 2,048) Eth1 blocks ~8 hours
ETH1_FOLLOW_DISTANCE: 2048,


# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
Expand All @@ -286,6 +285,11 @@ when const_preset == "mainnet":
# [New in Deneb:EIP7514] 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8,

# Fork choice
# ---------------------------------------------------------------
REORG_HEAD_WEIGHT_THRESHOLD: 20,
REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2,

# Deposit contract
# ---------------------------------------------------------------
# Ethereum PoW Mainnet
Expand Down Expand Up @@ -457,6 +461,11 @@ elif const_preset == "gnosis":
# [New in Deneb:EIP7514] 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8,

# Fork choice
# ---------------------------------------------------------------
REORG_HEAD_WEIGHT_THRESHOLD: 20,
REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2,

# Deposit contract
# ---------------------------------------------------------------
# Gnosis PoW Mainnet
Expand Down Expand Up @@ -609,7 +618,6 @@ elif const_preset == "minimal":
# [customized] process deposits more quickly, but insecure
ETH1_FOLLOW_DISTANCE: 16,


# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
Expand All @@ -625,6 +633,10 @@ elif const_preset == "minimal":
# [New in Deneb:EIP7514] [customized]
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 4,

# Fork choice
# ---------------------------------------------------------------
REORG_HEAD_WEIGHT_THRESHOLD: 20,
REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2,

# Deposit contract
# ---------------------------------------------------------------
Expand Down Expand Up @@ -1002,9 +1014,7 @@ proc readRuntimeConfig*(
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-beta.0/specs/phase0/fork-choice.md#configuration
# Isn't being used as a preset in the usual way: at any time, there's one correct value
checkCompatibility PROPOSER_SCORE_BOOST
checkCompatibility REORG_HEAD_WEIGHT_THRESHOLD
checkCompatibility REORG_PARENT_WEIGHT_THRESHOLD
checkCompatibility REORG_MAX_EPOCHS_SINCE_FINALIZATION

checkCompatibility SLOT_DURATION_MS
checkCompatibility ATTESTATION_DUE_BPS
Expand Down
Loading