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

Commit

Permalink
Merge pull request #1293 from ralexstokes/add-lmd-ghost-bounce-attack…
Browse files Browse the repository at this point in the history
…-resistance

v0.9.1 update: add bounce attack resistance to LMD GHOST
  • Loading branch information
ralexstokes authored Nov 20, 2019
2 parents 783dee3 + b97db94 commit fae0be8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
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

0 comments on commit fae0be8

Please sign in to comment.