fix: match fork digest in gossip spec tests#622
Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom Apr 16, 2026
Merged
Conversation
Match the beacon chain convention of using bare hex fork digests
(e.g. "12345678") instead of 0x-prefixed hex ("0x12345678").
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
42b95a1 to
a8d85be
Compare
MegaRedHand
approved these changes
Apr 16, 2026
MegaRedHand
added a commit
to lambdaclass/ethlambda
that referenced
this pull request
Apr 16, 2026
Match the leanSpec topic format `/leanconsensus/{fork_digest}/{name}/ssz_snappy`
(leanEthereum/leanSpec#622) instead of the custom `/leanconsensus/devnet0/...`.
Introduce a `ForkDigest` newtype displayed as lowercase hex without `0x`
prefix, plus `block_topic` / `aggregation_topic` / `attestation_subnet_topic`
helpers. The digest is plumbed through `SwarmConfig` / `BuiltSwarm` /
`P2PServer` so it becomes configurable once the spec defines real fork
identification. For now every client agrees on the dummy `12345678` value,
exposed as `ForkDigest::DUMMY`.
Closes #292
Open
2 tasks
MegaRedHand
added a commit
to lambdaclass/ethlambda
that referenced
this pull request
Apr 17, 2026
## Summary - Match the [leanSpec gossipsub topic format](leanEthereum/leanSpec#622) `/leanconsensus/{fork_digest}/{name}/ssz_snappy` instead of the custom `/leanconsensus/devnet0/...` we had hard-coded. Closes #292.
tcoratger
added a commit
to tcoratger/leanSpec
that referenced
this pull request
Apr 27, 2026
Delete forks/devnet5/ entirely. We are running one devnet roughly per month, so per-devnet placeholders rot fast and lock the spec into a sequential upgrade story we are not committing to. Rename forks/devnet4/ to forks/lstar/ (via git mv, history preserved): - Devnet4Spec -> LstarSpec - Devnet4 (test BaseFork class) -> Lstar - "devnet4" / "Devnet4" string identifiers -> "lstar" / "Lstar" - lean_spec.forks.devnet4.* import paths -> lean_spec.forks.lstar.* - --fork=Devnet4 / --fork=devnet4 in CI workflows and docs -> Lstar / lstar Test surface follows: TestDevnet4Spec -> TestLstarSpec, TestDevnet5Spec removed entirely. Multi-fork ForkRegistry tests now use a synthetic in-test successor class instead of a real second fork. Untouched on purpose: - pyproject.toml lean-multisig-py branch="devnet4" (external repo, not ours). - tests/consensus/devnet/ folder name (generic test path, no version number). - GOSSIP_DIGEST="devnet0" — the cross-client gossip network name set by PR leanEthereum#622. Renaming it touches the whole networking layer and is a separate cleanup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tcoratger
added a commit
to tcoratger/leanSpec
that referenced
this pull request
Apr 27, 2026
The value sitting on the gossipsub topic layer is the cross-client network name (currently "devnet0", set by PR leanEthereum#622), not a 4-byte fork digest hash. The "fork_digest" naming was a holdover from Ethereum mainline where it really is a digest; here it just confuses readers into expecting a hash where there is a string identifier. Renamed in the network-name layer: - ForkProtocol.GOSSIP_DIGEST -> ForkProtocol.NETWORK_NAME - GossipTopic.fork_digest -> GossipTopic.network_name - GossipTopic.{block,committee_aggregation,attestation_subnet} fork_digest parameter -> network_name - GossipTopic.validate_fork(expected_fork_digest=...) -> validate_fork(expected_network_name=...) - GossipTopic.from_string_validated(..., expected_fork_digest=...) -> expected_network_name - GossipHandler.fork_digest -> GossipHandler.network_name - LiveNetworkEventSource._fork_digest -> _network_name - LiveNetworkEventSource.set_fork_digest() -> set_network_name() - NetworkService.fork_digest -> NetworkService.network_name - NodeConfig.fork_digest -> NodeConfig.network_name Plus matching test renames: - test_gossip_digest -> test_network_name - test_gossip_topic_fork_digest_{matches,mismatch,...} -> test_gossip_topic_network_name_* - All test variables, parameters, and prose updated. Untouched on purpose: - Eth2Data.fork_digest: ForkDigest in subspecs/networking/enr/eth2.py is a real 4-byte ENR hash per the Ethereum p2p spec. The ForkDigest type stays. enr/enr.py, peer.py, discovery/routing.py all interact with this real digest and are unchanged. - JSON fixture keys "forkDigest" / "expectedForkDigest" in cross-client test vectors. Other clients consume those keys; renaming would break the wire format. Internal Python uses network_name; the JSON keys are read into network_name on the way in. - ForkMismatchError class name. A fork mismatch is still a fork mismatch semantically. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
Addresses #619
Matches the fork digest to the existing digest in the spec as well as the one implemented in other clients.
🔗 Related Issues or PRs
✅ Checklist
toxchecks to avoid unnecessary CI fails:uvx tox