Skip to content

test: assert the shared-tail clauses through cloneDeterministicOpenSalt - #265

Open
thedavidmeister wants to merge 2 commits into
mainfrom
2026-09-21-issue-123-open-salt-shared-tail
Open

thedavidmeister wants to merge 2 commits into
mainfrom
2026-09-21-issue-123-open-salt-shared-tail

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Closes #123

Both entry points funnel into one cloneAndInitialize body, so a mutant of any
tail 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
(checkBothEntryPointsRevert and friends in cloneAndInitialize.t.sol); five
clauses broke it and were pinned through cloneDeterministic only. All five are
now asserted through cloneDeterministicOpenSalt:

  • …OpenSaltInitializeIsTheOnlyCallinitialize is the first and only call
    on the fresh proxy, a clause ICloneableFactoryV4 states on
    cloneDeterministicOpenSalt itself.
  • …OpenSaltEventPrecedesInitializeNewClone lands in the log stream before
    the clone's own Initializing.
  • …OpenSaltNonceOnlyCollisionReverts — a codeless address with a nonzero nonce
    fails the CREATE2 itself: CloneDeploymentFailed, not
    CloneAddressOccupied. Salts 0 and max take the same branch.
  • …OpenSaltCodeGuardRunsBeforeCreate2 — the implementation code guard runs
    ahead of the occupancy check, so an emptied implementation at an occupied
    address reverts ZeroImplementationCodeSize, not CloneAddressOccupied.
  • …OpenSaltNoEthForwarded — an ETH-holding factory endows the clone with none
    of it and keeps its balance.

The issue named four. The fifth is …CodeGuardRunsBeforeCreate2, which the
verifier flagged as breaking the same property; the category is the property,
not the list.

QA

  • Discriminating tests: the five above
    (test/src/lib/LibICloneableFactoryV4.cloneDeterministicOpenSalt.t.sol).
  • Mutations applied: 5, one per clause, each to the shared tail in
    src/lib/LibICloneableFactoryV4.sol — (1) create2(selfbalance(), …) for
    value, (2) delete the child == address(0)CloneDeploymentFailed branch,
    (3) move emit NewClone after the initialize call, (4) insert a
    child.call("") before initialize, (5) move checkImplementationCode after
    the 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 / 0
    failed.
  • Oracle: src/interface/ICloneableFactoryV4.sol, whose call-ordering and
    occupancy clauses are written on cloneDeterministicOpenSalt itself, so they
    are claims about that function and not only about the tail it shares.
  • Category check: the category is "a shared-tail clause pinned through one
    entry point only", checked in both directions. Namespaced-only after this PR:
    …SenderScoped, …SaltIsDomainTaggedHash, …DataNotInDerivation,
    …PredictZeroDeployer, …SecondDeployDifferentDataReverts — all properties
    of the namespaced DERIVATION, which the open-salt path does not have — and
    …InitializeRevertBubbles, whose clause is already pinned through both paths
    by checkBothEntryPointsRevert(true, revertData, …) in
    cloneAndInitialize.t.sol. Open-salt-only: …CallerIndependent,
    …DataInDerivation, …DiffersFromSenderNamespaced,
    …DoesNotConsumeNamespacedSalt, …IsDomainTaggedHash, …EmptyData,
    …LargeData — all open-salt derivation properties. No tail clause is left on
    one side.

Touches test/src/lib/LibICloneableFactoryV4.cloneDeterministicOpenSalt.t.sol,
as does the PR for #166 — both branch off main; this one changes the imports
and the tail of the file, #166 the body of
…OpenSaltInitializeFailureFails.

🤖 Generated with Claude Code

thedavidmeister and others added 2 commits September 21, 2026 11:25
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>
@thedavidmeister thedavidmeister self-assigned this Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ae527504-46d4-408c-875a-c11b42a53168

📥 Commits

Reviewing files that changed from the base of the PR and between f2d9e5a and 725f870.

📒 Files selected for processing (1)
  • test/src/lib/LibICloneableFactoryV4.cloneDeterministicOpenSalt.t.sol

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[F19] [LOW] Four shared-tail clauses are pinned only through cloneDeterministic; nothing asserts cloneDeterministicOpenSalt reaches them

1 participant