Skip to content

fix: handle dynamic ephemery genesis metadata across config and lightclient paths#9204

Open
shrirajpawar4 wants to merge 4 commits intoChainSafe:unstablefrom
shrirajpawar4:feat/ephemery-network-config
Open

fix: handle dynamic ephemery genesis metadata across config and lightclient paths#9204
shrirajpawar4 wants to merge 4 commits intoChainSafe:unstablefrom
shrirajpawar4:feat/ephemery-network-config

Conversation

@shrirajpawar4
Copy link
Copy Markdown

Motivation

Ephemery was added in #6054, but some paths still assumed its genesis metadata was static. That left the remaining issue from #6050 unresolved in places that depend on genesisValidatorsRoot, fork
digests, and reset-aware chain config values.

Description

This PR completes the remaining Ephemery work by treating its network metadata as runtime-derived instead of fully static.

Changes included:

  • derive Ephemery MIN_GENESIS_TIME, DEPOSIT_CHAIN_ID, and DEPOSIT_NETWORK_ID from the current reset iteration
  • mark Ephemery genesisValidatorsRoot as unknown (null) in static network metadata
  • update validator slashing protection to fetch genesisValidatorsRoot from the beacon API when static metadata does not provide one
  • preserve an already-built runtime BeaconConfig in lightclient route serialization so fork digests use the correct live genesis context
  • add regression tests covering:
    • dynamic Ephemery config values
    • nullable Ephemery genesis metadata
    • slashing protection fallback behavior
    • lightclient serialization with runtime Ephemery config
  • add one explicit mainnet null check in validator tests to account for the new nullable genesisValidatorsRoot type

Closes #6050

AI Assistance Disclosure

used Codex to understand the code structure and identify the remaining gaps related to this issue. Each change was reviewed and is understood by me.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Ephemery network configuration to support dynamic genesis and periodic resets. Key changes include updating the GenesisData type to allow a null genesisValidatorsRoot, implementing derivation functions for Ephemery's chain configuration based on the current time, and updating the API and CLI utilities to handle runtime-defined beacon configurations. These updates ensure correct light client serialization and slashing protection for networks where the genesis root is not statically known. I have no feedback to provide.

@shrirajpawar4 shrirajpawar4 mentioned this pull request Apr 10, 2026
5 tasks
@shrirajpawar4 shrirajpawar4 marked this pull request as ready for review April 14, 2026 06:00
@shrirajpawar4 shrirajpawar4 requested a review from a team as a code owner April 14, 2026 06:00
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddf61d657b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/cli/src/cmds/validator/slashingProtection/utils.ts
@nflaig
Copy link
Copy Markdown
Member

nflaig commented Apr 21, 2026

@shrirajpawar4 please address the AI review comments

@shrirajpawar4
Copy link
Copy Markdown
Author

@nflaig done ser. The genesis fetch call is now inside the try block, so --force falls back to the zero root when api.beacon.getGenesis() throws before assertOk() is reached.

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.

Ephemery Testnet Configs

2 participants