-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: optimise EVM2EVMMultiOffRamp.executeSingleMessage (#1235)
## Motivation `EVM2EVMMultiOffRamp.executeSingleMessage` is optimised by replacing memory to calldata, internal functions `_releaseOrMintSingleTokens` and `_releaseOrMintSingleToken` can be optimised ``` function executeSingleMessage(Internal.Any2EVMRampMessage memory message, bytes[] memory offchainTokenData) external ``` Tradeoff is increased contract size, which is exceeding the limit and thus we have to decrease the optimiser runs ## Findings After replacing memory with call data we have the following findings for gas and contract size | Test | Before | after | delta | | ------------------------------------------------------------------------------------------- | ------ | ------ | ------ | | EVM2EVMMultiOffRamp_executeSingleMessage:test_NonContractWithTokens_Success() | 249368 | 247671 | \-1697 | | EVM2EVMMultiOffRamp_executeSingleMessage:test_NonContract_Success() | 20672 | 19245 | \-1427 | | EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens_Success() | 48381 | 47265 | \-1116 | | EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() | 278146 | 276759 | \-1387 | | EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithValidation_Success() | 93615 | 92499 | \-1116 | | EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_Success() | 108343 | 107939 | \-404 | | **Optimser Run** | **Size** | **Margin(kB)** | **With call data optimisation** | | ---------------- | --------------------------------- | -------------- | ------------------------------- | | 2500 | 24.113 | 0.463 | No | | 2500 | 24.857 (size increase of 0.744kB) | \-0.281 | Yes | | 2400 | 24.635 | \-0.059 | Yes | | 2200 | 24.635 | \-0.059 | | | 2000 | 24.572 | 0.004 | Yes | --------- Signed-off-by: 0xsuryansh <suryansh.shrivastava@smartcontract.com> Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ce8d50e
commit 54b8aac
Showing
6 changed files
with
108 additions
and
105 deletions.
There are no files selected for viewing
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
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
2 changes: 1 addition & 1 deletion
2
core/gethwrappers/ccip/generated/evm_2_evm_multi_offramp/evm_2_evm_multi_offramp.go
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