refactor(blockchain): reference INTERVALS_PER_SLOT in the tick panic message - #572
Conversation
…message The message hardcoded the interval count, so changing the grid would leave a stale number in a panic string.
Greptile SummaryThe PR keeps
Confidence Score: 5/5The PR appears safe to merge with no actionable issues identified. The change only updates diagnostic text to capture an in-scope integer constant using formatting supported by the repository’s pinned Rust toolchain, without changing control flow.
|
| Filename | Overview |
|---|---|
| crates/blockchain/src/lib.rs | Safely replaces a hardcoded panic-message value with the existing in-scope interval constant. |
Reviews (1): Last reviewed commit: "refactor(blockchain): reference INTERVAL..." | Re-trigger Greptile
🤖 Kimi Code Reviewcrates/blockchain/src/lib.rs:109 This is a positive change that improves maintainability. Using the Verification needed: No security or correctness issues introduced. The Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt |
🤖 Claude Code ReviewThe change is correct and safe — no findings. It's a minimal, well-justified fix that keeps the panic message in sync with Automated review by Claude (Anthropic) · sonnet · custom prompt |
🤖 Codex Code ReviewNo findings. The only change at crates/blockchain/src/lib.rs:109 replaces a hardcoded panic string with Residual gap: I could not run Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
🗒️ Description / Motivation
Extracted from #561, where the interval count changes and this message would otherwise have gone stale.
SlotInterval::from_intervals_since_genesishardcoded the interval count in itsunreachable!string, so changing the grid would leave a wrong number in a panic message — the one place you least want to be misled.What Changed
crates/blockchain/src/lib.rs— the panic message capturesINTERVALS_PER_SLOTinstead of spelling out the number.Correctness / Behavior Guarantees
No behavior change; the arm is unreachable by construction (
% INTERVALS_PER_SLOT). Inline format-arg capture of aconstinsideunreachable!was confirmed to compile, not assumed.Two doc comments in the same file still spell out
800ms/5 intervalsin prose. Left alone as out of scope for this PR.Tests Added / Run
No new tests — no behavior change to cover.
Related Issues / PRs
✅ Verification Checklist
make fmt— cleanmake lint(clippy with-D warnings) — cleanmake test(cargo test --workspace --profile release-fast) — all passing