Skip to content
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

Manual-execute-gas-overrides #1256

Merged
merged 66 commits into from
Aug 9, 2024

Conversation

defistar
Copy link
Contributor

@defistar defistar commented Aug 5, 2024

Motivation

currently, gas amounts are placed in the SourceTokenData. However, for the multi-ramps, the token data should be chain-family agnostic, which will likely require the destGasAmount lift to another field

Solution

  • add a new Struct which holds the receiverExecutionGasLimit and transferGasAmounts
struct GasLimitOverride {
    uint256 receiverExecutionGasLimit;
    uint256[] tokenGasOverrides;
}
  • tokenGasOverrides is an array of GasLimits to be used during the relaseOrMint call for the specific tokenPool associated with token

Copy link
Contributor

github-actions bot commented Aug 5, 2024

LCOV of commit 18bafa2 during Solidity Foundry #7137

Summary coverage rate:
  lines......: 98.7% (1882 of 1907 lines)
  functions..: 96.4% (347 of 360 functions)
  branches...: 90.6% (797 of 880 branches)

Files changed coverage rate: n/a

defistar added 2 commits August 8, 2024 23:49
}
}

// CCIP-2950 create a new object for evm_2_evm_offramp.EVM2EVMOffRampGasLimitOverride
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a TODO? If so, please add TODO so it's tracked

for (uint256 i = 0; i < messages.length; ++i) {
gasLimits[i] = messages[i].gasLimit;
gasLimitOverrides[i].receiverExecutionGasLimit = messages[i].gasLimit;
//create an array for destinationGasAmounts
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please don't add comments that just say what the next line does without adding more information than the line would have given

…-overrides

# Conflicts:
#	contracts/gas-snapshots/ccip.gas-snapshot
#	contracts/src/v0.8/ccip/offRamp/EVM2EVMOffRamp.sol
#	core/gethwrappers/ccip/generated/evm_2_evm_offramp/evm_2_evm_offramp.go
#	core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt
@@ -8,7 +8,7 @@ echo " └───────────────────────

SOLC_VERSION="0.8.24"
OPTIMIZE_RUNS=26000
OPTIMIZE_RUNS_OFFRAMP=22000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Needed due to space issues

contracts/src/v0.8/ccip/offRamp/EVM2EVMOffRamp.sol Outdated Show resolved Hide resolved
contracts/src/v0.8/ccip/offRamp/EVM2EVMOffRamp.sol Outdated Show resolved Hide resolved
@@ -292,8 +329,11 @@ contract EVM2EVMOffRamp is IAny2EVMOffRamp, AggregateRateLimiter, ITypeAndVersio
emit SkippedAlreadyExecutedMessage(message.sequenceNumber);
continue;
}
uint32[] memory tokenGasOverrides;
bool manualExecution = manualExecGasLimits.length != 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this moved into the loop, is it cheaper this way?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't change much but moved outside as it saves a tiny bit

@cl-sonarqube-production
Copy link

@RensR RensR merged commit 1cfd5e7 into ccip-develop Aug 9, 2024
108 checks passed
@RensR RensR deleted the feature/CCIP-2910-manual-execute-gas-overrides branch August 9, 2024 10:27
RensR added a commit that referenced this pull request Aug 9, 2024
Final release of all 1.5 contracts - don't merge before the other PRs
are all in


TODO
- #1258
- #1256
- #1273

---------

Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
dhaidashenko pushed a commit that referenced this pull request Sep 2, 2024
currently, gas amounts are placed in the SourceTokenData. However, for
the multi-ramps, the token data should be chain-family agnostic, which
will likely require the destGasAmount lift to another field

- add a new Struct which holds the receiverExecutionGasLimit and
transferGasAmounts

```js
struct GasLimitOverride {
    uint256 receiverExecutionGasLimit;
    uint256[] tokenGasOverrides;
}
```

- `tokenGasOverrides` is an array of GasLimits to be used during the
`relaseOrMint` call for the specific tokenPool associated with token

---------

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>
Co-authored-by: 0xsuryansh <suryansh.shrivastava@smartcontract.com>
Co-authored-by: Rens Rooimans <github@rensrooimans.nl>
dhaidashenko pushed a commit that referenced this pull request Sep 2, 2024
Final release of all 1.5 contracts - don't merge before the other PRs
are all in


TODO
- #1258
- #1256
- #1273

---------

Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
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.

6 participants