Skip to content

Commit

Permalink
Merge branch 'CCIP-2906-tooling-scaffolding-basic' of github.com:smar…
Browse files Browse the repository at this point in the history
…tcontractkit/ccip into CCIP-2906-tooling-scaffolding-basic
  • Loading branch information
connorwstein committed Aug 7, 2024
2 parents 186d18f + 4b69f8d commit d8397d1
Show file tree
Hide file tree
Showing 102 changed files with 2,719 additions and 1,689 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-mirrors-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#added L3X Config
5 changes: 5 additions & 0 deletions .changeset/violet-clouds-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Updated AutoPurge.Threshold and AutoPurge.MinAttempts configs to only be required for heuristic and added content-type header for Scroll API #internal
3 changes: 1 addition & 2 deletions .github/workflows/client-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
type: string

env:
CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-ccip
INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com
MOD_CACHE_VERSION: 2

Expand Down Expand Up @@ -270,7 +270,6 @@ jobs:
if: |
always() &&
needs.should-run.outputs.should_run == 'true' &&
github.ref_type != 'tag' &&
(
needs.select-versions.outputs.evm_implementations != '' ||
github.event.inputs.base64TestList != ''
Expand Down
49 changes: 46 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,13 @@ jobs:
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPOffRampAggRateLimit$
- name: ccip-smoke-leader-lane
nodes: 15
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPForBidirectionalLane$
config_path: ./integration-tests/ccip-tests/testconfig/tomls/leader-lane.toml
- name: runlog
id: runlog
nodes: 2
Expand Down Expand Up @@ -808,7 +815,8 @@ jobs:
echo "Error: The latest_version is empty. The migration tests need a verison to run."
exit 1
fi
echo "latest_version=${latest_version}" >> "$GITHUB_OUTPUT"
# CCIP uses the `-release` suffix for their versions
echo "latest_version=${latest_version}-release" >> "$GITHUB_OUTPUT"
- name: Name Versions
run: |
echo "Running migration tests from version '${{ steps.get_latest_version.outputs.latest_version }}' to: '${{ inputs.evm-ref || github.sha }}'"
Expand Down Expand Up @@ -868,5 +876,40 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
with:
channel-id: "#team-test-tooling-internal"
slack-message: ":x: :mild-panic-intensifies: Node Migration Tests Failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}"
channel-id: "C05QQ8Z342V"
slack-message: "CCIP Node Migration Tests Failed :x: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}"
payload: |
{
"attachments": [
{
"color": "${{ contains(join(needs.*.result, ','), 'failure') && '#C62828' || '#2E7D32' }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "CCIP Version Migration Test Results ${{ contains(join(needs.*.result, ','), 'failure') && ':x:' || ':white_check_mark:'}}",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ contains(join(needs.*.result, ','), 'failure') && 'Some tests failed! Notifying <!subteam^S06HJ46A1EX|ccip-qa>' || 'All Good!' }}"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}> | <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run>"
}
}
]
}
]
}
537 changes: 271 additions & 266 deletions contracts/gas-snapshots/ccip.gas-snapshot

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions contracts/gas-snapshots/liquiditymanager.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ LiquidityManager_addLiquidity:test_addLiquiditySuccess() (gas: 279154)
LiquidityManager_rebalanceLiquidity:test_InsufficientLiquidityReverts() (gas: 206745)
LiquidityManager_rebalanceLiquidity:test_InvalidRemoteChainReverts() (gas: 192319)
LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPoolsSuccess() (gas: 9141768)
LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPoolsSuccess_AlreadyFinalized() (gas: 8957594)
LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPools_MultiStageFinalization() (gas: 8952800)
LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPools_NativeRewrap() (gas: 8880598)
LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPoolsSuccess_AlreadyFinalized() (gas: 8981838)
LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPools_MultiStageFinalization() (gas: 8977044)
LiquidityManager_rebalanceLiquidity:test_rebalanceBetweenPools_NativeRewrap() (gas: 8904842)
LiquidityManager_rebalanceLiquidity:test_rebalanceLiquiditySuccess() (gas: 382897)
LiquidityManager_receive:test_receive_success() (gas: 21182)
LiquidityManager_removeLiquidity:test_InsufficientLiquidityReverts() (gas: 184869)
Expand All @@ -19,7 +19,7 @@ LiquidityManager_setFinanceRole:test_OnlyOwnerReverts() (gas: 10987)
LiquidityManager_setFinanceRole:test_setFinanceRoleSuccess() (gas: 21836)
LiquidityManager_setLocalLiquidityContainer:test_OnlyOwnerReverts() (gas: 11052)
LiquidityManager_setLocalLiquidityContainer:test_ReverstWhen_CalledWithTheZeroAddress() (gas: 10643)
LiquidityManager_setLocalLiquidityContainer:test_setLocalLiquidityContainerSuccess() (gas: 3495598)
LiquidityManager_setLocalLiquidityContainer:test_setLocalLiquidityContainerSuccess() (gas: 3519863)
LiquidityManager_setMinimumLiquidity:test_OnlyOwnerReverts() (gas: 10925)
LiquidityManager_setMinimumLiquidity:test_setMinimumLiquiditySuccess() (gas: 36389)
LiquidityManager_withdrawERC20:test_withdrawERC20Reverts() (gas: 180359)
Expand Down
3 changes: 0 additions & 3 deletions contracts/src/v0.8/ccip/MultiAggregateRateLimiter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {Client} from "./libraries/Client.sol";
import {RateLimiter} from "./libraries/RateLimiter.sol";
import {USDPriceWith18Decimals} from "./libraries/USDPriceWith18Decimals.sol";

import {EnumerableSet} from "./../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol";

/// @notice The aggregate rate limiter is a wrapper of the token bucket rate limiter
/// which permits rate limiting based on the aggregate value of a group of
/// token transfers, using a price registry to convert to a numeraire asset (e.g. USD).
Expand All @@ -22,7 +20,6 @@ contract MultiAggregateRateLimiter is IMessageInterceptor, AuthorizedCallers, IT
using RateLimiter for RateLimiter.TokenBucket;
using USDPriceWith18Decimals for uint224;
using EnumerableMapAddresses for EnumerableMapAddresses.AddressToBytes32Map;
using EnumerableSet for EnumerableSet.AddressSet;

error PriceNotFoundForToken(address token);
error ZeroChainSelectorNotAllowed();
Expand Down
5 changes: 0 additions & 5 deletions contracts/src/v0.8/ccip/PriceRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,11 @@ contract PriceRegistry is AuthorizedCallers, IPriceRegistry, ITypeAndVersion {
error MessageTooLarge(uint256 maxSize, uint256 actualSize);
error UnsupportedNumberOfTokens();

event PriceUpdaterSet(address indexed priceUpdater);
event PriceUpdaterRemoved(address indexed priceUpdater);
event FeeTokenAdded(address indexed feeToken);
event FeeTokenRemoved(address indexed feeToken);
event UsdPerUnitGasUpdated(uint64 indexed destChain, uint256 value, uint256 timestamp);
event UsdPerTokenUpdated(address indexed token, uint256 value, uint256 timestamp);
event PriceFeedPerTokenUpdated(address indexed token, IPriceRegistry.TokenPriceFeedConfig priceFeedConfig);

event TokenTransferFeeConfigUpdated(
uint64 indexed destChainSelector, address indexed token, TokenTransferFeeConfig tokenTransferFeeConfig
);
Expand Down Expand Up @@ -178,8 +175,6 @@ contract PriceRegistry is AuthorizedCallers, IPriceRegistry, ITypeAndVersion {
/// @dev The link token address
address internal immutable i_linkToken;

// Price updaters are allowed to update the prices.
EnumerableSet.AddressSet private s_priceUpdaters;
// Subset of tokens which prices tracked by this registry which are fee tokens.
EnumerableSet.AddressSet private s_feeTokens;
// The amount of time a gas price can be stale before it is considered invalid.
Expand Down
21 changes: 14 additions & 7 deletions contracts/src/v0.8/ccip/capability/CCIPConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator
/// @param chainSelector The chain selector.
event ChainConfigRemoved(uint64 chainSelector);

error ChainConfigNotSetForChain(uint64 chainSelector);
error NodeNotInRegistry(bytes32 p2pId);
error OnlyCapabilitiesRegistryCanCall();
error ChainSelectorNotFound(uint64 chainSelector);
Expand All @@ -55,6 +54,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator
error WrongConfigCount(uint64 got, uint64 expected);
error WrongConfigDigest(bytes32 got, bytes32 expected);
error WrongConfigDigestBlueGreen(bytes32 got, bytes32 expected);
error ZeroAddressNotAllowed();

/// @notice Type and version override.
string public constant override typeAndVersion = "CCIPConfig 1.6.0-dev";
Expand All @@ -75,15 +75,18 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator
uint32 donId => mapping(Internal.OCRPluginType pluginType => CCIPConfigTypes.OCR3ConfigWithMeta[] ocr3Configs)
) internal s_ocr3Configs;

/// @notice The DONs that have been configured.
EnumerableSet.UintSet internal s_donIds;

uint8 internal constant MAX_OCR3_CONFIGS_PER_PLUGIN = 2;
uint8 internal constant MAX_OCR3_CONFIGS_PER_DON = 4;
uint8 internal constant MAX_NUM_ORACLES = 31;
uint256 internal constant CONFIG_DIGEST_PREFIX_MASK = type(uint256).max << (256 - 16); // 0xFFFF00..0
/// @dev must be equal to libocr multi role: https://github.com/smartcontractkit/libocr/blob/ae747ca5b81236ffdbf1714318c652e923a5ff4d/offchainreporting2plus/types/config_digest.go#L28
uint256 internal constant CONFIG_DIGEST_PREFIX = 0x000a << (256 - 16); // 0x000a00..00

/// @param capabilitiesRegistry the canonical capabilities registry address.
constructor(address capabilitiesRegistry) {
if (capabilitiesRegistry == address(0)) {
revert ZeroAddressNotAllowed();
}
i_capabilitiesRegistry = capabilitiesRegistry;
}

Expand All @@ -95,6 +98,11 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator
// ================================================================
// │ Config Getters │
// ================================================================
/// @notice Returns the capabilities registry address.
/// @return The capabilities registry address.
function getCapabilityRegistry() external view returns (address) {
return i_capabilitiesRegistry;
}

/// @notice Returns all the chain configurations.
/// @return The chain configurations.
Expand Down Expand Up @@ -413,9 +421,8 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator
)
)
);
uint256 prefixMask = type(uint256).max << (256 - 16); // 0xFFFF00..00
uint256 prefix = 0x000a << (256 - 16); // 0x000a00..00
return bytes32((prefix & prefixMask) | (h & ~prefixMask));

return bytes32((CONFIG_DIGEST_PREFIX & CONFIG_DIGEST_PREFIX_MASK) | (h & ~CONFIG_DIGEST_PREFIX_MASK));
}

// ================================================================
Expand Down
Loading

0 comments on commit d8397d1

Please sign in to comment.