-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MultiOffRamp - size optimizations (#991)
## 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: * Remove in-depth message validations -> these will be moved off-chain (ticket already created) * Move `isCursed` to shared internal function * Move forked chain check, curse check and source config enabled check to common internal function * ~~Move source chain config + curse check to single shared function (used in both exec & commit)~~ * ~~Move zero address check to internal lib~~ * Remove global pausing from the multi-offramp -> there are 4 alternative methods of achieving pausing: * Per-lane: using `IMessageValidator` (execution-only), disabling the source chain config, cursing the lane via RMN * Globally: implementing the global pause in the RMN * The savings are significant, at around ~0.8KB * Split StaticConfig and DynamicConfig set events * Get rid of `Any2EVMMessageRoute` and use 2 internal functions to solve stack depth (same as the OffRamp changes) * Other contract size golfing: variable caching, inlining * Compile with lower optimizer runs for the multi-offramp * **Update**: OCR3 no longer needs a `uniqueReports` distinction * **Other fix**: OCR3 now uses sequenceNumbers
- Loading branch information
1 parent
f24af78
commit 969d44a
Showing
13 changed files
with
983 additions
and
1,293 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@chainlink/contracts-ccip': minor | ||
--- | ||
|
||
#changed MultiOffRamp contract size optimizations |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Oops, something went wrong.