test(integrity): slot-distinctness guard and per-word integrity count assertions#211
test(integrity): slot-distinctness guard and per-word integrity count assertions#211thedavidmeister wants to merge 3 commits into
Conversation
… assertions (#210) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 20 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThree new test functions are added to ChangesERC4626 integrity pointer tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…integrity-pointer-tests
|
Rework note (human reject, 2026-07-04): testIntegritySlotsAreDistinctlyAssigned asserts slot != 0, which is NON-ZERO, not DISTINCT — two opcodes colliding on one integrity slot (the exact self-consistent-but-wrong case #210 names) passes. Implement pairwise inequality across the table (or argue on the issue if deliberately shared integrity fns should be legitimate). #210's second ask — the END-TO-END integrity path: bad-arity source through the real parse/deploy path asserting the EXACT integrity error selector — is absent entirely; the direct-call 2-in/1-out units are fine as bonus but do not cover it. Re-attempt with both asks genuinely met, then Closes #210. |
…gnment naming Rework per the trusted rework note on #211: - End-to-end integrity leg: three parse2 tests drive bad-arity sources (too-few and too-many inputs for erc4626-convert-to-assets, too-few for erc4626-convert-to-shares) through the real subparser + deploy path and pin the EXACT ExternIntegrityInputsMismatch(bytecodeInputs, 2) revert data. Mutation-validated: with integrity mutated to return (1,1) all three fail (revert data no longer matches); green on baseline (116/116). - Pairwise-distinctness leg: renamed testIntegritySlotsAreDistinctlyAssigned to testIntegritySlotsAreAssigned (it asserts non-zero, not distinctness) and documented why distinctness is not asserted — both words' integrity functions are extensionally identical ((2,1)) so solc deduplicates them to one pointer (committed table hex"0c830c83"); a pairwise-inequality assertion reds on correct code. The distinctness design question is raised on #210 for a ruling. Co-Authored-By: Claude <noreply@anthropic.com>
|
🤖 ai:producer |
|
🤖 ai:vetter |
Closes #210
Adds three tests to
ERC4626Words.extern.pointers.t.sol:testIntegritySlotsAreDistinctlyAssigned— iterates every 2-byte slot in the freshly-built integrity table and asserts it is non-zero. Catches the case where an opcode is silently omitted from the dispatch table (zero = uninitialized pointer).testIntegrityConvertToAssetsReturns2Inputs1Output— callsLibOpERC4626ConvertToAssets.integrity(OperandV2.wrap(0), 0, 0)and asserts(inputs, outputs) == (2, 1).testIntegrityConvertToSharesReturns2Inputs1Output— identical structure forLibOpERC4626ConvertToShares.The
UnexpectedInputserror-selector path (part b of issue #210) requires the bounds-check guard from PR #205, which is not yet merged; that path is deferred to avoid conflict.Summary by CodeRabbit