test: assert the shared-tail clauses through cloneDeterministicOpenSalt - #265
Open
thedavidmeister wants to merge 2 commits into
Open
thedavidmeister wants to merge 2 commits into
thedavidmeister wants to merge 2 commits into
Conversation
Five clauses of the shared clone tail were asserted only through `cloneDeterministic`: that `initialize` is the only call the factory makes on the proxy — stated normatively on `cloneDeterministicOpenSalt` itself — that `NewClone` precedes it, `CloneDeploymentFailed` at a codeless address with a nonzero nonce, the implementation-code guard running before the `CREATE2`, and the literal `0` value that keeps a factory's ETH out of the clone. Both entry points funnel into one body, so a mutant of any of those lines is killed by whichever entry point happens to cover it and the per-entry-point gap is invisible to mutation. The suite's own convention is to assert shared-tail behaviour through both entry points, as `cloneAndInitialize.t.sol` does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…open-salt-shared-tail
|
Warning Review limit reachedNext included review available in 29 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
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 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #123
Both entry points funnel into one
cloneAndInitializebody, so a mutant of anytail line is killed by whichever entry point happens to cover it and a
per-entry-point gap is invisible to mutation. The suite's own convention is to
assert shared-tail behaviour through both paths
(
checkBothEntryPointsRevertand friends incloneAndInitialize.t.sol); fiveclauses broke it and were pinned through
cloneDeterministiconly. All five arenow asserted through
cloneDeterministicOpenSalt:…OpenSaltInitializeIsTheOnlyCall—initializeis the first and only callon the fresh proxy, a clause
ICloneableFactoryV4states oncloneDeterministicOpenSaltitself.…OpenSaltEventPrecedesInitialize—NewClonelands in the log stream beforethe clone's own
Initializing.…OpenSaltNonceOnlyCollisionReverts— a codeless address with a nonzero noncefails the
CREATE2itself:CloneDeploymentFailed, notCloneAddressOccupied. Salts0andmaxtake the same branch.…OpenSaltCodeGuardRunsBeforeCreate2— the implementation code guard runsahead of the occupancy check, so an emptied implementation at an occupied
address reverts
ZeroImplementationCodeSize, notCloneAddressOccupied.…OpenSaltNoEthForwarded— an ETH-holding factory endows the clone with noneof it and keeps its balance.
The issue named four. The fifth is
…CodeGuardRunsBeforeCreate2, which theverifier flagged as breaking the same property; the category is the property,
not the list.
QA
(
test/src/lib/LibICloneableFactoryV4.cloneDeterministicOpenSalt.t.sol).src/lib/LibICloneableFactoryV4.sol— (1)create2(selfbalance(), …)forvalue, (2) delete the
child == address(0)→CloneDeploymentFailedbranch,(3) move
emit NewCloneafter theinitializecall, (4) insert achild.call("")beforeinitialize, (5) movecheckImplementationCodeafterthe occupancy check. Every one SURVIVES on main: the open-salt file is 17
passed / 0 failed under all five. On this branch each one leaves 21 passed / 1
failed, and the single failure is its own clause's test —
(1)
…NoEthForwarded, (2)…NonceOnlyCollisionReverts,(3)
…EventPrecedesInitialize, (4)…InitializeIsTheOnlyCall,(5)
…CodeGuardRunsBeforeCreate2. Unmutated, the whole suite is 83 passed / 0failed.
src/interface/ICloneableFactoryV4.sol, whose call-ordering andoccupancy clauses are written on
cloneDeterministicOpenSaltitself, so theyare claims about that function and not only about the tail it shares.
entry point only", checked in both directions. Namespaced-only after this PR:
…SenderScoped,…SaltIsDomainTaggedHash,…DataNotInDerivation,…PredictZeroDeployer,…SecondDeployDifferentDataReverts— all propertiesof the namespaced DERIVATION, which the open-salt path does not have — and
…InitializeRevertBubbles, whose clause is already pinned through both pathsby
checkBothEntryPointsRevert(true, revertData, …)incloneAndInitialize.t.sol. Open-salt-only:…CallerIndependent,…DataInDerivation,…DiffersFromSenderNamespaced,…DoesNotConsumeNamespacedSalt,…IsDomainTaggedHash,…EmptyData,…LargeData— all open-salt derivation properties. No tail clause is left onone side.
Touches
test/src/lib/LibICloneableFactoryV4.cloneDeterministicOpenSalt.t.sol,as does the PR for #166 — both branch off
main; this one changes the importsand the tail of the file, #166 the body of
…OpenSaltInitializeFailureFails.🤖 Generated with Claude Code