Skip to content

Commit

Permalink
Merge branch 'develop' into via-ir-ccip
Browse files Browse the repository at this point in the history
# Conflicts:
#	contracts/gas-snapshots/ccip.gas-snapshot
#	core/gethwrappers/ccip/generated/fee_quoter/fee_quoter.go
#	core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt
  • Loading branch information
RensR committed Dec 17, 2024
2 parents 015f567 + 30e3a16 commit 01ad7ce
Show file tree
Hide file tree
Showing 15 changed files with 268 additions and 106 deletions.
32 changes: 16 additions & 16 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,8 @@ runner-test-matrix:
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-f461a9e
E2E_RMN_AFN2PROXY_VERSION: master-f461a9e
E2E_RMN_RAGEPROXY_VERSION: 678509b
E2E_RMN_AFN2PROXY_VERSION: 678509b
CCIP_V16_TEST_ENV: docker

- id: smoke/ccip/ccip_rmn_test.go:^TestRMN_MultipleMessagesOnOneLaneNoWaitForExec$
Expand All @@ -993,8 +993,8 @@ runner-test-matrix:
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-f461a9e
E2E_RMN_AFN2PROXY_VERSION: master-f461a9e
E2E_RMN_RAGEPROXY_VERSION: 678509b
E2E_RMN_AFN2PROXY_VERSION: 678509b
CCIP_V16_TEST_ENV: docker

- id: smoke/ccip/ccip_rmn_test.go:^TestRMN_NotEnoughObservers$
Expand All @@ -1009,8 +1009,8 @@ runner-test-matrix:
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-f461a9e
E2E_RMN_AFN2PROXY_VERSION: master-f461a9e
E2E_RMN_RAGEPROXY_VERSION: 678509b
E2E_RMN_AFN2PROXY_VERSION: 678509b
CCIP_V16_TEST_ENV: docker

- id: smoke/ccip/ccip_rmn_test.go:^TestRMN_DifferentSigners$
Expand All @@ -1025,8 +1025,8 @@ runner-test-matrix:
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-f461a9e
E2E_RMN_AFN2PROXY_VERSION: master-f461a9e
E2E_RMN_RAGEPROXY_VERSION: 678509b
E2E_RMN_AFN2PROXY_VERSION: 678509b
CCIP_V16_TEST_ENV: docker

- id: smoke/ccip/ccip_rmn_test.go:^TestRMN_NotEnoughSigners$
Expand All @@ -1041,8 +1041,8 @@ runner-test-matrix:
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-f461a9e
E2E_RMN_AFN2PROXY_VERSION: master-f461a9e
E2E_RMN_RAGEPROXY_VERSION: 678509b
E2E_RMN_AFN2PROXY_VERSION: 678509b
CCIP_V16_TEST_ENV: docker

- id: smoke/ccip/ccip_rmn_test.go:^TestRMN_DifferentRmnNodesForDifferentChains$
Expand All @@ -1057,8 +1057,8 @@ runner-test-matrix:
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-f461a9e
E2E_RMN_AFN2PROXY_VERSION: master-f461a9e
E2E_RMN_RAGEPROXY_VERSION: 678509b
E2E_RMN_AFN2PROXY_VERSION: 678509b
CCIP_V16_TEST_ENV: docker

- id: smoke/ccip/ccip_rmn_test.go:^TestRMN_TwoMessagesOneSourceChainCursed$
Expand All @@ -1073,8 +1073,8 @@ runner-test-matrix:
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-f461a9e
E2E_RMN_AFN2PROXY_VERSION: master-f461a9e
E2E_RMN_RAGEPROXY_VERSION: 678509b
E2E_RMN_AFN2PROXY_VERSION: 678509b
CCIP_V16_TEST_ENV: docker

- id: smoke/ccip/ccip_rmn_test.go:^TestRMN_GlobalCurseTwoMessagesOnTwoLanes$
Expand All @@ -1089,8 +1089,8 @@ runner-test-matrix:
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-f461a9e
E2E_RMN_AFN2PROXY_VERSION: master-f461a9e
E2E_RMN_RAGEPROXY_VERSION: 678509b
E2E_RMN_AFN2PROXY_VERSION: 678509b
CCIP_V16_TEST_ENV: docker

# END: CCIPv1.6 tests
Expand Down
9 changes: 9 additions & 0 deletions contracts/.changeset/early-cups-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@chainlink/contracts': minor
---

#internal Account for tokenTransferBytesOverhead in exec cost

PR issue: CCIP-4646

Solidity Review issue: CCIP-3966
10 changes: 10 additions & 0 deletions contracts/.changeset/eighty-cycles-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@chainlink/contracts': patch
---

remove legacy curse check from RMNRemote isCursed() method #bugfix


PR issue: CCIP-4476

Solidity Review issue: CCIP-3966
72 changes: 36 additions & 36 deletions contracts/gas-snapshots/ccip.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BurnWithFromMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 26554)
BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55702)
BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 241726)
BurnWithFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 25686)
CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 1832368)
CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 1832775)
CCIPHome__validateConfig:test__validateConfigLessTransmittersThanSigners_Success() (gas: 339166)
CCIPHome__validateConfig:test__validateConfigSmallerFChain_Success() (gas: 472436)
CCIPHome__validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 294901)
Expand Down Expand Up @@ -68,7 +68,7 @@ CCIPHome_setCandidate:test_setCandidate_success() (gas: 1363957)
CCIPHome_supportsInterface:test_supportsInterface_success() (gas: 9681)
DefensiveExampleTest:test_HappyPath_Success() (gas: 198484)
DefensiveExampleTest:test_Recovery() (gas: 423153)
E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1505876)
E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1506091)
EtherSenderReceiverTest_ccipReceive:test_ccipReceive_fallbackToWethTransfer() (gas: 97237)
EtherSenderReceiverTest_ccipReceive:test_ccipReceive_happyPath() (gas: 49876)
EtherSenderReceiverTest_ccipReceive:test_ccipReceive_wrongToken() (gas: 17943)
Expand All @@ -92,7 +92,7 @@ EtherSenderReceiverTest_validatedMessage:test_validatedMessage_tokenOverwrittenT
EtherSenderReceiverTest_validatedMessage:test_validatedMessage_validMessage_extraArgs() (gas: 27495)
FactoryBurnMintERC20_approve:test_Approve_Success() (gas: 55127)
FactoryBurnMintERC20_approve:test_InvalidAddress_Reverts() (gas: 10746)
FactoryBurnMintERC20_burn:test_BasicBurn_Success() (gas: 171808)
FactoryBurnMintERC20_burn:test_BasicBurn_Success() (gas: 171940)
FactoryBurnMintERC20_burn:test_BurnFromZeroAddress_Reverts() (gas: 47747)
FactoryBurnMintERC20_burn:test_ExceedsBalance_Reverts() (gas: 21968)
FactoryBurnMintERC20_burn:test_SenderNotBurner_Reverts() (gas: 13633)
Expand Down Expand Up @@ -138,7 +138,7 @@ FeeQuoter_applyTokenTransferFeeConfigUpdates:test_OnlyCallableByOwnerOrAdmin_Rev
FeeQuoter_constructor:test_InvalidLinkTokenEqZeroAddress_Revert() (gas: 105068)
FeeQuoter_constructor:test_InvalidMaxFeeJuelsPerMsg_Revert() (gas: 109494)
FeeQuoter_constructor:test_InvalidStalenessThreshold_Revert() (gas: 109717)
FeeQuoter_constructor:test_Setup_Success() (gas: 4632838)
FeeQuoter_constructor:test_Setup_Success() (gas: 4633648)
FeeQuoter_convertTokenAmount:test_ConvertTokenAmount_Success() (gas: 69224)
FeeQuoter_convertTokenAmount:test_LinkTokenNotSupported_Revert() (gas: 29140)
FeeQuoter_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost_Success() (gas: 93806)
Expand All @@ -161,18 +161,18 @@ FeeQuoter_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas_Succes
FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 29966)
FeeQuoter_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee_Success() (gas: 43522)
FeeQuoter_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults_Success() (gas: 31405)
FeeQuoter_getValidatedFee:test_DestinationChainNotEnabled_Revert() (gas: 19871)
FeeQuoter_getValidatedFee:test_EmptyMessage_Success() (gas: 85211)
FeeQuoter_getValidatedFee:test_EnforceOutOfOrder_Revert() (gas: 55277)
FeeQuoter_getValidatedFee:test_HighGasMessage_Success() (gas: 238190)
FeeQuoter_getValidatedFee:test_DestinationChainNotEnabled_Revert() (gas: 19874)
FeeQuoter_getValidatedFee:test_EmptyMessage_Success() (gas: 85381)
FeeQuoter_getValidatedFee:test_EnforceOutOfOrder_Revert() (gas: 55362)
FeeQuoter_getValidatedFee:test_HighGasMessage_Success() (gas: 238360)
FeeQuoter_getValidatedFee:test_InvalidEVMAddress_Revert() (gas: 23950)
FeeQuoter_getValidatedFee:test_MessageGasLimitTooHigh_Revert() (gas: 32598)
FeeQuoter_getValidatedFee:test_MessageGasLimitTooHigh_Revert() (gas: 32683)
FeeQuoter_getValidatedFee:test_MessageTooLarge_Revert() (gas: 100205)
FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 150475)
FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 150712)
FeeQuoter_getValidatedFee:test_NotAFeeToken_Revert() (gas: 22928)
FeeQuoter_getValidatedFee:test_SingleTokenMessage_Success() (gas: 118604)
FeeQuoter_getValidatedFee:test_SingleTokenMessage_Success() (gas: 119005)
FeeQuoter_getValidatedFee:test_TooManyTokens_Revert() (gas: 25323)
FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 64475)
FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 64549)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 1982692)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 1982450)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 1963014)
Expand Down Expand Up @@ -491,7 +491,7 @@ OffRamp_trialExecute:test_trialExecute() (gas: 272921)
OffRamp_trialExecute:test_trialExecute_RateLimitError() (gas: 129017)
OffRamp_trialExecute:test_trialExecute_TokenHandlingErrorIsCaught() (gas: 140657)
OffRamp_trialExecute:test_trialExecute_TokenPoolIsNotAContract() (gas: 292024)
OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 251747)
OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 251975)
OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_InvalidAllowListRequestDisabledAllowListWithAdds() (gas: 18091)
OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_Revert() (gas: 69790)
OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_Success() (gas: 330181)
Expand Down Expand Up @@ -526,11 +526,11 @@ OnRamp_forwardFromRouter:test_UnAllowedOriginalSender_Revert() (gas: 25059)
OnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 77868)
OnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 39653)
OnRamp_forwardFromRouter:test_forwardFromRouter_WithInterception_Success() (gas: 283896)
OnRamp_getFee:test_EmptyMessage_Success() (gas: 103375)
OnRamp_getFee:test_EnforceOutOfOrder_Revert() (gas: 66823)
OnRamp_getFee:test_GetFeeOfZeroForTokenMessage_Success() (gas: 89005)
OnRamp_getFee:test_EmptyMessage_Success() (gas: 103715)
OnRamp_getFee:test_EnforceOutOfOrder_Revert() (gas: 66908)
OnRamp_getFee:test_GetFeeOfZeroForTokenMessage_Success() (gas: 89164)
OnRamp_getFee:test_NotAFeeTokenButPricedToken_Revert() (gas: 35898)
OnRamp_getFee:test_SingleTokenMessage_Success() (gas: 119040)
OnRamp_getFee:test_SingleTokenMessage_Success() (gas: 119344)
OnRamp_getFee:test_Unhealthy_Revert() (gas: 17689)
OnRamp_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10824)
OnRamp_getTokenPool:test_GetTokenPool_Success() (gas: 35568)
Expand All @@ -541,11 +541,11 @@ OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigOnlyOwner_Revert() (g
OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigReentrancyGuardEnteredEqTrue_Revert() (gas: 13669)
OnRamp_setDynamicConfig:test_setDynamicConfig_Success() (gas: 57372)
OnRamp_withdrawFeeTokens:test_WithdrawFeeTokens_Success() (gas: 124513)
PingPong_ccipReceive:test_CcipReceive_Success() (gas: 173255)
PingPong_ccipReceive:test_CcipReceive_Success() (gas: 173340)
PingPong_setOutOfOrderExecution:test_OutOfOrderExecution_Success() (gas: 21331)
PingPong_setPaused:test_Pausing_Success() (gas: 18580)
PingPong_startPingPong:test_StartPingPong_With_OOO_Success() (gas: 152638)
PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered_Success() (gas: 178137)
PingPong_startPingPong:test_StartPingPong_With_OOO_Success() (gas: 152723)
PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered_Success() (gas: 178222)
RMNHome_getConfigDigests:test_getConfigDigests_success() (gas: 1076498)
RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() (gas: 24140)
RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed_reverts() (gas: 11029)
Expand All @@ -571,8 +571,8 @@ RMNHome_validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_OutOf
RMNRemote_constructor:test_constructor() (gas: 8988)
RMNRemote_curse:test_curse_AlreadyCursed_duplicateSubject_reverts() (gas: 155109)
RMNRemote_curse:test_curse_calledByNonOwner_reverts() (gas: 19542)
RMNRemote_curse:test_curse_success() (gas: 149106)
RMNRemote_global_and_legacy_curses:test_global_and_legacy_curses_success() (gas: 133076)
RMNRemote_curse:test_curse_success() (gas: 149112)
RMNRemote_global_curses:test_isCursed_globalCurseSubject() (gas: 71581)
RMNRemote_isBlessed:test_isBlessed() (gas: 18704)
RMNRemote_setConfig:test_setConfig_ZeroValueNotAllowed_revert() (gas: 38330)
RMNRemote_setConfig:test_setConfig_addSigner_removeSigner_success() (gas: 980080)
Expand Down Expand Up @@ -612,23 +612,23 @@ RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Rever
RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Success() (gas: 131381)
Router_applyRampUpdates:test_applyRampUpdates_OffRampUpdatesWithRouting() (gas: 10900977)
Router_applyRampUpdates:test_applyRampUpdates_OnRampDisable() (gas: 58445)
Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 131912)
Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 222167)
Router_ccipSend:test_FeeTokenAmountTooLow_Revert() (gas: 72583)
Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 131997)
Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 222243)
Router_ccipSend:test_FeeTokenAmountTooLow_Revert() (gas: 72668)
Router_ccipSend:test_InvalidMsgValue() (gas: 33851)
Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 71398)
Router_ccipSend:test_NativeFeeTokenOverpay_Success() (gas: 196033)
Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 63397)
Router_ccipSend:test_NativeFeeToken_Success() (gas: 194783)
Router_ccipSend:test_NonLinkFeeToken_Success() (gas: 228250)
Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 71483)
Router_ccipSend:test_NativeFeeTokenOverpay_Success() (gas: 196203)
Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 63482)
Router_ccipSend:test_NativeFeeToken_Success() (gas: 194953)
Router_ccipSend:test_NonLinkFeeToken_Success() (gas: 228335)
Router_ccipSend:test_UnsupportedDestinationChain_Revert() (gas: 25932)
Router_ccipSend:test_WhenNotHealthy_Revert() (gas: 45978)
Router_ccipSend:test_WrappedNativeFeeToken_Success() (gas: 197177)
Router_ccipSend:test_ccipSend_nativeFeeNoTokenSuccess_gas() (gas: 142144)
Router_ccipSend:test_ccipSend_nativeFeeOneTokenSuccess_gas() (gas: 232485)
Router_ccipSend:test_WrappedNativeFeeToken_Success() (gas: 197347)
Router_ccipSend:test_ccipSend_nativeFeeNoTokenSuccess_gas() (gas: 142229)
Router_ccipSend:test_ccipSend_nativeFeeOneTokenSuccess_gas() (gas: 232561)
Router_constructor:test_Constructor_Success() (gas: 13722)
Router_getArmProxy:test_getArmProxy() (gas: 10709)
Router_getFee:test_GetFeeSupportedChain_Success() (gas: 53098)
Router_getFee:test_GetFeeSupportedChain_Success() (gas: 53183)
Router_getFee:test_UnsupportedDestinationChain_Revert() (gas: 18139)
Router_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10824)
Router_recoverTokens:test_RecoverTokensInvalidRecipient_Revert() (gas: 11776)
Expand Down Expand Up @@ -734,9 +734,9 @@ USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism_Success() (gas:
USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism_thenSwitchToPrimary_Success() (gas: 212203)
USDCBridgeMigrator_releaseOrMint:test_OnLockReleaseMechanism_Success() (gas: 215351)
USDCBridgeMigrator_releaseOrMint:test_WhileMigrationPause_Revert() (gas: 110328)
USDCBridgeMigrator_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 263276)
USDCBridgeMigrator_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 263535)
USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_destChain_Success() (gas: 150644)
USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_homeChain_Success() (gas: 513510)
USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_homeChain_Success() (gas: 513769)
USDCBridgeMigrator_updateChainSelectorMechanism:test_PrimaryMechanism_Success() (gas: 137367)
USDCBridgeMigrator_updateChainSelectorMechanism:test_WhileMigrationPause_Revert() (gas: 111978)
USDCBridgeMigrator_updateChainSelectorMechanism:test_cannotRevertChainMechanism_afterMigration_Revert() (gas: 319699)
Expand Down
3 changes: 2 additions & 1 deletion contracts/src/v0.8/ccip/FeeQuoter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ contract FeeQuoter is AuthorizedCallers, IFeeQuoter, ITypeAndVersion, IReceiver,
// fee logic for other chains should be implemented in the future.
uint256 executionCost = uint112(packedGasPrice)
* (
destChainConfig.destGasOverhead + (message.data.length * destChainConfig.destGasPerPayloadByte) + tokenTransferGas
destChainConfig.destGasOverhead
+ ((message.data.length + tokenTransferBytesOverhead) * destChainConfig.destGasPerPayloadByte) + tokenTransferGas
+ _parseEVMExtraArgsFromBytes(message.extraArgs, destChainConfig).gasLimit
) * destChainConfig.gasMultiplierWeiPerEth;

Expand Down
9 changes: 2 additions & 7 deletions contracts/src/v0.8/ccip/rmn/RMNRemote.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import {Ownable2StepMsgSender} from "../../shared/access/Ownable2StepMsgSender.s
import {EnumerableSet} from "../../shared/enumerable/EnumerableSetWithBytes16.sol";
import {Internal} from "../libraries/Internal.sol";

/// @dev An active curse on this subject will cause isCursed() to return true. Use this subject if there is an issue
/// with a remote chain, for which there exists a legacy lane contract deployed on the same chain as this RMN contract
/// is deployed, relying on isCursed().
bytes16 constant LEGACY_CURSE_SUBJECT = 0x01000000000000000000000000000000;

/// @dev An active curse on this subject will cause isCursed() and isCursed(bytes16) to return true. Use this subject
/// for issues affecting all of CCIP chains, or pertaining to the chain that this contract is deployed on, instead of
/// using the local chain selector as a subject.
Expand Down Expand Up @@ -256,11 +251,11 @@ contract RMNRemote is Ownable2StepMsgSender, ITypeAndVersion, IRMNRemote, IRMN {
/// @inheritdoc IRMNRemote
function isCursed() external view override(IRMN, IRMNRemote) returns (bool) {
// There are zero curses under normal circumstances, which means it's cheaper to check for the absence of curses.
// than to check the subject list twice, as we have to check for both the legacy and global curse subjects.
// than to check the subject list for the global curse subject.
if (s_cursedSubjects.length() == 0) {
return false;
}
return s_cursedSubjects.contains(LEGACY_CURSE_SUBJECT) || s_cursedSubjects.contains(GLOBAL_CURSE_SUBJECT);
return s_cursedSubjects.contains(GLOBAL_CURSE_SUBJECT);
}

/// @inheritdoc IRMNRemote
Expand Down
Loading

0 comments on commit 01ad7ce

Please sign in to comment.