-
Notifications
You must be signed in to change notification settings - Fork 3.6k
contracts-bedrock: OptimismPortal reduce codesize #10117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe updates across various files in the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Actionable comments outside the diff hunks (1)
packages/contracts-bedrock/test/L1/OptimismPortal.t.sol (1)
Line range hint
518-518
: Correct the usage ofblockhash
function to avoid always getting zero.- blockhash(block.number) + blockhash(block.number - 1) // Use the hash of the most recent block
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #10117 +/- ##
============================================
- Coverage 42.40% 29.22% -13.18%
============================================
Files 73 31 -42
Lines 4830 2898 -1932
Branches 766 614 -152
============================================
- Hits 2048 847 -1201
+ Misses 2676 1976 -700
+ Partials 106 75 -31
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direction is looking good; Flipped conditionals look good to me. Couple nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Marking as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, re-reviewed the checks on commit e1f1715. Approving pending discussion offline.
This should probably be a major semver bump due to the ABI-breaking changes with removing the legacy getters, but we do have a major bump queued up in the OptimismPortal2
. Do we see this being deployed soon, and are we okay with violating proper semver here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
Reduce the codesize of the OptimismPortal and the OptimismPortal2 by converting `require` statements into custom error reverts. Also remove legacy getters, they only bloat codesize. This will help to reduce the diff of when we go to production with custom gas token as that feature put the contract over the codesize limit.
69114f8
to
ac535d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that general approach lgtm, but I did not review all changes super closely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for simplifying
Still having issues with deployment summary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Go part of the changes looks good. One nit about a test-call that can be replaced rather than removed.
…10117) * contracts-bedrock: OptimismPortal reduce codesize Reduce the codesize of the OptimismPortal and the OptimismPortal2 by converting `require` statements into custom error reverts. Also remove legacy getters, they only bloat codesize. This will help to reduce the diff of when we go to production with custom gas token as that feature put the contract over the codesize limit. * contracts-bedrock: cleanup errors * contracts-bedrock: more custom errors * contracts-bedrock: updates to portal * contracts-bedrock: error comments * contracts-bedrock: more custom errors * portal: fixup style * spec: update * op-bindings: regenerate * contracts-bedrock: update abi snapshots * snapshots: kontrol deploy * lint: fix * op-chain-ops: cleanup tests * contracts-bedrock: fix invariant tests * contracts-bedrock: correct assertion Co-authored-by: clabby <[email protected]> * op-bindings: regenerate * contracts-bedrock: cleanup style * contracts-bedrock: update locks * ctb: update test * snapshots: update * contracts-bedrock: simplify require * contracts-bedrock: require * contracts-bedrock: reduce diff * bindings: regenerate * snapshots: update * contracts-bedrock: small update * contracts-bedrock: more cleanup * contracts-bedrock: update snapshots * semver-lock: update * lint: fix * contracts-bedrock: fix tests * contracts-bedrock: fix test * kontrol: update * contracts-bedrock: delete dead errors * temp: fixes for kontrol * invariant-docs: regenerate --------- Co-authored-by: clabby <[email protected]>
Description
Reduce the codesize of the OptimismPortal and the OptimismPortal2
by converting
require
statements into custom error reverts.Also remove legacy getters, they only bloat codesize.
This will help to reduce the diff of when we go to production
with custom gas token as that feature put the contract over the
codesize limit.