Skip to content

Commit

Permalink
Merge branch 'ccip-develop' into tests-config-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-sekara authored Jun 28, 2024
2 parents 97c45b8 + 475dd3a commit bf978cf
Show file tree
Hide file tree
Showing 112 changed files with 6,656 additions and 3,691 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-bears-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ccip": patch
---

NewCommitServices + NewExecServices use a provider
14 changes: 10 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,18 +354,24 @@ jobs:
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPManuallyExecuteAfterExecutionFailingDueToInsufficientGas$
- name: ccip-smoke-self-serve-offramp-arl
- name: ccip-smoke-on-ramp-limits
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPSelfServeRateLimitOffRamp$
- name: ccip-smoke-self-serve-onramp-arl
run: -run ^TestSmokeCCIPOnRampLimits$
- name: ccip-smoke-off-ramp-capacity
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPSelfServeRateLimitOnRamp$
run: -run ^TestSmokeCCIPOffRampCapacityLimit$
- name: ccip-smoke-off-ramp-agg-rate-limit
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPOffRampAggRateLimit$
- name: runlog
id: runlog
nodes: 2
Expand Down
696 changes: 359 additions & 337 deletions contracts/gas-snapshots/ccip.gas-snapshot

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion contracts/scripts/native_solc_compile_all_ccip
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ compileContract ccip/capability/CCIPConfig.sol
# Test helpers
compileContract ccip/test/helpers/BurnMintERC677Helper.sol
compileContract ccip/test/helpers/CommitStoreHelper.sol
compileContract ccip/test/helpers/MessageHasher.sol
compileContract ccip/test/helpers/receivers/MaybeRevertMessageReceiver.sol
compileContract ccip/test/mocks/MockRMN.sol
compileContract ccip/test/mocks/MockRMN1_0.sol
compileContract ccip/test/mocks/MockE2EUSDCTokenMessenger.sol
compileContract ccip/test/mocks/MockE2EUSDCTransmitter.sol
compileContract ccip/test/WETH9.sol
Expand Down
829 changes: 594 additions & 235 deletions contracts/src/v0.8/ccip/RMN.sol

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions contracts/src/v0.8/ccip/interfaces/IRMN.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ interface IRMN {
/// @notice Callers MUST NOT cache the return value as a blessed tagged root could become unblessed.
function isBlessed(TaggedRoot calldata taggedRoot) external view returns (bool);

/// @notice Iff there is an active global curse, or an active legacy curse (for backwards compatibility), this function returns true.
/// @notice Iff there is an active global or legacy curse, this function returns true.
function isCursed() external view returns (bool);

/// @notice Iff there is an active global curse or an active subject curse, this function returns true.
/// @notice Iff there is an active global curse, or an active curse for `subject`, this function returns true.
/// @param subject To check whether a particular chain is cursed, set to bytes16(uint128(chainSelector)).
function isCursed(bytes16 subject) external view returns (bool);
}
13 changes: 7 additions & 6 deletions contracts/src/v0.8/ccip/test/arm/ARMProxy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,36 @@ import {IRMN} from "../../interfaces/IRMN.sol";
import {ARMProxy} from "../../ARMProxy.sol";
import {RMN} from "../../RMN.sol";
import {MockRMN} from "../mocks/MockRMN.sol";
import {RMNSetup} from "./RMNSetup.t.sol";
import {RMNSetup, makeSubjects} from "./RMNSetup.t.sol";

contract ARMProxyTest is RMNSetup {
event ARMSet(address arm);

MockRMN internal s_mockRMN;
ARMProxy internal s_armProxy;

function setUp() public virtual override {
RMNSetup.setUp();
s_mockRMN = new MockRMN();
s_armProxy = new ARMProxy(address(s_rmn));
}

function test_ARMIsCursed_Success() public {
s_armProxy.setARM(address(s_mockRMN));
assertFalse(IRMN(address(s_armProxy)).isCursed());
RMN(address(s_armProxy)).voteToCurse(bytes32(0));
s_mockRMN.setGlobalCursed(true);
assertTrue(IRMN(address(s_armProxy)).isCursed());
}

function test_ARMIsBlessed_Success() public {
s_armProxy.setARM(address(s_mockRMN));
s_mockRMN.setTaggedRootBlessed(IRMN.TaggedRoot({commitStore: address(0), root: bytes32(0)}), true);
assertTrue(IRMN(address(s_armProxy)).isBlessed(IRMN.TaggedRoot({commitStore: address(0), root: bytes32(0)})));
RMN(address(s_armProxy)).voteToCurse(bytes32(0));
s_mockRMN.setTaggedRootBlessed(IRMN.TaggedRoot({commitStore: address(0), root: bytes32(0)}), false);
assertFalse(IRMN(address(s_armProxy)).isBlessed(IRMN.TaggedRoot({commitStore: address(0), root: bytes32(0)})));
}

function test_ARMCallRevertReasonForwarded() public {
bytes memory err = bytes("revert");
s_mockRMN.setRevert(err);
s_mockRMN.setIsCursedRevert(err);
s_armProxy.setARM(address(s_mockRMN));
vm.expectRevert(abi.encodeWithSelector(MockRMN.CustomError.selector, err));
IRMN(address(s_armProxy)).isCursed();
Expand Down
10 changes: 4 additions & 6 deletions contracts/src/v0.8/ccip/test/arm/ARMProxy_standalone.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {ARMProxy} from "../../ARMProxy.sol";
import {Test} from "forge-std/Test.sol";

contract ARMProxyStandaloneTest is Test {
event ARMSet(address arm);

address internal constant EMPTY_ADDRESS = address(0x1);
address internal constant OWNER_ADDRESS = 0xC0ffeeEeC0fFeeeEc0ffeEeEc0ffEEEEC0FfEEee;
address internal constant MOCK_RMN_ADDRESS = 0x1337133713371337133713371337133713371337;
Expand All @@ -23,14 +21,14 @@ contract ARMProxyStandaloneTest is Test {

function test_Constructor() public {
vm.expectEmit();
emit ARMSet(MOCK_RMN_ADDRESS);
emit ARMProxy.ARMSet(MOCK_RMN_ADDRESS);
ARMProxy proxy = new ARMProxy(MOCK_RMN_ADDRESS);
assertEq(proxy.getARM(), MOCK_RMN_ADDRESS);
}

function test_SetARM() public {
vm.expectEmit();
emit ARMSet(MOCK_RMN_ADDRESS);
emit ARMProxy.ARMSet(MOCK_RMN_ADDRESS);
vm.prank(OWNER_ADDRESS);
s_armProxy.setARM(MOCK_RMN_ADDRESS);
assertEq(s_armProxy.getARM(), MOCK_RMN_ADDRESS);
Expand All @@ -57,9 +55,9 @@ contract ARMProxyStandaloneTest is Test {
);
if (expectedSuccess) {
vm.mockCall(MOCK_ARM_ADDRESS, 0, call, ret);
vm.mockCall(MOCK_RMN_ADDRESS, 0, call, ret);
} else {
vm.mockCallRevert(MOCK_ARM_ADDRESS, 0, call, ret);
vm.mockCallRevert(MOCK_RMN_ADDRESS, 0, call, ret);
}
(bool actualSuccess, bytes memory result) = address(s_armProxy).call(call);
vm.clearMockedCalls();
Expand Down
Loading

0 comments on commit bf978cf

Please sign in to comment.