test: pin every salt-derivation boundary as a fixed case - #88
Conversation
The derivations are specified over the whole input domain with no boundary carved out, but the suite asserted the boundary values only when the fuzzer happened to draw them, so which boundaries a green run had actually covered varied with the seed. Each end of every operand domain that was still left to the fuzzer is now a fixed case with the other operands fuzzed: salt and deployer at zero and max in `effectiveSalt`, data at the word-relative length boundaries in `effectiveOpenSalt`, implementation at zero and max in `cloneCreationCode`, factory and implementation at zero and max in `predictCloneAddress`. Expected values are recomputed from the interface formula, from OZ `Clones`, or written out as literal bytes, never read back from the library. The remaining two boundaries, the salt ends in `effectiveOpenSalt` and `predictCloneAddress`, are pinned by PR #75. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 41 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 (4)
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 |
|
@coderabbitai review |
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Brings in, from #75, testEffectiveOpenSaltBoundarySalts and testPredictCloneAddressBoundarySalts (salt at zero and max in the open-salt derivation and in the CREATE2 prediction), and from #77 the end-to-end boundary cases: testCloneDeterministicExtremeSalts, testCloneDeterministicOpenSaltExtremeSalts, testCloneDeterministicPredictZeroDeployer, testCloneDeterministicOpenSaltEmptyData and testCloneDeterministicOpenSaltLargeData. Test bodies are unchanged; comments state the behaviour pinned. testCloneCreationCodeBoundaryImplementations now builds its expectation from the library's EIP1167_CREATION_CODE_PREFIX/_SUFFIX around the boundary address bytes instead of copying the constants as hex literals. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Drop testCloneCreationCodeBoundaryImplementations: its mutants are killed by testPredictCloneAddressBoundaryImplementations. Drop assertions implied by others in the same test or covered by main's tests, and cut NatSpec to one line of behaviour. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Asserts the boundary values of the salt derivations and clone paths as fixed cases, so covering them no longer depends on what the fuzzer draws. Test-only.
effectiveSalt0/maxtestEffectiveSaltBoundarySaltseffectiveSalt0/maxtestEffectiveSaltBoundaryDeployerseffectiveOpenSalt0/maxtestEffectiveOpenSaltBoundarySaltseffectiveOpenSaltdataof 1, 32, 33, 2048 bytestestEffectiveOpenSaltBoundaryDataLengthspredictCloneAddress0/maxtestPredictCloneAddressBoundaryFactoriespredictCloneAddress0/maxtestPredictCloneAddressBoundaryImplementationspredictCloneAddress0/maxtestPredictCloneAddressBoundarySaltspredictDeterministicAddress0testCloneDeterministicPredictZeroDeployercloneDeterministic0/maxtestCloneDeterministicExtremeSaltscloneDeterministicOpenSalt0/maxtestCloneDeterministicOpenSaltExtremeSaltscloneDeterministicOpenSaltdatatestCloneDeterministicOpenSaltEmptyDatacloneDeterministicOpenSaltdatatestCloneDeterministicOpenSaltLargeData[fuzz] seedstays unpinned: the fixed cases cover the boundaries on every run.Supersedes #75 and #77. Closes #70
QA
forge testona8098e2: 62 passed (main: 50). CI green.Mutation probe (
rainlanguage/adversarial-mutation-test@4e59ec0cc05248c14bcb1f27bc5c11b4d1e5589c), 32 boundary mutants ofsrc/lib/LibICloneableFactoryV4.sol: whole suite 32/32 killed; the suite without this PR's 12 tests: 25/32, with 7 surviving (O06–O08, D01, D05, E06, E07). The other 25 die only when a fuzz run happens to draw the boundary value.Each test was run alone against all 32 mutants. Listed below are the mutants it kills where it is the only test that fixes that operand at the boundary:
testEffectiveSaltBoundarySaltstestEffectiveSaltBoundaryDeployerstestEffectiveOpenSaltBoundarySaltstestEffectiveOpenSaltBoundaryDataLengthstestPredictCloneAddressBoundaryFactoriestestPredictCloneAddressBoundaryImplementationstestPredictCloneAddressBoundarySaltstestCloneDeterministicPredictZeroDeployertestCloneDeterministicExtremeSaltstestCloneDeterministicOpenSaltExtremeSaltstestCloneDeterministicOpenSaltEmptyDatatestCloneDeterministicOpenSaltLargeDataMutant definitions, logs, JSON and the runner:
/home/gildlab/artifacts/factory/88/trim/.🤖 Generated with Claude Code