Skip to content

docs: refresh CLAUDE.md, devnet skills, and Table docs to match code#532

Merged
pablodeymo merged 1 commit into
mainfrom
docs/refresh-claude-md-skills
Jul 21, 2026
Merged

docs: refresh CLAUDE.md, devnet skills, and Table docs to match code#532
pablodeymo merged 1 commit into
mainfrom
docs/refresh-claude-md-skills

Conversation

@MegaRedHand

@MegaRedHand MegaRedHand commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Why

CLAUDE.md and the devnet skills had drifted from the code as PRs landed. Every claim below was verified against the current source before changing.

What

CLAUDE.md

  • Structure: 12 workspace crates — net/api and common/test-fixtures were missing from the tree; added the newer blockchain/src modules (block_builder.rs, aggregation.rs, reaggregate.rs, sync_status.rs)
  • Attestation pipeline: buffers are new_payloads/known_payloads (promotion at intervals 0/4), not new_attestations/known_attestations
  • Req/Resp: added BlocksByRange
  • Block-fetch retry: doubling from INITIAL_BACKOFF_MS (5ms → 2560ms), MAX_FETCH_RETRIES (10) attempts — was "10/40/160/640/2560, max 5"
  • XMSS signature size: SIGNATURE_SIZE = 2536 bytes, not 3112
  • Dependencies: ethereum_ssz/tree_hashlibssz(+derive/types)/libssz-merkle; tree_hash_root()hash_tree_root()
  • stf_spectests.rs lives in crates/blockchain/state_transition/tests/, not crates/blockchain/tests/
  • Replaced the rotted store.rs:368 line reference with the function name (on_gossip_attestation)
  • Added a docs/ index line to Resources

devnet-log-review skill

test-pr-devnet skill

  • Log analysis now points at this repo's own devnet-log-review skill (was pointing into lean-quickstart) and dumps container logs first
  • Fixed a broken relative link to CLAUDE.md; removed the stale client protocol-compatibility table

tables.rs

  • BlockSignatures doc said H256 -> BlockSignatures and "all other blocks must have an entry"; the key is (slot || root) (slot-ordered pruning) and entries are pruned below the finalized boundary
  • States doc now references SNAPSHOT_ANCHOR_INTERVAL by name instead of hardcoding 1024

Docs/comments only — no behavior change.

@github-actions

Copy link
Copy Markdown

🤖 Kimi Code Review

This PR consists entirely of documentation updates (markdown files and Rust doc comments) with no executable code changes. The updates are accurate and important for operator correctness.

Critical Documentation Fix

.claude/skills/devnet-log-review/SKILL.md (lines 157-162)

The correction to the supermajority calculation is critical and fixes a dangerous documentation error:

  • Before: Incorrectly stated 6 validators need 5 votes, 9 validators need 7 votes
  • After: Correctly states 6 validators need 4 votes, 9 validators need 6 votes (ceil(2N/3))

The formula 3 * votes >= 2 * validator_count is the correct integer arithmetic for BFT supermajority (≥2/3). Operators relying on the old documentation may have misconfigured testnets expecting finalization with insufficient validators.

Storage Schema Documentation

crates/storage/src/api/tables.rs (lines 8-16, 19-22)

The updated comments accurately describe the composite key (slot || root) for BlockSignatures:

  • Enables slot-ordered pruning scan (critical for storage management)
  • Clarifies that signatures are pruned after finalization while headers/bodies are retained
  • Correctly references SNAPSHOT_ANCHOR_INTERVAL constant instead of hardcoded 1024

Architectural Accuracy

CLAUDE.md updates are correct:

  • XMSS signature size: 3112 → 2536 bytes (matches SIGNATURE_SIZE constant)
  • State root method: tree_hash_root()hash_tree_root() (matches actual API)
  • Retry strategy: 5 attempts → 10 attempts, initial 5ms backoff (matches implementation)
  • Attestation pipeline: new_payloads/known_payloads buffer naming (matches store implementation)

Minor Suggestion

.claude/skills/test-pr-devnet/SKILL.md (line 143)

The log dump loop uses a hardcoded node list:

for node in zeam_0 ream_0 qlean_0 ethlambda_0; do

Consider making this configurable or documenting that this list must match the actual devnet topology if nodes are added/removed.

Summary

All documentation changes accurately reflect the current implementation. The supermajority fix prevents operational misconfiguration. No security issues or bugs introduced.


Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt

@github-actions

Copy link
Copy Markdown

🤖 Claude Code Review

All claims verified against source. This is a clean, well-fact-checked documentation-only PR.

Review: PR 532 — docs: refresh CLAUDE.md, devnet skills, and Table docs to match code

This PR is comments/docs-only (CLAUDE.md, two SKILL.md files, and doc comments in tables.rs) with no behavior change. I spot-checked the specific factual claims against the current source rather than just reading the diff, since a "fix stale docs" PR is exactly the kind of change where new inaccuracies can slip in unnoticed. Everything checked out:

  • Justification formula: 3 * vote_count >= 2 * validator_count at crates/blockchain/state_transition/src/lib.rs:355 — confirms the corrected 4-of-6 and 6-of-9 examples (old doc's "5 of 6" / "7 of 9" was indeed wrong).
  • XMSS SIGNATURE_SIZE: 2536, confirmed at crates/common/types/src/signature.rs:31.
  • Retry constants: INITIAL_BACKOFF_MS = 5, MAX_FETCH_RETRIES = 10 in crates/net/p2p/src/lib.rs:59-60.
  • Workspace crate count: 12 entries in the root Cargo.toml [workspace] members list, including crates/net/api and crates/common/test-fixtures, both confirmed to exist.
  • New blockchain/src modules: block_builder.rs, aggregation.rs, reaggregate.rs, sync_status.rs all present.
  • docs/ directory: rpc.md, metrics.md, checkpoint_sync.md, 3sf_mini.md, lmd_ghost.md all present as claimed.
  • new_payloads/known_payloads and accessor names extract_latest_new_attestations/extract_latest_known_attestations confirmed in crates/storage/src/store.rs and crates/blockchain/src/store.rs respectively.
  • "Intervals 0/4" promotion claim: confirmed by crates/blockchain/src/lib.rs:308-334 — attestations are indeed accepted at interval 0 for the proposer (comment: "this accepts attestations at interval 0 if we have a proposal"), not just interval 4. This is a genuine fix over the old "interval 4"-only text.
  • libssz/libssz-derive/libssz-merkle/libssz-types dependency names and hash_tree_root() confirmed in Cargo.toml / crates/common/types/Cargo.toml.
  • ethlambda-test-fixtures is indeed a prod ([dependencies], not [dev-dependencies]) dependency of crates/net/rpc, supporting the "prod dep of rpc's Hive test driver" claim.
  • Test file locations: crates/blockchain/tests/{forkchoice,signature}_spectests.rs and crates/blockchain/state_transition/tests/stf_spectests.rs match exactly.
  • SNAPSHOT_ANCHOR_INTERVAL (1024) and BlockSignatures key format (slot || root) confirmed in crates/storage/src/store.rs / tables.rs.
  • Skill relative links: .claude/skills/test-pr-devnet/SKILL.md's ../../../CLAUDE.md correctly resolves to the repo-root CLAUDE.md (the old ../../CLAUDE.md was one level short), and ../devnet-log-review/SKILL.md resolves correctly to the sibling skill.
  • Log markers "We are the proposer for this slot" and "Finished building block" both exist verbatim in crates/blockchain/src/lib.rs, supporting the updated block-proposal-flow steps in devnet-log-review/SKILL.md.

Minor nit

crates/storage/src/api/tables.rs:19 — the edited States doc line is noticeably longer than its neighbors (doesn't wrap at the ~85-char width the rest of the file uses):

/// every `SNAPSHOT_ANCHOR_INTERVAL` slots. Never pruned. Non-anchor states live in `StateDiffs` and

Purely cosmetic (rustfmt doesn't rewrap doc comments), but worth a manual wrap for consistency with the surrounding doc block.

Summary

No correctness, security, or behavioral concerns — this is a pure documentation/comment accuracy pass, and every changed factual claim I checked against the code was accurate. Good, careful work; the only note is the one cosmetic line-wrap nit above.


Automated review by Claude (Anthropic) · sonnet · custom prompt

@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR refreshes development and storage documentation to match the current code. The main changes are:

  • Updates workspace structure, protocol support, dependencies, and test paths.
  • Revises devnet finalization and block-proposal guidance.
  • Documents current storage keys, pruning, and snapshot intervals.

Confidence Score: 4/5

The changed devnet workflow invokes a missing script, while two comments misstate runtime retention and retry behavior.

  • Detailed log analysis fails at the newly documented command.
  • The retry sequence ends at 1280 ms rather than 2560 ms.
  • Signature pruning depends on a tip-based retention cutoff, not finalization alone.

.claude/skills/test-pr-devnet/SKILL.md, CLAUDE.md, and crates/storage/src/api/tables.rs

Important Files Changed

Filename Overview
.claude/skills/devnet-log-review/SKILL.md Updates finalization thresholds and the pre-built block proposal flow.
.claude/skills/test-pr-devnet/SKILL.md Corrects links and log collection guidance, but references a missing local analyzer.
CLAUDE.md Refreshes repository guidance, with an incorrect maximum block-fetch backoff.
crates/storage/src/api/tables.rs Clarifies persistent table behavior, but describes the signature pruning boundary too broadly.
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
.claude/skills/test-pr-devnet/SKILL.md:147
**Local Analyzer Script Is Missing**

The new detailed-analysis step invokes `.claude/skills/devnet-log-review/scripts/analyze-logs.sh`, but that script is not present in the repository. Following this workflow collects the container logs and then fails with `No such file or directory` instead of analyzing them.

### Issue 2 of 3
CLAUDE.md:282-284
**Backoff Endpoint Is Unreachable**

The handler stops when `pending.attempts >= MAX_FETCH_RETRIES`, before scheduling the next delay. With attempts starting at 1, it schedules nine retries from 5 ms through 1280 ms; the documented 2560 ms delay is never reached, so developers calculating fetch timing from this section get the wrong retry window.

```suggestion
### Retry Strategy on Block Requests
- Exponential backoff: doubling from `INITIAL_BACKOFF_MS` (5ms → 1280ms)
- Max `MAX_FETCH_RETRIES` (10) total attempts: the initial request plus 9 retries, with random peer selection on retry
```

### Issue 3 of 3
crates/storage/src/api/tables.rs:11-14
**Pruning Boundary Is Misstated**

Signatures are not pruned merely because they are below the finalized slot. The implementation first computes `tip_slot - SIGNATURE_PRUNING_RANGE` and only removes entries below that cutoff when the cutoff is finalized, so this comment can make maintainers expect recently finalized signatures to be absent when they are deliberately retained.

```suggestion
    /// Keyed by slot || root so pruning can scan in slot order and stop early.
    /// Non-genesis blocks have an entry until they fall below the retention cutoff
    /// (`tip_slot - SIGNATURE_PRUNING_RANGE`) and that cutoff is finalized. Headers
    /// and bodies are kept forever.
```

Reviews (1): Last reviewed commit: "docs: refresh CLAUDE.md, devnet skills, ..." | Re-trigger Greptile

docker logs "$node" > "${node}.log" 2>&1
done
.claude/skills/devnet-log-review/scripts/analyze-logs.sh
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Local Analyzer Script Is Missing

The new detailed-analysis step invokes .claude/skills/devnet-log-review/scripts/analyze-logs.sh, but that script is not present in the repository. Following this workflow collects the container logs and then fails with No such file or directory instead of analyzing them.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .claude/skills/test-pr-devnet/SKILL.md
Line: 147

Comment:
**Local Analyzer Script Is Missing**

The new detailed-analysis step invokes `.claude/skills/devnet-log-review/scripts/analyze-logs.sh`, but that script is not present in the repository. Following this workflow collects the container logs and then fails with `No such file or directory` instead of analyzing them.

How can I resolve this? If you propose a fix, please make it concise.

Comment thread CLAUDE.md
Comment on lines 282 to +284
### Retry Strategy on Block Requests
- Exponential backoff: 10ms, 40ms, 160ms, 640ms, 2560ms
- Max 5 attempts, random peer selection on retry
- Exponential backoff: doubling from `INITIAL_BACKOFF_MS` (5ms → 2560ms)
- Max `MAX_FETCH_RETRIES` (10) attempts, random peer selection on retry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Backoff Endpoint Is Unreachable

The handler stops when pending.attempts >= MAX_FETCH_RETRIES, before scheduling the next delay. With attempts starting at 1, it schedules nine retries from 5 ms through 1280 ms; the documented 2560 ms delay is never reached, so developers calculating fetch timing from this section get the wrong retry window.

Suggested change
### Retry Strategy on Block Requests
- Exponential backoff: 10ms, 40ms, 160ms, 640ms, 2560ms
- Max 5 attempts, random peer selection on retry
- Exponential backoff: doubling from `INITIAL_BACKOFF_MS` (5ms → 2560ms)
- Max `MAX_FETCH_RETRIES` (10) attempts, random peer selection on retry
### Retry Strategy on Block Requests
- Exponential backoff: doubling from `INITIAL_BACKOFF_MS` (5ms → 1280ms)
- Max `MAX_FETCH_RETRIES` (10) total attempts: the initial request plus 9 retries, with random peer selection on retry
Prompt To Fix With AI
This is a comment left during a code review.
Path: CLAUDE.md
Line: 282-284

Comment:
**Backoff Endpoint Is Unreachable**

The handler stops when `pending.attempts >= MAX_FETCH_RETRIES`, before scheduling the next delay. With attempts starting at 1, it schedules nine retries from 5 ms through 1280 ms; the documented 2560 ms delay is never reached, so developers calculating fetch timing from this section get the wrong retry window.

```suggestion
### Retry Strategy on Block Requests
- Exponential backoff: doubling from `INITIAL_BACKOFF_MS` (5ms → 1280ms)
- Max `MAX_FETCH_RETRIES` (10) total attempts: the initial request plus 9 retries, with random peer selection on retry
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +11 to +14
/// Keyed by slot || root so pruning can scan in slot order and stop early.
/// Non-genesis blocks have an entry until finalized: signatures below the
/// finalized boundary are pruned (`prune_old_block_signatures`), while
/// headers and bodies are kept forever.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Pruning Boundary Is Misstated

Signatures are not pruned merely because they are below the finalized slot. The implementation first computes tip_slot - SIGNATURE_PRUNING_RANGE and only removes entries below that cutoff when the cutoff is finalized, so this comment can make maintainers expect recently finalized signatures to be absent when they are deliberately retained.

Suggested change
/// Keyed by slot || root so pruning can scan in slot order and stop early.
/// Non-genesis blocks have an entry until finalized: signatures below the
/// finalized boundary are pruned (`prune_old_block_signatures`), while
/// headers and bodies are kept forever.
/// Keyed by slot || root so pruning can scan in slot order and stop early.
/// Non-genesis blocks have an entry until they fall below the retention cutoff
/// (`tip_slot - SIGNATURE_PRUNING_RANGE`) and that cutoff is finalized. Headers
/// and bodies are kept forever.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/storage/src/api/tables.rs
Line: 11-14

Comment:
**Pruning Boundary Is Misstated**

Signatures are not pruned merely because they are below the finalized slot. The implementation first computes `tip_slot - SIGNATURE_PRUNING_RANGE` and only removes entries below that cutoff when the cutoff is finalized, so this comment can make maintainers expect recently finalized signatures to be absent when they are deliberately retained.

```suggestion
    /// Keyed by slot || root so pruning can scan in slot order and stop early.
    /// Non-genesis blocks have an entry until they fall below the retention cutoff
    /// (`tip_slot - SIGNATURE_PRUNING_RANGE`) and that cutoff is finalized. Headers
    /// and bodies are kept forever.
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@github-actions

Copy link
Copy Markdown

🤖 Codex Code Review

  1. .claude/skills/devnet-log-review/SKILL.md: this summary now tells readers to consult the linked reference, but that reference still documents the old behavior and thresholds at references/FINALIZATION_DEBUG.md and references/FINALIZATION_DEBUG.md. The PR therefore introduces contradictory finalization guidance in the same skill path (every few slots / ceil(2N/3) here vs 6-12 slots / 5 of 6, 7 of 9 there).

  2. CLAUDE.md: the new retry description says backoff doubles from 5ms → 2560ms, but the implementation starts requests at attempts: 1 and stops retrying once attempts >= MAX_FETCH_RETRIES, so the actually scheduled backoffs are 5, 10, 20, ..., 1280ms; 2560ms is never reached. See crates/net/p2p/src/req_resp/handlers.rs and crates/net/p2p/src/lib.rs. This is minor, but it will mislead anyone debugging fetch behavior from the docs.

  3. crates/storage/src/api/tables.rs: “Non-genesis blocks have an entry until finalized” is not what the store does. Signatures are retained for at least SIGNATURE_PRUNING_RANGE slots even after finalization, and pruning only happens once that retention window is entirely finalized; see crates/storage/src/store.rs and crates/storage/src/store.rs. The comment should say “until old enough and finalized,” otherwise it overstates pruning.

Aside from those documentation mismatches, I did not find code correctness, security, or consensus-logic issues in this PR; the diff is comment/docs-only.


Automated review by OpenAI Codex · gpt-5.4 · custom prompt

The docs drifted from the code as PRs landed:

- CLAUDE.md: 12 workspace crates (net/api and common/test-fixtures were
  missing from the tree), Store buffer names (new_payloads/known_payloads),
  BlocksByRange in req/resp, actual fetch backoff (5ms doubling,
  MAX_FETCH_RETRIES attempts), XMSS signature size (SIGNATURE_SIZE),
  libssz/libssz-merkle dependency renames, hash_tree_root(), the stf
  spec-test location, and a docs/ index in Resources
- devnet-log-review skill: the justification threshold is
  3*votes >= 2*N, i.e. ceil(2N/3) — the worked examples said 5-of-6 and
  7-of-9 where the code needs 4 and 6; block proposal flow updated for
  the pre-build path (#445/#474)
- test-pr-devnet skill: point log analysis at this repo's own
  devnet-log-review skill and fix a broken relative link to CLAUDE.md
- tables.rs: BlockSignatures is keyed (slot || root) for slot-ordered
  pruning and entries are pruned below the finalized boundary; States
  anchors reference SNAPSHOT_ANCHOR_INTERVAL by name
@MegaRedHand
MegaRedHand force-pushed the docs/refresh-claude-md-skills branch from 9f67af5 to 32138e7 Compare July 21, 2026 16:15
@pablodeymo
pablodeymo merged commit 810b8b6 into main Jul 21, 2026
2 checks passed
@pablodeymo
pablodeymo deleted the docs/refresh-claude-md-skills branch July 21, 2026 16:47
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.

2 participants