Skip to content

Commit

Permalink
CCIP-3899 fix sender encoding (#14877)
Browse files Browse the repository at this point in the history
* CCIP-3899 fix sender encoding and comments
CCIP-3791 fix comments

* changeset for contracts

* formatting fix

* snapshot & wrapper

* update workflow to include --ir-minimum

* Revert "update workflow to include --ir-minimum"

This reverts commit 72a3e58.

* update workflow to include --ir-minimum
  • Loading branch information
0xsuryansh authored Oct 23, 2024
1 parent 6ba13c7 commit 317f930
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/solidity-foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
{ "name": "liquiditymanager", "setup": { "run-coverage": true, "min-coverage": 46.3, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "llo-feeds", "setup": { "run-coverage": true, "min-coverage": 49.3, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "operatorforwarder", "setup": { "run-coverage": true, "min-coverage": 55.7, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "shared", "setup": { "run-coverage": true, "extra-coverage-params": "--no-match-path='*CallWithExactGas*'", "min-coverage": 32.6, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "shared", "setup": { "run-coverage": true, "extra-coverage-params": "--no-match-path='*CallWithExactGas*' --ir-minimum", "min-coverage": 32.6, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "transmission", "setup": { "run-coverage": true, "min-coverage": 61.5, "run-gas-snapshot": true, "run-forge-fmt": false }},
{ "name": "vrf", "setup": { "run-coverage": false, "min-coverage": 98.5, "run-gas-snapshot": false, "run-forge-fmt": false }}
]
Expand Down
7 changes: 7 additions & 0 deletions contracts/.changeset/thin-owls-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@chainlink/contracts': minor
---

#internal fix sender encoding and comments in CCIP Any2EVMMEssage and corrected comments

PR issue: CCIP-3899
140 changes: 70 additions & 70 deletions contracts/gas-snapshots/ccip.gas-snapshot

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract contract MultiOCR3Base is ITypeAndVersion, OwnerIsCreator {
struct ConfigInfo {
bytes32 configDigest;
uint8 F; // ──────────────────────────────╮ maximum number of faulty/dishonest oracles the system can tolerate
uint8 n; // │ number of signers / transmitters
uint8 n; // │ number of configured signers
bool isSignatureVerificationEnabled; // ──╯ if true, requires signers and verifies signatures on transmission verification
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/src/v0.8/ccip/offRamp/OffRamp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base {
Client.Any2EVMMessage memory any2EvmMessage = Client.Any2EVMMessage({
messageId: message.header.messageId,
sourceChainSelector: message.header.sourceChainSelector,
sender: abi.encode(message.sender),
sender: message.sender,
data: message.data,
destTokenAmounts: destTokenAmounts
});
Expand Down Expand Up @@ -675,7 +675,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base {
// Wrap and rethrow the error so we can catch it lower in the stack
if (!success) revert TokenHandlingError(returnData);

// If the call was successful, the returnData should be the local token amount.
// If the call was successful, the returnData should be the amount released or minted denominated in the local token's decimals.
if (returnData.length != Pool.CCIP_POOL_V1_RET_BYTES) {
revert InvalidDataLength(Pool.CCIP_POOL_V1_RET_BYTES, returnData.length);
}
Expand Down
18 changes: 18 additions & 0 deletions contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,24 @@ contract OffRamp_executeSingleMessage is OffRampSetup {
function test_executeSingleMessage_NoTokens_Success() public {
Internal.Any2EVMRampMessage memory message =
_generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1);

Client.Any2EVMMessage memory expectedAny2EvmMessage = Client.Any2EVMMessage({
messageId: message.header.messageId,
sourceChainSelector: message.header.sourceChainSelector,
sender: message.sender,
data: message.data,
destTokenAmounts: new Client.EVMTokenAmount[](0)
});
vm.expectCall(
address(s_destRouter),
abi.encodeWithSelector(
IRouter.routeMessage.selector,
expectedAny2EvmMessage,
Internal.GAS_FOR_CALL_EXACT_CHECK,
message.gasLimit,
message.receiver
)
);
s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0));
}

Expand Down
2 changes: 1 addition & 1 deletion core/gethwrappers/ccip/generated/offramp/offramp.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mock_v3_aggregator_contract: ../../../contracts/solc/v0.8.24/MockV3Aggregator/Mo
multi_aggregate_rate_limiter: ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.abi ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.bin 0b541232e49727e947dc164eadf35963c66e67576f21baa0ecaa06a8833148ed
multi_ocr3_helper: ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.abi ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.bin 04b6b261dd71925670bf4d904aaf7bf08543452009feefb88e07d4c49d12e969
nonce_manager: ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.abi ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.bin eb234dfb57c6dc64f83cfbf9d78a27939a7241fd0de41342d41c919c156a3633
offramp: ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.abi ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.bin 9964a45e079950719c13a9485bf4d479e2a87a5f395c4fef645a8520b0ac42e6
offramp: ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.abi ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.bin c136eccc974484bb87e472fb778f6a34f847abf57f1819766e669545bd67fbba
onramp: ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.abi ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.bin 4766632d0938b33bfa04f30a5e6b301a944b6920dc1101ce8230e6b23706e898
ping_pong_demo: ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.abi ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.bin c1c2f8a65c7ffd971899cae7fe62f2da57d09e936151e2b92163c4bebe699d6b
registry_module_owner_custom: ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.abi ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.bin 75be86323c227917a9bbc3f799d7ed02f92db546653a36db30ed0ebe64461353
Expand Down

0 comments on commit 317f930

Please sign in to comment.