-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Merge CCIP V1.6 [CCIP-2946] #14278
Merged
Merged
Merge CCIP V1.6 [CCIP-2946] #14278
Conversation
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
Various minor onchain fixes - improve accounting for token payload data - rm old check in usdc pool - fix comment on precompile range - add transferLiquidity function to LockReleaseTokenPool - move rate limit admin logic from lockRelease pool to TokenPool New changes - removed defaultTokenDestBytesOverhead and used CCIP_LOCK_OR_BURN_V1_RET_BYTES as default value - Add uint32 destGasAmount to the SourceTokenData struct to allow us to send the amount we billed on source to dest - This single value is used for the releaseOrMint and what is left after that call is used for transfer - Removed the defaults for releaseOrMint and transfer from the offRamp --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
## Motivation `NonceManager` and `MultiAggregateRateLimiter` contracts were missing `typeAndVersion`. ## Solution Add `ITypeAndVersion` inheritance to both contracts.
Since the separation of manual exec window and DON exec window, it would theoretically be possible that two executions happen at the same time (although unlikely). Remove reverts to ensure other msgs in the batches are unaffected --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
## Motivation This PR applies several fixes from static analysis findings. ## Solution Fixes include: - Unused state variables removal - Unused imports removal - Unused events removal - Unused custom errors removal - Add of missing zero address check - Implementation of missing getter - Use of constants instead of magic numbers
## Motivation We want the ability to test new lanes using custom, test routers. Therefore, we need a one-to-many relationship b/t routers and lanes, rather than a singleton. ## Solution Make routers configurable per lane, rather than per contract
## Motivation Change the hop through the offRamp to a transferFrom so the funds never touch CCIP contracts outside of the pool ## Solution
We want to define and use the appropriate OCR offchain config for each plugin. Requires smartcontractkit/chainlink-ccip#36
## Motivation Change `typeAndVersion`of RMN contract from `RMN 1.5.0-dev` to `RMN 1.5.0` since the contract is finalized. --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: Rens Rooimans <[email protected]>
## 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 <[email protected]> Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
## Motivation It is significantly cheaper to assert balances than do the transferFrom ## Solution Undo recent approve changes, add balance assertions had to undo some of the multiOfframp calldata changes to make it fit --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
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 <[email protected]> Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: 0xsuryansh <[email protected]> Co-authored-by: Rens Rooimans <[email protected]>
Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
## Motivation ## Solution
## Motivation Recent merges to chainlink-ccip have caused the integration test to break. ## Solution Include the gas estimator changes required as well as some token data reader changes. Include fixes from smartcontractkit/chainlink-ccip#60
## Motivation Use the latest version of deps ## Solution Upgrade OZ deps to latest version ## Implementation Notes `IERC20` and `SafeERC20` are kept on `4.8.3` because of the `^0.8.20` requirement OZ imposes on the v5 contracts. We can't upgrade these deps until the rest of the contract codebase upgrades to 0.8.20+ --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
…instead of bytes32 (#1207) rateLimiterConfig mapping of localToRemoteTokens to take bytes instead of bytes32 - In the MultiAggregateRateLimiter contract, the the following mapping might be simplifiable to - (uint64 remoteChainSelector -> address token) , - since it is only used as an isEnabled check (i.e. the (address token -> bytes32 remoteToken) is never used on-chain) - mapping being necessary off-chain, we need to convert the (address -> bytes32) mapping to (address -> bytes) to be consistent with using bytes for all family-agnostic addresses ```js mapping(uint64 remoteChainSelector => EnumerableMapAddresses.AddressToBytes32Map tokensLocalToRemote) internal s_rateLimitedTokensLocalToRemote; ``` this has to been changed to ```js mapping(uint64 remoteChainSelector => EnumerableMapAddresses.AddressToBytesMap tokensLocalToRemote) internal s_rateLimitedTokensLocalToRemote; ``` 1. New solidity library `EnumerableMapBytes32` which contains `Bytes32ToBytes` Mapping and enumerate it 2. `EnumerableMapAddresses.sol` library has added support for the new library cherrypicked from chainlink repo `EnumerableMapBytes32` 3. `MultiAggregateRateLimiter` with mapping for remoteSelector -> localTokenAddress -> remoteTokenAddress is updated to contain remoteTokenAddress as `bytes` instead of `bytes32` --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
## Motivation Bump chainlink-ccip to the version from this PR: smartcontractkit/chainlink-ccip#64 ## Solution Bump and fix the tests.
- Fix stale comment - remove wrapper gen for the old mockRMN - should no longer be used in offchain tests, use the real RMN instead - Remove naming clash with RMN
There's already 1.4 pools out there of this type so we need a proxy
* setter of a bool representing the `allowOutOfOrderExecution` * creating and passing `extraArgs` to the message
## Motivation getPreviousPool was missing ## Solution Add getPreviousPool
- NOTE ~5k is generated protobuf code to unblock. That will be imported once exposed. - We put the deployment/configuration logic in integration-tests module for a few reasons: - Keeps the chain dependencies out of the core module, in particular helpful for eventual cross family tests - It can become the canonical deployment logic to be used for CRIB envs as well (eventually can replace the actions + contracts dirs) - To accomplish the lightweight tests (chainlink.Application + simulated.Backend) we expose some test utilities in util/testutils/ - integration-tests/deployment holds product agnostic deployment utilities including a general purpose environment structure to write environment abstracted code against and migration output components (address books, proposals etc) - integration-tests/deployment/ccip holds all product specific deployment code including - Top level migrations and migration tests where a "migration" is defined to be a function which operates against an environment and outputs a MigrationOutput structure with one or more artifacts (MCMS proposals, job specs). Notably migration tests can apply those outputs to an ephemeral environment to ensure correctness. These migrations are intended for export and use against real environments (testnet/mainnet). - Re-usable product specific components of top level migrations and associated tests Next steps / follow up PRs: - Port testutils export to chainlink repo - Example solana setup - Once cross family validated, start deeper testing and real CCIP use cases --------- Co-authored-by: Adam Hamrick <[email protected]> Co-authored-by: AnieeG <[email protected]>
CCIP Config can go to larger size and any query from offchain components via rpc call can cause timeout issues add pagination to `getAllCCIPConfig` function which takes - pageSize - startIndex --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: Makram Kamaleddine <[email protected]>
#1310) ## Motivation gasUsed for Execution to be emitted along with ExecutionStateChangedEvent ## Solution compute `gasUsed` for execution of a message in EVM2EVMMultiOffRamp this change is applicable to only 1.6 version Test Assertion must be added to assert the event body parameters (excluding the gasUsed as it cant be hardcoded in tests) ** This is extension of the closed PR: smartcontractkit/ccip#1297 got signature verification issue with other PR. so moving all changes over here --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: Ryan <[email protected]>
## Motivation Use the commit plugin state machine implementation. ## Solution Use the commit plugin state machine implementation.
Cleanup & more realistic values for gas overheads
asoliman92
changed the title
Ccip/capabilities debug contracts fmt
Contracts fmt [CCIP-2946]
Aug 30, 2024
run pnpm prettier
asoliman92
force-pushed
the
ccip/capabilities-debug-contracts-fmt
branch
from
August 30, 2024 10:04
a47f85e
to
3e28ee6
Compare
asoliman92
requested review from
a team,
RensR,
matYang,
RayXpub and
elatoskinas
as code owners
August 30, 2024 10:34
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.
mateusz-sekara
approved these changes
Aug 30, 2024
javuto
approved these changes
Aug 30, 2024
0xnogo
approved these changes
Aug 30, 2024
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Porting all CCIP V1.6 code (contracts and offchain) from ccip repo to chainlink repo.
This PR is divided into 2 steps.
First step cherry-picked changes that happened to contracts and capabilities directories.
Then fixed issues in this branch, squashed fixes and merged them here.
To review this PR you need the following:
./check-diff.sh contracts/src/v0.8/ccip
expected output:
Then
./check-diff.sh core/gethwrappers/ccip
expected ouptut:
Script:
For this reason both forge fmt and solidity lint are failing the CI checks. We're taking identical copy and we're not interested in formatting them for now to make it easier reviewing the branch.
Once both are good to go please review the offchain changes and any other changes.
For clarity this is how I cherry-picked the PRs: