Repository navigation
ci(ed25519-vectors): harden splice frame check and pin-parity version parse - #1081
Conversation
… parse Follow-up robustness hardening to the drift guard added in #1075. Neither fires in the normal CI/local workflow; both make a corrupt-input edge case fail loudly or parse correctly instead of silently misbehaving. - splice(): verify the line above/below each marker is actually a `// ===` frame before consuming it. A hand-edited .t.sol that lost a frame line (but kept the marker) previously had its first real line silently deleted; it now panics with a clear message. Also gives an accurate diagnostic when the END marker is the last line, replacing the misleading "markers out of order". - ed25519_pin_parity: take only the version token from a qualified Cargo.lock dependency edge, stripping any trailing ` (source)` suffix (present when a git/path override coexists with the registry copy) so it can't leak into the version string and cause a spurious mismatch. Verified: --write + forge fmt stays idempotent, the parity test still passes and still trips on a simulated pin drift, and the new frame check panics on a frame-stripped file. fmt/clippy clean. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request improves robustness in test utilities. In contracts/test/ed25519-vectors/src/main.rs, the splice function now explicitly verifies that the lines immediately outside the start and end markers are // === frame lines to prevent silently overwriting real code. In crates/incentive/tests/ed25519_pin_parity.rs, the dependency version parser is updated to extract only the version token from qualified edges, preventing spurious mismatches when source suffixes are present. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR hardens the Ed25519 differential-vector drift guard added in #1075 by turning two corrupt-input edge cases into explicit failures / correct parsing, without affecting the normal CI/local workflow when inputs are well-formed.
Changes:
- Tightens
splice()validation in the vector generator to confirm expected// ===frame lines exist around the AUTO-GENERATED marker span before rewriting. - Makes the pin-parity test’s Cargo.lock dependency parsing robust to qualified entries of the form
"name version (source)"by extracting only the version token.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/incentive/tests/ed25519_pin_parity.rs | Parses only the version token from a qualified Cargo.lock dependency entry to avoid spurious pin mismatches. |
| contracts/test/ed25519-vectors/src/main.rs | Validates marker-adjacent frame lines before splicing to prevent silent deletion of real code when frames are missing/corrupted. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Gas snapshotNo gas changes vs base. |
Contracts coverageLine coverage: 91.47% (2347/2566 lines) |
Coverage reportTotal: 81.71% (was 81.71%, ● 0.00%) — 42842/52433 lines No coverage data for changed Rust files. History
|
What & why
Follow-up robustness hardening to the Ed25519 differential-vector drift guard merged in #1075. These are the two optional items surfaced during review of that PR. Neither fires in the normal CI/local workflow — they turn corrupt-input edge cases from silent misbehavior into a loud failure / correct parse.
Changes
contracts/test/ed25519-vectors/src/main.rs—splice()frame validation. Before consuming the// ===frame line above/below eachAUTO-GENERATEDmarker, verify it's actually a frame. Previously, a hand-edited.t.solthat lost a frame line but kept the marker would have its first real line silently deleted by--write; it now panics with a clear message naming the file and marker. This also replaces the misleading"markers out of order"diagnostic that fired when theENDmarker was the last line of the file.crates/incentive/tests/ed25519_pin_parity.rs— version-token parse. A qualifiedCargo.lockdependency edge can be"name version (source)"(not just"name version") when a git/path override coexists with the registry copy. The parse now takes only the version token, so a trailing(source)suffix can't leak into the compared string and cause a spurious pin-mismatch failure. No such edge exists today (all dalek crates are single-source crates.io), so this is purely defensive.Verification
cargo run -- --write+forge fmtstays idempotent (empty diff against committed vectors).cargo fmt --check+cargo clippy -D warningsclean on both the generator workspace anddecdn-incentive.🤖 Generated with Claude Code
Summary by CodeRabbit