Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

v0.9.1 update: add SAFE_SLOTS_TO_UPDATE_JUSTIFIED parameter #1293

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
2 changes: 2 additions & 0 deletions eth2/beacon/state_machines/forks/serenity/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
MAX_ATTESTATIONS=2 ** 7, # (= 128)
MAX_DEPOSITS=2 ** 4, # (= 16)
MAX_VOLUNTARY_EXITS=2 ** 4, # (= 16)
# Fork choice
SAFE_SLOTS_TO_UPDATE_JUSTIFIED=8,
# Deposit contract
DEPOSIT_CONTRACT_ADDRESS=decode_hex(
"0x1234567890123456789012345678901234567890"
Expand Down
2 changes: 2 additions & 0 deletions eth2/beacon/state_machines/forks/skeleton_lake/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
MAX_ATTESTATIONS=2 ** 7, # (= 128)
MAX_DEPOSITS=2 ** 4, # (= 16)
MAX_VOLUNTARY_EXITS=2 ** 4, # (= 16)
# Fork choice
SAFE_SLOTS_TO_UPDATE_JUSTIFIED=2,
# Deposit contract
DEPOSIT_CONTRACT_ADDRESS=decode_hex(
"0x1234567890123456789012345678901234567890"
Expand Down
2 changes: 0 additions & 2 deletions eth2/beacon/tools/fixtures/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
def generate_config_by_dict(dict_config: Dict[str, Any]) -> Eth2Config:
filtered_keys = (
"DOMAIN_",
# TODO: Fork choice rule
"SAFE_SLOTS_TO_UPDATE_JUSTIFIED",
# Phase 1
"MAX_EPOCHS_PER_CROSSLINK",
"EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS",
Expand Down
2 changes: 2 additions & 0 deletions eth2/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
("MAX_ATTESTATIONS", int),
("MAX_DEPOSITS", int),
("MAX_VOLUNTARY_EXITS", int),
# Fork choice
("SAFE_SLOTS_TO_UPDATE_JUSTIFIED", int),
# Deposit contract
("DEPOSIT_CONTRACT_ADDRESS", bytes),
),
Expand Down
7 changes: 7 additions & 0 deletions tests/eth2/core/beacon/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ def max_voluntary_exits():
return SERENITY_CONFIG.MAX_VOLUNTARY_EXITS


@pytest.fixture
def safe_slots_to_update_justified():
return SERENITY_CONFIG.SAFE_SLOTS_TO_UPDATE_JUSTIFIED


@pytest.fixture
def deposit_contract_tree_depth():
return DEPOSIT_CONTRACT_TREE_DEPTH
Expand Down Expand Up @@ -285,6 +290,7 @@ def config(
max_attestations,
max_deposits,
max_voluntary_exits,
safe_slots_to_update_justified,
deposit_contract_address,
):
return Eth2Config(
Expand Down Expand Up @@ -327,6 +333,7 @@ def config(
MAX_ATTESTATIONS=max_attestations,
MAX_DEPOSITS=max_deposits,
MAX_VOLUNTARY_EXITS=max_voluntary_exits,
SAFE_SLOTS_TO_UPDATE_JUSTIFIED=safe_slots_to_update_justified,
DEPOSIT_CONTRACT_ADDRESS=deposit_contract_address,
)

Expand Down