-
Notifications
You must be signed in to change notification settings - Fork 54
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
MultiOffRamp - size optimizations #991
MultiOffRamp - size optimizations #991
Conversation
I see you updated files related to |
Go solidity wrappers are out-of-date, regenerate them via the |
LCOV of commit
|
@@ -181,6 +182,10 @@ library Internal { | |||
return address(uint160(encodedAddress)); | |||
} | |||
|
|||
function _validateNonZeroAddress(address inputAddress) internal pure { |
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.
Honestly not super fan of this as it makes the calls with multiple zero checks pretty unreadable
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.
Removed this. The overhead is 0.056KB without the optimization, but I agree regarding the readability
/// @dev Whether this OffRamp is paused or not | ||
bool private s_paused = false; | ||
/// @dev The sequence number of the last report | ||
uint64 private s_latestPriceSequenceNumber; |
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.
Do we still need the separate price seq num? Are these always sequencial without any gaps in OCR3? If so, we could force strict ordering based on seqNums?
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.
Creating a separate ticket for this
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.
Approved pending zero check undo and let's continue the discussion on potential OCR3 seq num improvements
92028ed
to
c42f37d
Compare
Motivation
Optimizes the contract size for the merged MultiOffRamp + CommitStore to be able to fit the deployment size limits
Solution
Currently the margin is at -0.972KB with 3600 optimizer runs. The contract size fits the space with 1800 optimizer runs.
The contract size can further be reduced, and the optimizer runs increased after the Nonce Manager is integrated into the MultiOffRamp
Each optimization is split into a separate commit. Complete list:
isCursed
to shared internal functionMove source chain config + curse check to single shared function (used in both exec & commit)Move zero address check to internal libIMessageValidator
(execution-only), disabling the source chain config, cursing the lane via RMNAny2EVMMessageRoute
and use 2 internal functions to solve stack depth (same as the OffRamp changes)uniqueReports
distinction