Skip to content

refactor: move chain config to lstar fork spec#816

Closed
tcoratger wants to merge 1 commit into
leanEthereum:mainfrom
tcoratger:move-chain-config-to-lstar-spec
Closed

refactor: move chain config to lstar fork spec#816
tcoratger wants to merge 1 commit into
leanEthereum:mainfrom
tcoratger:move-chain-config-to-lstar-spec

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

Summary

Moves node/chain/config.pyspec/forks/lstar/config.py.

These constants are protocol parameters that client teams must match, not node implementation details. Yet several spec/ modules already imported them from node/ — an inverted dependency where the protocol-spec layer reached down into a specific node implementation:

spec/forks/lstar/containers.py  → HISTORICAL_ROOTS_LIMIT
spec/forks/lstar/spec.py        → INTERVALS_PER_SLOT, JUSTIFICATION_LOOKBACK_SLOTS,
                                   MAX_ATTESTATIONS_DATA, GOSSIP_DISPARITY_INTERVALS, ...

The constants are all consensus-critical:

  • SSZ container/list bounds (HISTORICAL_ROOTS_LIMIT, MAX_ATTESTATIONS_DATA) — must match exactly or hash_tree_root diverges
  • Timing / forkchoice / attestation params (SECONDS_PER_SLOT, INTERVALS_PER_SLOT, JUSTIFICATION_LOOKBACK_SLOTS, GOSSIP_DISPARITY_INTERVALS, ATTESTATION_COMMITTEE_COUNT)

Scoping them to the lstar fork matches the per-fork registry pattern in spec/forks/, since a future fork could change these values. (Genuinely node-local config — node/sync/config.py, node/genesis/config.py — correctly stays in node/.)

Changes

  • git mv the file (history preserved)
  • Update all ~26 import sites across src/, tests/, and packages/testing/

Verification

  • just check passes (ruff lint, format, ty, codespell, mdformat)
  • Affected unit tests pass (143)

🤖 Generated with Claude Code

The chain and consensus configuration constants lived under
node/chain/config.py, but they are protocol parameters that client
teams must match, not node implementation details.

Several spec/ modules already imported them from node/, an inverted
dependency where the protocol-spec layer reached down into a specific
node implementation. SSZ container bounds (HISTORICAL_ROOTS_LIMIT,
MAX_ATTESTATIONS_DATA) and forkchoice/timing parameters belong with
the fork they define.

Move the file to spec/forks/lstar/config.py, scoping the constants to
the lstar fork in line with the per-fork registry pattern, and update
all import sites across src, tests, and packages/testing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger closed this Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant