Skip to content

⚡️ Optimize LibBytes.split null path and dynamicStructInCalldata bounds check fixes - #1564

Merged
atarpara merged 4 commits into
mainfrom
lb
Oct 20, 2026
Merged

atarpara merged 4 commits into
mainfrom
lb

Conversation

@atarpara

Copy link
Copy Markdown
Collaborator

Description

Describe the changes made in your pull request here.

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Ran forge fmt?
  • Ran forge test?

Pull requests with an incomplete checklist will be thrown out.

@github-actions

Copy link
Copy Markdown

Gas Snapshot Comparison Report

Generated at commit : 2436f00, Compared to commit : 2afba69

Contract Name Test Name Main Gas PR Gas Diff
JSONParserLibTest testParseJWTGas() 49819 49818 -1
test__codesize() 37555 37554 -1
LibBytesTest testBytesInCalldata() 25558 25581 23
testCheckInCalldata() 340 362 22
testCmp() 2630 2652 22
testDirectReturn() 8695 8739 44
testEmptyCalldata() 542 520 -22
testIndexOfByte() 5438 5396 -42
testSliceCalldata() 25186 25164 -22
testStaticStructInCalldata() 131170 131192 22
testUint8AtPaddingAfterShortValue() 279477 279466 -11
testUint8AtPaddingAfterSpilledValue() 303187 303244 57
testUint8AtPaddingAfterTaggedLongValue() 492973 492985 12
testUint8AtStaleByteAfterShrink() 313157 313114 -43
test__codesize() 17988 20101 2113
testDynamicStructInCalldataMalformedOffset() - 23795 -
testDynamicStructInCalldataValid() - 1898 -
testSplitNullPathAfterHash() - 1240 -
testSplitNullPathCleanScratch() - 1255 -
testSplitNullPathTwoConsecutive() - 2269 -
LibStringTest testBytesToHexString() 4772 4794 22
testFromAddressToHexString() 3133 3155 22
testFromAddressToHexStringWithLeadingZeros() 3154 3088 -66
testNormalizeSmallString() 1347 1369 22
testSetAndGetStringStorage() 2334364 2361838 27474
testSimpleStringSetAndGetGas() 1203200 1203210 10
testStringConcat() 4304 4259 -45
testStringDirectReturn() 11415 11349 -66
testStringEscapeJSON() 38596 38551 -45
testStringEscapeJSONHexEncode() 689326 698380 9054
testStringIndexOf() 17876 17811 -65
testStringIndicesOf() 11964 12018 54
testStringIs7BitASCII() 203678 203700 22
testStringIs7BitASCIIWithAllowedLookup() 4875 4897 22
testStringLowerDifferential() 3222623 3173405 -49218
testStringLowerOriginal() 1235 1257 22
testStringPackAndUnpackOne() 1404696 735471 -669225
testStringPackAndUnpackTwo() 982312 4702727 3720415
testStringRepeat() 5259 5276 17
testStringSlice() 9587 9609 22
testStringSplit() 20447 20444 -3
testStringUpperDifferential() 3157073 3401268 244195
testStringUpperOriginal() 1234 1256 22
testToHexStringFixedLengthPositiveNumberLong() 3674 3696 22
testToHexStringFixedLengthPositiveNumberShort() 960 982 22
testToHexStringPositiveNumber() 907 929 22
testToMinimalHexStringNoPrefixPositiveNumber() 3459 3481 22
testToMinimalHexStringNoPrefixUint256Max() 3397 3419 22
testToMinimalHexStringUint256Max() 3465 3487 22
testToSmallString() 5563 5540 -23
testToStringPositiveNumberBrutalized() 576066 585089 9023
testToStringSignedGas() 7212 7234 22
testToStringUint256MaxBrutalized() 587407 596610 9203
testToStringZero() 674 696 22
testToStringZeroBrutalized() 575508 584560 9052
testUint8AtStringStorage() 155506 155461 -45
test__codesize() 50463 50892 429

@atarpara
atarpara merged commit 258f67c into main Oct 20, 2026
14 checks passed
@atarpara
atarpara deleted the lb branch October 20, 2026 09:01
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.

2 participants