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

Commit

Permalink
don't define GENESIS_SLOT in custom chain and state machine now
Browse files Browse the repository at this point in the history
  • Loading branch information
ChihChengLiang committed Apr 16, 2019
1 parent 150155d commit 3fa905e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
11 changes: 9 additions & 2 deletions eth2/beacon/chains/testnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
from eth2.beacon.state_machines.forks.xiao_long_bao import (
XiaoLongBaoStateMachine,
)
from .constants import GENESIS_SLOT, TESTNET_CHAIN_ID
from .constants import (
TESTNET_CHAIN_ID,
)
from eth2.beacon.state_machines.forks.serenity.configs import (
SERENITY_CONFIG,
)


if TYPE_CHECKING:
from eth2.beacon.typing import ( # noqa: F401
Expand All @@ -23,7 +29,8 @@


TESTNET_SM_CONFIGURATION = (
(GENESIS_SLOT, XiaoLongBaoStateMachine),
# FIXME: Shouldn't access GENESIS_SLOT from a particular state machine configs.
(SERENITY_CONFIG.GENESIS_SLOT, XiaoLongBaoStateMachine),
) # type: Tuple[Tuple[Slot, Type[BaseBeaconStateMachine]], ...]


Expand Down
5 changes: 1 addition & 4 deletions eth2/beacon/chains/testnet/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from eth2.beacon.typing import (
Slot,
)

GENESIS_SLOT = Slot(2**32)

TESTNET_CHAIN_ID = 5566
9 changes: 2 additions & 7 deletions eth2/beacon/state_machines/forks/xiao_long_bao/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
from eth2.beacon.state_machines.forks.serenity.configs import (
SERENITY_CONFIG,
)
from eth2.beacon.typing import (
Slot,
)

SLOTS_PER_EPOCH = 4
GENESIS_SLOT = Slot(32)

SLOTS_PER_EPOCH = 4

XIAO_LONG_BAO_CONFIG = SERENITY_CONFIG._replace(
SLOTS_PER_EPOCH=SLOTS_PER_EPOCH,
GENESIS_SLOT=GENESIS_SLOT,
GENESIS_EPOCH=slot_to_epoch(GENESIS_SLOT, SLOTS_PER_EPOCH),
GENESIS_EPOCH=slot_to_epoch(SERENITY_CONFIG.GENESIS_SLOT, SLOTS_PER_EPOCH),
TARGET_COMMITTEE_SIZE=2,
SHARD_COUNT=2,
MIN_ATTESTATION_INCLUSION_DELAY=2,
Expand Down

0 comments on commit 3fa905e

Please sign in to comment.