Skip to content

cl: add per-directory spec maps for Caplin consensus code#21400

Merged
domiwei merged 4 commits into
mainfrom
kewei/forkchoice_spec_tests_35
May 28, 2026
Merged

cl: add per-directory spec maps for Caplin consensus code#21400
domiwei merged 4 commits into
mainfrom
kewei/forkchoice_spec_tests_35

Conversation

@domiwei
Copy link
Copy Markdown
Member

@domiwei domiwei commented May 25, 2026

Summary

  • Split the monolithic cl/CLAUDE.md into per-directory spec maps so each consensus-critical subdirectory has its own function-to-spec mapping and review checklist
  • cl/CLAUDE.md → concise top-level overview linking to subdirectories
  • cl/phase1/forkchoice/CLAUDE.md → forkchoice spec map (Phase0 through Gloas/Fulu)
  • cl/transition/CLAUDE.md → state transition: block operations + epoch processing
  • cl/phase1/core/state/CLAUDE.md → beacon state accessors, mutators, cache helpers

Motivation

Agent-assisted code changes in consensus-critical areas need spec grounding. Without function-level spec mappings, agents (and humans) can make changes that look locally correct but deviate from the spec — e.g., substituting a full list where the spec intentionally uses a partial accumulator.

Test plan

  • Docs-only change — no code modified
  • All relative links verified to point at existing files
  • All Go function names in spec maps verified against codebase (two rounds of subagent review, 100+ function names spot-checked)

🤖 Generated with Claude Code

domiwei and others added 4 commits May 23, 2026 11:11
The previous commit dropped these two Gloas forkchoice.go functions
and their on_execution_payload_envelope spec mapping when adding the
Fulu fork-choice entries. They still exist at forkchoice.go:730,736
and are used by the payload/envelope processing path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move forkchoice spec map to cl/phase1/forkchoice/CLAUDE.md and add new
spec maps for state transition (cl/transition/CLAUDE.md) and beacon state
helpers (cl/phase1/core/state/CLAUDE.md). The top-level cl/CLAUDE.md now
serves as a concise overview linking to the subdirectory files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds per-directory CLAUDE.md “spec maps” for Caplin consensus-critical code to make agent/human reviews easier to ground against the upstream Ethereum consensus specifications.

Changes:

  • Add a concise top-level cl/CLAUDE.md that links to spec maps per subdirectory.
  • Add spec-map + checklist docs for fork choice (cl/phase1/forkchoice/), state transition (cl/transition/), and beacon state helpers (cl/phase1/core/state/).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
cl/CLAUDE.md Top-level entrypoint linking to per-directory spec maps and cross-cutting review principles
cl/phase1/forkchoice/CLAUDE.md Fork-choice spec map + Fulu/Gloas review notes + checklist
cl/transition/CLAUDE.md State transition spec map across pipeline, operations, and epoch processing + checklist
cl/phase1/core/state/CLAUDE.md Beacon state helper accessor/mutator spec map + checklist

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +9 to +15
- Phase0 fork choice: https://ethereum.github.io/consensus-specs/phase0/fork-choice/
- Bellatrix fork choice: https://ethereum.github.io/consensus-specs/bellatrix/fork-choice/
- Deneb fork choice: https://ethereum.github.io/consensus-specs/deneb/fork-choice/
- Electra fork choice changes are inherited through Bellatrix/Deneb `on_block`
execution-request plumbing and beacon-chain state transition rules.
- Fulu fork choice: https://ethereum.github.io/consensus-specs/fulu/fork-choice/
- Gloas fork choice: https://ethereum.github.io/consensus-specs/gloas/fork-choice/
@AskAlexSharov AskAlexSharov added this pull request to the merge queue May 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 26, 2026
@AskAlexSharov AskAlexSharov added this pull request to the merge queue May 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 26, 2026
@domiwei domiwei added this pull request to the merge queue May 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 27, 2026
@domiwei domiwei added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit ea5d24d May 28, 2026
76 checks passed
@domiwei domiwei deleted the kewei/forkchoice_spec_tests_35 branch May 28, 2026 05:36
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.

3 participants