AMT coverage: g2-clone-tail - #98
Conversation
…d prefunded addresses Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe PR extends ChangesClone validation
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Adversarial + mutation campaign, group
g2-clone-tail, scanned at5a633508643e345fc72c11133f782214f60db9b5. Test-only. Tests 68 → 75.Behaviour ledger
Verdicts come from
mutation-probe(greedy fail-pattern, proof(\d+) tests passed, 0 no-run, 0 harness errors). Pass 1 ran on the untouched suite. Passes 2 and 3 ran on this branch.checkImplementationCode
0xefcompare/constant/boundaries; extcodecopy offsets; byte index): KILLED_PREEXISTING.< 2), A08 (>= 0xef): before this PR only the fuzztestCheckImplementationCodeEtchedkilled them, so the kill depended on the seed.testCheckImplementationCodeSingleBytenow kills them deterministically. A09 is also killed by it.testCheckImplementationCodeSingleByteEf: a lone0xefrevertsDelegatedImplementation.cloneAndInitialize
CloneDeploymentFailed,NewClonefields and ordering, the initialize call, bubbling and the return check.> 1): EQUIVALENT. The only code a CREATE2 clone address can hold is the 45-byte EIP-1167 runtime.NewClonecarriespredicted) and B52 (return predicted): EQUIVALENT.child == predictedwhenever CREATE2 succeeded.> 1) and B38 (bubble> 4): SURVIVED → KILLED_NEW bytestInitializeRevertsWithSubWordDataBubblesVerbatim(1, 4 and 31 bytes) and the fuzztestInitializeRevertsWithDataBubblesVerbatim.testInitializeReturnsSubWordRevertsInitializationFailed.testDelegatedImplementationRevertsDelegatedImplementation, which exercises both entry points.testCloneDeterministicInitializeRevertBubbles. The new tests kill it too.testPrefundedCloneAddressDeploys. A predicted address that holds ETH but no code deploys, and the clone keeps the ETH.codehash): KILLED_PREEXISTING bytestCloneDeterministicNonceOnlyCollisionReverts. The new tests kill it too.ICLONEABLE_V2_SUCCESS
TestCloneablereturns the spec literal, not the constant.QA
testCheckImplementationCodeSingleByte,testCheckImplementationCodeSingleByteEf,testInitializeRevertsWithSubWordDataBubblesVerbatim,testInitializeRevertsWithDataBubblesVerbatim,testInitializeReturnsSubWordRevertsInitializationFailed,testDelegatedImplementationRevertsDelegatedImplementation,testPrefundedCloneAddressDeploys. This PR is test-only and the base behaviour is correct, so each test passes on base and fails under its mutant (mutation-probe pass 2: 10/10 killed). The full suite on the branch is 75 passed, 0 failed, andforge fmt --checkis clean.code.length == 0→< 2(A03) → SingleByte;== 0xef→>= 0xef/<= 0xef(A08/A09) → SingleByte;returnData.length > 0→> 1/> 4(B37/B38) → SubWordDataBubblesVerbatim, DataBubblesVerbatim;length != 32→== 0 || > 32(B55) → ReturnsSubWord; the guard call → a zero-code check only (B58) → DelegatedImplementation; occupancy|| predicted.balance != 0(B61) → PrefundedCloneAddressDeploys.LibICloneableFactoryV4errors andcloneAndInitialize, andICloneableFactoryV3.cloneDeterministic: a revert with data bubbles verbatim; anything but the 32-byte sentinel isInitializationFailed;0xef-leading code isDelegatedImplementation(checkImplementationCode admits an EIP-7702 delegated EOA, whose code the account holder can repoint or revoke after clones exist #73);CloneAddressOccupiedis about code only. Expected values are literal bytes and typed selectors, not recomputed from the implementation.checkImplementationCode, the wholecloneAndInitializetail, andICLONEABLE_V2_SUCCESS. The ledger above covers all three.0xefchecks (empty code copies as 0);extcodecopyof 32 bytes (byte 0 unchanged);!success ||in the return check (a revert with data has already bubbled; a revert with empty data fails the length check);initializeonpredictedinstead ofchild.🤖 Generated with Claude Code
Summary by CodeRabbit