From d10fa519b9314319bb480bddf6fd6e2f735c6339 Mon Sep 17 00:00:00 2001 From: SyedAsadKazmi Date: Wed, 23 Sep 2026 17:15:44 +0530 Subject: [PATCH] Fixes for CI tests --- README.md | 2 +- .../reference/RateLimiterVersionBehavior.t.sol | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9b4281d..326ada8 100644 --- a/README.md +++ b/README.md @@ -159,4 +159,4 @@ npm run docs:gate # primitives catalog freshness + docs links/anchors/prose npm run lint:sol # solhint (chainlink-ccip ruleset, zero warnings) ``` -Disclaimer: Please note, this repo contains community examples only — these are not Chainlink products or services and are not supported or maintained by Chainlink. This code represents an example of using a Chainlink product or service, and is intended for demonstration and educational purposes only. It is provided “AS IS” and “AS AVAILABLE” without warranties of any kind, may not have been audited, and may omit checks or error handling. Each party intending to use this example code does so entirely at their own risk and must perform its own audits, security and code review, key management, and testing before any production deployment and ensure the operation and performance of such code matches expectations. Neither Chainlink Labs nor the Chainlink Foundation deploys, operates, monitors, maintains or endorses any deployment of this code. Note that this is not a Chainlink product, feature or service, and there are no commitments made with respect to the code, including compatibility with future Chainlink releases. You should not rely on this code without first conducting your own technical, engineering, and security review. This code is also outside the scope of any Chainlink bug bounty programs. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for outcomes due to errors in this example or how it is deployed or operated, or liable for any resulting claims or damages. Use of the Chainlink Network is subject to the Chainlink Foundation [Terms of Service](https://chain.link/terms), which provides important information and disclosures. By using this code, you acknowledge and agree to these terms. +Disclaimer: Please note, this repo contains community examples only - these are not Chainlink products or services and are not supported or maintained by Chainlink. This code represents an example of using a Chainlink product or service, and is intended for demonstration and educational purposes only. It is provided “AS IS” and “AS AVAILABLE” without warranties of any kind, may not have been audited, and may omit checks or error handling. Each party intending to use this example code does so entirely at their own risk and must perform its own audits, security and code review, key management, and testing before any production deployment and ensure the operation and performance of such code matches expectations. Neither Chainlink Labs nor the Chainlink Foundation deploys, operates, monitors, maintains or endorses any deployment of this code. Note that this is not a Chainlink product, feature or service, and there are no commitments made with respect to the code, including compatibility with future Chainlink releases. You should not rely on this code without first conducting your own technical, engineering, and security review. This code is also outside the scope of any Chainlink bug bounty programs. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for outcomes due to errors in this example or how it is deployed or operated, or liable for any resulting claims or damages. Use of the Chainlink Network is subject to the Chainlink Foundation [Terms of Service](https://chain.link/terms), which provides important information and disclosures. By using this code, you acknowledge and agree to these terms. diff --git a/test/reference/RateLimiterVersionBehavior.t.sol b/test/reference/RateLimiterVersionBehavior.t.sol index 91c557f..aca8cc9 100644 --- a/test/reference/RateLimiterVersionBehavior.t.sol +++ b/test/reference/RateLimiterVersionBehavior.t.sol @@ -22,6 +22,7 @@ struct RateLimitConfigArgs { interface IVersionedPool { function typeAndVersion() external view returns (string memory); function owner() external view returns (address); + function getDynamicConfig() external view returns (address router, address rateLimitAdmin, address feeAdmin); // v1.5.0 / v1.5.1 / v1.6.1 rate-limit setter. function setChainRateLimiterConfig( uint64 remoteChainSelector, @@ -43,6 +44,13 @@ interface IVersionedPool { ) external; } +/// @dev Minimal router surface for resolving the live onRamp of a lane. The v2.0 pool's `_onlyOnRamp` +/// checks `msg.sender == s_router.getOnRamp(remoteChainSelector)`, so the prank target must match +/// whatever the pool's CURRENT router reports - not a constant, since Sepolia router configs drift. +interface IRouter { + function getOnRamp(uint64 remoteChainSelector) external view returns (address); +} + /// @title RateLimiterVersionBehavior /// @notice Version-behavior fixtures backing docs/reference/pool-behavior-matrix.md rows for the /// RateLimiter config-validation deltas, the PAUSE mechanics, the enabled-vs-disabled 0/0 @@ -71,9 +79,11 @@ contract RateLimiterVersionBehavior is BaseForkTest { uint64 internal constant BASE_SEPOLIA = 8236463271206331221; // supported by V150 / V151 uint64 internal constant FUJI = 14767482510784806043; // supported by V161 / V200 - // V200 runtime plumbing: token + the v1.x GA Router onRamp for the Fuji lane (Router.getOnRamp(FUJI)). + // V200 runtime plumbing: token + the onRamp for the Fuji lane. The onRamp is resolved live from + // the pool's current router (getDynamicConfig -> getOnRamp) in setUp, because Sepolia router configs + // drift and a hardcoded ramp address rots - the original constant caused CallerIsNotARampOnRouter. address internal constant V200_TOKEN = 0x65901d3177F69CFA5b341C95D3943e72FFb2716A; - address internal constant V200_ONRAMP = 0x12492154714fBD28F28219f6fc4315d19de1025B; + address internal V200_ONRAMP; // MG161A is an old-OZ BurnMintERC20: burning past balance reverts with this string. Seeing it (rather // than TokenMaxCapacityExceeded) is the oracle that the rate limiter ALLOWED the transfer amount. @@ -82,6 +92,10 @@ contract RateLimiterVersionBehavior is BaseForkTest { function setUp() public override { // Only the Sepolia fork is needed; skip the token/pool deploy fixtures of BaseForkTest.setUp. _createSepoliaFork(); + // Resolve the live onRamp for the Fuji lane from the pool's current router. Hardcoding this + // rots when the Sepolia router is reconfigured; reading it keeps the prank target correct. + (address router,,) = IVersionedPool(V200).getDynamicConfig(); + V200_ONRAMP = IRouter(router).getOnRamp(FUJI); } // ─────────────────────────────────────────────────────────────────────────