Put back the swept content that reached main - #112
Merged
Merged
Conversation
Five comment-sweep commits reached main and cut prose that was not a restatement. 845e591 would have put two of them back but #102 merged without it. Restored: - `test/src/lib/AbiEncodeGas.t.sol`: the suite docstring naming the title-block cost bullet this file exists to measure and why the gasleft() window provably contains the encoding, the two docstrings giving the ABI length arithmetic term by term, and the one naming the helper's unnamed tuple returns. 6e24ffd cut these alongside the `src` title block claims; only the `src` half came back. - `LibHashSlow`'s title block, which is the only place "Slow" is defined as allocation rather than speed and the only statement that `hashBytesSlow` is a value oracle with no saving to measure, plus the `hashBytesSlow` docstring that says why. - `LibHashNoAlloc.t.sol`'s suite docstring. Rewritten to the suite as it now stands: the empty-input identities it used to list moved to the cross-type suite with ccc3720. - `testBytesTrueLength`: the `hex"01"` / `hex"0100"` collision the test is about. It was the only test in its file left undocumented. - The `keccak256(0, 0x40)` step comment in the README Yul, the last of five steps and the only one uncommented. - `testDeeplyNestedStructIsOnePointerWordPerLevel`, in the corrected "two outer levels" form 7566d57 cut rather than the "each level" form it replaced. - `testNewFooArrayAllocatesListThenElements`, `testFoldPrefixIsStepwiseCombine` (the README's N-A-B-C-D letters over the locals), `testFoldSingletonIsNotItem` (the "Nil hash prefix" citation its sibling kept), and the four pointer-only struct comments in the cross-type suite. Left cut as genuine restatements: the sign-extension comment under the lint directive the docstring above it already states, `take`'s one-line paraphrase of its body, `testLeafNodeCollision`'s docstring, which `hashBytes`'s NatSpec already carries, the per-function `abi.encodePacked` notes in `LibHashSlow` that the restored title block covers, and the per-test one-liners 9e711a8 cut from `LibHashNoAlloc.t.sol`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
|
Warning Review limit reachedNext included review available in 31 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 (7)
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 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.
Five comment-sweep commits reached
mainand took prose with them that was nota restatement. #102 merged without
845e591, the restoration commit onhash-68, and6e24ffdhad only itssrchalf put back. This is the fullsweep of
main, not just the four known losses.How the set was found
Every non-merge commit reachable from
mainsince 2026-09-13 was checked forcomment-only deletions, and every deleted
//////line was grepped againstthe current tree. Six sweep commits are on
main:65499d5,7566d57,8532c38,926dc2b,9e711a8,c380644, plus6e24ffd's test half. Linesthat came back under different wording (the
Foocitation now intest/lib/LibFooOracle.sol,testCombineHashesGas, thesrctitle block) arealready restored and are not touched here.
ccc3720,ea03286,f1f7ded,8e963c6and899aff8deleted comments as part of substantive rewrites andare left alone.
Restored
test/src/lib/AbiEncodeGas.t.sol—6e24ffdcut the title-block claims insrc/lib/LibHashNoAlloc.soland this file's docstrings in one commit. Thesrchalf is back on
main; this half never was, so the file that exists to measurethe cost bullet no longer says which bullet, and the ABI length arithmetic in
each
assertEqhas nothing naming its terms. The suite docstring, the two testdocstrings and the one naming
encodeGas's unnamed tuple returns come backverbatim; the bullet they quote is on
mainword for word.test/lib/LibHashSlow.sol— the title block is the only place "Slow" isdefined as allocation rather than speed, and the only statement that
hashBytesSlowis a value oracle with nothing to measure against, which is whytestHashBytesCostsTheSameAsBuiltinasserts equal gas where its siblings assertcheaper. Restored with the
hashBytesSlowdocstring that says why.test/src/lib/LibHashNoAlloc.t.sol— the suite docstring. Every other testcontract in the repo carries one;
9e711a8cut this one and #96 did not put itback. Restored to the suite as it now stands rather than verbatim: the
empty-input
HASH_NILidentities it used to list moved to the cross-type suitewith
ccc3720.test/src/lib/HashPattern.t.sol—testBytesTrueLength's docstring, thehex"01"/hex"0100"collision the test is about, which left it the onlyundocumented test in its file. And the
// Hash C and D, already in scratch, to produce the final hash Estep comment, the last of the README's five steps andthe only one left uncommented.
test/src/lib/MemoryLayout.t.sol—testDeeplyNestedStructIsOnePointerWordPerLevelin the corrected "2 words at each of the two outer levels" form
7566d57cut,not the "each level" form it had replaced, and
testNewFooArrayAllocatesListThenElements, which carries the allocation claimea03286split out oftestFooListIsWordList.test/src/lib/HashPatternFold.t.sol—testFoldPrefixIsStepwiseCombine'smapping of its locals onto the README's N, A, B, C, D, which nothing in the code
carries, and
testFoldSingletonIsNotItem's "Nil hash prefix" citation, the oneits sibling
testFoldEmptyIsNilHashkept.test/src/lib/LibHashNoAlloc.crossType.t.sol—struct TwoBytes, bothpointer-only-struct tests, and the
keccak256(s, 0)comment, which is the onlything saying that a zero-length hash is deliberate.
Left cut
These were restatements and the sweep was right about them:
65499d5's sign-extension comment: the docstring directly above it alreadystates the sign-extension claim, and the line below is the lint directive.
926dc2b'stakedocstring andtestLeafNodeCollisiondocstring: the firstparaphrases a three-line body, the second restates an assertion that
hashBytes's NatSpec already states as a property.9e711a8's per-test one-liners inLibHashNoAlloc.t.soland the per-functionabi.encodePackednotes inLibHashSlow, which the restored title blockcovers.
926dc2b's allocation paragraph ontestFooListIsWordList: that test nolonger measures allocation. The claim is restored on
testNewFooArrayAllocatesListThenElements, which does.QA
zero deleted, every inserted line a
///or//comment, so there is nobehaviour for a test to discriminate and nothing that could fail on base.
The existing suite is untouched and is the gate this branch stays green
against.
today rather than as it stood when the line was cut. The
AbiEncodeGasdocstrings were checked against the cost bullet currently in
src/lib/LibHashNoAlloc.soland against eachassertEqonencoded.length;LibHashSlow's title block against which tests use it as a gas oracle andwhich as a value oracle;
testBytesTrueLengthagainst README.md line 368 andits own three assertions; the fold letters against README "Handling pointers"
N-A-B-C-D and the five locals they name; the nested-struct docstring against
fmp1 - midPtr == 0x40andfmp2 - outermostPtr == 0x40, which is two outerlevels and not three;
testNewFooArrayAllocatesListThenElementsagainstfmpAfter - ptr == 0x20 + n * 0x20 + n * 0x80and itsw2/w3zero-slotreads. Two blocks were deliberately not restored verbatim because the
verbatim text is now false: the
LibHashNoAlloc.t.solsuite docstring, whoseempty-input identities left that suite in
ccc3720, and the nested-structdocstring, where
8532c38's "each level" form is the one docs: correct five inaccurate statements in the README and test docs #102 existed tocorrect.
LibHashSlow's title block,testBytesTrueLength, the Yul step comment and the nested-struct correction,and asks for a full check of
926dc2band8532c38rather than those fouralone. Covered: all four, the remainder of both named commits, the remainder
of
7566d57,9e711a8andc380644, and6e24ffd's test half, with65499d5checked and deliberately left cut. Thehash-55/ README: state each hash function's preimage as its API #88 Releasessection is out of scope under the ruling that release-lifecycle documentation
lives in rainix only, and is untouched.
🤖 Generated with Claude Code
https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN