Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 4 additions & 4 deletions src/lean_spec/subspecs/chain/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
SECONDS_PER_SLOT: Final = SLOT_DURATION_MS // 1000
"""The fixed duration of a single slot in seconds."""

SLOTS_PER_EPOCH: Final = 96
"""The number of slots in an epoch."""
JUSTIFICATION_LOOKBACK_SLOTS: Final = 3
"""The number of slots to lookback for justification."""

PROPOSER_REORG_CUTOFF_BPS: Final = 2500
"""
Expand Down Expand Up @@ -81,7 +81,7 @@ class _ChainConfig(BaseModel):
# Time Parameters
slot_duration_ms: Uint64
second_per_slot: Uint64
slots_per_epoch: Uint64
justification_lookback_slots: Uint64
proposer_reorg_cutoff_bps: BasisPoint
vote_due_bps: BasisPoint
fast_confirm_due_bps: BasisPoint
Expand All @@ -96,7 +96,7 @@ class _ChainConfig(BaseModel):
DEVNET_CONFIG: Final = _ChainConfig(
slot_duration_ms=SLOT_DURATION_MS,
second_per_slot=SECONDS_PER_SLOT,
slots_per_epoch=SLOTS_PER_EPOCH,
justification_lookback_slots=JUSTIFICATION_LOOKBACK_SLOTS,
proposer_reorg_cutoff_bps=PROPOSER_REORG_CUTOFF_BPS,
vote_due_bps=VOTE_DUE_BPS,
fast_confirm_due_bps=FAST_CONFIRM_DUE_BPS,
Expand Down
4 changes: 2 additions & 2 deletions src/lean_spec/subspecs/networking/gossipsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class GossipsubParameters(StrictBaseModel):
"""The number of history windows to gossip about."""

seen_ttl_secs: int = (
DEVNET_CONFIG.second_per_slot * DEVNET_CONFIG.slots_per_epoch * 2
DEVNET_CONFIG.second_per_slot * DEVNET_CONFIG.justification_lookback_slots * 2
)
"""
The expiry time in seconds for the cache of seen message IDs.

This is calculated as SECONDS_PER_SLOT * SLOTS_PER_EPOCH * 2.
This is calculated as SECONDS_PER_SLOT * JUSTIFICATION_LOOKBACK_SLOTS * 2.
"""
Loading