test: scope the recorder's claim to the calls it can record - #252
Open
thedavidmeister wants to merge 2 commits into
Open
thedavidmeister wants to merge 2 commits into
thedavidmeister wants to merge 2 commits into
Conversation
`selectors()` and `sData()` dispatch to view functions that reach neither push site, so they are never recorded — which is what `testCloneDeterministicInitializeIsTheOnlyCall` depends on, since it calls both after asserting the sequence length. Closes #137 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…recorder-accessor-scope # Conflicts: # test/concrete/TestCloneableCallRecorder.sol
|
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 (2)
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 #137
TestCloneableCallRecorder's notice said it "records the selector of every callthe proxy receives, in order", and the
sSelectorsdoc repeated "Every selectorthe proxy has been called with, in order". Only
initialize(bytes)and thefallbackpush. A call whose selector matches the fixture's ownselectors()orthe auto-getter for
bytes public sDatadispatches to thoseviewfunctions,which cannot record.
That is not incidental —
testCloneDeterministicInitializeIsTheOnlyCallassertsselectors.length == 1and then callsselectors()andsData(), so the testdepends on those two calls NOT being recorded. The same overclaim was restated in
that test's own NatSpec, under the suite's only check of
ICloneableFactoryV3.cloneDeterministic's "MUST NOT call any other functions onthe cloned proxy before
initializecompletes successfully".Both claims are now scoped to what the fixture records.
The finding's stronger alternative — delete the two externals and read
sSelectors/sDatawithvm.load— is not taken. It would close a two-selectorhole that the code under test cannot reach:
LibICloneableFactoryV4knows nothingabout the fixture's ABI, so a regression adding a stray call to the fresh proxy
lands on an
ICloneableV2selector or a random one, both of which the fallbackrecords. The cost is hand-decoding a dynamic
bytes4[]and abytesout of clonestorage in two tests.
The finding also proposed a sentence on the non-payable
fallback. Dropped: itre-teaches the EVM, and the library's entry points are non-payable, so no value
reaches the proxy for it to describe.
Comment-only. No source, ABI or bytecode change.
QA
text. The behaviour the comment now describes is already exercised:
testCloneDeterministicInitializeIsTheOnlyCallreads both accessors afterasserting the recorded length, which only passes because they do not record.
nothing to mutate.
test/concrete/TestCloneableCallRecorder.solitself —selectors()and the
sDataauto-getter areviewand reach neither push site (initialize,fallback), and Solidity's dispatcher matches them before the fallback.own dispatch allows".
TestCloneableandTestCloneFactoryare the otherfixtures with externals; neither claims to observe calls, so neither carries the
shape. Distinct from TestCloneableCallRecorder is an ICloneableV2 that initializes successfully but can be re-initialized by anyone, contradicting TestCloneable's single-conforming-fixture notice #96/PR docs: scope TestCloneable's conforming-fixture notice to what is true #103, which added the "refuses nothing / not
conforming" paragraph and did not touch these clauses; this branch keeps that
paragraph and merges current
main.🤖 Generated with Claude Code