Skip to content

✨ Added LibRLP.sol with clz#1535

Merged
atarpara merged 5 commits into
mainfrom
rlpclz
Jun 8, 2026
Merged

✨ Added LibRLP.sol with clz#1535
atarpara merged 5 commits into
mainfrom
rlpclz

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.

@atarpara atarpara changed the title ✨ Added LibRLP with clz ✨ Added LibRLP.sol with clz May 30, 2026
@github-actions

github-actions Bot commented May 30, 2026

Copy link
Copy Markdown

Gas Snapshot Comparison Report

Generated at commit : d779940, Compared to commit : 166f85b

Contract Name Test Name Main Gas PR Gas Diff
LibRLPWithCLZTest testComputeAddressForLargeNonces() - 1750 -
testComputeAddressForSmallNonces() - 997 -
testComputeAddressOriginalForLargeNonces() - 3495 -
testComputeAddressOriginalForSmallNonces() - 2088 -
testRLPEncodeBytes() - 250090 -
testRLPEncodeBytes2() - 155904 -
testRLPEncodeList() - 735942 -
testRLPEncodeList2() - 810708 -
testRLPEncodeListEdgeCases() - 1807743 -
testRLPEncodeStringEdgeCases() - 20424 -
testRLPEncodeUint() - 1175570 -
testRLPPUint256() - 363834 -
test__codesize() - 18292 -

@tekkac tekkac left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave your PR a quick look. nice use of clz.

I found potential clz use in two more spots.
gas savings is minimal though (approx 6 gas per call)

Comment thread src/utils/clz/LibRLP.sol Outdated
Comment thread src/utils/clz/LibRLP.sol Outdated
@atarpara

atarpara commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

@tekkac thanks for review. Applied your all suggestion.

@atarpara atarpara merged commit ab96a83 into main Jun 8, 2026
13 checks passed
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