diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index f2a590cf67..60bd3a9b85 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -116,148 +116,140 @@ CommitStore_verify:test_TooManyLeaves_Revert() (gas: 36785) DefensiveExampleTest:test_HappyPath_Success() (gas: 200018) DefensiveExampleTest:test_Recovery() (gas: 424253) E2E:test_E2E_3MessagesSuccess_gas() (gas: 1104821) -EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_NotACompatiblePool_Revert() (gas: 38297) -EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_Success() (gas: 108423) -EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_TokenHandlingError_revert_Revert() (gas: 116875) -EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_AddMultipleChains_Success() (gas: 262922) -EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_AddNewChain_Success() (gas: 93606) -EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates_Success() (gas: 12376) -EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRampAndPrevOffRamp_Revert() (gas: 87783) -EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRamp_Revert() (gas: 87494) -EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainPrevOffRamp_Revert() (gas: 87642) -EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChain_Success() (gas: 102139) -EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ZeroOnRampAddress_Revert() (gas: 12465) -EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ZeroSourceChainSelector_Revert() (gas: 12440) -EVM2EVMMultiOffRamp_batchExecute:test_MultipleReportsDifferentChains_Success() (gas: 278602) -EVM2EVMMultiOffRamp_batchExecute:test_MultipleReportsSameChain_Success() (gas: 223952) -EVM2EVMMultiOffRamp_batchExecute:test_MultipleReportsSkipDuplicate_Success() (gas: 149563) -EVM2EVMMultiOffRamp_batchExecute:test_OutOfBoundsGasLimitsAccess_Revert() (gas: 178860) -EVM2EVMMultiOffRamp_batchExecute:test_SingleReport_Success() (gas: 136014) -EVM2EVMMultiOffRamp_batchExecute:test_Unhealthy_Revert() (gas: 518511) +EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_NotACompatiblePool_Revert() (gas: 38361) +EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_Success() (gas: 108455) +EVM2EVMMultiOffRamp__releaseOrMintSingleToken:test__releaseOrMintSingleToken_TokenHandlingError_revert_Revert() (gas: 116907) +EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_AddMultipleChains_Success() (gas: 191359) +EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_AddNewChain_Success() (gas: 69836) +EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates_Success() (gas: 12359) +EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRampAndPrevOffRamp_Revert() (gas: 64548) +EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRamp_Revert() (gas: 64551) +EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChain_Success() (gas: 77549) +EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ZeroOnRampAddress_Revert() (gas: 12258) +EVM2EVMMultiOffRamp_applySourceChainConfigUpdates:test_ZeroSourceChainSelector_Revert() (gas: 12199) +EVM2EVMMultiOffRamp_batchExecute:test_MultipleReportsDifferentChains_Success() (gas: 294969) +EVM2EVMMultiOffRamp_batchExecute:test_MultipleReportsSameChain_Success() (gas: 238328) +EVM2EVMMultiOffRamp_batchExecute:test_MultipleReportsSkipDuplicate_Success() (gas: 157487) +EVM2EVMMultiOffRamp_batchExecute:test_OutOfBoundsGasLimitsAccess_Revert() (gas: 188364) +EVM2EVMMultiOffRamp_batchExecute:test_SingleReport_Success() (gas: 147255) +EVM2EVMMultiOffRamp_batchExecute:test_Unhealthy_Revert() (gas: 527932) EVM2EVMMultiOffRamp_batchExecute:test_ZeroReports_Revert() (gas: 10505) EVM2EVMMultiOffRamp_ccipReceive:test_Reverts() (gas: 17210) -EVM2EVMMultiOffRamp_commit:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 65962) -EVM2EVMMultiOffRamp_commit:test_InvalidInterval_Revert() (gas: 59612) -EVM2EVMMultiOffRamp_commit:test_InvalidRootRevert() (gas: 58692) -EVM2EVMMultiOffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6568439) -EVM2EVMMultiOffRamp_commit:test_NoConfig_Revert() (gas: 6151690) -EVM2EVMMultiOffRamp_commit:test_OnlyGasPriceUpdates_Success() (gas: 108339) -EVM2EVMMultiOffRamp_commit:test_OnlyPriceUpdateStaleReport_Revert() (gas: 118247) -EVM2EVMMultiOffRamp_commit:test_OnlyTokenPriceUpdates_Success() (gas: 108382) -EVM2EVMMultiOffRamp_commit:test_PriceSequenceNumberCleared_Success() (gas: 353651) -EVM2EVMMultiOffRamp_commit:test_ReportAndPriceUpdate_Success() (gas: 160080) -EVM2EVMMultiOffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 134987) -EVM2EVMMultiOffRamp_commit:test_RootAlreadyCommitted_Revert() (gas: 136659) -EVM2EVMMultiOffRamp_commit:test_SourceChainNotEnabled_Revert() (gas: 58960) -EVM2EVMMultiOffRamp_commit:test_StaleReportWithRoot_Success() (gas: 225241) -EVM2EVMMultiOffRamp_commit:test_UnauthorizedTransmitter_Revert() (gas: 119596) -EVM2EVMMultiOffRamp_commit:test_Unhealthy_Revert() (gas: 77519) -EVM2EVMMultiOffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 207875) -EVM2EVMMultiOffRamp_commit:test_WrongConfigWithoutSigners_Revert() (gas: 6562831) +EVM2EVMMultiOffRamp_commit:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 63695) +EVM2EVMMultiOffRamp_commit:test_InvalidInterval_Revert() (gas: 59630) +EVM2EVMMultiOffRamp_commit:test_InvalidRootRevert() (gas: 58710) +EVM2EVMMultiOffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6425913) +EVM2EVMMultiOffRamp_commit:test_NoConfig_Revert() (gas: 6009185) +EVM2EVMMultiOffRamp_commit:test_OnlyGasPriceUpdates_Success() (gas: 108329) +EVM2EVMMultiOffRamp_commit:test_OnlyPriceUpdateStaleReport_Revert() (gas: 118244) +EVM2EVMMultiOffRamp_commit:test_OnlyTokenPriceUpdates_Success() (gas: 108372) +EVM2EVMMultiOffRamp_commit:test_PriceSequenceNumberCleared_Success() (gas: 353558) +EVM2EVMMultiOffRamp_commit:test_ReportAndPriceUpdate_Success() (gas: 157810) +EVM2EVMMultiOffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 132726) +EVM2EVMMultiOffRamp_commit:test_RootAlreadyCommitted_Revert() (gas: 136695) +EVM2EVMMultiOffRamp_commit:test_SourceChainNotEnabled_Revert() (gas: 58978) +EVM2EVMMultiOffRamp_commit:test_StaleReportWithRoot_Success() (gas: 222706) +EVM2EVMMultiOffRamp_commit:test_UnauthorizedTransmitter_Revert() (gas: 119611) +EVM2EVMMultiOffRamp_commit:test_Unhealthy_Revert() (gas: 77537) +EVM2EVMMultiOffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 205601) +EVM2EVMMultiOffRamp_commit:test_WrongConfigWithoutSigners_Revert() (gas: 6420302) EVM2EVMMultiOffRamp_commit:test_ZeroEpochAndRound_Revert() (gas: 47717) -EVM2EVMMultiOffRamp_constructor:test_Constructor_Success() (gas: 6221393) -EVM2EVMMultiOffRamp_constructor:test_SourceChainSelector_Revert() (gas: 100992) -EVM2EVMMultiOffRamp_constructor:test_ZeroChainSelector_Revert() (gas: 97936) -EVM2EVMMultiOffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 101045) -EVM2EVMMultiOffRamp_constructor:test_ZeroRMNProxy_Revert() (gas: 95693) -EVM2EVMMultiOffRamp_constructor:test_ZeroTokenAdminRegistry_Revert() (gas: 95760) +EVM2EVMMultiOffRamp_constructor:test_Constructor_Success() (gas: 6024813) +EVM2EVMMultiOffRamp_constructor:test_SourceChainSelector_Revert() (gas: 103217) +EVM2EVMMultiOffRamp_constructor:test_ZeroChainSelector_Revert() (gas: 99988) +EVM2EVMMultiOffRamp_constructor:test_ZeroNonceManager_Revert() (gas: 97859) +EVM2EVMMultiOffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 103227) +EVM2EVMMultiOffRamp_constructor:test_ZeroRMNProxy_Revert() (gas: 97758) +EVM2EVMMultiOffRamp_constructor:test_ZeroTokenAdminRegistry_Revert() (gas: 97825) EVM2EVMMultiOffRamp_execute:test_IncorrectArrayType_Revert() (gas: 17299) -EVM2EVMMultiOffRamp_execute:test_LargeBatch_Success() (gas: 1492338) -EVM2EVMMultiOffRamp_execute:test_MultipleReportsWithPartialValidationFailures_Success() (gas: 330226) -EVM2EVMMultiOffRamp_execute:test_MultipleReports_Success() (gas: 247344) -EVM2EVMMultiOffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6618873) -EVM2EVMMultiOffRamp_execute:test_NoConfig_Revert() (gas: 6201840) -EVM2EVMMultiOffRamp_execute:test_NonArray_Revert() (gas: 30077) -EVM2EVMMultiOffRamp_execute:test_SingleReport_Success() (gas: 156624) -EVM2EVMMultiOffRamp_execute:test_UnauthorizedTransmitter_Revert() (gas: 140572) -EVM2EVMMultiOffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 6980966) +EVM2EVMMultiOffRamp_execute:test_LargeBatch_Success() (gas: 1546406) +EVM2EVMMultiOffRamp_execute:test_MultipleReportsWithPartialValidationFailures_Success() (gas: 341361) +EVM2EVMMultiOffRamp_execute:test_MultipleReports_Success() (gas: 258517) +EVM2EVMMultiOffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6477785) +EVM2EVMMultiOffRamp_execute:test_NoConfig_Revert() (gas: 6060776) +EVM2EVMMultiOffRamp_execute:test_NonArray_Revert() (gas: 30048) +EVM2EVMMultiOffRamp_execute:test_SingleReport_Success() (gas: 164664) +EVM2EVMMultiOffRamp_execute:test_UnauthorizedTransmitter_Revert() (gas: 148612) +EVM2EVMMultiOffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 6839860) EVM2EVMMultiOffRamp_execute:test_ZeroReports_Revert() (gas: 17174) -EVM2EVMMultiOffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 20742) -EVM2EVMMultiOffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 255656) -EVM2EVMMultiOffRamp_executeSingleMessage:test_NonContract_Success() (gas: 22893) -EVM2EVMMultiOffRamp_executeSingleMessage:test_TokenHandlingError_Revert() (gas: 208045) -EVM2EVMMultiOffRamp_executeSingleMessage:test_ZeroGasDONExecution_Revert() (gas: 50975) -EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens_Success() (gas: 50485) -EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidationNoRouterCall_Revert() (gas: 235475) -EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidation_Revert() (gas: 91297) -EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 287890) -EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithValidation_Success() (gas: 95401) -EVM2EVMMultiOffRamp_executeSingleReport:test_DisabledSourceChain_Revert() (gas: 37347) -EVM2EVMMultiOffRamp_executeSingleReport:test_EmptyReport_Revert() (gas: 23929) -EVM2EVMMultiOffRamp_executeSingleReport:test_InvalidMessageId_Revert() (gas: 41823) -EVM2EVMMultiOffRamp_executeSingleReport:test_InvalidSourcePoolAddress_Success() (gas: 448428) -EVM2EVMMultiOffRamp_executeSingleReport:test_ManualExecutionNotYetEnabled_Revert() (gas: 53593) -EVM2EVMMultiOffRamp_executeSingleReport:test_MismatchingOnRampAddress_Revert() (gas: 44660) -EVM2EVMMultiOffRamp_executeSingleReport:test_MismatchingSourceChainSelector_Revert() (gas: 41715) -EVM2EVMMultiOffRamp_executeSingleReport:test_NonExistingSourceChain_Revert() (gas: 37577) -EVM2EVMMultiOffRamp_executeSingleReport:test_ReceiverError_Success() (gas: 170344) -EVM2EVMMultiOffRamp_executeSingleReport:test_RetryFailedMessageWithoutManualExecution_Revert() (gas: 182073) -EVM2EVMMultiOffRamp_executeSingleReport:test_RootNotCommitted_Revert() (gas: 47177) -EVM2EVMMultiOffRamp_executeSingleReport:test_RouterYULCall_Revert() (gas: 405859) -EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessageNoTokensOtherChain_Success() (gas: 232987) -EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessageNoTokensUnordered_Success() (gas: 166040) -EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessageNoTokens_Success() (gas: 180585) -EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessageToNonCCIPReceiver_Success() (gas: 251817) -EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessagesNoTokensSuccess_gas() (gas: 119003) -EVM2EVMMultiOffRamp_executeSingleReport:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 383559) -EVM2EVMMultiOffRamp_executeSingleReport:test_SkippedIncorrectNonce_Success() (gas: 56005) -EVM2EVMMultiOffRamp_executeSingleReport:test_TokenDataMismatch_Revert() (gas: 51317) -EVM2EVMMultiOffRamp_executeSingleReport:test_TwoMessagesWithTokensAndGE_Success() (gas: 528276) -EVM2EVMMultiOffRamp_executeSingleReport:test_TwoMessagesWithTokensSuccess_gas() (gas: 465888) -EVM2EVMMultiOffRamp_executeSingleReport:test_UnexpectedTokenData_Revert() (gas: 38052) -EVM2EVMMultiOffRamp_executeSingleReport:test_UnhealthySingleChainCurse_Revert() (gas: 516921) -EVM2EVMMultiOffRamp_executeSingleReport:test_Unhealthy_Revert() (gas: 514300) -EVM2EVMMultiOffRamp_executeSingleReport:test_WithCurseOnAnotherSourceChain_Success() (gas: 483010) -EVM2EVMMultiOffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessageUnordered_Success() (gas: 127346) -EVM2EVMMultiOffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessage_Success() (gas: 147640) -EVM2EVMMultiOffRamp_execute_upgrade:test_NoPrevOffRampForChain_Success() (gas: 239300) -EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedNonceNewSenderStartsAtZero_Success() (gas: 239181) -EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedNonceStartsAtV1Nonce_Success() (gas: 289556) -EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedOffRampNonceSkipsIfMsgInFlight_Success() (gas: 270238) -EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedSenderNoncesReadsPreviousRampTransitive_Success() (gas: 247338) -EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedSenderNoncesReadsPreviousRamp_Success() (gas: 235313) -EVM2EVMMultiOffRamp_execute_upgrade:test_UpgradedWithMultiRamp_Revert() (gas: 7153761) -EVM2EVMMultiOffRamp_execute_upgrade:test_Upgraded_Success() (gas: 136447) -EVM2EVMMultiOffRamp_getExecutionState:test_FillExecutionState_Success() (gas: 3652910) -EVM2EVMMultiOffRamp_getExecutionState:test_GetDifferentChainExecutionState_Success() (gas: 118102) -EVM2EVMMultiOffRamp_getExecutionState:test_GetExecutionState_Success() (gas: 87240) -EVM2EVMMultiOffRamp_manuallyExecute:test_ManualExecGasLimitMismatchSingleReport_Revert() (gas: 80095) -EVM2EVMMultiOffRamp_manuallyExecute:test_ManualExecInvalidGasLimit_Revert() (gas: 28717) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_DoesNotRevertIfUntouched_Success() (gas: 152265) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_FailedTx_Revert() (gas: 199773) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_ForkedChain_Revert() (gas: 28246) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_GasLimitMismatchMultipleReports_Revert() (gas: 160817) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_LowGasLimit_Success() (gas: 497730) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_ReentrancyFails() (gas: 2371243) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_Success() (gas: 201928) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride_Success() (gas: 202502) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_WithMultiReportGasOverride_Success() (gas: 651738) -EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_WithPartialMessages_Success() (gas: 287352) -EVM2EVMMultiOffRamp_metadataHash:test_MetadataHashChangesOnOnRampAddress_Success() (gas: 10983) -EVM2EVMMultiOffRamp_metadataHash:test_MetadataHashChangesOnSourceChain_Success() (gas: 11029) -EVM2EVMMultiOffRamp_metadataHash:test_MetadataHash_Success() (gas: 9135) -EVM2EVMMultiOffRamp_releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 165131) -EVM2EVMMultiOffRamp_releaseOrMintTokens:test__releaseOrMintTokens_PoolIsNotAPool_Reverts() (gas: 26919) -EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() (gas: 63524) -EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidEVMAddress_Revert() (gas: 44641) -EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_PoolDoesNotSupportDest_Reverts() (gas: 80548) -EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 185328) -EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 283920) +EVM2EVMMultiOffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 20655) +EVM2EVMMultiOffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 255569) +EVM2EVMMultiOffRamp_executeSingleMessage:test_NonContract_Success() (gas: 22806) +EVM2EVMMultiOffRamp_executeSingleMessage:test_TokenHandlingError_Revert() (gas: 207958) +EVM2EVMMultiOffRamp_executeSingleMessage:test_ZeroGasDONExecution_Revert() (gas: 50888) +EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens_Success() (gas: 50398) +EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidationNoRouterCall_Revert() (gas: 235368) +EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidation_Revert() (gas: 91184) +EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 287803) +EVM2EVMMultiOffRamp_executeSingleMessage:test_executeSingleMessage_WithValidation_Success() (gas: 95288) +EVM2EVMMultiOffRamp_executeSingleReport:test_DisabledSourceChain_Revert() (gas: 37208) +EVM2EVMMultiOffRamp_executeSingleReport:test_EmptyReport_Revert() (gas: 23877) +EVM2EVMMultiOffRamp_executeSingleReport:test_InvalidMessageId_Revert() (gas: 41684) +EVM2EVMMultiOffRamp_executeSingleReport:test_InvalidSourcePoolAddress_Success() (gas: 458019) +EVM2EVMMultiOffRamp_executeSingleReport:test_ManualExecutionNotYetEnabled_Revert() (gas: 53460) +EVM2EVMMultiOffRamp_executeSingleReport:test_MismatchingOnRampAddress_Revert() (gas: 44527) +EVM2EVMMultiOffRamp_executeSingleReport:test_MismatchingSourceChainSelector_Revert() (gas: 41576) +EVM2EVMMultiOffRamp_executeSingleReport:test_NonExistingSourceChain_Revert() (gas: 37438) +EVM2EVMMultiOffRamp_executeSingleReport:test_ReceiverError_Success() (gas: 181595) +EVM2EVMMultiOffRamp_executeSingleReport:test_RetryFailedMessageWithoutManualExecution_Revert() (gas: 189957) +EVM2EVMMultiOffRamp_executeSingleReport:test_RootNotCommitted_Revert() (gas: 47044) +EVM2EVMMultiOffRamp_executeSingleReport:test_RouterYULCall_Revert() (gas: 434527) +EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessageNoTokensOtherChain_Success() (gas: 248935) +EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessageNoTokensUnordered_Success() (gas: 174421) +EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessageNoTokens_Success() (gas: 193347) +EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessageToNonCCIPReceiver_Success() (gas: 259840) +EVM2EVMMultiOffRamp_executeSingleReport:test_SingleMessagesNoTokensSuccess_gas() (gas: 127020) +EVM2EVMMultiOffRamp_executeSingleReport:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 394980) +EVM2EVMMultiOffRamp_executeSingleReport:test_SkippedIncorrectNonce_Success() (gas: 65861) +EVM2EVMMultiOffRamp_executeSingleReport:test_TokenDataMismatch_Revert() (gas: 80076) +EVM2EVMMultiOffRamp_executeSingleReport:test_TwoMessagesWithTokensAndGE_Success() (gas: 541116) +EVM2EVMMultiOffRamp_executeSingleReport:test_TwoMessagesWithTokensSuccess_gas() (gas: 475488) +EVM2EVMMultiOffRamp_executeSingleReport:test_UnexpectedTokenData_Revert() (gas: 37957) +EVM2EVMMultiOffRamp_executeSingleReport:test_UnhealthySingleChainCurse_Revert() (gas: 526295) +EVM2EVMMultiOffRamp_executeSingleReport:test_Unhealthy_Revert() (gas: 523674) +EVM2EVMMultiOffRamp_executeSingleReport:test_WithCurseOnAnotherSourceChain_Success() (gas: 492610) +EVM2EVMMultiOffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessageUnordered_Success() (gas: 126952) +EVM2EVMMultiOffRamp_executeSingleReport:test_execute_SkippedAlreadyExecutedMessage_Success() (gas: 155518) +EVM2EVMMultiOffRamp_getExecutionState:test_FillExecutionState_Success() (gas: 3667544) +EVM2EVMMultiOffRamp_getExecutionState:test_GetDifferentChainExecutionState_Success() (gas: 118276) +EVM2EVMMultiOffRamp_getExecutionState:test_GetExecutionState_Success() (gas: 87396) +EVM2EVMMultiOffRamp_manuallyExecute:test_ManualExecGasLimitMismatchSingleReport_Revert() (gas: 79283) +EVM2EVMMultiOffRamp_manuallyExecute:test_ManualExecInvalidGasLimit_Revert() (gas: 28601) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_DoesNotRevertIfUntouched_Success() (gas: 163512) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_FailedTx_Revert() (gas: 207222) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_ForkedChain_Revert() (gas: 28130) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_GasLimitMismatchMultipleReports_Revert() (gas: 158903) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_LowGasLimit_Success() (gas: 505081) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_ReentrancyFails() (gas: 2379173) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_Success() (gas: 209279) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride_Success() (gas: 209853) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_WithMultiReportGasOverride_Success() (gas: 664710) +EVM2EVMMultiOffRamp_manuallyExecute:test_manuallyExecute_WithPartialMessages_Success() (gas: 297865) +EVM2EVMMultiOffRamp_metadataHash:test_MetadataHashChangesOnOnRampAddress_Success() (gas: 10995) +EVM2EVMMultiOffRamp_metadataHash:test_MetadataHashChangesOnSourceChain_Success() (gas: 11041) +EVM2EVMMultiOffRamp_metadataHash:test_MetadataHash_Success() (gas: 9141) +EVM2EVMMultiOffRamp_releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 165102) +EVM2EVMMultiOffRamp_releaseOrMintTokens:test__releaseOrMintTokens_PoolIsNotAPool_Reverts() (gas: 26890) +EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() (gas: 63495) +EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidEVMAddress_Revert() (gas: 44612) +EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_PoolDoesNotSupportDest_Reverts() (gas: 80519) +EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 185299) +EVM2EVMMultiOffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 283897) EVM2EVMMultiOffRamp_resetUnblessedRoots:test_OnlyOwner_Revert() (gas: 11420) -EVM2EVMMultiOffRamp_resetUnblessedRoots:test_ResetUnblessedRoots_Success() (gas: 215133) +EVM2EVMMultiOffRamp_resetUnblessedRoots:test_ResetUnblessedRoots_Success() (gas: 215214) EVM2EVMMultiOffRamp_setDynamicConfig:test_NonOwner_Revert() (gas: 14223) EVM2EVMMultiOffRamp_setDynamicConfig:test_PriceRegistryZeroAddress_Revert() (gas: 11729) EVM2EVMMultiOffRamp_setDynamicConfig:test_RouterZeroAddress_Revert() (gas: 13885) -EVM2EVMMultiOffRamp_setDynamicConfig:test_SetDynamicConfigWithValidator_Success() (gas: 55589) -EVM2EVMMultiOffRamp_setDynamicConfig:test_SetDynamicConfig_Success() (gas: 33599) -EVM2EVMMultiOffRamp_trialExecute:test_RateLimitError_Success() (gas: 243734) -EVM2EVMMultiOffRamp_trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 252391) -EVM2EVMMultiOffRamp_trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 306560) -EVM2EVMMultiOffRamp_trialExecute:test_trialExecute_Success() (gas: 285807) -EVM2EVMMultiOffRamp_verify:test_Blessed_Success() (gas: 176503) -EVM2EVMMultiOffRamp_verify:test_NotBlessedWrongChainSelector_Success() (gas: 178574) -EVM2EVMMultiOffRamp_verify:test_NotBlessed_Success() (gas: 141432) -EVM2EVMMultiOffRamp_verify:test_TooManyLeaves_Revert() (gas: 51501) +EVM2EVMMultiOffRamp_setDynamicConfig:test_SetDynamicConfigWithValidator_Success() (gas: 55563) +EVM2EVMMultiOffRamp_setDynamicConfig:test_SetDynamicConfig_Success() (gas: 33573) +EVM2EVMMultiOffRamp_trialExecute:test_RateLimitError_Success() (gas: 243560) +EVM2EVMMultiOffRamp_trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 252217) +EVM2EVMMultiOffRamp_trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 306038) +EVM2EVMMultiOffRamp_trialExecute:test_trialExecute_Success() (gas: 285633) +EVM2EVMMultiOffRamp_verify:test_Blessed_Success() (gas: 176524) +EVM2EVMMultiOffRamp_verify:test_NotBlessedWrongChainSelector_Success() (gas: 178595) +EVM2EVMMultiOffRamp_verify:test_NotBlessed_Success() (gas: 141456) +EVM2EVMMultiOffRamp_verify:test_TooManyLeaves_Revert() (gas: 51507) EVM2EVMMultiOnRamp_applyDestChainConfigUpdates:test_InvalidDestBytesOverhead_Revert() (gas: 33833) EVM2EVMMultiOnRamp_applyDestChainConfigUpdates:test_InvalidDestChainConfigDestChainSelectorEqZero_Revert() (gas: 16646) EVM2EVMMultiOnRamp_applyDestChainConfigUpdates:test_InvalidDestChainConfigNewPrevOnRampOnExistingChain_Revert() (gas: 30796) @@ -273,15 +265,15 @@ EVM2EVMMultiOnRamp_constructor:test_Constructor_InvalidConfigLinkTokenEqAddressZ EVM2EVMMultiOnRamp_constructor:test_Constructor_InvalidConfigNonceManagerEqAddressZero_Revert() (gas: 140293) EVM2EVMMultiOnRamp_constructor:test_Constructor_InvalidConfigRMNProxyEqAddressZero_Revert() (gas: 145314) EVM2EVMMultiOnRamp_constructor:test_Constructor_InvalidConfigTokenAdminRegistryEqAddressZero_Revert() (gas: 140360) -EVM2EVMMultiOnRamp_constructor:test_Constructor_Success() (gas: 4895426) -EVM2EVMMultiOnRamp_forwardFromRouter:test_CannotSendZeroTokens_Revert() (gas: 96383) +EVM2EVMMultiOnRamp_constructor:test_Constructor_Success() (gas: 4895404) +EVM2EVMMultiOnRamp_forwardFromRouter:test_CannotSendZeroTokens_Revert() (gas: 96382) EVM2EVMMultiOnRamp_forwardFromRouter:test_EnforceOutOfOrder_Revert() (gas: 102566) EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue_Success() (gas: 125845) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2_Success() (gas: 156592) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 156103) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 156333) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 156358) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouter_Success() (gas: 155803) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2_Success() (gas: 156591) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 156102) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 156332) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 156357) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ForwardFromRouter_Success() (gas: 155802) EVM2EVMMultiOnRamp_forwardFromRouter:test_InvalidAddressEncodePacked_Revert() (gas: 35086) EVM2EVMMultiOnRamp_forwardFromRouter:test_InvalidAddress_Revert() (gas: 35347) EVM2EVMMultiOnRamp_forwardFromRouter:test_InvalidChainSelector_Revert() (gas: 27934) @@ -293,17 +285,17 @@ EVM2EVMMultiOnRamp_forwardFromRouter:test_MesssageFeeTooHigh_Revert() (gas: 3412 EVM2EVMMultiOnRamp_forwardFromRouter:test_OriginalSender_Revert() (gas: 23037) EVM2EVMMultiOnRamp_forwardFromRouter:test_Paused_Revert() (gas: 41465) EVM2EVMMultiOnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 25882) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 204830) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 231106) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 142549) -EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 169490) -EVM2EVMMultiOnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3778770) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 204962) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 231235) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 142548) +EVM2EVMMultiOnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 169489) +EVM2EVMMultiOnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3778765) EVM2EVMMultiOnRamp_forwardFromRouter:test_TooManyTokens_Revert() (gas: 32857) EVM2EVMMultiOnRamp_forwardFromRouter:test_Unhealthy_Revert() (gas: 44213) -EVM2EVMMultiOnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 135416) +EVM2EVMMultiOnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 135415) EVM2EVMMultiOnRamp_forwardFromRouter:test_ZeroAddressReceiver_Revert() (gas: 281847) -EVM2EVMMultiOnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 98477) -EVM2EVMMultiOnRamp_forwardFromRouter:test_forwardFromRouter_WithValidation_Success() (gas: 274980) +EVM2EVMMultiOnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 98476) +EVM2EVMMultiOnRamp_forwardFromRouter:test_forwardFromRouter_WithValidation_Success() (gas: 274979) EVM2EVMMultiOnRamp_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost_Success() (gas: 124845) EVM2EVMMultiOnRamp_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector_Success() (gas: 11969) EVM2EVMMultiOnRamp_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost_Success() (gas: 24662) @@ -650,16 +642,28 @@ MultiOCR3Base_transmit:test_UnAuthorizedTransmitter_Revert() (gas: 24191) MultiOCR3Base_transmit:test_UnauthorizedSigner_Revert() (gas: 61409) MultiOCR3Base_transmit:test_UnconfiguredPlugin_Revert() (gas: 39890) MultiOCR3Base_transmit:test_ZeroSignatures_Revert() (gas: 32973) -MultiRampsE2E:test_E2E_3MessagesSuccess_gas() (gas: 1411191) -NonceManagerTest_getIncrementedOutboundNonce:test_getIncrementedOutboundNonce_Success() (gas: 40392) -NonceManager_applyPreviousRampsUpdates:test_MultipleRampsUpdates() (gas: 68922) -NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySetOnRamp_Revert() (gas: 38712) -NonceManager_applyPreviousRampsUpdates:test_SingleRampUpdate() (gas: 39539) -NonceManager_applyPreviousRampsUpdates:test_ZeroInput() (gas: 12007) -NonceManager_onRampUpgrade:test_UpgradeNonceNewSenderStartsAtZero_Success() (gas: 173338) -NonceManager_onRampUpgrade:test_UpgradeNonceStartsAtV1Nonce_Success() (gas: 217286) -NonceManager_onRampUpgrade:test_UpgradeSenderNoncesReadsPreviousRamp_Success() (gas: 125619) -NonceManager_onRampUpgrade:test_Upgrade_Success() (gas: 120819) +MultiRampsE2E:test_E2E_3MessagesSuccess_gas() (gas: 1424394) +NonceManager_NonceIncrementation:test_getIncrementedOutboundNonce_Success() (gas: 37907) +NonceManager_NonceIncrementation:test_incrementInboundNonce_Skip() (gas: 23694) +NonceManager_NonceIncrementation:test_incrementInboundNonce_Success() (gas: 38763) +NonceManager_NonceIncrementation:test_incrementNoncesInboundAndOutbound_Success() (gas: 71847) +NonceManager_OffRampUpgrade:test_NoPrevOffRampForChain_Success() (gas: 251109) +NonceManager_OffRampUpgrade:test_UpgradedNonceNewSenderStartsAtZero_Success() (gas: 250287) +NonceManager_OffRampUpgrade:test_UpgradedNonceStartsAtV1Nonce_Success() (gas: 303526) +NonceManager_OffRampUpgrade:test_UpgradedOffRampNonceSkipsIfMsgInFlight_Success() (gas: 286447) +NonceManager_OffRampUpgrade:test_UpgradedSenderNoncesReadsPreviousRampTransitive_Success() (gas: 250490) +NonceManager_OffRampUpgrade:test_UpgradedSenderNoncesReadsPreviousRamp_Success() (gas: 238465) +NonceManager_OffRampUpgrade:test_Upgraded_Success() (gas: 144101) +NonceManager_OnRampUpgrade:test_UpgradeNonceNewSenderStartsAtZero_Success() (gas: 173337) +NonceManager_OnRampUpgrade:test_UpgradeNonceStartsAtV1Nonce_Success() (gas: 217372) +NonceManager_OnRampUpgrade:test_UpgradeSenderNoncesReadsPreviousRamp_Success() (gas: 125707) +NonceManager_OnRampUpgrade:test_Upgrade_Success() (gas: 120818) +NonceManager_applyPreviousRampsUpdates:test_MultipleRampsUpdates() (gas: 122899) +NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySetOffRamp_Revert() (gas: 42959) +NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySetOnRampAndOffRamp_Revert() (gas: 64282) +NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySetOnRamp_Revert() (gas: 42823) +NonceManager_applyPreviousRampsUpdates:test_SingleRampUpdate() (gas: 66548) +NonceManager_applyPreviousRampsUpdates:test_ZeroInput() (gas: 12025) OCR2BaseNoChecks_setOCR2Config:test_FMustBePositive_Revert() (gas: 12171) OCR2BaseNoChecks_setOCR2Config:test_RepeatAddress_Revert() (gas: 42233) OCR2BaseNoChecks_setOCR2Config:test_SetConfigSuccess_gas() (gas: 84124) diff --git a/contracts/scripts/native_solc_compile_all_ccip b/contracts/scripts/native_solc_compile_all_ccip index 63ffdca7f6..b00071c9b3 100755 --- a/contracts/scripts/native_solc_compile_all_ccip +++ b/contracts/scripts/native_solc_compile_all_ccip @@ -76,6 +76,7 @@ compileContract ccip/ARMProxy.sol compileContract ccip/tokenAdminRegistry/TokenAdminRegistry.sol compileContract ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol compileContract ccip/capability/CCIPConfig.sol +compileContract ccip/capability/interfaces/IOCR3ConfigEncoder.sol # Test helpers compileContract ccip/test/helpers/BurnMintERC677Helper.sol diff --git a/contracts/src/v0.8/ccip/NonceManager.sol b/contracts/src/v0.8/ccip/NonceManager.sol index 96e5fd03e4..2cfcbbe9e2 100644 --- a/contracts/src/v0.8/ccip/NonceManager.sol +++ b/contracts/src/v0.8/ccip/NonceManager.sol @@ -11,12 +11,13 @@ import {AuthorizedCallers} from "../shared/access/AuthorizedCallers.sol"; contract NonceManager is INonceManager, AuthorizedCallers { error PreviousRampAlreadySet(); - event PreviousOnRampUpdated(uint64 indexed destChainSelector, address prevOnRamp); + event PreviousRampsUpdated(uint64 indexed remoteChainSelector, PreviousRamps prevRamp); + event SkippedIncorrectNonce(uint64 sourceChainSelector, uint64 nonce, bytes sender); /// @dev Struct that contains the previous on/off ramp addresses - // TODO: add prevOffRamp struct PreviousRamps { address prevOnRamp; // Previous onRamp + address prevOffRamp; // Previous offRamp } /// @dev Struct that contains the chain selector and the previous on/off ramps, same as PreviousRamps but with the chain selector @@ -30,6 +31,10 @@ contract NonceManager is INonceManager, AuthorizedCallers { mapping(uint64 chainSelector => PreviousRamps previousRamps) private s_previousRamps; /// @dev The current outbound nonce per sender used on the onramp mapping(uint64 destChainSelector => mapping(address sender => uint64 outboundNonce)) private s_outboundNonces; + /// @dev The current inbound nonce per sender used on the offramp + /// Eventually in sync with the outbound nonce in the remote source chain NonceManager, used to enforce that messages are + /// executed in the same order they are sent (assuming they are DON) + mapping(uint64 sourceChainSelector => mapping(bytes sender => uint64 inboundNonce)) private s_inboundNonces; constructor(address[] memory authorizedCallers) AuthorizedCallers(authorizedCallers) {} @@ -44,9 +49,7 @@ contract NonceManager is INonceManager, AuthorizedCallers { return outboundNonce; } - /// TODO: add incrementInboundNonce - - /// @notice Returns the outbound nonce for the given sender on the given destination chain + /// @notice Returns the outbound nonce for a given sender on a given destination chain /// @param destChainSelector The destination chain selector /// @param sender The sender address /// @return The outbound nonce @@ -57,6 +60,8 @@ contract NonceManager is INonceManager, AuthorizedCallers { function _getOutboundNonce(uint64 destChainSelector, address sender) private view returns (uint64) { uint64 outboundNonce = s_outboundNonces[destChainSelector][sender]; + // When introducing the NonceManager with existing lanes, we still want to have sequential nonces. + // Referencing the old onRamp preserves sequencing between updates. if (outboundNonce == 0) { address prevOnRamp = s_previousRamps[destChainSelector].prevOnRamp; if (prevOnRamp != address(0)) { @@ -67,7 +72,51 @@ contract NonceManager is INonceManager, AuthorizedCallers { return outboundNonce; } - /// TODO: add getInboundNonce + /// @inheritdoc INonceManager + function incrementInboundNonce( + uint64 sourceChainSelector, + uint64 expectedNonce, + bytes calldata sender + ) external onlyAuthorizedCallers returns (bool) { + uint64 inboundNonce = _getInboundNonce(sourceChainSelector, sender) + 1; + + if (inboundNonce != expectedNonce) { + // If the nonce is not the expected one, this means that there are still messages in flight so we skip + // the nonce increment + emit SkippedIncorrectNonce(sourceChainSelector, expectedNonce, sender); + return false; + } + + s_inboundNonces[sourceChainSelector][sender] = inboundNonce; + + return true; + } + + /// @notice Returns the inbound nonce for a given sender on a given source chain + /// @param sourceChainSelector The source chain selector + /// @param sender The encoded sender address + /// @return The inbound nonce + function getInboundNonce(uint64 sourceChainSelector, bytes calldata sender) external view returns (uint64) { + return _getInboundNonce(sourceChainSelector, sender); + } + + function _getInboundNonce(uint64 sourceChainSelector, bytes calldata sender) private view returns (uint64) { + uint64 inboundNonce = s_inboundNonces[sourceChainSelector][sender]; + + // When introducing the NonceManager with existing lanes, we still want to have sequential nonces. + // Referencing the old offRamp to check the expected nonce if none is set for a + // given sender allows us to skip the current message in the current offRamp if it would not be the next according + // to the old offRamp. This preserves sequencing between updates. + if (inboundNonce == 0) { + address prevOffRamp = s_previousRamps[sourceChainSelector].prevOffRamp; + if (prevOffRamp != address(0)) { + // We only expect EVM previous offRamps here so we can safely decode the sender + return IEVM2AnyOnRamp(prevOffRamp).getSenderNonce(abi.decode(sender, (address))); + } + } + + return inboundNonce; + } /// @notice Updates the previous ramps addresses /// @param previousRampsArgs The previous on/off ramps addresses @@ -77,13 +126,15 @@ contract NonceManager is INonceManager, AuthorizedCallers { PreviousRamps storage prevRamps = s_previousRamps[previousRampsArg.remoteChainSelector]; - // If the previous onRamp is already set then it should not be updated - if (prevRamps.prevOnRamp != address(0)) { + // If the previous ramps are already set then they should not be updated + if (prevRamps.prevOnRamp != address(0) || prevRamps.prevOffRamp != address(0)) { revert PreviousRampAlreadySet(); } prevRamps.prevOnRamp = previousRampsArg.prevRamps.prevOnRamp; - emit PreviousOnRampUpdated(previousRampsArg.remoteChainSelector, prevRamps.prevOnRamp); + prevRamps.prevOffRamp = previousRampsArg.prevRamps.prevOffRamp; + + emit PreviousRampsUpdated(previousRampsArg.remoteChainSelector, previousRampsArg.prevRamps); } } diff --git a/contracts/src/v0.8/ccip/capability/CCIPConfig.sol b/contracts/src/v0.8/ccip/capability/CCIPConfig.sol index 5ae82fe900..795db0c3e4 100644 --- a/contracts/src/v0.8/ccip/capability/CCIPConfig.sol +++ b/contracts/src/v0.8/ccip/capability/CCIPConfig.sol @@ -7,6 +7,9 @@ import {ICapabilitiesRegistry} from "./interfaces/ICapabilitiesRegistry.sol"; import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; +import {Internal} from "../libraries/Internal.sol"; +import {CCIPConfigTypes} from "./libraries/CCIPConfigTypes.sol"; + import {IERC165} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/interfaces/IERC165.sol"; import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/structs/EnumerableSet.sol"; @@ -21,7 +24,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @notice Emitted when a chain's configuration is set. /// @param chainSelector The chain selector. /// @param chainConfig The chain configuration. - event ChainConfigSet(uint64 chainSelector, ChainConfig chainConfig); + event ChainConfigSet(uint64 chainSelector, CCIPConfigTypes.ChainConfig chainConfig); /// @notice Emitted when a chain's configuration is removed. /// @param chainSelector The chain selector. @@ -44,70 +47,14 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator error InvalidPluginType(); error OfframpAddressCannotBeZero(); error InvalidConfigLength(uint256 length); - error InvalidConfigStateTransition(ConfigState currentState, ConfigState proposedState); + error InvalidConfigStateTransition( + CCIPConfigTypes.ConfigState currentState, CCIPConfigTypes.ConfigState proposedState + ); error NonExistentConfigTransition(); error WrongConfigCount(uint64 got, uint64 expected); error WrongConfigDigest(bytes32 got, bytes32 expected); error WrongConfigDigestBlueGreen(bytes32 got, bytes32 expected); - /// @notice PluginType indicates the type of plugin that the configuration is for. - /// @param Commit The configuration is for the commit plugin. - /// @param Execution The configuration is for the execution plugin. - enum PluginType { - Commit, - Execution - } - - /// @notice ConfigState indicates the state of the configuration. - /// A DON's configuration always starts out in the "Init" state - this is the starting state. - /// The only valid transition from "Init" is to the "Running" state - this is the first ever configuration. - /// The only valid transition from "Running" is to the "Staging" state - this is a blue/green proposal. - /// The only valid transition from "Staging" is back to the "Running" state - this is a promotion. - /// TODO: explain rollbacks? - enum ConfigState { - Init, - Running, - Staging - } - - /// @notice Chain configuration. - /// Changes to chain configuration are detected out-of-band in plugins and decoded offchain. - struct ChainConfig { - bytes32[] readers; // The P2P IDs of the readers for the chain. These IDs must be registered in the capabilities registry. - uint8 fChain; // The fault tolerance parameter of the chain. - bytes config; // The chain configuration. This is kept intentionally opaque so as to add fields in the future if needed. - } - - /// @notice Chain configuration information struct used in applyChainConfigUpdates and getAllChainConfigs. - struct ChainConfigInfo { - uint64 chainSelector; - ChainConfig chainConfig; - } - - /// @notice OCR3 configuration. - struct OCR3Config { - PluginType pluginType; // ────────╮ The plugin that the configuration is for. - uint64 chainSelector; // | The (remote) chain that the configuration is for. - uint8 F; // | The "big F" parameter for the role DON. - uint64 offchainConfigVersion; // ─╯ The version of the offchain configuration. - bytes offrampAddress; // The remote chain offramp address. - bytes32[] bootstrapP2PIds; // The bootstrap P2P IDs of the oracles that are part of the role DON. - // len(p2pIds) == len(signers) == len(transmitters) == 3 * F + 1 - // NOTE: indexes matter here! The p2p ID at index i corresponds to the signer at index i and the transmitter at index i. - // This is crucial in order to build the oracle ID <-> peer ID mapping offchain. - bytes32[] p2pIds; // The P2P IDs of the oracles that are part of the role DON. - bytes[] signers; // The onchain signing keys of nodes in the don. - bytes[] transmitters; // The onchain transmitter keys of nodes in the don. - bytes offchainConfig; // The offchain configuration for the OCR3 protocol. Protobuf encoded. - } - - /// @notice OCR3 configuration with metadata, specifically the config count and the config digest. - struct OCR3ConfigWithMeta { - OCR3Config config; // The OCR3 configuration. - uint64 configCount; // The config count used to compute the config digest. - bytes32 configDigest; // The config digest of the OCR3 configuration. - } - /// @notice Type and version override. string public constant override typeAndVersion = "CCIPConfig 1.6.0-dev"; @@ -115,7 +62,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator address internal immutable i_capabilitiesRegistry; /// @notice chain configuration for each chain that CCIP is deployed on. - mapping(uint64 chainSelector => ChainConfig chainConfig) internal s_chainConfigurations; + mapping(uint64 chainSelector => CCIPConfigTypes.ChainConfig chainConfig) internal s_chainConfigurations; /// @notice All chains that are configured. EnumerableSet.UintSet internal s_remoteChainSelectors; @@ -123,7 +70,9 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @notice OCR3 configurations for each DON. /// Each CR DON will have a commit and execution configuration. /// This means that a DON can have up to 4 configurations, since we are implementing blue/green deployments. - mapping(uint32 donId => mapping(PluginType pluginType => OCR3ConfigWithMeta[] ocr3Configs)) internal s_ocr3Configs; + mapping( + uint32 donId => mapping(Internal.OCRPluginType pluginType => CCIPConfigTypes.OCR3ConfigWithMeta[] ocr3Configs) + ) internal s_ocr3Configs; /// @notice The DONs that have been configured. EnumerableSet.UintSet internal s_donIds; @@ -149,13 +98,16 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @notice Returns all the chain configurations. /// @return The chain configurations. // TODO: will this eventually hit the RPC max response size limit? - function getAllChainConfigs() external view returns (ChainConfigInfo[] memory) { + function getAllChainConfigs() external view returns (CCIPConfigTypes.ChainConfigInfo[] memory) { uint256[] memory chainSelectors = s_remoteChainSelectors.values(); - ChainConfigInfo[] memory chainConfigs = new ChainConfigInfo[](s_remoteChainSelectors.length()); + CCIPConfigTypes.ChainConfigInfo[] memory chainConfigs = + new CCIPConfigTypes.ChainConfigInfo[](s_remoteChainSelectors.length()); for (uint256 i = 0; i < chainSelectors.length; ++i) { uint64 chainSelector = uint64(chainSelectors[i]); - chainConfigs[i] = - ChainConfigInfo({chainSelector: chainSelector, chainConfig: s_chainConfigurations[chainSelector]}); + chainConfigs[i] = CCIPConfigTypes.ChainConfigInfo({ + chainSelector: chainSelector, + chainConfig: s_chainConfigurations[chainSelector] + }); } return chainConfigs; } @@ -164,7 +116,10 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @param donId The DON ID. /// @param pluginType The plugin type. /// @return The OCR3 configurations, up to 2 (blue and green). - function getOCRConfig(uint32 donId, PluginType pluginType) external view returns (OCR3ConfigWithMeta[] memory) { + function getOCRConfig( + uint32 donId, + Internal.OCRPluginType pluginType + ) external view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { return s_ocr3Configs[donId][pluginType]; } @@ -190,27 +145,32 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator revert OnlyCapabilitiesRegistryCanCall(); } - OCR3Config[] memory ocr3Configs = abi.decode(config, (OCR3Config[])); - (OCR3Config[] memory commitConfigs, OCR3Config[] memory execConfigs) = _groupByPluginType(ocr3Configs); + CCIPConfigTypes.OCR3Config[] memory ocr3Configs = abi.decode(config, (CCIPConfigTypes.OCR3Config[])); + (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.OCR3Config[] memory execConfigs) = + _groupByPluginType(ocr3Configs); if (commitConfigs.length > 0) { - _updatePluginConfig(donId, PluginType.Commit, commitConfigs); + _updatePluginConfig(donId, Internal.OCRPluginType.Commit, commitConfigs); } if (execConfigs.length > 0) { - _updatePluginConfig(donId, PluginType.Execution, execConfigs); + _updatePluginConfig(donId, Internal.OCRPluginType.Execution, execConfigs); } } - function _updatePluginConfig(uint32 donId, PluginType pluginType, OCR3Config[] memory newConfig) internal { - OCR3ConfigWithMeta[] memory currentConfig = s_ocr3Configs[donId][pluginType]; + function _updatePluginConfig( + uint32 donId, + Internal.OCRPluginType pluginType, + CCIPConfigTypes.OCR3Config[] memory newConfig + ) internal { + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = s_ocr3Configs[donId][pluginType]; // Validate the state transition being proposed, which is implicitly defined by the combination // of lengths of the current and new configurations. - ConfigState currentState = _stateFromConfigLength(currentConfig.length); - ConfigState proposedState = _stateFromConfigLength(newConfig.length); + CCIPConfigTypes.ConfigState currentState = _stateFromConfigLength(currentConfig.length); + CCIPConfigTypes.ConfigState proposedState = _stateFromConfigLength(newConfig.length); _validateConfigStateTransition(currentState, proposedState); // Build the new configuration with metadata and validate that the transition is valid. - OCR3ConfigWithMeta[] memory newConfigWithMeta = + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, proposedState); _validateConfigTransition(currentConfig, newConfigWithMeta); @@ -229,11 +189,11 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @notice Determine the config state of the configuration from the length of the config. /// @param configLen The length of the configuration. /// @return The config state. - function _stateFromConfigLength(uint256 configLen) internal pure returns (ConfigState) { + function _stateFromConfigLength(uint256 configLen) internal pure returns (CCIPConfigTypes.ConfigState) { if (configLen > 2) { revert InvalidConfigLength(configLen); } - return ConfigState(configLen); + return CCIPConfigTypes.ConfigState(configLen); } // the only valid state transitions are the following: @@ -241,7 +201,10 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator // running -> staging (blue/green proposal) // staging -> running (promotion) // everything else is invalid and should revert. - function _validateConfigStateTransition(ConfigState currentState, ConfigState newState) internal pure { + function _validateConfigStateTransition( + CCIPConfigTypes.ConfigState currentState, + CCIPConfigTypes.ConfigState newState + ) internal pure { // Calculate the difference between the new state and the current state int256 stateDiff = int256(uint256(newState)) - int256(uint256(currentState)); @@ -250,15 +213,15 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator // 1. currentState -> newState (where stateDiff == 1) // e.g., init -> running or running -> staging // 2. staging -> running (where stateDiff == -1) - if (stateDiff == 1 || (stateDiff == -1 && currentState == ConfigState.Staging)) { + if (stateDiff == 1 || (stateDiff == -1 && currentState == CCIPConfigTypes.ConfigState.Staging)) { return; } revert InvalidConfigStateTransition(currentState, newState); } function _validateConfigTransition( - OCR3ConfigWithMeta[] memory currentConfig, - OCR3ConfigWithMeta[] memory newConfigWithMeta + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta ) internal pure { uint256 currentConfigLen = currentConfig.length; uint256 newConfigLen = newConfigWithMeta.length; @@ -303,35 +266,36 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @return The new configuration with metadata. function _computeNewConfigWithMeta( uint32 donId, - OCR3ConfigWithMeta[] memory currentConfig, - OCR3Config[] memory newConfig, - ConfigState currentState, - ConfigState newState - ) internal view returns (OCR3ConfigWithMeta[] memory) { + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, + CCIPConfigTypes.OCR3Config[] memory newConfig, + CCIPConfigTypes.ConfigState currentState, + CCIPConfigTypes.ConfigState newState + ) internal view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { uint64[] memory configCounts = new uint64[](newConfig.length); // Set config counts based on the only valid state transitions. // Init -> Running (first ever config) // Running -> Staging (blue/green proposal) // Staging -> Running (promotion) - if (currentState == ConfigState.Init && newState == ConfigState.Running) { + if (currentState == CCIPConfigTypes.ConfigState.Init && newState == CCIPConfigTypes.ConfigState.Running) { // First ever config starts with config count == 1. configCounts[0] = 1; - } else if (currentState == ConfigState.Running && newState == ConfigState.Staging) { + } else if (currentState == CCIPConfigTypes.ConfigState.Running && newState == CCIPConfigTypes.ConfigState.Staging) { // On a blue/green proposal, the config count of the green config is the blue config count + 1. configCounts[0] = currentConfig[0].configCount; configCounts[1] = currentConfig[0].configCount + 1; - } else if (currentState == ConfigState.Staging && newState == ConfigState.Running) { + } else if (currentState == CCIPConfigTypes.ConfigState.Staging && newState == CCIPConfigTypes.ConfigState.Running) { // On a promotion, the config count of the green config becomes the blue config count. configCounts[0] = currentConfig[1].configCount; } else { revert InvalidConfigStateTransition(currentState, newState); } - OCR3ConfigWithMeta[] memory newConfigWithMeta = new OCR3ConfigWithMeta[](newConfig.length); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = + new CCIPConfigTypes.OCR3ConfigWithMeta[](newConfig.length); for (uint256 i = 0; i < configCounts.length; ++i) { _validateConfig(newConfig[i]); - newConfigWithMeta[i] = OCR3ConfigWithMeta({ + newConfigWithMeta[i] = CCIPConfigTypes.OCR3ConfigWithMeta({ config: newConfig[i], configCount: configCounts[i], configDigest: _computeConfigDigest(donId, configCounts[i], newConfig[i]) @@ -343,10 +307,10 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @notice Group the OCR3 configurations by plugin type for further processing. /// @param ocr3Configs The OCR3 configurations to group. - function _groupByPluginType(OCR3Config[] memory ocr3Configs) + function _groupByPluginType(CCIPConfigTypes.OCR3Config[] memory ocr3Configs) internal pure - returns (OCR3Config[] memory commitConfigs, OCR3Config[] memory execConfigs) + returns (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.OCR3Config[] memory execConfigs) { if (ocr3Configs.length > MAX_OCR3_CONFIGS_PER_DON) { revert TooManyOCR3Configs(); @@ -356,12 +320,12 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator // If we have less we will adjust the length later using mstore. // If the caller provides more than 2 configs per plugin type, we will revert due to out of bounds // access in the for loop below. - commitConfigs = new OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); - execConfigs = new OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); + commitConfigs = new CCIPConfigTypes.OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); + execConfigs = new CCIPConfigTypes.OCR3Config[](MAX_OCR3_CONFIGS_PER_PLUGIN); uint256 commitCount; uint256 execCount; for (uint256 i = 0; i < ocr3Configs.length; ++i) { - if (ocr3Configs[i].pluginType == PluginType.Commit) { + if (ocr3Configs[i].pluginType == Internal.OCRPluginType.Commit) { commitConfigs[commitCount] = ocr3Configs[i]; ++commitCount; } else { @@ -379,9 +343,11 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator return (commitConfigs, execConfigs); } - function _validateConfig(OCR3Config memory cfg) internal view { + function _validateConfig(CCIPConfigTypes.OCR3Config memory cfg) internal view { if (cfg.chainSelector == 0) revert ChainSelectorNotSet(); - if (cfg.pluginType != PluginType.Commit && cfg.pluginType != PluginType.Execution) revert InvalidPluginType(); + if (cfg.pluginType != Internal.OCRPluginType.Commit && cfg.pluginType != Internal.OCRPluginType.Execution) { + revert InvalidPluginType(); + } // TODO: can we do more sophisticated validation than this? if (cfg.offrampAddress.length == 0) revert OfframpAddressCannotBeZero(); if (!s_remoteChainSelectors.contains(cfg.chainSelector)) revert ChainSelectorNotFound(cfg.chainSelector); @@ -424,7 +390,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator function _computeConfigDigest( uint32 donId, uint64 configCount, - OCR3Config memory ocr3Config + CCIPConfigTypes.OCR3Config memory ocr3Config ) internal pure returns (bytes32) { uint256 h = uint256( keccak256( @@ -458,7 +424,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator /// @param chainConfigAdds The chain configurations to add. function applyChainConfigUpdates( uint64[] calldata chainSelectorRemoves, - ChainConfigInfo[] calldata chainConfigAdds + CCIPConfigTypes.ChainConfigInfo[] calldata chainConfigAdds ) external onlyOwner { // Process removals first. for (uint256 i = 0; i < chainSelectorRemoves.length; ++i) { @@ -475,7 +441,7 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator // Process additions next. for (uint256 i = 0; i < chainConfigAdds.length; ++i) { - ChainConfig memory chainConfig = chainConfigAdds[i].chainConfig; + CCIPConfigTypes.ChainConfig memory chainConfig = chainConfigAdds[i].chainConfig; bytes32[] memory readers = chainConfig.readers; uint64 chainSelector = chainConfigAdds[i].chainSelector; diff --git a/contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol b/contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol index 5e3c2c4e8d..621c3686cf 100644 --- a/contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol +++ b/contracts/src/v0.8/ccip/capability/interfaces/ICapabilitiesRegistry.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.24; interface ICapabilitiesRegistry { diff --git a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol b/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol new file mode 100644 index 0000000000..6d0b0f72a5 --- /dev/null +++ b/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {CCIPConfigTypes} from "../libraries/CCIPConfigTypes.sol"; + +/// @dev This is so that we can generate gethwrappers and easily encode/decode OCR3Config +/// in the offchain integration tests. +interface IOCR3ConfigEncoder { + /// @dev Encodes an array of OCR3Config into a bytes array. For test usage only. + function exposeOCR3Config(CCIPConfigTypes.OCR3Config[] calldata config) external view returns (bytes memory); +} diff --git a/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol b/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol new file mode 100644 index 0000000000..5f052b3509 --- /dev/null +++ b/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {Internal} from "../../libraries/Internal.sol"; + +library CCIPConfigTypes { + /// @notice ConfigState indicates the state of the configuration. + /// A DON's configuration always starts out in the "Init" state - this is the starting state. + /// The only valid transition from "Init" is to the "Running" state - this is the first ever configuration. + /// The only valid transition from "Running" is to the "Staging" state - this is a blue/green proposal. + /// The only valid transition from "Staging" is back to the "Running" state - this is a promotion. + /// TODO: explain rollbacks? + enum ConfigState { + Init, + Running, + Staging + } + + /// @notice Chain configuration. + /// Changes to chain configuration are detected out-of-band in plugins and decoded offchain. + struct ChainConfig { + bytes32[] readers; // The P2P IDs of the readers for the chain. These IDs must be registered in the capabilities registry. + uint8 fChain; // The fault tolerance parameter of the chain. + bytes config; // The chain configuration. This is kept intentionally opaque so as to add fields in the future if needed. + } + + /// @notice Chain configuration information struct used in applyChainConfigUpdates and getAllChainConfigs. + struct ChainConfigInfo { + uint64 chainSelector; + ChainConfig chainConfig; + } + + /// @notice OCR3 configuration. + struct OCR3Config { + Internal.OCRPluginType pluginType; // ────────╮ The plugin that the configuration is for. + uint64 chainSelector; // | The (remote) chain that the configuration is for. + uint8 F; // | The "big F" parameter for the role DON. + uint64 offchainConfigVersion; // ─────────────╯ The version of the offchain configuration. + bytes offrampAddress; // The remote chain offramp address. + bytes32[] bootstrapP2PIds; // The bootstrap P2P IDs of the oracles that are part of the role DON. + // len(p2pIds) == len(signers) == len(transmitters) == 3 * F + 1 + // NOTE: indexes matter here! The p2p ID at index i corresponds to the signer at index i and the transmitter at index i. + // This is crucial in order to build the oracle ID <-> peer ID mapping offchain. + bytes32[] p2pIds; // The P2P IDs of the oracles that are part of the role DON. + bytes[] signers; // The onchain signing keys of nodes in the don. + bytes[] transmitters; // The onchain transmitter keys of nodes in the don. + bytes offchainConfig; // The offchain configuration for the OCR3 protocol. Protobuf encoded. + } + + /// @notice OCR3 configuration with metadata, specifically the config count and the config digest. + struct OCR3ConfigWithMeta { + OCR3Config config; // The OCR3 configuration. + uint64 configCount; // The config count used to compute the config digest. + bytes32 configDigest; // The config digest of the OCR3 configuration. + } +} diff --git a/contracts/src/v0.8/ccip/interfaces/IAny2EVMMultiOffRamp.sol b/contracts/src/v0.8/ccip/interfaces/IAny2EVMMultiOffRamp.sol deleted file mode 100644 index 484bd9c52c..0000000000 --- a/contracts/src/v0.8/ccip/interfaces/IAny2EVMMultiOffRamp.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -interface IAny2EVMMultiOffRamp { - /// @notice Returns the the current nonce for a receiver. - /// @param sourceChainSelector The source chain to retrieve the nonce for - /// @param sender The sender address - /// @return nonce The nonce value belonging to the sender address. - function getSenderNonce(uint64 sourceChainSelector, address sender) external view returns (uint64 nonce); -} diff --git a/contracts/src/v0.8/ccip/interfaces/INonceManager.sol b/contracts/src/v0.8/ccip/interfaces/INonceManager.sol index 1e1b915ce0..52408ae4f5 100644 --- a/contracts/src/v0.8/ccip/interfaces/INonceManager.sol +++ b/contracts/src/v0.8/ccip/interfaces/INonceManager.sol @@ -3,9 +3,21 @@ pragma solidity ^0.8.0; /// @notice Contract interface that allows managing sender nonces interface INonceManager { - /// @notice Increments the outbound nonce for the given sender on the given destination chain + /// @notice Increments the outbound nonce for a given sender on a given destination chain /// @param destChainSelector The destination chain selector /// @param sender The sender address /// @return The new outbound nonce function getIncrementedOutboundNonce(uint64 destChainSelector, address sender) external returns (uint64); + + /// @notice Increments the inbound nonce for a given sender on a given source chain + /// @notice The increment is only applied if the resulting nonce matches the expectedNonce + /// @param sourceChainSelector The destination chain selector + /// @param expectedNonce The expected inbound nonce + /// @param sender The encoded sender address + /// @return True if the nonce was incremented, false otherwise + function incrementInboundNonce( + uint64 sourceChainSelector, + uint64 expectedNonce, + bytes calldata sender + ) external returns (bool); } diff --git a/contracts/src/v0.8/ccip/offRamp/EVM2EVMMultiOffRamp.sol b/contracts/src/v0.8/ccip/offRamp/EVM2EVMMultiOffRamp.sol index feb5ff360f..44df9df050 100644 --- a/contracts/src/v0.8/ccip/offRamp/EVM2EVMMultiOffRamp.sol +++ b/contracts/src/v0.8/ccip/offRamp/EVM2EVMMultiOffRamp.sol @@ -3,9 +3,8 @@ pragma solidity 0.8.24; import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {IAny2EVMMessageReceiver} from "../interfaces/IAny2EVMMessageReceiver.sol"; -import {IAny2EVMMultiOffRamp} from "../interfaces/IAny2EVMMultiOffRamp.sol"; -import {IAny2EVMOffRamp} from "../interfaces/IAny2EVMOffRamp.sol"; import {IMessageInterceptor} from "../interfaces/IMessageInterceptor.sol"; +import {INonceManager} from "../interfaces/INonceManager.sol"; import {IPoolV1} from "../interfaces/IPool.sol"; import {IPriceRegistry} from "../interfaces/IPriceRegistry.sol"; import {IRMN} from "../interfaces/IRMN.sol"; @@ -30,7 +29,7 @@ import {ERC165Checker} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts /// @dev MultiOCR3Base is used to store multiple OCR configs for both the OffRamp and the CommitStore. /// The execution plugin type has to be configured without signature verification, and the commit /// plugin type with verification. -contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3Base { +contract EVM2EVMMultiOffRamp is ITypeAndVersion, MultiOCR3Base { using ERC165Checker for address; using EnumerableMapAddresses for EnumerableMapAddresses.AddressToAddressMap; @@ -64,8 +63,6 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 /// @dev Atlas depends on this event, if changing, please notify Atlas. event StaticConfigSet(StaticConfig staticConfig); event DynamicConfigSet(DynamicConfig dynamicConfig); - event SkippedIncorrectNonce(uint64 sourceChainSelector, uint64 nonce, address sender); - event SkippedSenderWithPreviousRampMessageInflight(uint64 sourceChainSelector, uint64 nonce, address sender); /// @dev RMN depends on this event, if changing, please notify the RMN maintainers. event ExecutionStateChanged( uint64 indexed sourceChainSelector, @@ -87,14 +84,14 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 uint64 chainSelector; // ───╮ Destination chainSelector address rmnProxy; // ───────╯ RMN proxy address address tokenAdminRegistry; // Token admin registry address + address nonceManager; // Address of the nonce manager } /// @notice Per-chain source config (defining a lane from a Source Chain -> Dest OffRamp) struct SourceChainConfig { - bool isEnabled; // ─────────╮ Flag whether the source chain is enabled or not - uint64 minSeqNr; // | The min sequence number expected for future messages - address prevOffRamp; // ────╯ Address of previous-version per-lane OffRamp. Used to be able to provide sequencing continuity during a zero downtime upgrade. - address onRamp; // OnRamp address on the source chain + bool isEnabled; // ────╮ Flag whether the source chain is enabled or not + uint64 minSeqNr; // | The min sequence number expected for future messages + address onRamp; // ────╯ OnRamp address on the source chain /// @dev Ensures that 2 identical messages sent to 2 different lanes will have a distinct hash. /// Must match the metadataHash used in computing leaf hashes offchain for the root committed in /// the commitStore and i_metadataHash in the onRamp. @@ -105,8 +102,7 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 struct SourceChainConfigArgs { uint64 sourceChainSelector; // ───╮ Source chain selector of the config to update bool isEnabled; // │ Flag whether the source chain is enabled or not - address prevOffRamp; // ───────────╯ Address of previous-version per-lane OffRamp. Used to be able to provide sequencing continuity during a zero downtime upgrade. - address onRamp; // OnRamp address on the source chain + address onRamp; // ────────────────╯ OnRamp address on the source chain } /// @notice Dynamic offRamp config @@ -155,6 +151,8 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 address internal immutable i_rmnProxy; /// @dev The address of the token admin registry address internal immutable i_tokenAdminRegistry; + /// @dev The address of the nonce manager + address internal immutable i_nonceManager; // DYNAMIC CONFIG DynamicConfig internal s_dynamicConfig; @@ -164,11 +162,6 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 mapping(uint64 sourceChainSelector => SourceChainConfig sourceChainConfig) internal s_sourceChainConfigs; // STATE - /// @dev The expected nonce for a given sender per source chain. - /// Corresponds to s_senderNonce in the OnRamp for a lane, used to enforce that messages are - /// executed in the same order they are sent (assuming they are DON). Note that re-execution - /// of FAILED messages however, can be out of order. - mapping(uint64 sourceChainSelector => mapping(address sender => uint64 nonce)) internal s_senderNonce; /// @dev A mapping of sequence numbers (per source chain) to execution state using a bitmap with each execution /// state only taking up 2 bits of the uint256, packing 128 states into a single slot. /// Message state is tracked to ensure message can only be executed successfully once. @@ -181,7 +174,10 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 uint64 private s_latestPriceSequenceNumber; constructor(StaticConfig memory staticConfig, SourceChainConfigArgs[] memory sourceChainConfigs) MultiOCR3Base() { - if (staticConfig.rmnProxy == address(0) || staticConfig.tokenAdminRegistry == address(0)) { + if ( + staticConfig.rmnProxy == address(0) || staticConfig.tokenAdminRegistry == address(0) + || staticConfig.nonceManager == address(0) + ) { revert ZeroAddressNotAllowed(); } @@ -192,6 +188,7 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 i_chainSelector = staticConfig.chainSelector; i_rmnProxy = staticConfig.rmnProxy; i_tokenAdminRegistry = staticConfig.tokenAdminRegistry; + i_nonceManager = staticConfig.nonceManager; emit StaticConfigSet(staticConfig); _applySourceChainConfigUpdates(sourceChainConfigs); @@ -258,35 +255,6 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 return s_executionStates[sourceChainSelector][sequenceNumber / 128]; } - /// @inheritdoc IAny2EVMMultiOffRamp - function getSenderNonce(uint64 sourceChainSelector, address sender) external view returns (uint64) { - (uint64 nonce,) = _getSenderNonce(sourceChainSelector, sender); - return nonce; - } - - /// @notice Returns the the current nonce for a receiver. - /// @param sourceChainSelector The source chain to retrieve the nonce for - /// @param sender The sender address - /// @return nonce The nonce value belonging to the sender address. - /// @return isFromPrevRamp True if the nonce was retrieved from the prevOffRamps - function _getSenderNonce( - uint64 sourceChainSelector, - address sender - ) internal view returns (uint64 nonce, bool isFromPrevRamp) { - uint64 senderNonce = s_senderNonce[sourceChainSelector][sender]; - - if (senderNonce == 0) { - address prevOffRamp = s_sourceChainConfigs[sourceChainSelector].prevOffRamp; - if (prevOffRamp != address(0)) { - // If OffRamp was upgraded, check if sender has a nonce from the previous OffRamp. - // NOTE: assuming prevOffRamp is always a lane-specific off ramp - return (IAny2EVMOffRamp(prevOffRamp).getSenderNonce(sender), true); - } - } - - return (senderNonce, false); - } - /// @notice Manually executes a set of reports. /// @param reports Internal.ExecutionReportSingleChain[] - list of reports to execute /// @param gasLimitOverrides New gasLimit for each message per report @@ -436,35 +404,19 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 } } - if (message.nonce > 0) { - // In the scenario where we upgrade offRamps, we still want to have sequential nonces. - // Referencing the old offRamp to check the expected nonce if none is set for a - // given sender allows us to skip the current message if it would not be the next according - // to the old offRamp. This preserves sequencing between updates. - (uint64 prevNonce, bool isFromPrevRamp) = _getSenderNonce(sourceChainSelector, message.sender); - if (isFromPrevRamp) { - if (prevNonce + 1 != message.nonce) { - // the starting v2 onramp nonce, i.e. the 1st message nonce v2 offramp is expected to receive, - // is guaranteed to equal (largest v1 onramp nonce + 1). - // if this message's nonce isn't (v1 offramp nonce + 1), then v1 offramp nonce != largest v1 onramp nonce, - // it tells us there are still messages inflight for v1 offramp - emit SkippedSenderWithPreviousRampMessageInflight(sourceChainSelector, message.nonce, message.sender); - continue; - } - // Otherwise this nonce is indeed the "transitional nonce", that is - // all messages sent to v1 ramp have been executed by the DON and the sequence can resume in V2. - // Note if first time user in V2, then prevNonce will be 0, and message.nonce = 1, so this will be a no-op. - s_senderNonce[sourceChainSelector][message.sender] = prevNonce; - } - - // UNTOUCHED messages MUST be executed in order always IF message.nonce > 0. - if (originalState == Internal.MessageExecutionState.UNTOUCHED) { - if (prevNonce + 1 != message.nonce) { - // We skip the message if the nonce is incorrect, since message.nonce > 0. - emit SkippedIncorrectNonce(sourceChainSelector, message.nonce, message.sender); - continue; - } - } + // Nonce changes per state transition (these only apply for ordered messages): + // UNTOUCHED -> FAILURE nonce bump + // UNTOUCHED -> SUCCESS nonce bump + // FAILURE -> FAILURE no nonce bump + // FAILURE -> SUCCESS no nonce bump + // UNTOUCHED messages MUST be executed in order always + if (message.nonce > 0 && originalState == Internal.MessageExecutionState.UNTOUCHED) { + // If a nonce is not incremented, that means it was skipped, and we can ignore the message + if ( + !INonceManager(i_nonceManager).incrementInboundNonce( + sourceChainSelector, message.nonce, abi.encode(message.sender) + ) + ) continue; } // Although we expect only valid messages will be committed, we check again @@ -496,16 +448,6 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 revert InvalidNewState(sourceChainSelector, message.sequenceNumber, newState); } - // Nonce changes per state transition. - // These only apply for ordered messages. - // UNTOUCHED -> FAILURE nonce bump - // UNTOUCHED -> SUCCESS nonce bump - // FAILURE -> FAILURE no nonce bump - // FAILURE -> SUCCESS no nonce bump - if (message.nonce > 0 && originalState == Internal.MessageExecutionState.UNTOUCHED) { - s_senderNonce[sourceChainSelector][message.sender]++; - } - emit ExecutionStateChanged(sourceChainSelector, message.sequenceNumber, message.messageId, newState, returnData); } } @@ -748,8 +690,12 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 /// @dev This function will always return the same struct as the contents is static and can never change. /// RMN depends on this function, if changing, please notify the RMN maintainers. function getStaticConfig() external view returns (StaticConfig memory) { - return - StaticConfig({chainSelector: i_chainSelector, rmnProxy: i_rmnProxy, tokenAdminRegistry: i_tokenAdminRegistry}); + return StaticConfig({ + chainSelector: i_chainSelector, + rmnProxy: i_rmnProxy, + tokenAdminRegistry: i_tokenAdminRegistry, + nonceManager: i_nonceManager + }); } /// @notice Returns the current dynamic config. @@ -793,13 +739,10 @@ contract EVM2EVMMultiOffRamp is IAny2EVMMultiOffRamp, ITypeAndVersion, MultiOCR3 currentConfig.metadataHash = _metadataHash(sourceChainSelector, sourceConfigUpdate.onRamp, Internal.EVM_2_EVM_MESSAGE_HASH); currentConfig.onRamp = sourceConfigUpdate.onRamp; - currentConfig.prevOffRamp = sourceConfigUpdate.prevOffRamp; currentConfig.minSeqNr = 1; emit SourceChainSelectorAdded(sourceChainSelector); - } else if ( - currentConfig.onRamp != sourceConfigUpdate.onRamp || currentConfig.prevOffRamp != sourceConfigUpdate.prevOffRamp - ) { + } else if (currentConfig.onRamp != sourceConfigUpdate.onRamp) { revert InvalidStaticConfig(sourceChainSelector); } diff --git a/contracts/src/v0.8/ccip/test/NonceManager.t.sol b/contracts/src/v0.8/ccip/test/NonceManager.t.sol index 7c59e82272..f6e332701d 100644 --- a/contracts/src/v0.8/ccip/test/NonceManager.t.sol +++ b/contracts/src/v0.8/ccip/test/NonceManager.t.sol @@ -2,19 +2,33 @@ pragma solidity 0.8.24; import {NonceManager} from "../NonceManager.sol"; +import {ICommitStore} from "../interfaces/ICommitStore.sol"; import {Client} from "../libraries/Client.sol"; import {Internal} from "../libraries/Internal.sol"; import {Pool} from "../libraries/Pool.sol"; import {RateLimiter} from "../libraries/RateLimiter.sol"; +import {EVM2EVMMultiOffRamp} from "../offRamp/EVM2EVMMultiOffRamp.sol"; import {EVM2EVMMultiOnRamp} from "../onRamp/EVM2EVMMultiOnRamp.sol"; import {EVM2EVMOnRamp} from "../onRamp/EVM2EVMOnRamp.sol"; + +import {BaseTest} from "./BaseTest.t.sol"; import {EVM2EVMMultiOnRampHelper} from "./helpers/EVM2EVMMultiOnRampHelper.sol"; +import {EVM2EVMOffRampHelper} from "./helpers/EVM2EVMOffRampHelper.sol"; import {EVM2EVMOnRampHelper} from "./helpers/EVM2EVMOnRampHelper.sol"; +import {MockCommitStore} from "./mocks/MockCommitStore.sol"; +import {EVM2EVMMultiOffRampSetup} from "./offRamp/EVM2EVMMultiOffRampSetup.t.sol"; import {EVM2EVMMultiOnRampSetup} from "./onRamp/EVM2EVMMultiOnRampSetup.t.sol"; -contract NonceManagerTest_getIncrementedOutboundNonce is EVM2EVMMultiOnRampSetup { +contract NonceManager_NonceIncrementation is BaseTest { + NonceManager private s_nonceManager; + + function setUp() public override { + address[] memory authorizedCallers = new address[](1); + authorizedCallers[0] = address(this); + s_nonceManager = new NonceManager(authorizedCallers); + } + function test_getIncrementedOutboundNonce_Success() public { - vm.startPrank(address(s_onRamp)); address sender = address(this); assertEq(s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, sender), 0); @@ -22,59 +36,136 @@ contract NonceManagerTest_getIncrementedOutboundNonce is EVM2EVMMultiOnRampSetup uint64 outboundNonce = s_nonceManager.getIncrementedOutboundNonce(DEST_CHAIN_SELECTOR, sender); assertEq(outboundNonce, 1); } + + function test_incrementInboundNonce_Success() public { + address sender = address(this); + + s_nonceManager.incrementInboundNonce(SOURCE_CHAIN_SELECTOR, 1, abi.encode(sender)); + + assertEq(s_nonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR, abi.encode(sender)), 1); + } + + function test_incrementInboundNonce_Skip() public { + address sender = address(this); + uint64 expectedNonce = 2; + + vm.expectEmit(); + emit NonceManager.SkippedIncorrectNonce(SOURCE_CHAIN_SELECTOR, expectedNonce, abi.encode(sender)); + + s_nonceManager.incrementInboundNonce(SOURCE_CHAIN_SELECTOR, expectedNonce, abi.encode(sender)); + + assertEq(s_nonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR, abi.encode(sender)), 0); + } + + function test_incrementNoncesInboundAndOutbound_Success() public { + address sender = address(this); + + assertEq(s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, sender), 0); + uint64 outboundNonce = s_nonceManager.getIncrementedOutboundNonce(DEST_CHAIN_SELECTOR, sender); + assertEq(outboundNonce, 1); + + // Inbound nonce unchanged + assertEq(s_nonceManager.getInboundNonce(DEST_CHAIN_SELECTOR, abi.encode(sender)), 0); + + s_nonceManager.incrementInboundNonce(DEST_CHAIN_SELECTOR, 1, abi.encode(sender)); + assertEq(s_nonceManager.getInboundNonce(DEST_CHAIN_SELECTOR, abi.encode(sender)), 1); + + // Outbound nonce unchanged + assertEq(s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, sender), 1); + } } contract NonceManager_applyPreviousRampsUpdates is EVM2EVMMultiOnRampSetup { function test_SingleRampUpdate() public { - address prevOnRamp = vm.addr(1); + address prevOnRamp = makeAddr("prevOnRamp"); + address prevOffRamp = makeAddr("prevOffRamp"); NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); - previousRamps[0] = NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp)); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, prevOffRamp)); vm.expectEmit(); - emit NonceManager.PreviousOnRampUpdated(DEST_CHAIN_SELECTOR, prevOnRamp); + emit NonceManager.PreviousRampsUpdated(DEST_CHAIN_SELECTOR, previousRamps[0].prevRamps); - s_nonceManager.applyPreviousRampsUpdates(previousRamps); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); - _assertPreviousRampsEqual(s_nonceManager.getPreviousRamps(DEST_CHAIN_SELECTOR), previousRamps[0].prevRamps); + _assertPreviousRampsEqual(s_outboundNonceManager.getPreviousRamps(DEST_CHAIN_SELECTOR), previousRamps[0].prevRamps); } function test_MultipleRampsUpdates() public { - address prevOnRamp1 = vm.addr(1); - address prevOnRamp2 = vm.addr(2); + address prevOnRamp1 = makeAddr("prevOnRamp1"); + address prevOnRamp2 = makeAddr("prevOnRamp2"); + address prevOffRamp1 = makeAddr("prevOffRamp1"); + address prevOffRamp2 = makeAddr("prevOffRamp2"); NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](2); - previousRamps[0] = NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp1)); - previousRamps[1] = NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR + 1, NonceManager.PreviousRamps(prevOnRamp2)); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp1, prevOffRamp1)); + previousRamps[1] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR + 1, NonceManager.PreviousRamps(prevOnRamp2, prevOffRamp2)); vm.expectEmit(); - emit NonceManager.PreviousOnRampUpdated(DEST_CHAIN_SELECTOR, prevOnRamp1); + emit NonceManager.PreviousRampsUpdated(DEST_CHAIN_SELECTOR, previousRamps[0].prevRamps); vm.expectEmit(); - emit NonceManager.PreviousOnRampUpdated(DEST_CHAIN_SELECTOR + 1, prevOnRamp2); + emit NonceManager.PreviousRampsUpdated(DEST_CHAIN_SELECTOR + 1, previousRamps[1].prevRamps); - s_nonceManager.applyPreviousRampsUpdates(previousRamps); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); - _assertPreviousRampsEqual(s_nonceManager.getPreviousRamps(DEST_CHAIN_SELECTOR), previousRamps[0].prevRamps); - _assertPreviousRampsEqual(s_nonceManager.getPreviousRamps(DEST_CHAIN_SELECTOR + 1), previousRamps[1].prevRamps); + _assertPreviousRampsEqual(s_outboundNonceManager.getPreviousRamps(DEST_CHAIN_SELECTOR), previousRamps[0].prevRamps); + _assertPreviousRampsEqual( + s_outboundNonceManager.getPreviousRamps(DEST_CHAIN_SELECTOR + 1), previousRamps[1].prevRamps + ); } function test_ZeroInput() public { vm.recordLogs(); - s_nonceManager.applyPreviousRampsUpdates(new NonceManager.PreviousRampsArgs[](0)); + s_outboundNonceManager.applyPreviousRampsUpdates(new NonceManager.PreviousRampsArgs[](0)); assertEq(vm.getRecordedLogs().length, 0); } function test_PreviousRampAlreadySetOnRamp_Revert() public { NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); + address prevOnRamp = makeAddr("prevOnRamp"); previousRamps[0] = - NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(address(vm.addr(1)))); + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, address(0))); - s_nonceManager.applyPreviousRampsUpdates(previousRamps); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); previousRamps[0] = - NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(address(vm.addr(2)))); + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, address(0))); vm.expectRevert(NonceManager.PreviousRampAlreadySet.selector); - s_nonceManager.applyPreviousRampsUpdates(previousRamps); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + } + + function test_PreviousRampAlreadySetOffRamp_Revert() public { + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); + address prevOffRamp = makeAddr("prevOffRamp"); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(address(0), prevOffRamp)); + + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(address(0), prevOffRamp)); + + vm.expectRevert(NonceManager.PreviousRampAlreadySet.selector); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + } + + function test_PreviousRampAlreadySetOnRampAndOffRamp_Revert() public { + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); + address prevOnRamp = makeAddr("prevOnRamp"); + address prevOffRamp = makeAddr("prevOffRamp"); + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, prevOffRamp)); + + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + previousRamps[0] = + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(prevOnRamp, prevOffRamp)); + + vm.expectRevert(NonceManager.PreviousRampAlreadySet.selector); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); } function _assertPreviousRampsEqual( @@ -82,15 +173,16 @@ contract NonceManager_applyPreviousRampsUpdates is EVM2EVMMultiOnRampSetup { NonceManager.PreviousRamps memory b ) internal pure { assertEq(a.prevOnRamp, b.prevOnRamp); + assertEq(a.prevOffRamp, b.prevOffRamp); } } -contract NonceManager_onRampUpgrade is EVM2EVMMultiOnRampSetup { +contract NonceManager_OnRampUpgrade is EVM2EVMMultiOnRampSetup { uint256 internal constant FEE_AMOUNT = 1234567890; EVM2EVMOnRampHelper internal s_prevOnRamp; function setUp() public virtual override { - EVM2EVMMultiOnRampSetup.setUp(); + super.setUp(); EVM2EVMOnRamp.FeeTokenConfigArgs[] memory feeTokenConfigArgs = new EVM2EVMOnRamp.FeeTokenConfigArgs[](1); feeTokenConfigArgs[0] = EVM2EVMOnRamp.FeeTokenConfigArgs({ @@ -149,14 +241,14 @@ contract NonceManager_onRampUpgrade is EVM2EVMMultiOnRampSetup { NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); previousRamps[0] = - NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(address(s_prevOnRamp))); - s_nonceManager.applyPreviousRampsUpdates(previousRamps); + NonceManager.PreviousRampsArgs(DEST_CHAIN_SELECTOR, NonceManager.PreviousRamps(address(s_prevOnRamp), address(0))); + s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); EVM2EVMMultiOnRamp.DestChainConfigArgs[] memory destChainConfigArgs = _generateDestChainConfigArgs(); destChainConfigArgs[0].prevOnRamp = address(s_prevOnRamp); (s_onRamp, s_metadataHash) = _deployOnRamp( - SOURCE_CHAIN_SELECTOR, address(s_sourceRouter), address(s_nonceManager), address(s_tokenAdminRegistry) + SOURCE_CHAIN_SELECTOR, address(s_sourceRouter), address(s_outboundNonceManager), address(s_tokenAdminRegistry) ); vm.startPrank(address(s_sourceRouter)); @@ -172,24 +264,24 @@ contract NonceManager_onRampUpgrade is EVM2EVMMultiOnRampSetup { function test_UpgradeSenderNoncesReadsPreviousRamp_Success() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); - uint64 startNonce = s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 startNonce = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); for (uint64 i = 1; i < 4; ++i) { s_prevOnRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); - assertEq(startNonce + i, s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); + assertEq(startNonce + i, s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); } } function test_UpgradeNonceStartsAtV1Nonce_Success() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); - uint64 startNonce = s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 startNonce = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); // send 1 message from previous onramp s_prevOnRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); - assertEq(startNonce + 1, s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); + assertEq(startNonce + 1, s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); // new onramp nonce should start from 2, while sequence number start from 1 vm.expectEmit(); @@ -198,7 +290,7 @@ contract NonceManager_onRampUpgrade is EVM2EVMMultiOnRampSetup { ); s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); - assertEq(startNonce + 2, s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); + assertEq(startNonce + 2, s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); // after another send, nonce should be 3, and sequence number be 2 vm.expectEmit(); @@ -207,7 +299,7 @@ contract NonceManager_onRampUpgrade is EVM2EVMMultiOnRampSetup { ); s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, OWNER); - assertEq(startNonce + 3, s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); + assertEq(startNonce + 3, s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER)); } function test_UpgradeNonceNewSenderStartsAtZero_Success() public { @@ -225,3 +317,263 @@ contract NonceManager_onRampUpgrade is EVM2EVMMultiOnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, FEE_AMOUNT, newSender); } } + +contract NonceManager_OffRampUpgrade is EVM2EVMMultiOffRampSetup { + EVM2EVMOffRampHelper internal s_prevOffRamp; + EVM2EVMOffRampHelper[] internal s_nestedPrevOffRamps; + + function setUp() public virtual override { + super.setUp(); + + ICommitStore mockPrevCommitStore = new MockCommitStore(); + s_prevOffRamp = _deploySingleLaneOffRamp( + mockPrevCommitStore, s_destRouter, address(0), SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1 + ); + + s_nestedPrevOffRamps = new EVM2EVMOffRampHelper[](2); + s_nestedPrevOffRamps[0] = _deploySingleLaneOffRamp( + mockPrevCommitStore, s_destRouter, address(0), SOURCE_CHAIN_SELECTOR_2, ON_RAMP_ADDRESS_2 + ); + s_nestedPrevOffRamps[1] = _deploySingleLaneOffRamp( + mockPrevCommitStore, s_destRouter, address(s_nestedPrevOffRamps[0]), SOURCE_CHAIN_SELECTOR_2, ON_RAMP_ADDRESS_2 + ); + + NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](3); + previousRamps[0] = NonceManager.PreviousRampsArgs( + SOURCE_CHAIN_SELECTOR_1, NonceManager.PreviousRamps(address(0), address(s_prevOffRamp)) + ); + previousRamps[1] = NonceManager.PreviousRampsArgs( + SOURCE_CHAIN_SELECTOR_2, NonceManager.PreviousRamps(address(0), address(s_nestedPrevOffRamps[1])) + ); + previousRamps[2] = + NonceManager.PreviousRampsArgs(SOURCE_CHAIN_SELECTOR_3, NonceManager.PreviousRamps(ON_RAMP_ADDRESS_3, address(0))); + s_inboundNonceManager.applyPreviousRampsUpdates(previousRamps); + + EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = + new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](3); + sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, + isEnabled: true, + onRamp: ON_RAMP_ADDRESS_1 + }); + sourceChainConfigs[1] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_2, + isEnabled: true, + onRamp: ON_RAMP_ADDRESS_2 + }); + sourceChainConfigs[2] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ + sourceChainSelector: SOURCE_CHAIN_SELECTOR_3, + isEnabled: true, + onRamp: ON_RAMP_ADDRESS_3 + }); + + _setupMultipleOffRampsFromConfigs(sourceChainConfigs); + + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); + s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_3, 1); + } + + function test_Upgraded_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + vm.expectEmit(); + emit EVM2EVMMultiOffRamp.ExecutionStateChanged( + SOURCE_CHAIN_SELECTOR_1, + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.SUCCESS, + "" + ); + + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + } + + function test_NoPrevOffRampForChain_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + uint64 startNonceChain3 = + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, abi.encode(messages[0].sender)); + s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + + // Nonce unchanged for chain 3 + assertEq( + startNonceChain3, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, abi.encode(messages[0].sender)) + ); + + Internal.EVM2EVMMessage[] memory messagesChain3 = + _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3); + vm.expectEmit(); + emit EVM2EVMMultiOffRamp.ExecutionStateChanged( + SOURCE_CHAIN_SELECTOR_3, + messagesChain3[0].sequenceNumber, + messagesChain3[0].messageId, + Internal.MessageExecutionState.SUCCESS, + "" + ); + + s_offRamp.executeSingleReport( + _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messagesChain3), new uint256[](0) + ); + assertEq( + startNonceChain3 + 1, + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, abi.encode(messagesChain3[0].sender)) + ); + } + + function test_UpgradedSenderNoncesReadsPreviousRamp_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + uint64 startNonce = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)); + + for (uint64 i = 1; i < 4; ++i) { + s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + + // messages contains a single message - update for the next execution + messages[0].nonce++; + messages[0].sequenceNumber++; + messages[0].messageId = Internal._hash(messages[0], s_prevOffRamp.metadataHash()); + + assertEq( + startNonce + i, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); + } + } + + function test_UpgradedSenderNoncesReadsPreviousRampTransitive_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_2, ON_RAMP_ADDRESS_2); + uint64 startNonce = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_2, abi.encode(messages[0].sender)); + + for (uint64 i = 1; i < 4; ++i) { + s_nestedPrevOffRamps[0].execute( + _generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_2, messages), new uint256[](0) + ); + + // messages contains a single message - update for the next execution + messages[0].nonce++; + messages[0].sequenceNumber++; + messages[0].messageId = Internal._hash(messages[0], s_nestedPrevOffRamps[0].metadataHash()); + + // Read through prev sender nonce through prevOffRamp -> prevPrevOffRamp + assertEq( + startNonce + i, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_2, abi.encode(messages[0].sender)) + ); + } + } + + function test_UpgradedNonceStartsAtV1Nonce_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + uint64 startNonce = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)); + s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + + assertEq( + startNonce + 1, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); + + messages[0].nonce++; + messages[0].messageId = + Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); + + vm.expectEmit(); + emit EVM2EVMMultiOffRamp.ExecutionStateChanged( + SOURCE_CHAIN_SELECTOR_1, + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.SUCCESS, + "" + ); + + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertEq( + startNonce + 2, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); + + messages[0].nonce++; + messages[0].sequenceNumber++; + messages[0].messageId = + Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); + + vm.expectEmit(); + emit EVM2EVMMultiOffRamp.ExecutionStateChanged( + SOURCE_CHAIN_SELECTOR_1, + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.SUCCESS, + "" + ); + + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertEq( + startNonce + 3, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); + } + + function test_UpgradedNonceNewSenderStartsAtZero_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + + address newSender = address(1234567); + messages[0].sender = newSender; + messages[0].messageId = + Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); + + vm.expectEmit(); + emit EVM2EVMMultiOffRamp.ExecutionStateChanged( + SOURCE_CHAIN_SELECTOR_1, + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.SUCCESS, + "" + ); + + // new sender nonce in new offramp should go from 0 -> 1 + assertEq(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(newSender)), 0); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertEq(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(newSender)), 1); + } + + function test_UpgradedOffRampNonceSkipsIfMsgInFlight_Success() public { + Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); + + address newSender = address(1234567); + messages[0].sender = newSender; + messages[0].nonce = 2; + messages[0].messageId = + Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); + + uint64 startNonce = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)); + + // new offramp sees msg nonce higher than senderNonce + // it waits for previous offramp to execute + vm.expectEmit(); + emit NonceManager.SkippedIncorrectNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].nonce, abi.encode(newSender)); + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertEq(startNonce, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender))); + + messages[0].nonce = 1; + messages[0].messageId = Internal._hash(messages[0], s_prevOffRamp.metadataHash()); + + // previous offramp executes msg and increases nonce + s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertEq( + startNonce + 1, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); + + messages[0].nonce = 2; + messages[0].messageId = + Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); + + // new offramp is able to execute + vm.expectEmit(); + emit EVM2EVMMultiOffRamp.ExecutionStateChanged( + SOURCE_CHAIN_SELECTOR_1, + messages[0].sequenceNumber, + messages[0].messageId, + Internal.MessageExecutionState.SUCCESS, + "" + ); + + s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); + assertEq( + startNonce + 2, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); + } +} diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol index b23e0cae0d..4caa4394be 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol @@ -5,6 +5,8 @@ import {Test} from "forge-std/Test.sol"; import {CCIPConfig} from "../../capability/CCIPConfig.sol"; import {ICapabilitiesRegistry} from "../../capability/interfaces/ICapabilitiesRegistry.sol"; +import {CCIPConfigTypes} from "../../capability/libraries/CCIPConfigTypes.sol"; +import {Internal} from "../../libraries/Internal.sol"; import {CCIPConfigHelper} from "../helpers/CCIPConfigHelper.sol"; contract CCIPConfigSetup is Test { @@ -67,10 +69,10 @@ contract CCIPConfigSetup is Test { ); } // Add chain selector for chain 1. - CCIPConfig.ChainConfigInfo[] memory adds = new CCIPConfig.ChainConfigInfo[](1); - adds[0] = CCIPConfig.ChainConfigInfo({ + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](1); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfig.ChainConfig({readers: p2pIds, fChain: 1, config: bytes("config1")}) + chainConfig: CCIPConfigTypes.ChainConfig({readers: p2pIds, fChain: 1, config: bytes("config1")}) }); vm.expectEmit(); @@ -92,14 +94,14 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { function test_applyChainConfigUpdates_addChainConfigs_Success() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfig.ChainConfigInfo[] memory adds = new CCIPConfig.ChainConfigInfo[](2); - adds[0] = CCIPConfig.ChainConfigInfo({ + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfig.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) }); - adds[1] = CCIPConfig.ChainConfigInfo({ + adds[1] = CCIPConfigTypes.ChainConfigInfo({ chainSelector: 2, - chainConfig: CCIPConfig.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) }); vm.mockCall( @@ -124,7 +126,7 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { emit CCIPConfig.ChainConfigSet(2, adds[1].chainConfig); s_ccipCC.applyChainConfigUpdates(new uint64[](0), adds); - CCIPConfig.ChainConfigInfo[] memory configs = s_ccipCC.getAllChainConfigs(); + CCIPConfigTypes.ChainConfigInfo[] memory configs = s_ccipCC.getAllChainConfigs(); assertEq(configs.length, 2, "chain configs length must be 2"); assertEq(configs[0].chainSelector, 1, "chain selector must match"); assertEq(configs[1].chainSelector, 2, "chain selector must match"); @@ -133,14 +135,14 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { function test_applyChainConfigUpdates_removeChainConfigs_Success() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfig.ChainConfigInfo[] memory adds = new CCIPConfig.ChainConfigInfo[](2); - adds[0] = CCIPConfig.ChainConfigInfo({ + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfig.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) }); - adds[1] = CCIPConfig.ChainConfigInfo({ + adds[1] = CCIPConfigTypes.ChainConfigInfo({ chainSelector: 2, - chainConfig: CCIPConfig.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config2")}) }); vm.mockCall( @@ -170,7 +172,7 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { vm.expectEmit(); emit CCIPConfig.ChainConfigRemoved(1); - s_ccipCC.applyChainConfigUpdates(removes, new CCIPConfig.ChainConfigInfo[](0)); + s_ccipCC.applyChainConfigUpdates(removes, new CCIPConfigTypes.ChainConfigInfo[](0)); } // Reverts. @@ -180,16 +182,16 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { removes[0] = uint64(1); vm.expectRevert(abi.encodeWithSelector(CCIPConfig.ChainSelectorNotFound.selector, 1)); - s_ccipCC.applyChainConfigUpdates(removes, new CCIPConfig.ChainConfigInfo[](0)); + s_ccipCC.applyChainConfigUpdates(removes, new CCIPConfigTypes.ChainConfigInfo[](0)); } function test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfig.ChainConfigInfo[] memory adds = new CCIPConfig.ChainConfigInfo[](1); - adds[0] = CCIPConfig.ChainConfigInfo({ + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](1); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfig.ChainConfig({readers: chainReaders, fChain: 1, config: abi.encode(1, 2, 3)}) + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: abi.encode(1, 2, 3)}) }); vm.mockCall( @@ -215,14 +217,14 @@ contract CCIPConfig_chainConfig is CCIPConfigSetup { function test__applyChainConfigUpdates_FChainNotPositive_Reverts() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); - CCIPConfig.ChainConfigInfo[] memory adds = new CCIPConfig.ChainConfigInfo[](2); - adds[0] = CCIPConfig.ChainConfigInfo({ + CCIPConfigTypes.ChainConfigInfo[] memory adds = new CCIPConfigTypes.ChainConfigInfo[](2); + adds[0] = CCIPConfigTypes.ChainConfigInfo({ chainSelector: 1, - chainConfig: CCIPConfig.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 1, config: bytes("config1")}) }); - adds[1] = CCIPConfig.ChainConfigInfo({ + adds[1] = CCIPConfigTypes.ChainConfigInfo({ chainSelector: 2, - chainConfig: CCIPConfig.ChainConfig({readers: chainReaders, fChain: 0, config: bytes("config2")}) // bad fChain + chainConfig: CCIPConfigTypes.ChainConfig({readers: chainReaders, fChain: 0, config: bytes("config2")}) // bad fChain }); vm.mockCall( @@ -253,8 +255,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); // Config is for 4 nodes, so f == 1. - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -274,8 +276,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); // Config is for 4 nodes, so f == 1. - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 0, // invalid bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -295,8 +297,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); // Config is for 4 nodes, so f == 1. - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: bytes(""), // invalid chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -316,8 +318,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); // Config is for 4 nodes, so f == 1. - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 2, // not set bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -337,8 +339,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { // 32 > 31 (max num oracles) (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(32); - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -363,8 +365,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { mstore(signers, 30) } - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -390,8 +392,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { mstore(transmitters, 3) } - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -411,8 +413,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); // Config is for 4 nodes, so f == 1. - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -431,8 +433,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { function test__validateConfig_FTooHigh_Reverts() public { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -456,8 +458,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { } // Config is for 4 nodes, so f == 1. - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -479,8 +481,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); // Config is for 4 nodes, so f == 1. - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _makeBytes32Array(5, 0), // too many bootstrap p2pIds, 5 > 4 @@ -518,8 +520,8 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup { ); // Config is for 4 nodes, so f == 1. - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -541,24 +543,24 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__stateFromConfigLength_Success() public { uint256 configLen = 0; - CCIPConfig.ConfigState state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPConfig.ConfigState.Init)); + CCIPConfigTypes.ConfigState state = s_ccipCC.stateFromConfigLength(configLen); + assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Init)); configLen = 1; state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPConfig.ConfigState.Running)); + assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Running)); configLen = 2; state = s_ccipCC.stateFromConfigLength(configLen); - assertEq(uint256(state), uint256(CCIPConfig.ConfigState.Staging)); + assertEq(uint256(state), uint256(CCIPConfigTypes.ConfigState.Staging)); } function test__validateConfigStateTransition_Success() public { - s_ccipCC.validateConfigStateTransition(CCIPConfig.ConfigState.Init, CCIPConfig.ConfigState.Running); + s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Init, CCIPConfigTypes.ConfigState.Running); - s_ccipCC.validateConfigStateTransition(CCIPConfig.ConfigState.Running, CCIPConfig.ConfigState.Staging); + s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Running, CCIPConfigTypes.ConfigState.Staging); - s_ccipCC.validateConfigStateTransition(CCIPConfig.ConfigState.Staging, CCIPConfig.ConfigState.Running); + s_ccipCC.validateConfigStateTransition(CCIPConfigTypes.ConfigState.Staging, CCIPConfigTypes.ConfigState.Running); } function test__computeConfigDigest_Success() public { @@ -569,8 +571,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { bytes32[] memory p2pIds = _makeBytes32Array(4, 0); bytes[] memory signers = _makeBytesArray(2, 10); bytes[] memory transmitters = _makeBytesArray(2, 20); - CCIPConfig.OCR3Config memory config = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory config = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -594,7 +596,7 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { bytes32 configDigest3 = s_ccipCC.computeConfigDigest(donId, configCount, config); configCount = 1; - config.pluginType = CCIPConfig.PluginType.Execution; + config.pluginType = Internal.OCRPluginType.Execution; bytes32 configDigest4 = s_ccipCC.computeConfigDigest(donId, configCount, config); assertNotEq(configDigest1, configDigest2, "config digests 1 and 2 must not match"); @@ -612,10 +614,10 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { bytes32[] memory p2pIds = _makeBytes32Array(4, 0); bytes[] memory signers = _makeBytesArray(4, 10); bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPConfig.OCR3Config[] memory cfgs = new CCIPConfig.OCR3Config[](numCommitCfgs + numExecCfgs); + CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](numCommitCfgs + numExecCfgs); for (uint256 i = 0; i < numCommitCfgs; i++) { - cfgs[i] = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + cfgs[i] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -628,8 +630,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { }); } for (uint256 i = 0; i < numExecCfgs; i++) { - cfgs[numCommitCfgs + i] = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Execution, + cfgs[numCommitCfgs + i] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Execution, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -641,17 +643,17 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: abi.encode("exec", numCommitCfgs + i) }); } - (CCIPConfig.OCR3Config[] memory commitCfgs, CCIPConfig.OCR3Config[] memory execCfgs) = + (CCIPConfigTypes.OCR3Config[] memory commitCfgs, CCIPConfigTypes.OCR3Config[] memory execCfgs) = s_ccipCC.groupByPluginType(cfgs); assertEq(commitCfgs.length, numCommitCfgs, "commitCfgs length must match"); assertEq(execCfgs.length, numExecCfgs, "execCfgs length must match"); for (uint256 i = 0; i < commitCfgs.length; i++) { - assertEq(uint8(commitCfgs[i].pluginType), uint8(CCIPConfig.PluginType.Commit), "plugin type must be commit"); + assertEq(uint8(commitCfgs[i].pluginType), uint8(Internal.OCRPluginType.Commit), "plugin type must be commit"); assertEq(commitCfgs[i].offchainConfig, abi.encode("commit", i), "offchain config must match"); } for (uint256 i = 0; i < execCfgs.length; i++) { - assertEq(uint8(execCfgs[i].pluginType), uint8(CCIPConfig.PluginType.Execution), "plugin type must be execution"); + assertEq(uint8(execCfgs[i].pluginType), uint8(Internal.OCRPluginType.Execution), "plugin type must be execution"); assertEq(execCfgs[i].offchainConfig, abi.encode("exec", numCommitCfgs + i), "offchain config must match"); } } @@ -659,10 +661,10 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__computeNewConfigWithMeta_InitToRunning_Success() public { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); uint32 donId = 1; - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](0); - CCIPConfig.OCR3Config[] memory newConfig = new CCIPConfig.OCR3Config[](1); - newConfig[0] = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](1); + newConfig[0] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -673,9 +675,9 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.ConfigState currentState = CCIPConfig.ConfigState.Init; - CCIPConfig.ConfigState newState = CCIPConfig.ConfigState.Running; - CCIPConfig.OCR3ConfigWithMeta[] memory newConfigWithMeta = + CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Init; + CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Running; + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); assertEq(newConfigWithMeta.length, 1, "new config with meta length must be 1"); assertEq(newConfigWithMeta[0].configCount, uint64(1), "config count must be 1"); @@ -694,8 +696,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__computeNewConfigWithMeta_RunningToStaging_Success() public { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -706,8 +708,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config memory greenConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -719,23 +721,23 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfig.OCR3Config[] memory newConfig = new CCIPConfig.OCR3Config[](2); + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](2); // existing blue config first. newConfig[0] = blueConfig; // green config next. newConfig[1] = greenConfig; - CCIPConfig.ConfigState currentState = CCIPConfig.ConfigState.Running; - CCIPConfig.ConfigState newState = CCIPConfig.ConfigState.Staging; + CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Running; + CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Staging; - CCIPConfig.OCR3ConfigWithMeta[] memory newConfigWithMeta = + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); assertEq(newConfigWithMeta.length, 2, "new config with meta length must be 2"); @@ -772,8 +774,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__computeNewConfigWithMeta_StagingToRunning_Success() public { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -784,8 +786,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config memory greenConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -797,24 +799,24 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](2); - currentConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - currentConfig[1] = CCIPConfig.OCR3ConfigWithMeta({ + currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); - CCIPConfig.OCR3Config[] memory newConfig = new CCIPConfig.OCR3Config[](1); + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](1); newConfig[0] = greenConfig; - CCIPConfig.ConfigState currentState = CCIPConfig.ConfigState.Staging; - CCIPConfig.ConfigState newState = CCIPConfig.ConfigState.Running; + CCIPConfigTypes.ConfigState currentState = CCIPConfigTypes.ConfigState.Staging; + CCIPConfigTypes.ConfigState newState = CCIPConfigTypes.ConfigState.Running; - CCIPConfig.OCR3ConfigWithMeta[] memory newConfigWithMeta = + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta = s_ccipCC.computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); assertEq(newConfigWithMeta.length, 1, "new config with meta length must be 1"); @@ -832,8 +834,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__validateConfigTransition_InitToRunning_Success() public { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -845,13 +847,13 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit") }); - CCIPConfig.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfig.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](0); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); s_ccipCC.validateConfigTransition(currentConfig, newConfig); } @@ -859,8 +861,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__validateConfigTransition_RunningToStaging_Success() public { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -871,8 +873,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config memory greenConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -884,20 +886,20 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfig.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfig.OCR3ConfigWithMeta[](2); - newConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - newConfig[1] = CCIPConfig.OCR3ConfigWithMeta({ + newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) @@ -909,8 +911,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__validateConfigTransition_StagingToRunning_Success() public { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -921,8 +923,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config memory greenConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -934,20 +936,20 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](2); - currentConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - currentConfig[1] = CCIPConfig.OCR3ConfigWithMeta({ + currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); - CCIPConfig.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfig.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) @@ -968,10 +970,10 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { bytes32[] memory p2pIds = _makeBytes32Array(4, 0); bytes[] memory signers = _makeBytesArray(4, 10); bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPConfig.OCR3Config[] memory cfgs = new CCIPConfig.OCR3Config[](3); + CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](3); for (uint256 i = 0; i < 3; i++) { - cfgs[i] = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + cfgs[i] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -991,10 +993,10 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { bytes32[] memory p2pIds = _makeBytes32Array(4, 0); bytes[] memory signers = _makeBytesArray(4, 10); bytes[] memory transmitters = _makeBytesArray(4, 20); - CCIPConfig.OCR3Config[] memory cfgs = new CCIPConfig.OCR3Config[](3); + CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](3); for (uint256 i = 0; i < 3; i++) { - cfgs[i] = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Execution, + cfgs[i] = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Execution, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1011,15 +1013,15 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { } function test__groupByPluginType_TooManyOCR3Configs_Reverts() public { - CCIPConfig.OCR3Config[] memory cfgs = new CCIPConfig.OCR3Config[](5); + CCIPConfigTypes.OCR3Config[] memory cfgs = new CCIPConfigTypes.OCR3Config[](5); vm.expectRevert(CCIPConfig.TooManyOCR3Configs.selector); s_ccipCC.groupByPluginType(cfgs); } function test__validateConfigTransition_InitToRunning_WrongConfigCount_Reverts() public { uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(_makeBytes32Array(4, 0), 0, 1), @@ -1031,13 +1033,13 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit") }); - CCIPConfig.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfig.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 0, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](0); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](0); vm.expectRevert(abi.encodeWithSelector(CCIPConfig.WrongConfigCount.selector, 0, 1)); s_ccipCC.validateConfigTransition(currentConfig, newConfig); @@ -1045,8 +1047,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__validateConfigTransition_RunningToStaging_WrongConfigDigestBlueGreen_Reverts() public { uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(_makeBytes32Array(4, 0), 0, 1), @@ -1057,8 +1059,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config memory greenConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(_makeBytes32Array(4, 0), 0, 1), @@ -1070,20 +1072,20 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfig.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfig.OCR3ConfigWithMeta[](2); - newConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 3, blueConfig) // wrong config digest (due to diff config count) }); - newConfig[1] = CCIPConfig.OCR3ConfigWithMeta({ + newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) @@ -1101,8 +1103,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__validateConfigTransition_RunningToStaging_WrongConfigCount_Reverts() public { uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(_makeBytes32Array(4, 0), 0, 1), @@ -1113,8 +1115,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config memory greenConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(_makeBytes32Array(4, 0), 0, 1), @@ -1126,20 +1128,20 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](1); - currentConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - CCIPConfig.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfig.OCR3ConfigWithMeta[](2); - newConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - newConfig[1] = CCIPConfig.OCR3ConfigWithMeta({ + newConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 3, // wrong config count config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 3, greenConfig) @@ -1151,8 +1153,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { function test__validateConfigTransition_StagingToRunning_WrongConfigDigest_Reverts() public { uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(_makeBytes32Array(4, 0), 0, 1), @@ -1163,8 +1165,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config memory greenConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(_makeBytes32Array(4, 0), 0, 1), @@ -1176,20 +1178,20 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { offchainConfig: bytes("commit-new") }); - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](2); - currentConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](2); + currentConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 1, config: blueConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 1, blueConfig) }); - currentConfig[1] = CCIPConfig.OCR3ConfigWithMeta({ + currentConfig[1] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 2, greenConfig) }); - CCIPConfig.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfig.OCR3ConfigWithMeta[](1); - newConfig[0] = CCIPConfig.OCR3ConfigWithMeta({ + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); + newConfig[0] = CCIPConfigTypes.OCR3ConfigWithMeta({ configCount: 2, config: greenConfig, configDigest: s_ccipCC.computeConfigDigest(donId, 3, greenConfig) // wrong config digest @@ -1206,8 +1208,8 @@ contract CCIPConfig_ConfigStateMachine is CCIPConfigSetup { } function test__validateConfigTransition_NonExistentConfigTransition_Reverts() public { - CCIPConfig.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfig.OCR3ConfigWithMeta[](3); - CCIPConfig.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfig.OCR3ConfigWithMeta[](1); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](3); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfig = new CCIPConfigTypes.OCR3ConfigWithMeta[](1); vm.expectRevert(CCIPConfig.NonExistentConfigTransition.selector); s_ccipCC.validateConfigTransition(currentConfig, newConfig); } @@ -1219,8 +1221,8 @@ contract CCIPConfig__updatePluginConfig is CCIPConfigSetup { function test__updatePluginConfig_InitToRunning_Success() public { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1231,13 +1233,14 @@ contract CCIPConfig__updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config[] memory configs = new CCIPConfig.OCR3Config[](1); + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); configs[0] = blueConfig; - s_ccipCC.updatePluginConfig(donId, CCIPConfig.PluginType.Commit, configs); + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, configs); // should see the updated config in the contract state. - CCIPConfig.OCR3ConfigWithMeta[] memory storedConfig = s_ccipCC.getOCRConfig(donId, CCIPConfig.PluginType.Commit); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfig = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); assertEq(storedConfig.length, 1, "don config length must be 1"); assertEq(storedConfig[0].configCount, uint64(1), "config count must be 1"); assertEq(uint256(storedConfig[0].config.pluginType), uint256(blueConfig.pluginType), "plugin type must match"); @@ -1247,9 +1250,9 @@ contract CCIPConfig__updatePluginConfig is CCIPConfigSetup { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); // add blue config. uint32 donId = 1; - CCIPConfig.PluginType pluginType = CCIPConfig.PluginType.Commit; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + Internal.OCRPluginType pluginType = Internal.OCRPluginType.Commit; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1260,13 +1263,13 @@ contract CCIPConfig__updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config[] memory startConfigs = new CCIPConfig.OCR3Config[](1); + CCIPConfigTypes.OCR3Config[] memory startConfigs = new CCIPConfigTypes.OCR3Config[](1); startConfigs[0] = blueConfig; // add blue AND green config to indicate an update. - s_ccipCC.updatePluginConfig(donId, CCIPConfig.PluginType.Commit, startConfigs); - CCIPConfig.OCR3Config memory greenConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, startConfigs); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1277,22 +1280,23 @@ contract CCIPConfig__updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit-new") }); - CCIPConfig.OCR3Config[] memory blueAndGreen = new CCIPConfig.OCR3Config[](2); + CCIPConfigTypes.OCR3Config[] memory blueAndGreen = new CCIPConfigTypes.OCR3Config[](2); blueAndGreen[0] = blueConfig; blueAndGreen[1] = greenConfig; - s_ccipCC.updatePluginConfig(donId, CCIPConfig.PluginType.Commit, blueAndGreen); + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, blueAndGreen); // should see the updated config in the contract state. - CCIPConfig.OCR3ConfigWithMeta[] memory storedConfig = s_ccipCC.getOCRConfig(donId, CCIPConfig.PluginType.Commit); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfig = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); assertEq(storedConfig.length, 2, "don config length must be 2"); // 0 index is blue config, 1 index is green config. assertEq(storedConfig[1].configCount, uint64(2), "config count must be 2"); assertEq( - uint256(storedConfig[0].config.pluginType), uint256(CCIPConfig.PluginType.Commit), "plugin type must match" + uint256(storedConfig[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" ); assertEq( - uint256(storedConfig[1].config.pluginType), uint256(CCIPConfig.PluginType.Commit), "plugin type must match" + uint256(storedConfig[1].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" ); assertEq(storedConfig[0].config.offchainConfig, bytes("commit"), "blue offchain config must match"); assertEq(storedConfig[1].config.offchainConfig, bytes("commit-new"), "green offchain config must match"); @@ -1302,9 +1306,9 @@ contract CCIPConfig__updatePluginConfig is CCIPConfigSetup { (bytes32[] memory p2pIds, bytes[] memory signers, bytes[] memory transmitters) = _addChainConfig(4); // add blue config. uint32 donId = 1; - CCIPConfig.PluginType pluginType = CCIPConfig.PluginType.Commit; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + Internal.OCRPluginType pluginType = Internal.OCRPluginType.Commit; + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1315,13 +1319,13 @@ contract CCIPConfig__updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config[] memory startConfigs = new CCIPConfig.OCR3Config[](1); + CCIPConfigTypes.OCR3Config[] memory startConfigs = new CCIPConfigTypes.OCR3Config[](1); startConfigs[0] = blueConfig; // add blue AND green config to indicate an update. - s_ccipCC.updatePluginConfig(donId, CCIPConfig.PluginType.Commit, startConfigs); - CCIPConfig.OCR3Config memory greenConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, startConfigs); + CCIPConfigTypes.OCR3Config memory greenConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1332,38 +1336,39 @@ contract CCIPConfig__updatePluginConfig is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit-new") }); - CCIPConfig.OCR3Config[] memory blueAndGreen = new CCIPConfig.OCR3Config[](2); + CCIPConfigTypes.OCR3Config[] memory blueAndGreen = new CCIPConfigTypes.OCR3Config[](2); blueAndGreen[0] = blueConfig; blueAndGreen[1] = greenConfig; - s_ccipCC.updatePluginConfig(donId, CCIPConfig.PluginType.Commit, blueAndGreen); + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, blueAndGreen); // should see the updated config in the contract state. - CCIPConfig.OCR3ConfigWithMeta[] memory storedConfig = s_ccipCC.getOCRConfig(donId, CCIPConfig.PluginType.Commit); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfig = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); assertEq(storedConfig.length, 2, "don config length must be 2"); // 0 index is blue config, 1 index is green config. assertEq(storedConfig[1].configCount, uint64(2), "config count must be 2"); assertEq( - uint256(storedConfig[0].config.pluginType), uint256(CCIPConfig.PluginType.Commit), "plugin type must match" + uint256(storedConfig[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" ); assertEq( - uint256(storedConfig[1].config.pluginType), uint256(CCIPConfig.PluginType.Commit), "plugin type must match" + uint256(storedConfig[1].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" ); assertEq(storedConfig[0].config.offchainConfig, bytes("commit"), "blue offchain config must match"); assertEq(storedConfig[1].config.offchainConfig, bytes("commit-new"), "green offchain config must match"); // promote green to blue. - CCIPConfig.OCR3Config[] memory promote = new CCIPConfig.OCR3Config[](1); + CCIPConfigTypes.OCR3Config[] memory promote = new CCIPConfigTypes.OCR3Config[](1); promote[0] = greenConfig; - s_ccipCC.updatePluginConfig(donId, CCIPConfig.PluginType.Commit, promote); + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, promote); // should see the updated config in the contract state. - storedConfig = s_ccipCC.getOCRConfig(donId, CCIPConfig.PluginType.Commit); + storedConfig = s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); assertEq(storedConfig.length, 1, "don config length must be 1"); assertEq(storedConfig[0].configCount, uint64(2), "config count must be 2"); assertEq( - uint256(storedConfig[0].config.pluginType), uint256(CCIPConfig.PluginType.Commit), "plugin type must match" + uint256(storedConfig[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must match" ); assertEq(storedConfig[0].config.offchainConfig, bytes("commit-new"), "green offchain config must match"); } @@ -1371,17 +1376,17 @@ contract CCIPConfig__updatePluginConfig is CCIPConfigSetup { // Reverts. function test__updatePluginConfig_InvalidConfigLength_Reverts() public { uint32 donId = 1; - CCIPConfig.OCR3Config[] memory newConfig = new CCIPConfig.OCR3Config[](3); + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](3); vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigLength.selector, uint256(3))); - s_ccipCC.updatePluginConfig(donId, CCIPConfig.PluginType.Commit, newConfig); + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, newConfig); } function test__updatePluginConfig_InvalidConfigStateTransition_Reverts() public { uint32 donId = 1; - CCIPConfig.OCR3Config[] memory newConfig = new CCIPConfig.OCR3Config[](2); + CCIPConfigTypes.OCR3Config[] memory newConfig = new CCIPConfigTypes.OCR3Config[](2); // 0 -> 2 is an invalid state transition. vm.expectRevert(abi.encodeWithSelector(CCIPConfig.InvalidConfigStateTransition.selector, 0, 2)); - s_ccipCC.updatePluginConfig(donId, CCIPConfig.PluginType.Commit, newConfig); + s_ccipCC.updatePluginConfig(donId, Internal.OCRPluginType.Commit, newConfig); } } @@ -1390,7 +1395,7 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { function test_beforeCapabilityConfigSet_ZeroLengthConfig_Success() public { changePrank(CAPABILITIES_REGISTRY); - CCIPConfig.OCR3Config[] memory configs = new CCIPConfig.OCR3Config[](0); + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](0); bytes memory encodedConfigs = abi.encode(configs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encodedConfigs, 1, 1); } @@ -1400,8 +1405,8 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { changePrank(CAPABILITIES_REGISTRY); uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1412,17 +1417,18 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config[] memory configs = new CCIPConfig.OCR3Config[](1); + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); configs[0] = blueConfig; bytes memory encoded = abi.encode(configs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); - CCIPConfig.OCR3ConfigWithMeta[] memory storedConfigs = s_ccipCC.getOCRConfig(donId, CCIPConfig.PluginType.Commit); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfigs = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); assertEq(storedConfigs.length, 1, "config length must be 1"); assertEq(storedConfigs[0].configCount, uint64(1), "config count must be 1"); assertEq( - uint256(storedConfigs[0].config.pluginType), uint256(CCIPConfig.PluginType.Commit), "plugin type must be commit" + uint256(storedConfigs[0].config.pluginType), uint256(Internal.OCRPluginType.Commit), "plugin type must be commit" ); } @@ -1431,8 +1437,8 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { changePrank(CAPABILITIES_REGISTRY); uint32 donId = 1; - CCIPConfig.OCR3Config memory blueConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Execution, + CCIPConfigTypes.OCR3Config memory blueConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Execution, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1443,18 +1449,19 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("exec") }); - CCIPConfig.OCR3Config[] memory configs = new CCIPConfig.OCR3Config[](1); + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](1); configs[0] = blueConfig; bytes memory encoded = abi.encode(configs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); - CCIPConfig.OCR3ConfigWithMeta[] memory storedConfigs = s_ccipCC.getOCRConfig(donId, CCIPConfig.PluginType.Execution); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedConfigs = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Execution); assertEq(storedConfigs.length, 1, "config length must be 1"); assertEq(storedConfigs[0].configCount, uint64(1), "config count must be 1"); assertEq( uint256(storedConfigs[0].config.pluginType), - uint256(CCIPConfig.PluginType.Execution), + uint256(Internal.OCRPluginType.Execution), "plugin type must be execution" ); } @@ -1464,8 +1471,8 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { changePrank(CAPABILITIES_REGISTRY); uint32 donId = 1; - CCIPConfig.OCR3Config memory blueCommitConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Commit, + CCIPConfigTypes.OCR3Config memory blueCommitConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Commit, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1476,8 +1483,8 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("commit") }); - CCIPConfig.OCR3Config memory blueExecConfig = CCIPConfig.OCR3Config({ - pluginType: CCIPConfig.PluginType.Execution, + CCIPConfigTypes.OCR3Config memory blueExecConfig = CCIPConfigTypes.OCR3Config({ + pluginType: Internal.OCRPluginType.Execution, offrampAddress: abi.encodePacked(keccak256(abi.encode("offramp"))), chainSelector: 1, bootstrapP2PIds: _subset(p2pIds, 0, 1), @@ -1488,30 +1495,30 @@ contract CCIPConfig_beforeCapabilityConfigSet is CCIPConfigSetup { offchainConfigVersion: 30, offchainConfig: bytes("exec") }); - CCIPConfig.OCR3Config[] memory configs = new CCIPConfig.OCR3Config[](2); + CCIPConfigTypes.OCR3Config[] memory configs = new CCIPConfigTypes.OCR3Config[](2); configs[0] = blueExecConfig; configs[1] = blueCommitConfig; bytes memory encoded = abi.encode(configs); s_ccipCC.beforeCapabilityConfigSet(new bytes32[](0), encoded, 1, donId); - CCIPConfig.OCR3ConfigWithMeta[] memory storedExecConfigs = - s_ccipCC.getOCRConfig(donId, CCIPConfig.PluginType.Execution); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedExecConfigs = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Execution); assertEq(storedExecConfigs.length, 1, "config length must be 1"); assertEq(storedExecConfigs[0].configCount, uint64(1), "config count must be 1"); assertEq( uint256(storedExecConfigs[0].config.pluginType), - uint256(CCIPConfig.PluginType.Execution), + uint256(Internal.OCRPluginType.Execution), "plugin type must be execution" ); - CCIPConfig.OCR3ConfigWithMeta[] memory storedCommitConfigs = - s_ccipCC.getOCRConfig(donId, CCIPConfig.PluginType.Commit); + CCIPConfigTypes.OCR3ConfigWithMeta[] memory storedCommitConfigs = + s_ccipCC.getOCRConfig(donId, Internal.OCRPluginType.Commit); assertEq(storedCommitConfigs.length, 1, "config length must be 1"); assertEq(storedCommitConfigs[0].configCount, uint64(1), "config count must be 1"); assertEq( uint256(storedCommitConfigs[0].config.pluginType), - uint256(CCIPConfig.PluginType.Commit), + uint256(Internal.OCRPluginType.Commit), "plugin type must be commit" ); } diff --git a/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.sol b/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.sol index a1213c5730..d8cc6cc97c 100644 --- a/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.sol +++ b/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.sol @@ -81,7 +81,7 @@ contract MultiRampsE2E is EVM2EVMMultiOnRampSetup, EVM2EVMMultiOffRampSetup { s_sourceRouter2.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), new Router.OffRamp[](0)); // Deploy offramp - _deployOffRamp(s_destRouter, s_mockRMN); + _deployOffRamp(s_destRouter, s_mockRMN, s_inboundNonceManager); // Enable source chains on offramp EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = @@ -89,13 +89,11 @@ contract MultiRampsE2E is EVM2EVMMultiOnRampSetup, EVM2EVMMultiOffRampSetup { sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR, isEnabled: true, - prevOffRamp: address(0), onRamp: address(s_onRamp) }); sourceChainConfigs[1] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR + 1, isEnabled: true, - prevOffRamp: address(0), onRamp: address(s_onRamp2) }); diff --git a/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol b/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol index f321ea5d40..74f03890d3 100644 --- a/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol +++ b/contracts/src/v0.8/ccip/test/helpers/CCIPConfigHelper.sol @@ -2,39 +2,44 @@ pragma solidity ^0.8.24; import {CCIPConfig} from "../../capability/CCIPConfig.sol"; +import {CCIPConfigTypes} from "../../capability/libraries/CCIPConfigTypes.sol"; +import {Internal} from "../../libraries/Internal.sol"; contract CCIPConfigHelper is CCIPConfig { constructor(address capabilitiesRegistry) CCIPConfig(capabilitiesRegistry) {} - function stateFromConfigLength(uint256 configLength) public pure returns (ConfigState) { + function stateFromConfigLength(uint256 configLength) public pure returns (CCIPConfigTypes.ConfigState) { return _stateFromConfigLength(configLength); } - function validateConfigStateTransition(ConfigState currentState, ConfigState newState) public pure { + function validateConfigStateTransition( + CCIPConfigTypes.ConfigState currentState, + CCIPConfigTypes.ConfigState newState + ) public pure { _validateConfigStateTransition(currentState, newState); } function validateConfigTransition( - OCR3ConfigWithMeta[] memory currentConfig, - OCR3ConfigWithMeta[] memory newConfigWithMeta + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, + CCIPConfigTypes.OCR3ConfigWithMeta[] memory newConfigWithMeta ) public pure { _validateConfigTransition(currentConfig, newConfigWithMeta); } function computeNewConfigWithMeta( uint32 donId, - OCR3ConfigWithMeta[] memory currentConfig, - OCR3Config[] memory newConfig, - ConfigState currentState, - ConfigState newState - ) public view returns (OCR3ConfigWithMeta[] memory) { + CCIPConfigTypes.OCR3ConfigWithMeta[] memory currentConfig, + CCIPConfigTypes.OCR3Config[] memory newConfig, + CCIPConfigTypes.ConfigState currentState, + CCIPConfigTypes.ConfigState newState + ) public view returns (CCIPConfigTypes.OCR3ConfigWithMeta[] memory) { return _computeNewConfigWithMeta(donId, currentConfig, newConfig, currentState, newState); } - function groupByPluginType(OCR3Config[] memory ocr3Configs) + function groupByPluginType(CCIPConfigTypes.OCR3Config[] memory ocr3Configs) public pure - returns (OCR3Config[] memory commitConfigs, OCR3Config[] memory execConfigs) + returns (CCIPConfigTypes.OCR3Config[] memory commitConfigs, CCIPConfigTypes.OCR3Config[] memory execConfigs) { return _groupByPluginType(ocr3Configs); } @@ -42,16 +47,20 @@ contract CCIPConfigHelper is CCIPConfig { function computeConfigDigest( uint32 donId, uint64 configCount, - OCR3Config memory ocr3Config + CCIPConfigTypes.OCR3Config memory ocr3Config ) public pure returns (bytes32) { return _computeConfigDigest(donId, configCount, ocr3Config); } - function validateConfig(OCR3Config memory cfg) public view { + function validateConfig(CCIPConfigTypes.OCR3Config memory cfg) public view { _validateConfig(cfg); } - function updatePluginConfig(uint32 donId, PluginType pluginType, OCR3Config[] memory newConfig) public { + function updatePluginConfig( + uint32 donId, + Internal.OCRPluginType pluginType, + CCIPConfigTypes.OCR3Config[] memory newConfig + ) public { _updatePluginConfig(donId, pluginType, newConfig); } } diff --git a/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRamp.t.sol b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRamp.t.sol index ab7057f340..edb27d1a74 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRamp.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRamp.t.sol @@ -8,6 +8,7 @@ import {IRMN} from "../../interfaces/IRMN.sol"; import {ITokenAdminRegistry} from "../../interfaces/ITokenAdminRegistry.sol"; import {CallWithExactGas} from "../../../shared/call/CallWithExactGas.sol"; +import {NonceManager} from "../../NonceManager.sol"; import {PriceRegistry} from "../../PriceRegistry.sol"; import {RMN} from "../../RMN.sol"; import {Router} from "../../Router.sol"; @@ -28,18 +29,18 @@ import {ConformingReceiver} from "../helpers/receivers/ConformingReceiver.sol"; import {MaybeRevertMessageReceiver} from "../helpers/receivers/MaybeRevertMessageReceiver.sol"; import {MaybeRevertMessageReceiverNo165} from "../helpers/receivers/MaybeRevertMessageReceiverNo165.sol"; import {ReentrancyAbuserMultiRamp} from "../helpers/receivers/ReentrancyAbuserMultiRamp.sol"; -import {MockCommitStore} from "../mocks/MockCommitStore.sol"; import {EVM2EVMMultiOffRampSetup} from "./EVM2EVMMultiOffRampSetup.t.sol"; +import {Vm} from "forge-std/Vm.sol"; import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; -import {Vm} from "forge-std/Vm.sol"; contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { function test_Constructor_Success() public { EVM2EVMMultiOffRamp.StaticConfig memory staticConfig = EVM2EVMMultiOffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, rmnProxy: address(s_mockRMN), - tokenAdminRegistry: address(s_tokenAdminRegistry) + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) }); EVM2EVMMultiOffRamp.DynamicConfig memory dynamicConfig = _generateDynamicMultiOffRampConfig(address(s_destRouter), address(s_priceRegistry)); @@ -49,20 +50,17 @@ contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_1 }); sourceChainConfigs[1] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1 + 1, isEnabled: true, - prevOffRamp: address(0), onRamp: address(uint160(ON_RAMP_ADDRESS_1) + 1) }); EVM2EVMMultiOffRamp.SourceChainConfig memory expectedSourceChainConfig1 = EVM2EVMMultiOffRamp.SourceChainConfig({ isEnabled: true, minSeqNr: 1, - prevOffRamp: address(0), onRamp: sourceChainConfigs[0].onRamp, metadataHash: s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, sourceChainConfigs[0].onRamp) }); @@ -70,7 +68,6 @@ contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { EVM2EVMMultiOffRamp.SourceChainConfig memory expectedSourceChainConfig2 = EVM2EVMMultiOffRamp.SourceChainConfig({ isEnabled: true, minSeqNr: 1, - prevOffRamp: address(0), onRamp: sourceChainConfigs[1].onRamp, metadataHash: s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1 + 1, sourceChainConfigs[1].onRamp) }); @@ -152,7 +149,6 @@ contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(0), onRamp: address(0) }); @@ -162,7 +158,8 @@ contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { EVM2EVMMultiOffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, rmnProxy: address(s_mockRMN), - tokenAdminRegistry: address(s_tokenAdminRegistry) + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) }), sourceChainConfigs ); @@ -174,12 +171,8 @@ contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](1); - sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ - sourceChainSelector: 0, - isEnabled: true, - prevOffRamp: address(0), - onRamp: address(0) - }); + sourceChainConfigs[0] = + EVM2EVMMultiOffRamp.SourceChainConfigArgs({sourceChainSelector: 0, isEnabled: true, onRamp: address(0)}); vm.expectRevert(EVM2EVMMultiOffRamp.ZeroChainSelectorNotAllowed.selector); @@ -187,7 +180,8 @@ contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { EVM2EVMMultiOffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, rmnProxy: address(s_mockRMN), - tokenAdminRegistry: address(s_tokenAdminRegistry) + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) }), sourceChainConfigs ); @@ -206,7 +200,8 @@ contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { EVM2EVMMultiOffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, rmnProxy: ZERO_ADDRESS, - tokenAdminRegistry: address(s_tokenAdminRegistry) + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) }), sourceChainConfigs ); @@ -225,7 +220,8 @@ contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { EVM2EVMMultiOffRamp.StaticConfig({ chainSelector: 0, rmnProxy: address(s_mockRMN), - tokenAdminRegistry: address(s_tokenAdminRegistry) + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) }), sourceChainConfigs ); @@ -244,7 +240,28 @@ contract EVM2EVMMultiOffRamp_constructor is EVM2EVMMultiOffRampSetup { EVM2EVMMultiOffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, rmnProxy: address(s_mockRMN), - tokenAdminRegistry: ZERO_ADDRESS + tokenAdminRegistry: ZERO_ADDRESS, + nonceManager: address(s_inboundNonceManager) + }), + sourceChainConfigs + ); + } + + function test_ZeroNonceManager_Revert() public { + uint64[] memory sourceChainSelectors = new uint64[](1); + sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; + + EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = + new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](0); + + vm.expectRevert(EVM2EVMMultiOffRamp.ZeroAddressNotAllowed.selector); + + s_offRamp = new EVM2EVMMultiOffRampHelper( + EVM2EVMMultiOffRamp.StaticConfig({ + chainSelector: DEST_CHAIN_SELECTOR, + rmnProxy: address(s_mockRMN), + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: ZERO_ADDRESS }), sourceChainConfigs ); @@ -423,9 +440,11 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { "" ); - uint64 nonceBefore = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)); s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - assertGt(s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), nonceBefore); + assertGt( + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)), nonceBefore + ); } function test_SingleMessageNoTokensUnordered_Success() public { @@ -444,10 +463,10 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { ); // Nonce never increments on unordered messages. - uint64 nonceBefore = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)); s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); assertEq( - s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)), nonceBefore, "nonce must remain unchanged on unordered messages" ); @@ -466,10 +485,10 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { ); // Nonce never increments on unordered messages. - nonceBefore = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); + nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)); s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); assertEq( - s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)), nonceBefore, "nonce must remain unchanged on unordered messages" ); @@ -482,20 +501,23 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messagesChain1), new uint256[](0) ); - uint64 nonceChain1 = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messagesChain1[0].sender); + uint64 nonceChain1 = + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messagesChain1[0].sender)); assertGt(nonceChain1, 0); Internal.EVM2EVMMessage[] memory messagesChain2 = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3); - assertEq(s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_3, messagesChain2[0].sender), 0); + assertEq(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, abi.encode(messagesChain2[0].sender)), 0); s_offRamp.executeSingleReport( _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messagesChain2), new uint256[](0) ); - assertGt(s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_3, messagesChain2[0].sender), 0); + assertGt(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, abi.encode(messagesChain2[0].sender)), 0); // Other chain's nonce is unaffected - assertEq(s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messagesChain1[0].sender), nonceChain1); + assertEq( + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messagesChain1[0].sender)), nonceChain1 + ); } function test_ReceiverError_Success() public { @@ -522,9 +544,9 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { ) ); // Nonce should increment on non-strict - assertEq(uint64(0), s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, address(OWNER))); + assertEq(uint64(0), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - assertEq(uint64(1), s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, address(OWNER))); + assertEq(uint64(1), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); } function test_SkippedIncorrectNonce_Success() public { @@ -535,8 +557,8 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); vm.expectEmit(); - emit EVM2EVMMultiOffRamp.SkippedIncorrectNonce( - messages[0].sourceChainSelector, messages[0].nonce, messages[0].sender + emit NonceManager.SkippedIncorrectNonce( + messages[0].sourceChainSelector, messages[0].nonce, abi.encode(messages[0].sender) ); s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); @@ -559,12 +581,12 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { ); vm.expectEmit(); - emit EVM2EVMMultiOffRamp.SkippedIncorrectNonce(SOURCE_CHAIN_SELECTOR_1, messages[1].nonce, messages[1].sender); + emit NonceManager.SkippedIncorrectNonce(SOURCE_CHAIN_SELECTOR_1, messages[1].nonce, abi.encode(messages[1].sender)); s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); } - function test__execute_SkippedAlreadyExecutedMessage_Success() public { + function test_execute_SkippedAlreadyExecutedMessage_Success() public { Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); vm.expectEmit(); @@ -704,11 +726,11 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { "" ); - assertEq(uint64(0), s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, OWNER)); + assertEq(uint64(0), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); s_offRamp.executeSingleReport( _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), _getGasLimitsFromMessages(messages) ); - assertEq(uint64(2), s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, OWNER)); + assertEq(uint64(2), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); } function test_Fuzz_InterleavingOrderedAndUnorderedMessages_Success(bool[7] memory orderings) public { @@ -739,7 +761,7 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { ); } - uint64 nonceBefore = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, OWNER); + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER)); assertEq(uint64(0), nonceBefore, "nonce before exec should be 0"); s_offRamp.executeSingleReport( _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), _getGasLimitsFromMessages(messages) @@ -751,7 +773,9 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { uint256(Internal.MessageExecutionState.SUCCESS) ); } - assertEq(nonceBefore + expectedNonce, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, OWNER)); + assertEq( + nonceBefore + expectedNonce, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER)) + ); } function test_InvalidSourcePoolAddress_Success() public { @@ -1002,272 +1026,6 @@ contract EVM2EVMMultiOffRamp_executeSingleReport is EVM2EVMMultiOffRampSetup { } } -contract EVM2EVMMultiOffRamp_execute_upgrade is EVM2EVMMultiOffRampSetup { - EVM2EVMOffRampHelper internal s_prevOffRamp; - EVM2EVMOffRampHelper[] internal s_nestedPrevOffRamps; - - function setUp() public virtual override { - super.setUp(); - - ICommitStore mockPrevCommitStore = new MockCommitStore(); - s_prevOffRamp = _deploySingleLaneOffRamp( - mockPrevCommitStore, s_destRouter, address(0), SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1 - ); - - s_nestedPrevOffRamps = new EVM2EVMOffRampHelper[](2); - s_nestedPrevOffRamps[0] = _deploySingleLaneOffRamp( - mockPrevCommitStore, s_destRouter, address(0), SOURCE_CHAIN_SELECTOR_2, ON_RAMP_ADDRESS_2 - ); - s_nestedPrevOffRamps[1] = _deploySingleLaneOffRamp( - mockPrevCommitStore, s_destRouter, address(s_nestedPrevOffRamps[0]), SOURCE_CHAIN_SELECTOR_2, ON_RAMP_ADDRESS_2 - ); - - EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = - new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](3); - sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ - sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, - isEnabled: true, - prevOffRamp: address(s_prevOffRamp), - onRamp: ON_RAMP_ADDRESS_1 - }); - sourceChainConfigs[1] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ - sourceChainSelector: SOURCE_CHAIN_SELECTOR_2, - isEnabled: true, - prevOffRamp: address(s_nestedPrevOffRamps[1]), - onRamp: ON_RAMP_ADDRESS_2 - }); - sourceChainConfigs[2] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ - sourceChainSelector: SOURCE_CHAIN_SELECTOR_3, - isEnabled: true, - prevOffRamp: address(0), - onRamp: ON_RAMP_ADDRESS_3 - }); - - _setupMultipleOffRampsFromConfigs(sourceChainConfigs); - - s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); - s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_3, 1); - } - - function test_Upgraded_Success() public { - Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); - vm.expectEmit(); - emit EVM2EVMMultiOffRamp.ExecutionStateChanged( - SOURCE_CHAIN_SELECTOR_1, - messages[0].sequenceNumber, - messages[0].messageId, - Internal.MessageExecutionState.SUCCESS, - "" - ); - - s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - } - - function test_NoPrevOffRampForChain_Success() public { - Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); - uint64 startNonceChain3 = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_3, messages[0].sender); - s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - - // Nonce unchanged for chain 3 - assertEq(startNonceChain3, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_3, messages[0].sender)); - - Internal.EVM2EVMMessage[] memory messagesChain3 = - _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3); - vm.expectEmit(); - emit EVM2EVMMultiOffRamp.ExecutionStateChanged( - SOURCE_CHAIN_SELECTOR_3, - messagesChain3[0].sequenceNumber, - messagesChain3[0].messageId, - Internal.MessageExecutionState.SUCCESS, - "" - ); - - s_offRamp.executeSingleReport( - _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_3, messagesChain3), new uint256[](0) - ); - assertEq(startNonceChain3 + 1, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_3, messagesChain3[0].sender)); - } - - function test_UpgradedSenderNoncesReadsPreviousRamp_Success() public { - Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); - uint64 startNonce = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); - - for (uint64 i = 1; i < 4; ++i) { - s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - - // messages contains a single message - update for the next execution - messages[0].nonce++; - messages[0].sequenceNumber++; - messages[0].messageId = Internal._hash(messages[0], s_prevOffRamp.metadataHash()); - - assertEq(startNonce + i, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); - } - } - - function test_UpgradedSenderNoncesReadsPreviousRampTransitive_Success() public { - Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_2, ON_RAMP_ADDRESS_2); - uint64 startNonce = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_2, messages[0].sender); - - for (uint64 i = 1; i < 4; ++i) { - s_nestedPrevOffRamps[0].execute( - _generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_2, messages), new uint256[](0) - ); - - // messages contains a single message - update for the next execution - messages[0].nonce++; - messages[0].sequenceNumber++; - messages[0].messageId = Internal._hash(messages[0], s_nestedPrevOffRamps[0].metadataHash()); - - // Read through prev sender nonce through prevOffRamp -> prevPrevOffRamp - assertEq(startNonce + i, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_2, messages[0].sender)); - } - } - - function test_UpgradedNonceStartsAtV1Nonce_Success() public { - Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); - - uint64 startNonce = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); - s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - - assertEq(startNonce + 1, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); - - messages[0].nonce++; - messages[0].messageId = - Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); - - vm.expectEmit(); - emit EVM2EVMMultiOffRamp.ExecutionStateChanged( - SOURCE_CHAIN_SELECTOR_1, - messages[0].sequenceNumber, - messages[0].messageId, - Internal.MessageExecutionState.SUCCESS, - "" - ); - - s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - assertEq(startNonce + 2, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); - - messages[0].nonce++; - messages[0].sequenceNumber++; - messages[0].messageId = - Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); - - vm.expectEmit(); - emit EVM2EVMMultiOffRamp.ExecutionStateChanged( - SOURCE_CHAIN_SELECTOR_1, - messages[0].sequenceNumber, - messages[0].messageId, - Internal.MessageExecutionState.SUCCESS, - "" - ); - - s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - assertEq(startNonce + 3, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); - } - - function test_UpgradedNonceNewSenderStartsAtZero_Success() public { - Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); - - s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - - address newSender = address(1234567); - messages[0].sender = newSender; - messages[0].messageId = - Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); - - vm.expectEmit(); - emit EVM2EVMMultiOffRamp.ExecutionStateChanged( - SOURCE_CHAIN_SELECTOR_1, - messages[0].sequenceNumber, - messages[0].messageId, - Internal.MessageExecutionState.SUCCESS, - "" - ); - - // new sender nonce in new offramp should go from 0 -> 1 - assertEq(s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, newSender), 0); - s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - assertEq(s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, newSender), 1); - } - - function test_UpgradedOffRampNonceSkipsIfMsgInFlight_Success() public { - Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); - - address newSender = address(1234567); - messages[0].sender = newSender; - messages[0].nonce = 2; - messages[0].messageId = - Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); - - uint64 startNonce = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); - - // new offramp sees msg nonce higher than senderNonce - // it waits for previous offramp to execute - vm.expectEmit(); - emit EVM2EVMMultiOffRamp.SkippedSenderWithPreviousRampMessageInflight( - SOURCE_CHAIN_SELECTOR_1, messages[0].nonce, newSender - ); - s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - assertEq(startNonce, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); - - messages[0].nonce = 1; - messages[0].messageId = Internal._hash(messages[0], s_prevOffRamp.metadataHash()); - - // previous offramp executes msg and increases nonce - s_prevOffRamp.execute(_generateSingleRampReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - assertEq(startNonce + 1, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); - - messages[0].nonce = 2; - messages[0].messageId = - Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); - - // new offramp is able to execute - vm.expectEmit(); - emit EVM2EVMMultiOffRamp.ExecutionStateChanged( - SOURCE_CHAIN_SELECTOR_1, - messages[0].sequenceNumber, - messages[0].messageId, - Internal.MessageExecutionState.SUCCESS, - "" - ); - - s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - assertEq(startNonce + 2, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); - } - - function test_UpgradedWithMultiRamp_Revert() public { - Internal.EVM2EVMMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); - vm.expectEmit(); - emit EVM2EVMMultiOffRamp.ExecutionStateChanged( - SOURCE_CHAIN_SELECTOR_1, - messages[0].sequenceNumber, - messages[0].messageId, - Internal.MessageExecutionState.SUCCESS, - "" - ); - s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - - address prevOffRamp = address(s_offRamp); - _deployOffRamp(s_destRouter, s_mockRMN); - - EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = - new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](1); - sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ - sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, - isEnabled: true, - prevOffRamp: address(prevOffRamp), - onRamp: ON_RAMP_ADDRESS_1 - }); - _setupMultipleOffRampsFromConfigs(sourceChainConfigs); - - vm.expectRevert(); - s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); - - vm.expectRevert(); - s_offRamp.executeSingleReport(_generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[](0)); - } -} - contract EVM2EVMMultiOffRamp_executeSingleMessage is EVM2EVMMultiOffRampSetup { function setUp() public virtual override { super.setUp(); @@ -1434,10 +1192,12 @@ contract EVM2EVMMultiOffRamp_batchExecute is EVM2EVMMultiOffRampSetup { "" ); - uint64 nonceBefore = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender); + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)); s_offRamp.batchExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), new uint256[][](1)); - assertGt(s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), nonceBefore); + assertGt( + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)), nonceBefore + ); } function test_MultipleReportsSameChain_Success() public { @@ -1479,9 +1239,11 @@ contract EVM2EVMMultiOffRamp_batchExecute is EVM2EVMMultiOffRampSetup { "" ); - uint64 nonceBefore = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages1[0].sender); + uint64 nonceBefore = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages1[0].sender)); s_offRamp.batchExecute(reports, new uint256[][](2)); - assertGt(s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages1[0].sender), nonceBefore); + assertGt( + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages1[0].sender)), nonceBefore + ); } function test_MultipleReportsDifferentChains_Success() public { @@ -1525,8 +1287,8 @@ contract EVM2EVMMultiOffRamp_batchExecute is EVM2EVMMultiOffRampSetup { s_offRamp.batchExecute(reports, new uint256[][](2)); - uint64 nonceChain1 = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages1[0].sender); - uint64 nonceChain3 = s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_3, messages2[0].sender); + uint64 nonceChain1 = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages1[0].sender)); + uint64 nonceChain3 = s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_3, abi.encode(messages2[0].sender)); assertTrue(nonceChain1 != nonceChain3); assertGt(nonceChain1, 0); @@ -1660,7 +1422,10 @@ contract EVM2EVMMultiOffRamp_manuallyExecute is EVM2EVMMultiOffRampSetup { messages[0].messageId = Internal._hash(messages[0], s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1)); - assertEq(messages[0].nonce - 1, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); + assertEq( + messages[0].nonce - 1, + s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); s_reverting_receiver.setRevert(true); @@ -1681,7 +1446,9 @@ contract EVM2EVMMultiOffRamp_manuallyExecute is EVM2EVMMultiOffRampSetup { s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); - assertEq(messages[0].nonce, s_offRamp.getSenderNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender)); + assertEq( + messages[0].nonce, s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(messages[0].sender)) + ); } function test_manuallyExecute_WithMultiReportGasOverride_Success() public { @@ -2977,14 +2744,12 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_1 }); EVM2EVMMultiOffRamp.SourceChainConfig memory expectedSourceChainConfig = EVM2EVMMultiOffRamp.SourceChainConfig({ isEnabled: true, minSeqNr: 1, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_1, metadataHash: s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) }); @@ -3006,7 +2771,6 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_1 }); @@ -3016,7 +2780,6 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam EVM2EVMMultiOffRamp.SourceChainConfig memory expectedSourceChainConfig = EVM2EVMMultiOffRamp.SourceChainConfig({ isEnabled: false, minSeqNr: 1, - prevOffRamp: address(0), onRamp: sourceChainConfigs[0].onRamp, metadataHash: s_offRamp.metadataHash(SOURCE_CHAIN_SELECTOR_1, sourceChainConfigs[0].onRamp) }); @@ -3044,19 +2807,16 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_1 }); sourceChainConfigs[1] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1 + 1, isEnabled: false, - prevOffRamp: address(999), onRamp: address(uint160(ON_RAMP_ADDRESS_1) + 7) }); sourceChainConfigs[2] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1 + 2, isEnabled: true, - prevOffRamp: address(1000), onRamp: address(uint160(ON_RAMP_ADDRESS_1) + 42) }); @@ -3066,7 +2826,6 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam expectedSourceChainConfigs[i] = EVM2EVMMultiOffRamp.SourceChainConfig({ isEnabled: sourceChainConfigs[i].isEnabled, minSeqNr: 1, - prevOffRamp: sourceChainConfigs[i].prevOffRamp, onRamp: sourceChainConfigs[i].onRamp, metadataHash: s_offRamp.metadataHash(sourceChainConfigs[i].sourceChainSelector, sourceChainConfigs[i].onRamp) }); @@ -3106,7 +2865,6 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(42), onRamp: ON_RAMP_ADDRESS_1 }); sourceChainConfigs[1] = sourceChainConfigArgs; @@ -3114,7 +2872,6 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam // Handle cases when an update occurs bool isNewChain = true; if (sourceChainConfigs[1].sourceChainSelector == SOURCE_CHAIN_SELECTOR_1) { - sourceChainConfigs[1].prevOffRamp = sourceChainConfigs[0].prevOffRamp; sourceChainConfigs[1].onRamp = sourceChainConfigs[0].onRamp; isNewChain = false; } @@ -3122,7 +2879,6 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam EVM2EVMMultiOffRamp.SourceChainConfig memory expectedSourceChainConfig = EVM2EVMMultiOffRamp.SourceChainConfig({ isEnabled: sourceChainConfigArgs.isEnabled, minSeqNr: 1, - prevOffRamp: sourceChainConfigArgs.prevOffRamp, onRamp: sourceChainConfigArgs.onRamp, metadataHash: s_offRamp.metadataHash(sourceChainConfigArgs.sourceChainSelector, sourceChainConfigArgs.onRamp) }); @@ -3150,7 +2906,6 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(0), onRamp: address(0) }); @@ -3161,12 +2916,8 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam function test_ZeroSourceChainSelector_Revert() public { EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](1); - sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ - sourceChainSelector: 0, - isEnabled: true, - prevOffRamp: address(0), - onRamp: ON_RAMP_ADDRESS_1 - }); + sourceChainConfigs[0] = + EVM2EVMMultiOffRamp.SourceChainConfigArgs({sourceChainSelector: 0, isEnabled: true, onRamp: ON_RAMP_ADDRESS_1}); vm.expectRevert(EVM2EVMMultiOffRamp.ZeroChainSelectorNotAllowed.selector); s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); @@ -3178,7 +2929,6 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_1 }); @@ -3190,38 +2940,18 @@ contract EVM2EVMMultiOffRamp_applySourceChainConfigUpdates is EVM2EVMMultiOffRam s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); } - function test_ReplaceExistingChainPrevOffRamp_Revert() public { - EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = - new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](1); - sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ - sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, - isEnabled: true, - prevOffRamp: address(0), - onRamp: ON_RAMP_ADDRESS_1 - }); - - s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); - - sourceChainConfigs[0].prevOffRamp = address(uint160(sourceChainConfigs[0].prevOffRamp) + 1); - - vm.expectRevert(abi.encodeWithSelector(EVM2EVMMultiOffRamp.InvalidStaticConfig.selector, SOURCE_CHAIN_SELECTOR_1)); - s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); - } - function test_ReplaceExistingChainOnRampAndPrevOffRamp_Revert() public { EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](1); sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_1 }); s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); sourceChainConfigs[0].onRamp = address(uint160(sourceChainConfigs[0].onRamp) + 1); - sourceChainConfigs[0].prevOffRamp = address(uint160(sourceChainConfigs[0].prevOffRamp) + 1); vm.expectRevert(abi.encodeWithSelector(EVM2EVMMultiOffRamp.InvalidStaticConfig.selector, SOURCE_CHAIN_SELECTOR_1)); s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); @@ -3669,7 +3399,7 @@ contract EVM2EVMMultiOffRamp_resetUnblessedRoots is EVM2EVMMultiOffRampSetup { function setUp() public virtual override { super.setUp(); _setupRealRMN(); - _deployOffRamp(s_destRouter, s_realRMN); + _deployOffRamp(s_destRouter, s_realRMN, s_inboundNonceManager); _setupMultipleOffRamps(); } @@ -3735,7 +3465,7 @@ contract EVM2EVMMultiOffRamp_verify is EVM2EVMMultiOffRampSetup { function setUp() public virtual override { super.setUp(); _setupRealRMN(); - _deployOffRamp(s_destRouter, s_realRMN); + _deployOffRamp(s_destRouter, s_realRMN, s_inboundNonceManager); _setupMultipleOffRamps(); } diff --git a/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRampSetup.t.sol b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRampSetup.t.sol index b53fb503fb..e5d882b10e 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRampSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/EVM2EVMMultiOffRampSetup.t.sol @@ -8,11 +8,11 @@ import {ICommitStore} from "../../interfaces/ICommitStore.sol"; import {IRMN} from "../../interfaces/IRMN.sol"; import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; +import {NonceManager} from "../../NonceManager.sol"; import {RMN} from "../../RMN.sol"; import {Router} from "../../Router.sol"; import {Client} from "../../libraries/Client.sol"; import {Internal} from "../../libraries/Internal.sol"; - import {MultiOCR3Base} from "../../ocr/MultiOCR3Base.sol"; import {EVM2EVMMultiOffRamp} from "../../offRamp/EVM2EVMMultiOffRamp.sol"; import {EVM2EVMOffRamp} from "../../offRamp/EVM2EVMOffRamp.sol"; @@ -22,7 +22,6 @@ import {TokenSetup} from "../TokenSetup.t.sol"; import {EVM2EVMMultiOffRampHelper} from "../helpers/EVM2EVMMultiOffRampHelper.sol"; import {EVM2EVMOffRampHelper} from "../helpers/EVM2EVMOffRampHelper.sol"; import {MaybeRevertingBurnMintTokenPool} from "../helpers/MaybeRevertingBurnMintTokenPool.sol"; - import {MessageInterceptorHelper} from "../helpers/MessageInterceptorHelper.sol"; import {MaybeRevertMessageReceiver} from "../helpers/receivers/MaybeRevertMessageReceiver.sol"; import {MockCommitStore} from "../mocks/MockCommitStore.sol"; @@ -50,6 +49,7 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba EVM2EVMMultiOffRampHelper internal s_offRamp; MessageInterceptorHelper internal s_inboundMessageValidator; + NonceManager internal s_inboundNonceManager; RMN internal s_realRMN; address internal s_sourceTokenPool = makeAddr("sourceTokenPool"); @@ -71,11 +71,12 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba s_reverting_receiver = new MaybeRevertMessageReceiver(true); s_maybeRevertingPool = MaybeRevertingBurnMintTokenPool(s_destPoolByToken[s_destTokens[1]]); + s_inboundNonceManager = new NonceManager(new address[](0)); - _deployOffRamp(s_destRouter, s_mockRMN); + _deployOffRamp(s_destRouter, s_mockRMN, s_inboundNonceManager); } - function _deployOffRamp(Router router, IRMN rmnProxy) internal { + function _deployOffRamp(Router router, IRMN rmnProxy, NonceManager nonceManager) internal { EVM2EVMMultiOffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](0); @@ -83,7 +84,8 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba EVM2EVMMultiOffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, rmnProxy: address(rmnProxy), - tokenAdminRegistry: address(s_tokenAdminRegistry) + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(nonceManager) }), sourceChainConfigs ); @@ -112,6 +114,12 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba s_offRamp.setDynamicConfig(_generateDynamicMultiOffRampConfig(address(router), address(s_priceRegistry))); s_offRamp.setOCR3Configs(ocrConfigs); + address[] memory authorizedCallers = new address[](1); + authorizedCallers[0] = address(s_offRamp); + NonceManager(nonceManager).applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: authorizedCallers, removedCallers: new address[](0)}) + ); + address[] memory priceUpdaters = new address[](1); priceUpdaters[0] = address(s_offRamp); s_priceRegistry.applyAuthorizedCallerUpdates( @@ -168,19 +176,16 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba sourceChainConfigs[0] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, isEnabled: true, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_1 }); sourceChainConfigs[1] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_2, isEnabled: false, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_2 }); sourceChainConfigs[2] = EVM2EVMMultiOffRamp.SourceChainConfigArgs({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_3, isEnabled: true, - prevOffRamp: address(0), onRamp: ON_RAMP_ADDRESS_3 }); _setupMultipleOffRampsFromConfigs(sourceChainConfigs); @@ -200,8 +205,10 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba onRampUpdates[i] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: sourceChainConfigs[i].onRamp}); offRampUpdates[2 * i] = Router.OffRamp({sourceChainSelector: sourceChainSelector, offRamp: address(s_offRamp)}); - offRampUpdates[2 * i + 1] = - Router.OffRamp({sourceChainSelector: sourceChainSelector, offRamp: address(sourceChainConfigs[i].prevOffRamp)}); + offRampUpdates[2 * i + 1] = Router.OffRamp({ + sourceChainSelector: sourceChainSelector, + offRamp: s_inboundNonceManager.getPreviousRamps(sourceChainSelector).prevOffRamp + }); } s_destRouter.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), offRampUpdates); @@ -423,7 +430,6 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba ) internal pure { assertEq(config1.isEnabled, config2.isEnabled); assertEq(config1.minSeqNr, config2.minSeqNr); - assertEq(config1.prevOffRamp, config2.prevOffRamp); assertEq(config1.onRamp, config2.onRamp); assertEq(config1.metadataHash, config2.metadataHash); } @@ -457,12 +463,18 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba EVM2EVMMultiOffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, rmnProxy: address(s_mockRMN), - tokenAdminRegistry: address(s_tokenAdminRegistry) + tokenAdminRegistry: address(s_tokenAdminRegistry), + nonceManager: address(s_inboundNonceManager) }), new EVM2EVMMultiOffRamp.SourceChainConfigArgs[](0) ); s_offRamp.setDynamicConfig(_generateDynamicMultiOffRampConfig(address(s_destRouter), address(s_priceRegistry))); + address[] memory authorizedCallers = new address[](1); + authorizedCallers[0] = address(s_offRamp); + s_inboundNonceManager.applyAuthorizedCallerUpdates( + AuthorizedCallers.AuthorizedCallerArgs({addedCallers: authorizedCallers, removedCallers: new address[](0)}) + ); _setupMultipleOffRamps(); address[] memory priceUpdaters = new address[](1); diff --git a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRamp.t.sol b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRamp.t.sol index 4b04a6fc16..2b16c87e2e 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRamp.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRamp.t.sol @@ -24,7 +24,7 @@ contract EVM2EVMMultiOnRamp_constructor is EVM2EVMMultiOnRampSetup { chainSelector: SOURCE_CHAIN_SELECTOR, maxFeeJuelsPerMsg: MAX_MSG_FEES_JUELS, rmnProxy: address(s_mockRMN), - nonceManager: address(s_nonceManager), + nonceManager: address(s_outboundNonceManager), tokenAdminRegistry: address(s_tokenAdminRegistry) }); EVM2EVMMultiOnRamp.DynamicConfig memory dynamicConfig = @@ -56,7 +56,7 @@ contract EVM2EVMMultiOnRamp_constructor is EVM2EVMMultiOnRampSetup { ); _deployOnRamp( - SOURCE_CHAIN_SELECTOR, address(s_sourceRouter), address(s_nonceManager), address(s_tokenAdminRegistry) + SOURCE_CHAIN_SELECTOR, address(s_sourceRouter), address(s_outboundNonceManager), address(s_tokenAdminRegistry) ); EVM2EVMMultiOnRamp.DestChainConfig memory expectedDestChainConfig = EVM2EVMMultiOnRamp.DestChainConfig({ @@ -99,7 +99,7 @@ contract EVM2EVMMultiOnRamp_constructor is EVM2EVMMultiOnRampSetup { chainSelector: SOURCE_CHAIN_SELECTOR, maxFeeJuelsPerMsg: MAX_NOP_FEES_JUELS, rmnProxy: address(s_mockRMN), - nonceManager: address(s_nonceManager), + nonceManager: address(s_outboundNonceManager), tokenAdminRegistry: address(s_tokenAdminRegistry) }), _generateDynamicMultiOnRampConfig(address(s_sourceRouter), address(s_priceRegistry)), @@ -117,7 +117,7 @@ contract EVM2EVMMultiOnRamp_constructor is EVM2EVMMultiOnRampSetup { chainSelector: 0, maxFeeJuelsPerMsg: MAX_NOP_FEES_JUELS, rmnProxy: address(s_mockRMN), - nonceManager: address(s_nonceManager), + nonceManager: address(s_outboundNonceManager), tokenAdminRegistry: address(s_tokenAdminRegistry) }), _generateDynamicMultiOnRampConfig(address(s_sourceRouter), address(s_priceRegistry)), @@ -135,7 +135,7 @@ contract EVM2EVMMultiOnRamp_constructor is EVM2EVMMultiOnRampSetup { chainSelector: SOURCE_CHAIN_SELECTOR, maxFeeJuelsPerMsg: MAX_NOP_FEES_JUELS, rmnProxy: address(0), - nonceManager: address(s_nonceManager), + nonceManager: address(s_outboundNonceManager), tokenAdminRegistry: address(s_tokenAdminRegistry) }), _generateDynamicMultiOnRampConfig(address(s_sourceRouter), address(s_priceRegistry)), @@ -171,7 +171,7 @@ contract EVM2EVMMultiOnRamp_constructor is EVM2EVMMultiOnRampSetup { chainSelector: SOURCE_CHAIN_SELECTOR, maxFeeJuelsPerMsg: MAX_NOP_FEES_JUELS, rmnProxy: address(s_mockRMN), - nonceManager: address(s_nonceManager), + nonceManager: address(s_outboundNonceManager), tokenAdminRegistry: address(0) }), _generateDynamicMultiOnRampConfig(address(s_sourceRouter), address(s_priceRegistry)), @@ -489,7 +489,7 @@ contract EVM2EVMMultiOnRamp_forwardFromRouter is EVM2EVMMultiOnRampSetup { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); for (uint64 i = 1; i < 4; ++i) { - uint64 nonceBefore = s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 nonceBefore = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); uint64 sequenceNumberBefore = s_onRamp.getDestChainConfig(DEST_CHAIN_SELECTOR).sequenceNumber; vm.expectEmit(); @@ -497,7 +497,7 @@ contract EVM2EVMMultiOnRamp_forwardFromRouter is EVM2EVMMultiOnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); - uint64 nonceAfter = s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 nonceAfter = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); uint64 sequenceNumberAfter = s_onRamp.getDestChainConfig(DEST_CHAIN_SELECTOR).sequenceNumber; assertEq(nonceAfter, nonceBefore + 1); assertEq(sequenceNumberAfter, sequenceNumberBefore + 1); @@ -511,7 +511,7 @@ contract EVM2EVMMultiOnRamp_forwardFromRouter is EVM2EVMMultiOnRampSetup { ); for (uint64 i = 1; i < 4; ++i) { - uint64 nonceBefore = s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 nonceBefore = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); uint64 sequenceNumberBefore = s_onRamp.getDestChainConfig(DEST_CHAIN_SELECTOR).sequenceNumber; vm.expectEmit(); @@ -519,7 +519,7 @@ contract EVM2EVMMultiOnRamp_forwardFromRouter is EVM2EVMMultiOnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); - uint64 nonceAfter = s_nonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); + uint64 nonceAfter = s_outboundNonceManager.getOutboundNonce(DEST_CHAIN_SELECTOR, OWNER); uint64 sequenceNumberAfter = s_onRamp.getDestChainConfig(DEST_CHAIN_SELECTOR).sequenceNumber; assertEq(nonceAfter, nonceBefore); assertEq(sequenceNumberAfter, sequenceNumberBefore + 1); diff --git a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRampSetup.t.sol b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRampSetup.t.sol index 5b62b0f8e4..d9e2921421 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRampSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/EVM2EVMMultiOnRampSetup.t.sol @@ -35,7 +35,7 @@ contract EVM2EVMMultiOnRampSetup is TokenSetup, PriceRegistrySetup { EVM2EVMMultiOnRampHelper internal s_onRamp; MessageInterceptorHelper internal s_outboundMessageValidator; address[] internal s_offRamps; - NonceManager internal s_nonceManager; + NonceManager internal s_outboundNonceManager; address internal s_destTokenPool = makeAddr("destTokenPool"); address internal s_destToken = makeAddr("destToken"); @@ -104,9 +104,9 @@ contract EVM2EVMMultiOnRampSetup is TokenSetup, PriceRegistrySetup { ); s_outboundMessageValidator = new MessageInterceptorHelper(); - s_nonceManager = new NonceManager(new address[](0)); + s_outboundNonceManager = new NonceManager(new address[](0)); (s_onRamp, s_metadataHash) = _deployOnRamp( - SOURCE_CHAIN_SELECTOR, address(s_sourceRouter), address(s_nonceManager), address(s_tokenAdminRegistry) + SOURCE_CHAIN_SELECTOR, address(s_sourceRouter), address(s_outboundNonceManager), address(s_tokenAdminRegistry) ); s_offRamps = new address[](2); diff --git a/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go b/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go index a50f757806..3d879a047c 100644 --- a/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go +++ b/core/gethwrappers/ccip/generated/ccip_config/ccip_config.go @@ -30,18 +30,18 @@ var ( _ = abi.ConvertType ) -type CCIPConfigChainConfig struct { +type CCIPConfigTypesChainConfig struct { Readers [][32]byte FChain uint8 Config []byte } -type CCIPConfigChainConfigInfo struct { +type CCIPConfigTypesChainConfigInfo struct { ChainSelector uint64 - ChainConfig CCIPConfigChainConfig + ChainConfig CCIPConfigTypesChainConfig } -type CCIPConfigOCR3Config struct { +type CCIPConfigTypesOCR3Config struct { PluginType uint8 ChainSelector uint64 F uint8 @@ -54,14 +54,14 @@ type CCIPConfigOCR3Config struct { OffchainConfig []byte } -type CCIPConfigOCR3ConfigWithMeta struct { - Config CCIPConfigOCR3Config +type CCIPConfigTypesOCR3ConfigWithMeta struct { + Config CCIPConfigTypesOCR3Config ConfigCount uint64 ConfigDigest [32]byte } var CCIPConfigMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"capabilitiesRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainConfigNotSetForChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainSelectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainSelectorNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FChainMustBePositive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FMustBePositive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"InvalidConfigLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumCCIPConfig.ConfigState\",\"name\":\"currentState\",\"type\":\"uint8\"},{\"internalType\":\"enumCCIPConfig.ConfigState\",\"name\":\"proposedState\",\"type\":\"uint8\"}],\"name\":\"InvalidConfigStateTransition\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPluginType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeNotInRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonExistentConfigTransition\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minimum\",\"type\":\"uint256\"}],\"name\":\"NotEnoughTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OfframpAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCapabilitiesRegistryCanCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"p2pIdsLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"signersLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"transmittersLength\",\"type\":\"uint256\"}],\"name\":\"P2PIdsLengthNotMatching\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyBootstrapP2PIds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOCR3Configs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManySigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyTransmitters\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"got\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"}],\"name\":\"WrongConfigCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigestBlueGreen\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"CapabilityConfigurationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structCCIPConfig.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"chainSelectorRemoves\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfig.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPConfig.ChainConfigInfo[]\",\"name\":\"chainConfigAdds\",\"type\":\"tuple[]\"}],\"name\":\"applyChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"beforeCapabilityConfigSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllChainConfigs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfig.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPConfig.ChainConfigInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"getCapabilityConfiguration\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"configuration\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumCCIPConfig.PluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getOCRConfig\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"enumCCIPConfig.PluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"bootstrapP2PIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"p2pIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes[]\",\"name\":\"signers\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes[]\",\"name\":\"transmitters\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfig.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"internalType\":\"structCCIPConfig.OCR3ConfigWithMeta[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"capabilitiesRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainConfigNotSetForChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainSelectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainSelectorNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FChainMustBePositive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FMustBePositive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FTooHigh\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"InvalidConfigLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumCCIPConfigTypes.ConfigState\",\"name\":\"currentState\",\"type\":\"uint8\"},{\"internalType\":\"enumCCIPConfigTypes.ConfigState\",\"name\":\"proposedState\",\"type\":\"uint8\"}],\"name\":\"InvalidConfigStateTransition\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPluginType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"p2pId\",\"type\":\"bytes32\"}],\"name\":\"NodeNotInRegistry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonExistentConfigTransition\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minimum\",\"type\":\"uint256\"}],\"name\":\"NotEnoughTransmitters\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OfframpAddressCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCapabilitiesRegistryCanCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"p2pIdsLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"signersLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"transmittersLength\",\"type\":\"uint256\"}],\"name\":\"P2PIdsLengthNotMatching\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyBootstrapP2PIds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyOCR3Configs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManySigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyTransmitters\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"got\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"}],\"name\":\"WrongConfigCount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigest\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"got\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"}],\"name\":\"WrongConfigDigestBlueGreen\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"CapabilityConfigurationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"}],\"name\":\"ChainConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structCCIPConfigTypes.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"name\":\"ChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"chainSelectorRemoves\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfigInfo[]\",\"name\":\"chainConfigAdds\",\"type\":\"tuple[]\"}],\"name\":\"applyChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"}],\"name\":\"beforeCapabilityConfigSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllChainConfigs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"readers\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"fChain\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"config\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfig\",\"name\":\"chainConfig\",\"type\":\"tuple\"}],\"internalType\":\"structCCIPConfigTypes.ChainConfigInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"getCapabilityConfiguration\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"configuration\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"donId\",\"type\":\"uint32\"},{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"}],\"name\":\"getOCRConfig\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"bootstrapP2PIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"p2pIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes[]\",\"name\":\"signers\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes[]\",\"name\":\"transmitters\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Config\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"configCount\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"}],\"internalType\":\"structCCIPConfigTypes.OCR3ConfigWithMeta[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", Bin: "0x60a06040523480156200001157600080fd5b506040516200417c3803806200417c83398101604081905262000034916200017e565b33806000816200008b5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000be57620000be81620000d3565b5050506001600160a01b0316608052620001b0565b336001600160a01b038216036200012d5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000082565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000602082840312156200019157600080fd5b81516001600160a01b0381168114620001a957600080fd5b9392505050565b608051613fa9620001d360003960008181610e4e01526110e30152613fa96000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80638da5cb5b11610076578063f2fde38b1161005b578063f2fde38b146101bc578063f442c89a146101cf578063fba64a7c146101e257600080fd5b80638da5cb5b1461017f578063ddc042a8146101a757600080fd5b80634bd0473f116100a75780634bd0473f1461013457806379ba5097146101545780638318ed5d1461015e57600080fd5b806301ffc9a7146100c3578063181f5a77146100eb575b600080fd5b6100d66100d1366004612d5f565b6101f5565b60405190151581526020015b60405180910390f35b6101276040518060400160405280601481526020017f43434950436f6e66696720312e362e302d64657600000000000000000000000081525081565b6040516100e29190612e05565b610147610142366004612e49565b61028e565b6040516100e29190612f75565b61015c61075e565b005b61012761016c366004613152565b5060408051602081019091526000815290565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e2565b6101af610860565b6040516100e291906131b3565b61015c6101ca366004613243565b610a52565b61015c6101dd3660046132c5565b610a66565b61015c6101f0366004613349565b610e36565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f78bea72100000000000000000000000000000000000000000000000000000000148061028857507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b63ffffffff821660009081526005602052604081206060918360018111156102b8576102b8612e7e565b60018111156102c9576102c9612e7e565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561075257600084815260209020604080516101a08101909152600984029091018054829060608201908390829060ff16600181111561033c5761033c612e7e565b600181111561034d5761034d612e7e565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a01000000000000000000009091041660608201526001820180546080909201916103a590613406565b80601f01602080910402602001604051908101604052809291908181526020018280546103d190613406565b801561041e5780601f106103f35761010080835404028352916020019161041e565b820191906000526020600020905b81548152906001019060200180831161040157829003601f168201915b505050505081526020016002820180548060200260200160405190810160405280929190818152602001828054801561047657602002820191906000526020600020905b815481526020019060010190808311610462575b50505050508152602001600382018054806020026020016040519081016040528092919081815260200182805480156104ce57602002820191906000526020600020905b8154815260200190600101908083116104ba575b5050505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b828210156105a857838290600052602060002001805461051b90613406565b80601f016020809104026020016040519081016040528092919081815260200182805461054790613406565b80156105945780601f1061056957610100808354040283529160200191610594565b820191906000526020600020905b81548152906001019060200180831161057757829003601f168201915b5050505050815260200190600101906104fc565b50505050815260200160058201805480602002602001604051908101604052809291908181526020016000905b828210156106815783829060005260206000200180546105f490613406565b80601f016020809104026020016040519081016040528092919081815260200182805461062090613406565b801561066d5780601f106106425761010080835404028352916020019161066d565b820191906000526020600020905b81548152906001019060200180831161065057829003601f168201915b5050505050815260200190600101906105d5565b50505050815260200160068201805461069990613406565b80601f01602080910402602001604051908101604052809291908181526020018280546106c590613406565b80156107125780601f106106e757610100808354040283529160200191610712565b820191906000526020600020905b8154815290600101906020018083116106f557829003601f168201915b505050919092525050508152600782015467ffffffffffffffff1660208083019190915260089092015460409091015290825260019290920191016102f7565b50505050905092915050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146107e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064015b60405180910390fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6060600061086e6003610ef7565b9050600061087c6003610f0b565b67ffffffffffffffff81111561089457610894613459565b6040519080825280602002602001820160405280156108cd57816020015b6108ba612af0565b8152602001906001900390816108b25790505b50905060005b8251811015610a4b5760008382815181106108f0576108f0613488565b60209081029190910181015160408051808201825267ffffffffffffffff83168082526000908152600285528290208251815460808188028301810190955260608201818152959750929586019490939192849284919084018282801561097657602002820191906000526020600020905b815481526020019060010190808311610962575b5050509183525050600182015460ff1660208201526002820180546040909201916109a090613406565b80601f01602080910402602001604051908101604052809291908181526020018280546109cc90613406565b8015610a195780601f106109ee57610100808354040283529160200191610a19565b820191906000526020600020905b8154815290600101906020018083116109fc57829003601f168201915b505050505081525050815250838381518110610a3757610a37613488565b6020908102919091010152506001016108d3565b5092915050565b610a5a610f15565b610a6381610f98565b50565b610a6e610f15565b60005b83811015610c5457610ab5858583818110610a8e57610a8e613488565b9050602002016020810190610aa391906134b7565b60039067ffffffffffffffff1661108d565b610b1f57848482818110610acb57610acb613488565b9050602002016020810190610ae091906134b7565b6040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107db565b60026000868684818110610b3557610b35613488565b9050602002016020810190610b4a91906134b7565b67ffffffffffffffff1681526020810191909152604001600090812090610b718282612b38565b6001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055610ba9600283016000612b56565b5050610be7858583818110610bc057610bc0613488565b9050602002016020810190610bd591906134b7565b60039067ffffffffffffffff166110a5565b507f2a680691fef3b2d105196805935232c661ce703e92d464ef0b94a7bc62d714f0858583818110610c1b57610c1b613488565b9050602002016020810190610c3091906134b7565b60405167ffffffffffffffff909116815260200160405180910390a1600101610a71565b5060005b81811015610e2f576000838383818110610c7457610c74613488565b9050602002810190610c8691906134d2565b610c94906020810190613510565b610c9d90613712565b80519091506000858585818110610cb657610cb6613488565b9050602002810190610cc891906134d2565b610cd69060208101906134b7565b905060005b8251811015610d0e57610d06838281518110610cf957610cf9613488565b60200260200101516110b1565b600101610cdb565b50826020015160ff16600003610d50576040517fa9b3766e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff81166000908152600260209081526040909120845180518693610d80928492910190612b90565b5060208201516001820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff90921691909117905560408201516002820190610dcd90826137f9565b50610de791506003905067ffffffffffffffff83166111ca565b507f05dd57854af2c291a94ea52e7c43d80bc3be7fa73022f98b735dea86642fa5e08184604051610e19929190613913565b60405180910390a1505050806001019050610c58565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610ea5576040517fac7a7efd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610eb3848601866139be565b9050600080610ec1836111d6565b8151919350915015610ed957610ed98460008461142f565b805115610eec57610eec8460018361142f565b505050505050505050565b60606000610f0483611c10565b9392505050565b6000610288825490565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016107db565b565b3373ffffffffffffffffffffffffffffffffffffffff821603611017576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016107db565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60008181526001830160205260408120541515610f04565b6000610f048383611c6c565b6040517f50c946fe000000000000000000000000000000000000000000000000000000008152600481018290526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906350c946fe90602401600060405180830381865afa15801561113f573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526111859190810190613c2f565b60808101519091506111c6576040517f8907a4fa000000000000000000000000000000000000000000000000000000008152600481018390526024016107db565b5050565b6000610f048383611d5f565b606080600460ff1683511115611218576040517f8854586400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160028082526060820190925290816020015b61129c6040805161014081019091528060008152602001600067ffffffffffffffff168152602001600060ff168152602001600067ffffffffffffffff1681526020016060815260200160608152602001606081526020016060815260200160608152602001606081525090565b81526020019060019003908161122e57505060408051600280825260608201909252919350602082015b6113346040805161014081019091528060008152602001600067ffffffffffffffff168152602001600060ff168152602001600067ffffffffffffffff1681526020016060815260200160608152602001606081526020016060815260200160608152602001606081525090565b8152602001906001900390816112c657905050905060008060005b855181101561142257600086828151811061136c5761136c613488565b602002602001015160000151600181111561138957611389612e7e565b036113d6578581815181106113a0576113a0613488565b60200260200101518584815181106113ba576113ba613488565b6020026020010181905250826113cf90613d36565b925061141a565b8581815181106113e8576113e8613488565b602002602001015184838151811061140257611402613488565b60200260200101819052508161141790613d36565b91505b60010161134f565b5090835281529092909150565b63ffffffff831660009081526005602052604081208184600181111561145757611457612e7e565b600181111561146857611468612e7e565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156118f157600084815260209020604080516101a08101909152600984029091018054829060608201908390829060ff1660018111156114db576114db612e7e565b60018111156114ec576114ec612e7e565b8152815467ffffffffffffffff61010082048116602084015260ff690100000000000000000083041660408401526a010000000000000000000090910416606082015260018201805460809092019161154490613406565b80601f016020809104026020016040519081016040528092919081815260200182805461157090613406565b80156115bd5780601f10611592576101008083540402835291602001916115bd565b820191906000526020600020905b8154815290600101906020018083116115a057829003601f168201915b505050505081526020016002820180548060200260200160405190810160405280929190818152602001828054801561161557602002820191906000526020600020905b815481526020019060010190808311611601575b505050505081526020016003820180548060200260200160405190810160405280929190818152602001828054801561166d57602002820191906000526020600020905b815481526020019060010190808311611659575b5050505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b828210156117475783829060005260206000200180546116ba90613406565b80601f01602080910402602001604051908101604052809291908181526020018280546116e690613406565b80156117335780601f1061170857610100808354040283529160200191611733565b820191906000526020600020905b81548152906001019060200180831161171657829003601f168201915b50505050508152602001906001019061169b565b50505050815260200160058201805480602002602001604051908101604052809291908181526020016000905b8282101561182057838290600052602060002001805461179390613406565b80601f01602080910402602001604051908101604052809291908181526020018280546117bf90613406565b801561180c5780601f106117e15761010080835404028352916020019161180c565b820191906000526020600020905b8154815290600101906020018083116117ef57829003601f168201915b505050505081526020019060010190611774565b50505050815260200160068201805461183890613406565b80601f016020809104026020016040519081016040528092919081815260200182805461186490613406565b80156118b15780601f10611886576101008083540402835291602001916118b1565b820191906000526020600020905b81548152906001019060200180831161189457829003601f168201915b505050919092525050508152600782015467ffffffffffffffff166020808301919091526008909201546040909101529082526001929092019101611496565b50505050905060006119038251611dae565b905060006119118451611dae565b905061191d8282611e00565b600061192c8785878686611ebc565b905061193884826122a8565b63ffffffff871660009081526005602052604081209087600181111561196057611960612e7e565b600181111561197157611971612e7e565b8152602001908152602001600020600061198b9190612bdb565b60005b8151811015611c065763ffffffff88166000908152600560205260408120908860018111156119bf576119bf612e7e565b60018111156119d0576119d0612e7e565b81526020019081526020016000208282815181106119f0576119f0613488565b6020908102919091018101518254600181810185556000948552929093208151805160099095029091018054929490939192849283917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016908381811115611a5a57611a5a612e7e565b021790555060208201518154604084015160608501517fffffffffffffffffffffffffffffffffffffffffffff000000000000000000ff90921661010067ffffffffffffffff948516027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff1617690100000000000000000060ff90921691909102177fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff166a0100000000000000000000929091169190910217815560808201516001820190611b2990826137f9565b5060a08201518051611b45916002840191602090910190612b90565b5060c08201518051611b61916003840191602090910190612b90565b5060e08201518051611b7d916004840191602090910190612bfc565b506101008201518051611b9a916005840191602090910190612bfc565b506101208201516006820190611bb090826137f9565b50505060208201516007820180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff90921691909117905560409091015160089091015560010161198e565b5050505050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015611c6057602002820191906000526020600020905b815481526020019060010190808311611c4c575b50505050509050919050565b60008181526001830160205260408120548015611d55576000611c90600183613d6e565b8554909150600090611ca490600190613d6e565b9050818114611d09576000866000018281548110611cc457611cc4613488565b9060005260206000200154905080876000018481548110611ce757611ce7613488565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611d1a57611d1a613d81565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610288565b6000915050610288565b6000818152600183016020526040812054611da657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610288565b506000610288565b60006002821115611dee576040517f3e478526000000000000000000000000000000000000000000000000000000008152600481018390526024016107db565b81600281111561028857610288612e7e565b6000826002811115611e1457611e14612e7e565b826002811115611e2657611e26612e7e565b611e309190613db0565b90508060011480611e7c5750807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff148015611e7c57506002836002811115611e7a57611e7a612e7e565b145b15611e8657505050565b82826040517f0a6b675b0000000000000000000000000000000000000000000000000000000081526004016107db929190613de0565b60606000845167ffffffffffffffff811115611eda57611eda613459565b604051908082528060200260200182016040528015611f03578160200160208202803683370190505b5090506000846002811115611f1a57611f1a612e7e565b148015611f3857506001836002811115611f3657611f36612e7e565b145b15611f7957600181600081518110611f5257611f52613488565b602002602001019067ffffffffffffffff16908167ffffffffffffffff16815250506120e1565b6001846002811115611f8d57611f8d612e7e565b148015611fab57506002836002811115611fa957611fa9612e7e565b145b156120425785600081518110611fc357611fc3613488565b60200260200101516020015181600081518110611fe257611fe2613488565b602002602001019067ffffffffffffffff16908167ffffffffffffffff16815250508560008151811061201757612017613488565b602002602001015160200151600161202f9190613dfb565b81600181518110611f5257611f52613488565b600284600281111561205657612056612e7e565b1480156120745750600183600281111561207257612072612e7e565b145b156120ab578560018151811061208c5761208c613488565b60200260200101516020015181600081518110611f5257611f52613488565b83836040517f0a6b675b0000000000000000000000000000000000000000000000000000000081526004016107db929190613de0565b6000855167ffffffffffffffff8111156120fd576120fd613459565b6040519080825280602002602001820160405280156121b357816020015b604080516101a081018252600060608083018281526080840183905260a0840183905260c0840183905260e084018290526101008401829052610120840182905261014084018290526101608401829052610180840191909152825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161211b5790505b50905060005b825181101561229c576121e48782815181106121d7576121d7613488565b6020026020010151612627565b604051806060016040528088838151811061220157612201613488565b6020026020010151815260200184838151811061222057612220613488565b602002602001015167ffffffffffffffff1681526020016122748b86858151811061224d5761224d613488565b60200260200101518b868151811061226757612267613488565b6020026020010151612a1b565b81525082828151811061228957612289613488565b60209081029190910101526001016121b9565b50979650505050505050565b81518151811580156122ba5750806001145b1561235c57826000815181106122d2576122d2613488565b60200260200101516020015167ffffffffffffffff16600114612356578260008151811061230257612302613488565b60209081029190910181015101516040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152600160248201526044016107db565b50505050565b81600114801561236c5750806002145b15612522578360008151811061238457612384613488565b602002602001015160400151836000815181106123a3576123a3613488565b6020026020010151604001511461242f57826000815181106123c7576123c7613488565b602002602001015160400151846000815181106123e6576123e6613488565b6020026020010151604001516040517fc7ccdd7f0000000000000000000000000000000000000000000000000000000081526004016107db929190918252602082015260400190565b8360008151811061244257612442613488565b602002602001015160200151600161245a9190613dfb565b67ffffffffffffffff168360018151811061247757612477613488565b60200260200101516020015167ffffffffffffffff161461235657826001815181106124a5576124a5613488565b602002602001015160200151846000815181106124c4576124c4613488565b60200260200101516020015160016124dc9190613dfb565b6040517fc1658eb800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9283166004820152911660248201526044016107db565b8160021480156125325750806001145b156125f5578360018151811061254a5761254a613488565b6020026020010151604001518360008151811061256957612569613488565b60200260200101516040015114612356578260008151811061258d5761258d613488565b602002602001015160400151846001815181106125ac576125ac613488565b6020026020010151604001516040517f9e9756700000000000000000000000000000000000000000000000000000000081526004016107db929190918252602082015260400190565b6040517f1f1b2bb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806020015167ffffffffffffffff1660000361266f576040517f698cf8e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008151600181111561268457612684612e7e565b141580156126a557506001815160018111156126a2576126a2612e7e565b14155b156126dc576040517f3302dbd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80608001515160000361271b576040517f358c192700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101516127369060039067ffffffffffffffff1661108d565b61277e5760208101516040517f1bd4d2d200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016107db565b60e081015151601f10156127be576040517f1b925da600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61010081015151601f10156127ff576040517f645960ff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208082015167ffffffffffffffff1660009081526002909152604081206001015461282f9060ff166003613e1c565b61283a906001613e38565b60ff1690508082610100015151101561289157610100820151516040517f548dd21f0000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016107db565b816040015160ff166000036128d2576040517f39d1a4d000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516128e2906003613e1c565b60ff168260e001515111612922576040517f4856694e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160e00151518260c00151511415806129465750816101000151518260c001515114155b156129a15760c08201515160e083015151610100840151516040517fba900f6d0000000000000000000000000000000000000000000000000000000081526004810193909352602483019190915260448201526064016107db565b8160c00151518260a001515111156129e5576040517f8473d80700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8260e0015151811015612a1657612a0e8360c001518281518110610cf957610cf9613488565b6001016129e8565b505050565b60008082602001518584600001518560800151878760a001518860c001518960e001518a61010001518b604001518c606001518d6101200151604051602001612a6f9c9b9a99989796959493929190613ebc565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e0a000000000000000000000000000000000000000000000000000000000000179150509392505050565b6040518060400160405280600067ffffffffffffffff168152602001612b33604051806060016040528060608152602001600060ff168152602001606081525090565b905290565b5080546000825590600052602060002090810190610a639190612c4e565b508054612b6290613406565b6000825580601f10612b72575050565b601f016020900490600052602060002090810190610a639190612c4e565b828054828255906000526020600020908101928215612bcb579160200282015b82811115612bcb578251825591602001919060010190612bb0565b50612bd7929150612c4e565b5090565b5080546000825560090290600052602060002090810190610a639190612c63565b828054828255906000526020600020908101928215612c42579160200282015b82811115612c425782518290612c3290826137f9565b5091602001919060010190612c1c565b50612bd7929150612d24565b5b80821115612bd75760008155600101612c4f565b80821115612bd75780547fffffffffffffffffffffffffffff00000000000000000000000000000000000016815560008181612ca26001830182612b56565b612cb0600283016000612b38565b612cbe600383016000612b38565b612ccc600483016000612d41565b612cda600583016000612d41565b612ce8600683016000612b56565b5050506007810180547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016905560006008820155600901612c63565b80821115612bd7576000612d388282612b56565b50600101612d24565b5080546000825590600052602060002090810190610a639190612d24565b600060208284031215612d7157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f0457600080fd5b6000815180845260005b81811015612dc757602081850181015186830182015201612dab565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000610f046020830184612da1565b63ffffffff81168114610a6357600080fd5b8035612e3581612e18565b919050565b803560028110612e3557600080fd5b60008060408385031215612e5c57600080fd5b8235612e6781612e18565b9150612e7560208401612e3a565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60028110612ebd57612ebd612e7e565b9052565b60008151808452602080850194506020840160005b83811015612ef257815187529582019590820190600101612ed6565b509495945050505050565b60008282518085526020808601955060208260051b8401016020860160005b84811015612f68577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952612f56838351612da1565b98840198925090830190600101612f1c565b5090979650505050505050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015613144577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0898403018552815160608151818652612fe38287018251612ead565b898101516080612ffe8189018367ffffffffffffffff169052565b8a830151915060a0613014818a018460ff169052565b938301519360c092506130328984018667ffffffffffffffff169052565b818401519450610140915060e082818b01526130526101a08b0187612da1565b95508185015191507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0610100818c890301818d01526130918885612ec1565b97508587015195506101209350818c890301848d01526130b18887612ec1565b9750828701519550818c890301858d01526130cc8887612efd565b975080870151955050808b8803016101608c01526130ea8786612efd565b9650828601519550808b8803016101808c0152505050505061310c8282612da1565b915050888201516131288a87018267ffffffffffffffff169052565b5090870151938701939093529386019390860190600101612f9e565b509098975050505050505050565b60006020828403121561316457600080fd5b8135610f0481612e18565b60008151606084526131846060850182612ec1565b905060ff6020840151166020850152604083015184820360408601526131aa8282612da1565b95945050505050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015613144578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805167ffffffffffffffff1684528701518784018790526132308785018261316f565b95880195935050908601906001016131dc565b60006020828403121561325557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610f0457600080fd5b60008083601f84011261328b57600080fd5b50813567ffffffffffffffff8111156132a357600080fd5b6020830191508360208260051b85010111156132be57600080fd5b9250929050565b600080600080604085870312156132db57600080fd5b843567ffffffffffffffff808211156132f357600080fd5b6132ff88838901613279565b9096509450602087013591508082111561331857600080fd5b5061332587828801613279565b95989497509550505050565b803567ffffffffffffffff81168114612e3557600080fd5b6000806000806000806080878903121561336257600080fd5b863567ffffffffffffffff8082111561337a57600080fd5b6133868a838b01613279565b9098509650602089013591508082111561339f57600080fd5b818901915089601f8301126133b357600080fd5b8135818111156133c257600080fd5b8a60208285010111156133d457600080fd5b6020830196508095505050506133ec60408801613331565b91506133fa60608801612e2a565b90509295509295509295565b600181811c9082168061341a57607f821691505b602082108103613453577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156134c957600080fd5b610f0482613331565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc183360301811261350657600080fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261350657600080fd5b604051610140810167ffffffffffffffff8111828210171561356857613568613459565b60405290565b60405160e0810167ffffffffffffffff8111828210171561356857613568613459565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156135d8576135d8613459565b604052919050565b600067ffffffffffffffff8211156135fa576135fa613459565b5060051b60200190565b600082601f83011261361557600080fd5b8135602061362a613625836135e0565b613591565b8083825260208201915060208460051b87010193508684111561364c57600080fd5b602086015b848110156136685780358352918301918301613651565b509695505050505050565b803560ff81168114612e3557600080fd5b600082601f83011261369557600080fd5b813567ffffffffffffffff8111156136af576136af613459565b6136e060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613591565b8181528460208386010111156136f557600080fd5b816020850160208301376000918101602001919091529392505050565b60006060823603121561372457600080fd5b6040516060810167ffffffffffffffff828210818311171561374857613748613459565b81604052843591508082111561375d57600080fd5b61376936838701613604565b835261377760208601613673565b6020840152604085013591508082111561379057600080fd5b5061379d36828601613684565b60408301525092915050565b601f821115612a16576000816000526020600020601f850160051c810160208610156137d25750805b601f850160051c820191505b818110156137f1578281556001016137de565b505050505050565b815167ffffffffffffffff81111561381357613813613459565b613827816138218454613406565b846137a9565b602080601f83116001811461387a57600084156138445750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556137f1565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156138c7578886015182559484019460019091019084016138a8565b508582101561390357878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff83168152604060208201526000613936604083018461316f565b949350505050565b600082601f83011261394f57600080fd5b8135602061395f613625836135e0565b82815260059290921b8401810191818101908684111561397e57600080fd5b8286015b8481101561366857803567ffffffffffffffff8111156139a25760008081fd5b6139b08986838b0101613684565b845250918301918301613982565b600060208083850312156139d157600080fd5b823567ffffffffffffffff808211156139e957600080fd5b818501915085601f8301126139fd57600080fd5b8135613a0b613625826135e0565b81815260059190911b83018401908481019088831115613a2a57600080fd5b8585015b83811015613bb857803585811115613a4557600080fd5b8601610140818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0011215613a7a57600080fd5b613a82613544565b613a8d898301612e3a565b8152613a9b60408301613331565b89820152613aab60608301613673565b6040820152613abc60808301613331565b606082015260a082013587811115613ad357600080fd5b613ae18d8b83860101613684565b60808301525060c082013587811115613af957600080fd5b613b078d8b83860101613604565b60a08301525060e082013587811115613b1f57600080fd5b613b2d8d8b83860101613604565b60c0830152506101008083013588811115613b4757600080fd5b613b558e8c8387010161393e565b60e0840152506101208084013589811115613b6f57600080fd5b613b7d8f8d8388010161393e565b8385015250610140840135915088821115613b9757600080fd5b613ba58e8c84870101613684565b9083015250845250918601918601613a2e565b5098975050505050505050565b8051612e3581612e18565b600082601f830112613be157600080fd5b81516020613bf1613625836135e0565b8083825260208201915060208460051b870101935086841115613c1357600080fd5b602086015b848110156136685780518352918301918301613c18565b600060208284031215613c4157600080fd5b815167ffffffffffffffff80821115613c5957600080fd5b9083019060e08286031215613c6d57600080fd5b613c7561356e565b613c7e83613bc5565b8152613c8c60208401613bc5565b6020820152613c9d60408401613bc5565b6040820152606083015160608201526080830151608082015260a083015182811115613cc857600080fd5b613cd487828601613bd0565b60a08301525060c083015182811115613cec57600080fd5b613cf887828601613bd0565b60c08301525095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613d6757613d67613d07565b5060010190565b8181038181111561028857610288613d07565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b8181036000831280158383131683831282161715610a4b57610a4b613d07565b60038110612ebd57612ebd612e7e565b60408101613dee8285613dd0565b610f046020830184613dd0565b67ffffffffffffffff818116838216019080821115610a4b57610a4b613d07565b60ff8181168382160290811690818114610a4b57610a4b613d07565b60ff818116838216019081111561028857610288613d07565b60008282518085526020808601955060208260051b8401016020860160005b84811015612f68577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0868403018952613eaa838351612da1565b98840198925090830190600101613e70565b67ffffffffffffffff8d16815263ffffffff8c166020820152613ee2604082018c612ead565b61018060608201526000613efa61018083018c612da1565b67ffffffffffffffff8b16608084015282810360a0840152613f1c818b612ec1565b905082810360c0840152613f30818a612ec1565b905082810360e0840152613f448189613e51565b9050828103610100840152613f598188613e51565b60ff8716610120850152905067ffffffffffffffff8516610140840152828103610160840152613f898185612da1565b9f9e50505050505050505050505050505056fea164736f6c6343000818000a", } @@ -201,25 +201,25 @@ func (_CCIPConfig *CCIPConfigTransactorRaw) Transact(opts *bind.TransactOpts, me return _CCIPConfig.Contract.contract.Transact(opts, method, params...) } -func (_CCIPConfig *CCIPConfigCaller) GetAllChainConfigs(opts *bind.CallOpts) ([]CCIPConfigChainConfigInfo, error) { +func (_CCIPConfig *CCIPConfigCaller) GetAllChainConfigs(opts *bind.CallOpts) ([]CCIPConfigTypesChainConfigInfo, error) { var out []interface{} err := _CCIPConfig.contract.Call(opts, &out, "getAllChainConfigs") if err != nil { - return *new([]CCIPConfigChainConfigInfo), err + return *new([]CCIPConfigTypesChainConfigInfo), err } - out0 := *abi.ConvertType(out[0], new([]CCIPConfigChainConfigInfo)).(*[]CCIPConfigChainConfigInfo) + out0 := *abi.ConvertType(out[0], new([]CCIPConfigTypesChainConfigInfo)).(*[]CCIPConfigTypesChainConfigInfo) return out0, err } -func (_CCIPConfig *CCIPConfigSession) GetAllChainConfigs() ([]CCIPConfigChainConfigInfo, error) { +func (_CCIPConfig *CCIPConfigSession) GetAllChainConfigs() ([]CCIPConfigTypesChainConfigInfo, error) { return _CCIPConfig.Contract.GetAllChainConfigs(&_CCIPConfig.CallOpts) } -func (_CCIPConfig *CCIPConfigCallerSession) GetAllChainConfigs() ([]CCIPConfigChainConfigInfo, error) { +func (_CCIPConfig *CCIPConfigCallerSession) GetAllChainConfigs() ([]CCIPConfigTypesChainConfigInfo, error) { return _CCIPConfig.Contract.GetAllChainConfigs(&_CCIPConfig.CallOpts) } @@ -245,25 +245,25 @@ func (_CCIPConfig *CCIPConfigCallerSession) GetCapabilityConfiguration(arg0 uint return _CCIPConfig.Contract.GetCapabilityConfiguration(&_CCIPConfig.CallOpts, arg0) } -func (_CCIPConfig *CCIPConfigCaller) GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPConfigOCR3ConfigWithMeta, error) { +func (_CCIPConfig *CCIPConfigCaller) GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) { var out []interface{} err := _CCIPConfig.contract.Call(opts, &out, "getOCRConfig", donId, pluginType) if err != nil { - return *new([]CCIPConfigOCR3ConfigWithMeta), err + return *new([]CCIPConfigTypesOCR3ConfigWithMeta), err } - out0 := *abi.ConvertType(out[0], new([]CCIPConfigOCR3ConfigWithMeta)).(*[]CCIPConfigOCR3ConfigWithMeta) + out0 := *abi.ConvertType(out[0], new([]CCIPConfigTypesOCR3ConfigWithMeta)).(*[]CCIPConfigTypesOCR3ConfigWithMeta) return out0, err } -func (_CCIPConfig *CCIPConfigSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPConfigOCR3ConfigWithMeta, error) { +func (_CCIPConfig *CCIPConfigSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) { return _CCIPConfig.Contract.GetOCRConfig(&_CCIPConfig.CallOpts, donId, pluginType) } -func (_CCIPConfig *CCIPConfigCallerSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPConfigOCR3ConfigWithMeta, error) { +func (_CCIPConfig *CCIPConfigCallerSession) GetOCRConfig(donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) { return _CCIPConfig.Contract.GetOCRConfig(&_CCIPConfig.CallOpts, donId, pluginType) } @@ -345,15 +345,15 @@ func (_CCIPConfig *CCIPConfigTransactorSession) AcceptOwnership() (*types.Transa return _CCIPConfig.Contract.AcceptOwnership(&_CCIPConfig.TransactOpts) } -func (_CCIPConfig *CCIPConfigTransactor) ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigChainConfigInfo) (*types.Transaction, error) { +func (_CCIPConfig *CCIPConfigTransactor) ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) { return _CCIPConfig.contract.Transact(opts, "applyChainConfigUpdates", chainSelectorRemoves, chainConfigAdds) } -func (_CCIPConfig *CCIPConfigSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigChainConfigInfo) (*types.Transaction, error) { +func (_CCIPConfig *CCIPConfigSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) { return _CCIPConfig.Contract.ApplyChainConfigUpdates(&_CCIPConfig.TransactOpts, chainSelectorRemoves, chainConfigAdds) } -func (_CCIPConfig *CCIPConfigTransactorSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigChainConfigInfo) (*types.Transaction, error) { +func (_CCIPConfig *CCIPConfigTransactorSession) ApplyChainConfigUpdates(chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) { return _CCIPConfig.Contract.ApplyChainConfigUpdates(&_CCIPConfig.TransactOpts, chainSelectorRemoves, chainConfigAdds) } @@ -676,7 +676,7 @@ func (it *CCIPConfigChainConfigSetIterator) Close() error { type CCIPConfigChainConfigSet struct { ChainSelector uint64 - ChainConfig CCIPConfigChainConfig + ChainConfig CCIPConfigTypesChainConfig Raw types.Log } @@ -1047,11 +1047,11 @@ func (_CCIPConfig *CCIPConfig) Address() common.Address { } type CCIPConfigInterface interface { - GetAllChainConfigs(opts *bind.CallOpts) ([]CCIPConfigChainConfigInfo, error) + GetAllChainConfigs(opts *bind.CallOpts) ([]CCIPConfigTypesChainConfigInfo, error) GetCapabilityConfiguration(opts *bind.CallOpts, arg0 uint32) ([]byte, error) - GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPConfigOCR3ConfigWithMeta, error) + GetOCRConfig(opts *bind.CallOpts, donId uint32, pluginType uint8) ([]CCIPConfigTypesOCR3ConfigWithMeta, error) Owner(opts *bind.CallOpts) (common.Address, error) @@ -1061,7 +1061,7 @@ type CCIPConfigInterface interface { AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) - ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigChainConfigInfo) (*types.Transaction, error) + ApplyChainConfigUpdates(opts *bind.TransactOpts, chainSelectorRemoves []uint64, chainConfigAdds []CCIPConfigTypesChainConfigInfo) (*types.Transaction, error) BeforeCapabilityConfigSet(opts *bind.TransactOpts, arg0 [][32]byte, config []byte, arg2 uint64, donId uint32) (*types.Transaction, error) diff --git a/core/gethwrappers/ccip/generated/evm_2_evm_multi_offramp/evm_2_evm_multi_offramp.go b/core/gethwrappers/ccip/generated/evm_2_evm_multi_offramp/evm_2_evm_multi_offramp.go index 70f1c46dda..f5a77a4070 100644 --- a/core/gethwrappers/ccip/generated/evm_2_evm_multi_offramp/evm_2_evm_multi_offramp.go +++ b/core/gethwrappers/ccip/generated/evm_2_evm_multi_offramp/evm_2_evm_multi_offramp.go @@ -71,7 +71,6 @@ type EVM2EVMMultiOffRampMerkleRoot struct { type EVM2EVMMultiOffRampSourceChainConfig struct { IsEnabled bool MinSeqNr uint64 - PrevOffRamp common.Address OnRamp common.Address MetadataHash [32]byte } @@ -79,7 +78,6 @@ type EVM2EVMMultiOffRampSourceChainConfig struct { type EVM2EVMMultiOffRampSourceChainConfigArgs struct { SourceChainSelector uint64 IsEnabled bool - PrevOffRamp common.Address OnRamp common.Address } @@ -87,6 +85,7 @@ type EVM2EVMMultiOffRampStaticConfig struct { ChainSelector uint64 RmnProxy common.Address TokenAdminRegistry common.Address + NonceManager common.Address } type EVM2EVMMultiOffRampUnblessedRoot struct { @@ -156,8 +155,8 @@ type MultiOCR3BaseOCRConfigArgs struct { } var EVM2EVMMultiOffRampMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.SourceChainConfigArgs[]\",\"name\":\"sourceChainConfigs\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyAttempted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CanOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ExecutionError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumMultiOCR3Base.InvalidConfigErrorType\",\"name\":\"errorType\",\"type\":\"uint8\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidEVMAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.Interval\",\"name\":\"interval\",\"type\":\"tuple\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"newLimit\",\"type\":\"uint256\"}],\"name\":\"InvalidManualExecutionGasLimit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"name\":\"InvalidMessageId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"newState\",\"type\":\"uint8\"}],\"name\":\"InvalidNewState\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidStaticConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionGasLimitMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"ManualExecutionNotYetEnabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"errorReason\",\"type\":\"bytes\"}],\"name\":\"MessageValidationError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"notPool\",\"type\":\"address\"}],\"name\":\"NotACompatiblePool\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ReceiverError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"RootNotCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"SourceChainNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleCommitReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"StaticConfigCannotBeChanged\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"TokenDataMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"TokenHandlingError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedTokenData\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroChainSelectorNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.Interval\",\"name\":\"interval\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMMultiOffRamp.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"CommitReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMMultiOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"DynamicConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"name\":\"ExecutionStateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"SkippedAlreadyExecutedMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedIncorrectNonce\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SkippedSenderWithPreviousRampMessageInflight\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"metadataHash\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMMultiOffRamp.SourceChainConfig\",\"name\":\"sourceConfig\",\"type\":\"tuple\"}],\"name\":\"SourceChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"SourceChainSelectorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMMultiOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"name\":\"StaticConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.SourceChainConfigArgs[]\",\"name\":\"sourceChainConfigUpdates\",\"type\":\"tuple[]\"}],\"name\":\"applySourceChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"commit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes[]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[]\"}],\"name\":\"executeSingleMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"getExecutionState\",\"outputs\":[{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getSenderNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"getSourceChainConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"prevOffRamp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"metadataHash\",\"type\":\"bytes32\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.SourceChainConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"latestConfigDetails\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"n\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\"}],\"internalType\":\"structMultiOCR3Base.ConfigInfo\",\"name\":\"configInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"}],\"internalType\":\"structMultiOCR3Base.OCRConfig\",\"name\":\"ocrConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[][]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"internalType\":\"structInternal.ExecutionReportSingleChain[]\",\"name\":\"reports\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[][]\",\"name\":\"gasLimitOverrides\",\"type\":\"uint256[][]\"}],\"name\":\"manuallyExecute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.UnblessedRoot[]\",\"name\":\"rootToReset\",\"type\":\"tuple[]\"}],\"name\":\"resetUnblessedRoots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"setDynamicConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"}],\"internalType\":\"structMultiOCR3Base.OCRConfigArgs[]\",\"name\":\"ocrConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setOCR3Configs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6101006040523480156200001257600080fd5b506040516200678738038062006787833981016040819052620000359162000648565b33806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf81620001c1565b5050466080525060208201516001600160a01b03161580620000ec575060408201516001600160a01b0316155b156200010b576040516342bcdf7f60e11b815260040160405180910390fd5b81516001600160401b0316600003620001375760405163c656089560e01b815260040160405180910390fd5b81516001600160401b0390811660a052602080840180516001600160a01b0390811660c05260408087018051831660e052815188519096168652925182169385019390935290511682820152517f2f56698ec552a5d53d27d6f4b3dd8b6989f6426b6151a36aff61160c1d07efdf9181900360600190a1620001b9816200026c565b5050620007d0565b336001600160a01b038216036200021b5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005b81518110156200051c576000828281518110620002905762000290620007ba565b60200260200101519050600081600001519050806001600160401b0316600003620002ce5760405163c656089560e01b815260040160405180910390fd5b60608201516001600160a01b0316620002fa576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160401b038116600090815260076020526040902060018101546001600160a01b031662000400576200035c8284606001517f8acd72527118c8324937b1a42e02cd246697c3b633f1742f3cae11de233722b36200052060201b60201c565b600282015560608301516001820180546001600160a01b039283166001600160a01b03199091161790556040808501518354610100600160481b03199190931669010000000000000000000216610100600160e81b031990921691909117610100178255516001600160401b03831681527ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb99060200160405180910390a16200046f565b606083015160018201546001600160a01b03908116911614158062000444575060408301518154690100000000000000000090046001600160a01b03908116911614155b156200046f5760405163c39a620560e01b81526001600160401b038316600482015260240162000083565b6020830151815490151560ff199091161781556040516001600160401b038316907fa73c588738263db34ef8c1942db8f99559bc6696f6a812d42e76bafb4c0e8d309062000505908490815460ff811615158252600881901c6001600160401b0316602083015260481c6001600160a01b0390811660408301526001830154166060820152600290910154608082015260a00190565b60405180910390a25050508060010190506200026f565b5050565b60a0805160408051602081018590526001600160401b0380881692820192909252911660608201526001600160a01b0384166080820152600091016040516020818303038152906040528051906020012090509392505050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715620005b557620005b56200057a565b60405290565b604051608081016001600160401b0381118282101715620005b557620005b56200057a565b604051601f8201601f191681016001600160401b03811182821017156200060b576200060b6200057a565b604052919050565b80516001600160401b03811681146200062b57600080fd5b919050565b80516001600160a01b03811681146200062b57600080fd5b6000808284036080808212156200065e57600080fd5b6060808312156200066e57600080fd5b6200067862000590565b9250620006858662000613565b835260206200069681880162000630565b818501526040620006aa6040890162000630565b604086015260608801519496506001600160401b0380861115620006cd57600080fd5b858901955089601f870112620006e257600080fd5b855181811115620006f757620006f76200057a565b62000707848260051b01620005e0565b818152848101925060079190911b87018401908b8211156200072857600080fd5b968401965b81881015620007a85786888d031215620007475760008081fd5b62000751620005bb565b6200075c8962000613565b8152858901518015158114620007725760008081fd5b818701526200078389860162000630565b8582015262000794878a0162000630565b81880152835296860196918401916200072d565b80985050505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b60805160a05160c05160e051615f5a6200082d6000396000818161021301526131a40152600081816101e401528181611573015261162a0152600081816101b401526130c6015260008181611bc60152611c120152615f5a6000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c806385572ffb116100d8578063d2a15d351161008c578063f52121a511610066578063f52121a514610668578063f716f99f1461067b578063ff888fb11461068e57600080fd5b8063d2a15d3514610534578063e9d68a8e14610547578063f2fde38b1461065557600080fd5b80638da5cb5b116100bd5780638da5cb5b146104b4578063c673e584146104cf578063ccd37ba3146104ef57600080fd5b806385572ffb146104935780638b364334146104a157600080fd5b8063403b2d631161013a5780637437ff9f116101145780637437ff9f1461036357806379ba5097146104785780637f63b7111461048057600080fd5b8063403b2d631461031d578063542625af146103305780635e36480c1461034357600080fd5b80632d04ab761161016b5780632d04ab76146102ce578063311cd513146102e35780633f4b04aa146102f657600080fd5b806306285c6914610187578063181f5a7714610285575b600080fd5b610243604080516060810182526000808252602082018190529181019190915260405180606001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250905090565b60408051825167ffffffffffffffff1681526020808401516001600160a01b039081169183019190915292820151909216908201526060015b60405180910390f35b6102c16040518060400160405280601d81526020017f45564d3245564d4d756c74694f666652616d7020312e362e302d64657600000081525081565b60405161027c91906141e0565b6102e16102dc36600461428b565b6106b1565b005b6102e16102f136600461433e565b610a77565b600b5467ffffffffffffffff165b60405167ffffffffffffffff909116815260200161027c565b6102e161032b3660046144eb565b610ae0565b6102e161033e366004614b0f565b610c9d565b610356610351366004614c3a565b610e42565b60405161027c9190614c9d565b61040f6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c0810182526004546001600160a01b03808216835263ffffffff74010000000000000000000000000000000000000000830481166020850152600160c01b8304811694840194909452600160e01b90910490921660608201526005548216608082015260065490911660a082015290565b60405161027c9190600060c0820190506001600160a01b03808451168352602084015163ffffffff808216602086015280604087015116604086015280606087015116606086015250508060808501511660808401528060a08501511660a08401525092915050565b6102e1610e98565b6102e161048e366004614cab565b610f56565b6102e1610182366004614d8f565b6103046104af366004614dca565b610f6a565b6000546040516001600160a01b03909116815260200161027c565b6104e26104dd366004614e09565b610f80565b60405161027c9190614e69565b6105266104fd366004614ede565b67ffffffffffffffff919091166000908152600a60209081526040808320938352929052205490565b60405190815260200161027c565b6102e1610542366004614f0a565b6110de565b6105f8610555366004614f7f565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091525067ffffffffffffffff908116600090815260076020908152604091829020825160a081018452815460ff8116151582526101008104909516928101929092526001600160a01b0369010000000000000000009094048416928201929092526001820154909216606083015260020154608082015290565b60405161027c9190600060a08201905082511515825267ffffffffffffffff602084015116602083015260408301516001600160a01b03808216604085015280606086015116606085015250506080830151608083015292915050565b6102e1610663366004614f9c565b611198565b6102e1610676366004614fb9565b6111a9565b6102e1610689366004615085565b6114db565b6106a161069c3660046151d0565b61151d565b604051901515815260200161027c565b60006106bf87890189615361565b805151519091501515806106d857508051602001515115155b156107d857600b5460208a01359067ffffffffffffffff8083169116101561079757600b805467ffffffffffffffff191667ffffffffffffffff831617905560065482516040517f3937306f0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691633937306f916107609160040161559f565b600060405180830381600087803b15801561077a57600080fd5b505af115801561078e573d6000803e3d6000fd5b505050506107d6565b8160200151516000036107d6576040517f2261116700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b60005b8160200151518110156109c057600082602001518281518110610800576108006154cc565b6020026020010151905060008160000151905061081c816115de565b6000610827826116e0565b602084015151815491925067ffffffffffffffff90811661010090920416141580610869575060208084015190810151905167ffffffffffffffff9182169116115b156108b257825160208401516040517feefb0cac0000000000000000000000000000000000000000000000000000000081526108a99291906004016155b2565b60405180910390fd5b6040830151806108ee576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b835167ffffffffffffffff166000908152600a60209081526040808320848452909152902054156109615783516040517f32cf0cbf00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602481018290526044016108a9565b60208085015101516109749060016155fd565b825468ffffffffffffffff00191661010067ffffffffffffffff92831602179092559251166000908152600a6020908152604080832094835293905291909120429055506001016107db565b507f3a3950e13dd607cc37980db0ef14266c40d2bba9c01b2e44bfe549808883095d816040516109f09190615625565b60405180910390a1610a6c60008a8a8a8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c9182918501908490808284376000920191909152508b9250611740915050565b505050505050505050565b610ab7610a86828401846156c2565b6040805160008082526020820190925290610ab1565b6060815260200190600190039081610a9c5790505b50611ab7565b604080516000808252602082019092529050610ada600185858585866000611740565b50505050565b610ae8611b67565b60a08101516001600160a01b03161580610b0a575080516001600160a01b0316155b15610b41576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516004805460208085018051604080880180516060808b0180516001600160a01b039b8c167fffffffffffffffff000000000000000000000000000000000000000000000000909a168a177401000000000000000000000000000000000000000063ffffffff988916021777ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b948816949094026001600160e01b031693909317600160e01b93871693909302929092179098556080808b0180516005805473ffffffffffffffffffffffffffffffffffffffff19908116928e1692909217905560a0808e01805160068054909416908f161790925586519a8b5297518716988a0198909852925185169388019390935251909216958501959095525185169383019390935251909216908201527f0da37fd00459f4f5f0b8210d31525e4910ae674b8bab34b561d146bb45773a4c9060c00160405180910390a150565b610ca5611bc3565b815181518114610ce1576040517f83e3f56400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015610e32576000848281518110610d0057610d006154cc565b60200260200101519050600081602001515190506000858481518110610d2857610d286154cc565b6020026020010151905080518214610d6c576040517f83e3f56400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82811015610e23576000828281518110610d8b57610d8b6154cc565b6020026020010151905080600014158015610dc6575084602001518281518110610db757610db76154cc565b60200260200101516080015181105b15610e1a5784516040517fc8e9605100000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260248101839052604481018290526064016108a9565b50600101610d6f565b50505050806001019050610ce4565b50610e3d8383611ab7565b505050565b6000610e50600160046156f7565b6002610e5d608085615720565b67ffffffffffffffff16610e719190615747565b610e7b8585611c44565b901c166003811115610e8f57610e8f614c73565b90505b92915050565b6001546001600160a01b03163314610ef25760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016108a9565b600080543373ffffffffffffffffffffffffffffffffffffffff19808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610f5e611b67565b610f6781611c8b565b50565b600080610f778484611f9c565b50949350505050565b610fc36040805160e081019091526000606082018181526080830182905260a0830182905260c08301919091528190815260200160608152602001606081525090565b60ff808316600090815260026020818152604092839020835160e081018552815460608201908152600183015480881660808401526101008104881660a0840152620100009004909616151560c08201529485529182018054845181840281018401909552808552929385830193909283018282801561106c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161104e575b50505050508152602001600382018054806020026020016040519081016040528092919081815260200182805480156110ce57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116110b0575b5050505050815250509050919050565b6110e6611b67565b60005b81811015610e3d576000838383818110611105576111056154cc565b90506040020180360381019061111b919061575e565b905061112a816020015161151d565b61118f57805167ffffffffffffffff166000908152600a602090815260408083208285018051855290835281842093909355915191519182527f202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12910160405180910390a15b506001016110e9565b6111a0611b67565b610f67816120ad565b3330146111e2576040517f371a732800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516000808252602082019092528161121f565b60408051808201909152600080825260208201528152602001906001900390816111f85790505b5061014084015151909150156112805761127d836101400151846020015160405160200161125c91906001600160a01b0391909116815260200190565b60408051601f19818403018152918152860151865161016088015187612163565b90505b600061128c8483612210565b6005549091506001600160a01b03168015611379576040517f08d450a10000000000000000000000000000000000000000000000000000000081526001600160a01b038216906308d450a1906112e6908590600401615846565b600060405180830381600087803b15801561130057600080fd5b505af1925050508015611311575060015b611379573d80801561133f576040519150601f19603f3d011682016040523d82523d6000602084013e611344565b606091505b50806040517f09c253250000000000000000000000000000000000000000000000000000000081526004016108a991906141e0565b6101208501515115801561138f57506080850151155b806113a6575060408501516001600160a01b03163b155b806113e6575060408501516113e4906001600160a01b03167f85572ffb000000000000000000000000000000000000000000000000000000006122b3565b155b156113f2575050505050565b60048054608087015160408089015190517f3cf9798300000000000000000000000000000000000000000000000000000000815260009485946001600160a01b031693633cf979839361144d938a9361138893929101615859565b6000604051808303816000875af115801561146c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261149491908101906158da565b5091509150816114d257806040517f0a8d6e8c0000000000000000000000000000000000000000000000000000000081526004016108a991906141e0565b50505050505050565b6114e3611b67565b60005b815181101561151957611511828281518110611504576115046154cc565b60200260200101516122cf565b6001016114e6565b5050565b6040805180820182523081526020810183815291517f4d61677100000000000000000000000000000000000000000000000000000000815290516001600160a01b039081166004830152915160248201526000917f00000000000000000000000000000000000000000000000000000000000000001690634d61677190604401602060405180830381865afa1580156115ba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e929190615934565b6040517f2cbc26bb000000000000000000000000000000000000000000000000000000008152608082901b77ffffffffffffffff000000000000000000000000000000001660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632cbc26bb90602401602060405180830381865afa158015611679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169d9190615934565b15610f67576040517ffdbd6a7200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016108a9565b67ffffffffffffffff81166000908152600760205260408120805460ff16610e92576040517fed053c5900000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016108a9565b60ff8781166000908152600260209081526040808320815160808101835281548152600190910154808616938201939093526101008304851691810191909152620100009091049092161515606083015287359061179f8760a4615951565b90508260600151156117e75784516117b8906020615747565b86516117c5906020615747565b6117d09060a0615951565b6117da9190615951565b6117e49082615951565b90505b368114611829576040517f8e1192e1000000000000000000000000000000000000000000000000000000008152600481018290523660248201526044016108a9565b50815181146118715781516040517f93df584c0000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016108a9565b611879611bc3565b60ff808a16600090815260036020908152604080832033845282528083208151808301909252805480861683529394919390928401916101009091041660028111156118c7576118c7614c73565b60028111156118d8576118d8614c73565b90525090506002816020015160028111156118f5576118f5614c73565b1480156119495750600260008b60ff1660ff168152602001908152602001600020600301816000015160ff1681548110611931576119316154cc565b6000918252602090912001546001600160a01b031633145b61197f576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50816060015115611a6157602082015161199a906001615964565b60ff168551146119d6576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8351855114611a11576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008787604051611a2392919061597d565b604051908190038120611a3a918b9060200161598d565b604051602081830303815290604052805190602001209050611a5f8a828888886125da565b505b6040805182815260208a81013567ffffffffffffffff169082015260ff8b16917f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef0910160405180910390a2505050505050505050565b8151600003611af1576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805160408051600080825260208201909252911591905b8451811015611b6057611b58858281518110611b2657611b266154cc565b602002602001015184611b5257858381518110611b4557611b456154cc565b60200260200101516127f1565b836127f1565b600101611b08565b5050505050565b6000546001600160a01b03163314611bc15760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016108a9565b565b467f000000000000000000000000000000000000000000000000000000000000000014611bc1576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201524660248201526044016108a9565b67ffffffffffffffff8216600090815260096020526040812081611c696080856159a1565b67ffffffffffffffff1681526020810191909152604001600020549392505050565b60005b8151811015611519576000828281518110611cab57611cab6154cc565b602002602001015190506000816000015190508067ffffffffffffffff16600003611d02576040517fc656089500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608201516001600160a01b0316611d46576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff8116600090815260076020526040902060018101546001600160a01b0316611e6957611da08284606001517f8acd72527118c8324937b1a42e02cd246697c3b633f1742f3cae11de233722b36130c0565b600282015560608301516001820180546001600160a01b0392831673ffffffffffffffffffffffffffffffffffffffff19909116179055604080850151835468ffffffffffffffff001991909316690100000000000000000002167fffffff00000000000000000000000000000000000000000000000000000000ff909216919091176101001782555167ffffffffffffffff831681527ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb99060200160405180910390a1611eef565b606083015160018201546001600160a01b039081169116141580611eac575060408301518154690100000000000000000090046001600160a01b03908116911614155b15611eef576040517fc39a620500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff831660048201526024016108a9565b6020830151815490151560ff1990911617815560405167ffffffffffffffff8316907fa73c588738263db34ef8c1942db8f99559bc6696f6a812d42e76bafb4c0e8d3090611f86908490815460ff811615158252600881901c67ffffffffffffffff16602083015260481c6001600160a01b0390811660408301526001830154166060820152600290910154608082015260a00190565b60405180910390a2505050806001019050611c8e565b67ffffffffffffffff80831660009081526008602090815260408083206001600160a01b0386168452909152812054909182911680820361209f5767ffffffffffffffff8516600090815260076020526040902054690100000000000000000090046001600160a01b0316801561209d576040517f856c82470000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015282169063856c824790602401602060405180830381865afa15801561206c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209091906159c8565b60019350935050506120a6565b505b9150600090505b9250929050565b336001600160a01b038216036121055760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016108a9565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b8560005b8751811015612205576121e0888281518110612185576121856154cc565b6020026020010151602001518888888886815181106121a6576121a66154cc565b60200260200101518060200190518101906121c191906159e5565b8887815181106121d3576121d36154cc565b6020026020010151613143565b8282815181106121f2576121f26154cc565b6020908102919091010152600101612167565b509695505050505050565b6040805160a08101825260008082526020820152606091810182905281810182905260808101919091526040518060a001604052808461018001518152602001846000015167ffffffffffffffff168152602001846020015160405160200161228891906001600160a01b0391909116815260200190565b6040516020818303038152906040528152602001846101200151815260200183815250905092915050565b60006122be836134bc565b8015610e8f5750610e8f8383613508565b806040015160ff166000036122fa576000604051631b3fab5160e11b81526004016108a99190615a9a565b60208082015160ff8082166000908152600290935260408320600181015492939092839216900361234b576060840151600182018054911515620100000262ff0000199092169190911790556123a0565b6060840151600182015460ff62010000909104161515901515146123a0576040517f87f6037c00000000000000000000000000000000000000000000000000000000815260ff841660048201526024016108a9565b60a08401518051601f60ff821611156123cf576001604051631b3fab5160e11b81526004016108a99190615a9a565b612435858560030180548060200260200160405190810160405280929190818152602001828054801561242b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161240d575b50505050506135aa565b856060015115612547576124a3858560020180548060200260200160405190810160405280929190818152602001828054801561242b576020028201919060005260206000209081546001600160a01b0316815260019091019060200180831161240d5750505050506135aa565b608086015180516124bd90600287019060208401906140ee565b50805160018501805461ff00191661010060ff841690810291909117909155601f1015612500576002604051631b3fab5160e11b81526004016108a99190615a9a565b6040880151612510906003615ab4565b60ff168160ff1611612538576003604051631b3fab5160e11b81526004016108a99190615a9a565b61254487836001613613565b50505b61255385836002613613565b815161256890600386019060208501906140ee565b5060408681015160018501805460ff191660ff8316179055875180865560a089015192517fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f547936125c1938a939260028b01929190615ad0565b60405180910390a16125d285613793565b505050505050565b6125e261415c565b835160005b818110156127e7576000600188868460208110612606576126066154cc565b61261391901a601b615964565b898581518110612625576126256154cc565b602002602001015189868151811061263f5761263f6154cc565b60200260200101516040516000815260200160405260405161267d949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa15801561269f573d6000803e3d6000fd5b505060408051601f1981015160ff808e166000908152600360209081528582206001600160a01b0385168352815285822085870190965285548084168652939750909550929392840191610100900416600281111561270057612700614c73565b600281111561271157612711614c73565b905250905060018160200151600281111561272e5761272e614c73565b14612765576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f811061277c5761277c6154cc565b6020020151156127b8576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f81106127d3576127d36154cc565b9115156020909202015250506001016125e7565b5050505050505050565b81516127fc816115de565b6000612807826116e0565b602085015151909150600081900361284a576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8460400151518114612888576040517f57e0e08300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff8111156128a3576128a3614392565b6040519080825280602002602001820160405280156128cc578160200160208202803683370190505b50905060005b82811015612991576000876020015182815181106128f2576128f26154cc565b6020026020010151905061290a8186600201546137af565b83838151811061291c5761291c6154cc565b602002602001018181525050806101800151838381518110612940576129406154cc565b602002602001015114612988578061018001516040517f345039be0000000000000000000000000000000000000000000000000000000081526004016108a991815260200190565b506001016128d2565b5060006129a8858389606001518a6080015161390b565b9050806000036129f0576040517f7dd17a7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff861660048201526024016108a9565b8551151560005b84811015610a6c57600089602001518281518110612a1757612a176154cc565b602002602001015190506000612a31898360600151610e42565b90506002816003811115612a4757612a47614c73565b03612a9d5760608201516040805167ffffffffffffffff808d16825290921660208301527f3b575419319662b2a6f5e2467d84521517a3382b908eb3d557bb3fdb0c50e23c910160405180910390a150506130b8565b6000816003811115612ab157612ab1614c73565b1480612ace57506003816003811115612acc57612acc614c73565b145b612b1e5760608201516040517f25507e7f00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808c16600483015290911660248201526044016108a9565b8315612bff5760045460009074010000000000000000000000000000000000000000900463ffffffff16612b5287426156f7565b1190508080612b7257506003826003811115612b7057612b70614c73565b145b612bb4576040517fa9cfc86200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8b1660048201526024016108a9565b8a8481518110612bc657612bc66154cc565b6020026020010151600014612bf9578a8481518110612be757612be76154cc565b60200260200101518360800181815250505b50612c64565b6000816003811115612c1357612c13614c73565b14612c645760608201516040517f3ef2a99c00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808c16600483015290911660248201526044016108a9565b60c082015167ffffffffffffffff1615612e2057600080612c898b8560200151611f9c565b915091508015612d785760c084015167ffffffffffffffff16612cad8360016155fd565b67ffffffffffffffff1614612d305760c084015160208501516040517f5444a3301c7c42dd164cbf6ba4b72bf02504f86c049b06a27fc2b662e334bdbd92612d1f928f9267ffffffffffffffff93841681529190921660208201526001600160a01b0391909116604082015260600190565b60405180910390a1505050506130b8565b67ffffffffffffffff8b81166000908152600860209081526040808320888301516001600160a01b031684529091529020805467ffffffffffffffff19169184169190911790555b6000836003811115612d8c57612d8c614c73565b03612e1d5760c084015167ffffffffffffffff16612dab8360016155fd565b67ffffffffffffffff1614612e1d5760c084015160208501516040517f852dc8e405695593e311bd83991cf39b14a328f304935eac6d3d55617f911d8992612d1f928f9267ffffffffffffffff93841681529190921660208201526001600160a01b0391909116604082015260600190565b50505b60008b604001518481518110612e3857612e386154cc565b6020026020010151905080518361014001515114612e9c5760608301516040517f1cfe6d8b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808d16600483015290911660248201526044016108a9565b612eac8a84606001516001613961565b600080612eb98584613a09565b91509150612ecc8c866060015184613961565b868015612eea57506003826003811115612ee857612ee8614c73565b145b8015612f0857506000846003811115612f0557612f05614c73565b14155b15612f4857846101800151816040517f2b11b8d90000000000000000000000000000000000000000000000000000000081526004016108a9929190615b56565b6003826003811115612f5c57612f5c614c73565b14158015612f7c57506002826003811115612f7957612f79614c73565b14155b15612fbc5760608501516040517f926c5a3e0000000000000000000000000000000000000000000000000000000081526108a9918e918590600401615b6f565b60008560c0015167ffffffffffffffff16118015612feb57506000846003811115612fe957612fe9614c73565b145b156130595767ffffffffffffffff808d166000908152600860209081526040808320898301516001600160a01b0316845290915281208054909216919061303183615b95565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b846101800151856060015167ffffffffffffffff168d67ffffffffffffffff167f8c324ce1367b83031769f6a813e3bb4c117aba2185789d66b98b791405be6df285856040516130aa929190615bbc565b60405180910390a450505050505b6001016129f7565b600081847f000000000000000000000000000000000000000000000000000000000000000085604051602001613123949392919093845267ffffffffffffffff9283166020850152911660408301526001600160a01b0316606082015260800190565b6040516020818303038152906040528051906020012090505b9392505050565b604080518082019091526000808252602082015260006131668460200151613c53565b6040517fbbe4f6db0000000000000000000000000000000000000000000000000000000081526001600160a01b0380831660048301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063bbe4f6db90602401602060405180830381865afa1580156131eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061320f9190615bdc565b90506001600160a01b038116158061325757506132556001600160a01b0382167faff2afbf000000000000000000000000000000000000000000000000000000006122b3565b155b15613299576040517fae9b4ce90000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108a9565b600080613364633907753760e01b6040518061010001604052808d81526020018b67ffffffffffffffff1681526020018c6001600160a01b031681526020018e8152602001876001600160a01b031681526020018a6000015181526020018a604001518152602001898152506040516024016133159190615bf9565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152600454859063ffffffff600160e01b909104166113886084613c95565b509150915081613389578060405163e1cd550960e01b81526004016108a991906141e0565b80516020146133d15780516040517f78ef80240000000000000000000000000000000000000000000000000000000081526020600482015260248101919091526044016108a9565b6000818060200190518101906133e79190615cd0565b604080516001600160a01b038d16602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905260045491925061346a918790600160c01b900463ffffffff166113886084613c95565b50909350915082613490578160405163e1cd550960e01b81526004016108a991906141e0565b604080518082019091526001600160a01b03909516855260208501525091925050509695505050505050565b60006134e8827f01ffc9a700000000000000000000000000000000000000000000000000000000613508565b8015610e925750613501826001600160e01b0319613508565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d91506000519050828015613593575060208210155b801561359f5750600081115b979650505050505050565b60005b8151811015610e3d5760ff8316600090815260036020526040812083519091908490849081106135df576135df6154cc565b6020908102919091018101516001600160a01b03168252810191909152604001600020805461ffff191690556001016135ad565b60005b82518160ff161015610ada576000838260ff1681518110613639576136396154cc565b602002602001015190506000600281111561365657613656614c73565b60ff80871660009081526003602090815260408083206001600160a01b0387168452909152902054610100900416600281111561369557613695614c73565b146136b6576004604051631b3fab5160e11b81526004016108a99190615a9a565b6001600160a01b0381166136f6576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052808360ff16815260200184600281111561371c5761371c614c73565b905260ff80871660009081526003602090815260408083206001600160a01b0387168452825290912083518154931660ff198416811782559184015190929091839161ffff19161761010083600281111561377957613779614c73565b0217905550905050508061378c90615ce9565b9050613616565b60ff8116610f6757600b805467ffffffffffffffff1916905550565b60008060001b8284602001518560400151866060015187608001518860a001518960c001518a60e001518b61010001516040516020016138459897969594939291906001600160a01b039889168152968816602088015267ffffffffffffffff95861660408801526060870194909452911515608086015290921660a0840152921660c082015260e08101919091526101000190565b604051602081830303815290604052805190602001208561012001518051906020012086610140015160405160200161387e9190615d08565b604051602081830303815290604052805190602001208761016001516040516020016138aa9190615dbd565b60408051601f198184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915260e0015b60405160208183030381529060405280519060200120905092915050565b600080613919858585613dbb565b90506139248161151d565b613932576000915050613959565b67ffffffffffffffff86166000908152600a60209081526040808320938352929052205490505b949350505050565b60006002613970608085615720565b67ffffffffffffffff166139849190615747565b905060006139928585611c44565b9050816139a1600160046156f7565b901b1916818360038111156139b8576139b8614c73565b67ffffffffffffffff871660009081526009602052604081209190921b929092179182916139e76080886159a1565b67ffffffffffffffff1681526020810191909152604001600020555050505050565b6040517ff52121a5000000000000000000000000000000000000000000000000000000008152600090606090309063f52121a590613a4d9087908790600401615dd0565b600060405180830381600087803b158015613a6757600080fd5b505af1925050508015613a78575060015b613c38573d808015613aa6576040519150601f19603f3d011682016040523d82523d6000602084013e613aab565b606091505b506000613ab782615f15565b90507f0a8d6e8c000000000000000000000000000000000000000000000000000000006001600160e01b031982161480613b01575063e1cd550960e01b6001600160e01b03198216145b80613b1c575063046b337b60e51b6001600160e01b03198216145b80613b5057507f78ef8024000000000000000000000000000000000000000000000000000000006001600160e01b03198216145b80613b8457507f0c3b563c000000000000000000000000000000000000000000000000000000006001600160e01b03198216145b80613bb857507fae9b4ce9000000000000000000000000000000000000000000000000000000006001600160e01b03198216145b80613bec57507f09c25325000000000000000000000000000000000000000000000000000000006001600160e01b03198216145b15613bfd57506003925090506120a6565b856101800151826040517f2b11b8d90000000000000000000000000000000000000000000000000000000081526004016108a9929190615b56565b50506040805160208101909152600081526002909250929050565b60008151602014613c79578160405163046b337b60e51b81526004016108a991906141e0565b610e9282806020019051810190613c909190615cd0565b614059565b6000606060008361ffff1667ffffffffffffffff811115613cb857613cb8614392565b6040519080825280601f01601f191660200182016040528015613ce2576020820181803683370190505b509150863b613d15577f0c3b563c0000000000000000000000000000000000000000000000000000000060005260046000fd5b5a85811015613d48577fafa32a2c0000000000000000000000000000000000000000000000000000000060005260046000fd5b8590036040810481038710613d81577f37c3be290000000000000000000000000000000000000000000000000000000060005260046000fd5b505a6000808a5160208c0160008c8cf193505a900390503d84811115613da45750835b808352806000602085013e50955095509592505050565b8251825160009190818303613dfc576040517f11a6b26400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101018211801590613e1057506101018111155b613e2d576040516309bde33960e01b815260040160405180910390fd5b60001982820101610100811115613e57576040516309bde33960e01b815260040160405180910390fd5b80600003613e845786600081518110613e7257613e726154cc565b6020026020010151935050505061313c565b60008167ffffffffffffffff811115613e9f57613e9f614392565b604051908082528060200260200182016040528015613ec8578160200160208202803683370190505b50905060008080805b85811015613ff25760006001821b8b811603613f2c5788851015613f15578c5160018601958e918110613f0657613f066154cc565b60200260200101519050613f4e565b8551600185019487918110613f0657613f066154cc565b8b5160018401938d918110613f4357613f436154cc565b602002602001015190505b600089861015613f7e578d5160018701968f918110613f6f57613f6f6154cc565b60200260200101519050613fa0565b8651600186019588918110613f9557613f956154cc565b602002602001015190505b82851115613fc1576040516309bde33960e01b815260040160405180910390fd5b613fcb82826140ad565b878481518110613fdd57613fdd6154cc565b60209081029190910101525050600101613ed1565b50600185038214801561400457508683145b801561400f57508581145b61402c576040516309bde33960e01b815260040160405180910390fd5b836001860381518110614041576140416154cc565b60200260200101519750505050505050509392505050565b60006001600160a01b03821180614071575061040082105b156140a95760408051602081018490520160408051601f198184030181529082905263046b337b60e51b82526108a9916004016141e0565b5090565b60008183106140c5576140c082846140cb565b610e8f565b610e8f83835b6040805160016020820152908101839052606081018290526000906080016138ed565b828054828255906000526020600020908101928215614150579160200282015b82811115614150578251825473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0390911617825560209092019160019091019061410e565b506140a992915061417b565b604051806103e00160405280601f906020820280368337509192915050565b5b808211156140a9576000815560010161417c565b60005b838110156141ab578181015183820152602001614193565b50506000910152565b600081518084526141cc816020860160208601614190565b601f01601f19169290920160200192915050565b602081526000610e8f60208301846141b4565b8060608101831015610e9257600080fd5b60008083601f84011261421657600080fd5b50813567ffffffffffffffff81111561422e57600080fd5b6020830191508360208285010111156120a657600080fd5b60008083601f84011261425857600080fd5b50813567ffffffffffffffff81111561427057600080fd5b6020830191508360208260051b85010111156120a657600080fd5b60008060008060008060008060e0898b0312156142a757600080fd5b6142b18a8a6141f3565b9750606089013567ffffffffffffffff808211156142ce57600080fd5b6142da8c838d01614204565b909950975060808b01359150808211156142f357600080fd5b6142ff8c838d01614246565b909750955060a08b013591508082111561431857600080fd5b506143258b828c01614246565b999c989b50969995989497949560c00135949350505050565b60008060006080848603121561435357600080fd5b61435d85856141f3565b9250606084013567ffffffffffffffff81111561437957600080fd5b61438586828701614204565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156143cb576143cb614392565b60405290565b6040805190810167ffffffffffffffff811182821017156143cb576143cb614392565b6040516101a0810167ffffffffffffffff811182821017156143cb576143cb614392565b60405160a0810167ffffffffffffffff811182821017156143cb576143cb614392565b6040516080810167ffffffffffffffff811182821017156143cb576143cb614392565b6040516060810167ffffffffffffffff811182821017156143cb576143cb614392565b604051601f8201601f1916810167ffffffffffffffff811182821017156144aa576144aa614392565b604052919050565b6001600160a01b0381168114610f6757600080fd5b80356144d2816144b2565b919050565b803563ffffffff811681146144d257600080fd5b600060c082840312156144fd57600080fd5b6145056143a8565b8235614510816144b2565b815261451e602084016144d7565b602082015261452f604084016144d7565b6040820152614540606084016144d7565b60608201526080830135614553816144b2565b608082015260a0830135614566816144b2565b60a08201529392505050565b600067ffffffffffffffff82111561458c5761458c614392565b5060051b60200190565b67ffffffffffffffff81168114610f6757600080fd5b80356144d281614596565b8015158114610f6757600080fd5b80356144d2816145b7565b600067ffffffffffffffff8211156145ea576145ea614392565b50601f01601f191660200190565b600082601f83011261460957600080fd5b813561461c614617826145d0565b614481565b81815284602083860101111561463157600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011261465f57600080fd5b8135602061466f61461783614572565b82815260069290921b8401810191818101908684111561468e57600080fd5b8286015b8481101561220557604081890312156146ab5760008081fd5b6146b36143d1565b81356146be816144b2565b81528185013585820152835291830191604001614692565b600082601f8301126146e757600080fd5b813560206146f761461783614572565b82815260059290921b8401810191818101908684111561471657600080fd5b8286015b8481101561220557803567ffffffffffffffff81111561473a5760008081fd5b6147488986838b01016145f8565b84525091830191830161471a565b60006101a0828403121561476957600080fd5b6147716143f4565b905061477c826145ac565b815261478a602083016144c7565b602082015261479b604083016144c7565b60408201526147ac606083016145ac565b6060820152608082013560808201526147c760a083016145c5565b60a08201526147d860c083016145ac565b60c08201526147e960e083016144c7565b60e082015261010082810135908201526101208083013567ffffffffffffffff8082111561481657600080fd5b614822868387016145f8565b8385015261014092508285013591508082111561483e57600080fd5b61484a8683870161464e565b8385015261016092508285013591508082111561486657600080fd5b50614873858286016146d6565b82840152505061018080830135818301525092915050565b600082601f83011261489c57600080fd5b813560206148ac61461783614572565b82815260059290921b840181019181810190868411156148cb57600080fd5b8286015b8481101561220557803567ffffffffffffffff8111156148ef5760008081fd5b6148fd8986838b0101614756565b8452509183019183016148cf565b600082601f83011261491c57600080fd5b8135602061492c61461783614572565b82815260059290921b8401810191818101908684111561494b57600080fd5b8286015b8481101561220557803567ffffffffffffffff81111561496f5760008081fd5b61497d8986838b01016146d6565b84525091830191830161494f565b600082601f83011261499c57600080fd5b813560206149ac61461783614572565b8083825260208201915060208460051b8701019350868411156149ce57600080fd5b602086015b8481101561220557803583529183019183016149d3565b600082601f8301126149fb57600080fd5b81356020614a0b61461783614572565b82815260059290921b84018101918181019086841115614a2a57600080fd5b8286015b8481101561220557803567ffffffffffffffff80821115614a4f5760008081fd5b9088019060a0828b03601f1901811315614a695760008081fd5b614a71614418565b614a7c8885016145ac565b815260408085013584811115614a925760008081fd5b614aa08e8b8389010161488b565b8a8401525060608086013585811115614ab95760008081fd5b614ac78f8c838a010161490b565b8385015250608091508186013585811115614ae25760008081fd5b614af08f8c838a010161498b565b9184019190915250919093013590830152508352918301918301614a2e565b6000806040808486031215614b2357600080fd5b833567ffffffffffffffff80821115614b3b57600080fd5b614b47878388016149ea565b9450602091508186013581811115614b5e57600080fd5b8601601f81018813614b6f57600080fd5b8035614b7d61461782614572565b81815260059190911b8201840190848101908a831115614b9c57600080fd5b8584015b83811015614c2857803586811115614bb85760008081fd5b8501603f81018d13614bca5760008081fd5b87810135614bda61461782614572565b81815260059190911b82018a0190898101908f831115614bfa5760008081fd5b928b01925b82841015614c185783358252928a0192908a0190614bff565b8652505050918601918601614ba0565b50809750505050505050509250929050565b60008060408385031215614c4d57600080fd5b8235614c5881614596565b91506020830135614c6881614596565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b60048110614c9957614c99614c73565b9052565b60208101610e928284614c89565b60006020808385031215614cbe57600080fd5b823567ffffffffffffffff811115614cd557600080fd5b8301601f81018513614ce657600080fd5b8035614cf461461782614572565b81815260079190911b82018301908381019087831115614d1357600080fd5b928401925b8284101561359f5760808489031215614d315760008081fd5b614d3961443b565b8435614d4481614596565b815284860135614d53816145b7565b81870152604085810135614d66816144b2565b90820152606085810135614d79816144b2565b9082015282526080939093019290840190614d18565b600060208284031215614da157600080fd5b813567ffffffffffffffff811115614db857600080fd5b820160a0818503121561313c57600080fd5b60008060408385031215614ddd57600080fd5b8235614de881614596565b91506020830135614c68816144b2565b803560ff811681146144d257600080fd5b600060208284031215614e1b57600080fd5b610e8f82614df8565b60008151808452602080850194506020840160005b83811015614e5e5781516001600160a01b031687529582019590820190600101614e39565b509495945050505050565b60208152600082518051602084015260ff602082015116604084015260ff604082015116606084015260608101511515608084015250602083015160c060a0840152614eb860e0840182614e24565b90506040840151601f198483030160c0850152614ed58282614e24565b95945050505050565b60008060408385031215614ef157600080fd5b8235614efc81614596565b946020939093013593505050565b60008060208385031215614f1d57600080fd5b823567ffffffffffffffff80821115614f3557600080fd5b818501915085601f830112614f4957600080fd5b813581811115614f5857600080fd5b8660208260061b8501011115614f6d57600080fd5b60209290920196919550909350505050565b600060208284031215614f9157600080fd5b813561313c81614596565b600060208284031215614fae57600080fd5b813561313c816144b2565b60008060408385031215614fcc57600080fd5b823567ffffffffffffffff80821115614fe457600080fd5b614ff086838701614756565b9350602085013591508082111561500657600080fd5b50615013858286016146d6565b9150509250929050565b600082601f83011261502e57600080fd5b8135602061503e61461783614572565b8083825260208201915060208460051b87010193508684111561506057600080fd5b602086015b84811015612205578035615078816144b2565b8352918301918301615065565b6000602080838503121561509857600080fd5b823567ffffffffffffffff808211156150b057600080fd5b818501915085601f8301126150c457600080fd5b81356150d261461782614572565b81815260059190911b830184019084810190888311156150f157600080fd5b8585015b838110156151c35780358581111561510c57600080fd5b860160c0818c03601f190112156151235760008081fd5b61512b6143a8565b888201358152604061513e818401614df8565b8a830152606061514f818501614df8565b82840152608091506151628285016145c5565b9083015260a0838101358981111561517a5760008081fd5b6151888f8d8388010161501d565b838501525060c08401359150888211156151a25760008081fd5b6151b08e8c8487010161501d565b90830152508452509186019186016150f5565b5098975050505050505050565b6000602082840312156151e257600080fd5b5035919050565b80356001600160e01b03811681146144d257600080fd5b600082601f83011261521157600080fd5b8135602061522161461783614572565b82815260069290921b8401810191818101908684111561524057600080fd5b8286015b84811015612205576040818903121561525d5760008081fd5b6152656143d1565b813561527081614596565b815261527d8286016151e9565b81860152835291830191604001615244565b600082601f8301126152a057600080fd5b813560206152b061461783614572565b82815260079290921b840181019181810190868411156152cf57600080fd5b8286015b848110156122055780880360808112156152ed5760008081fd5b6152f561445e565b823561530081614596565b81526040601f1983018113156153165760008081fd5b61531e6143d1565b92508684013561532d81614596565b83528381013561533c81614596565b83880152818701929092526060830135918101919091528352918301916080016152d3565b6000602080838503121561537457600080fd5b823567ffffffffffffffff8082111561538c57600080fd5b818501915060408083880312156153a257600080fd5b6153aa6143d1565b8335838111156153b957600080fd5b84016040818a0312156153cb57600080fd5b6153d36143d1565b8135858111156153e257600080fd5b8201601f81018b136153f357600080fd5b803561540161461782614572565b81815260069190911b8201890190898101908d83111561542057600080fd5b928a01925b828410156154705787848f03121561543d5760008081fd5b6154456143d1565b8435615450816144b2565b815261545d858d016151e9565b818d0152825292870192908a0190615425565b84525050508187013593508484111561548857600080fd5b6154948a858401615200565b81880152825250838501359150828211156154ae57600080fd5b6154ba8883860161528f565b85820152809550505050505092915050565b634e487b7160e01b600052603260045260246000fd5b805160408084528151848201819052600092602091908201906060870190855b8181101561553957835180516001600160a01b031684528501516001600160e01b0316858401529284019291850191600101615502565b50508583015187820388850152805180835290840192506000918401905b80831015615593578351805167ffffffffffffffff1683528501516001600160e01b031685830152928401926001929092019190850190615557565b50979650505050505050565b602081526000610e8f60208301846154e2565b67ffffffffffffffff831681526060810161313c6020830184805167ffffffffffffffff908116835260209182015116910152565b634e487b7160e01b600052601160045260246000fd5b67ffffffffffffffff81811683821601908082111561561e5761561e6155e7565b5092915050565b60006020808352606084516040808487015261564460608701836154e2565b87850151878203601f19016040890152805180835290860193506000918601905b808310156151c357845167ffffffffffffffff8151168352878101516156a489850182805167ffffffffffffffff908116835260209182015116910152565b50840151828701529386019360019290920191608090910190615665565b6000602082840312156156d457600080fd5b813567ffffffffffffffff8111156156eb57600080fd5b613959848285016149ea565b81810381811115610e9257610e926155e7565b634e487b7160e01b600052601260045260246000fd5b600067ffffffffffffffff8084168061573b5761573b61570a565b92169190910692915050565b8082028115828204841417610e9257610e926155e7565b60006040828403121561577057600080fd5b6157786143d1565b823561578381614596565b81526020928301359281019290925250919050565b60008151808452602080850194506020840160005b83811015614e5e57815180516001600160a01b0316885260209081015190880152604087019650908201906001016157ad565b8051825267ffffffffffffffff60208201511660208301526000604082015160a0604085015261581360a08501826141b4565b90506060830151848203606086015261582c82826141b4565b91505060808301518482036080860152614ed58282615798565b602081526000610e8f60208301846157e0565b60808152600061586c60808301876157e0565b61ffff9590951660208301525060408101929092526001600160a01b0316606090910152919050565b600082601f8301126158a657600080fd5b81516158b4614617826145d0565b8181528460208386010111156158c957600080fd5b613959826020830160208701614190565b6000806000606084860312156158ef57600080fd5b83516158fa816145b7565b602085015190935067ffffffffffffffff81111561591757600080fd5b61592386828701615895565b925050604084015190509250925092565b60006020828403121561594657600080fd5b815161313c816145b7565b80820180821115610e9257610e926155e7565b60ff8181168382160190811115610e9257610e926155e7565b8183823760009101908152919050565b828152606082602083013760800192915050565b600067ffffffffffffffff808416806159bc576159bc61570a565b92169190910492915050565b6000602082840312156159da57600080fd5b815161313c81614596565b6000602082840312156159f757600080fd5b815167ffffffffffffffff80821115615a0f57600080fd5b9083019060608286031215615a2357600080fd5b615a2b61445e565b825182811115615a3a57600080fd5b615a4687828601615895565b825250602083015182811115615a5b57600080fd5b615a6787828601615895565b602083015250604083015182811115615a7f57600080fd5b615a8b87828601615895565b60408301525095945050505050565b6020810160058310615aae57615aae614c73565b91905290565b60ff818116838216029081169081811461561e5761561e6155e7565b600060a0820160ff88168352602087602085015260a0604085015281875480845260c086019150886000526020600020935060005b81811015615b2a5784546001600160a01b031683526001948501949284019201615b05565b50508481036060860152615b3e8188614e24565b935050505060ff831660808301529695505050505050565b82815260406020820152600061395960408301846141b4565b67ffffffffffffffff848116825283166020820152606081016139596040830184614c89565b600067ffffffffffffffff808316818103615bb257615bb26155e7565b6001019392505050565b615bc68184614c89565b60406020820152600061395960408301846141b4565b600060208284031215615bee57600080fd5b815161313c816144b2565b6020815260008251610100806020850152615c186101208501836141b4565b91506020850151615c35604086018267ffffffffffffffff169052565b5060408501516001600160a01b038116606086015250606085015160808501526080850151615c6f60a08601826001600160a01b03169052565b5060a0850151601f19808685030160c0870152615c8c84836141b4565b935060c08701519150808685030160e0870152615ca984836141b4565b935060e0870151915080868503018387015250615cc683826141b4565b9695505050505050565b600060208284031215615ce257600080fd5b5051919050565b600060ff821660ff8103615cff57615cff6155e7565b60010192915050565b6020808252825182820181905260009190848201906040850190845b81811015615d5757835180516001600160a01b031684526020908101519084015260408301938501939250600101615d24565b50909695505050505050565b60008282518085526020808601955060208260051b8401016020860160005b84811015615db057601f19868403018952615d9e8383516141b4565b98840198925090830190600101615d82565b5090979650505050505050565b602081526000610e8f6020830184615d63565b60408152615deb60408201845167ffffffffffffffff169052565b60006020840151615e0760608401826001600160a01b03169052565b5060408401516001600160a01b038116608084015250606084015167ffffffffffffffff811660a084015250608084015160c083015260a084015180151560e08401525060c0840151610100615e688185018367ffffffffffffffff169052565b60e08601519150610120615e86818601846001600160a01b03169052565b81870151925061014091508282860152808701519250506101a06101608181870152615eb66101e08701856141b4565b9350828801519250603f19610180818887030181890152615ed78686615798565b9550828a01519450818887030184890152615ef28686615d63565b9550808a01516101c089015250505050508281036020840152614ed58185615d63565b6000815160208301516001600160e01b031980821693506004831015615f455780818460040360031b1b83161693505b50505091905056fea164736f6c6343000818000a", + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nonceManager\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.SourceChainConfigArgs[]\",\"name\":\"sourceChainConfigs\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyAttempted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"AlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CanOnlySelfCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"ConfigDigestMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"CursedByRMN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ExecutionError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"ForkedChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"enumMultiOCR3Base.InvalidConfigErrorType\",\"name\":\"errorType\",\"type\":\"uint8\"}],\"name\":\"InvalidConfig\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"got\",\"type\":\"uint256\"}],\"name\":\"InvalidDataLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedAddress\",\"type\":\"bytes\"}],\"name\":\"InvalidEVMAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.Interval\",\"name\":\"interval\",\"type\":\"tuple\"}],\"name\":\"InvalidInterval\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"newLimit\",\"type\":\"uint256\"}],\"name\":\"InvalidManualExecutionGasLimit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"name\":\"InvalidMessageId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"newState\",\"type\":\"uint8\"}],\"name\":\"InvalidNewState\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRoot\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"InvalidStaticConfig\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeavesCannotBeEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ManualExecutionGasLimitMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"ManualExecutionNotYetEnabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"errorReason\",\"type\":\"bytes\"}],\"name\":\"MessageValidationError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonUniqueSignatures\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"notPool\",\"type\":\"address\"}],\"name\":\"NotACompatiblePool\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleCannotBeZeroAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"ReceiverError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"name\":\"RootAlreadyCommitted\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"RootNotCommitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignaturesOutOfRegistration\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"SourceChainNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StaleCommitReport\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"StaticConfigCannotBeChanged\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"TokenDataMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"name\":\"TokenHandlingError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedTransmitter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedTokenData\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expected\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actual\",\"type\":\"uint256\"}],\"name\":\"WrongMessageLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongNumberOfSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroChainSelectorNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"uint224\",\"name\":\"usdPerToken\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.TokenPriceUpdate[]\",\"name\":\"tokenPriceUpdates\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"destChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint224\",\"name\":\"usdPerUnitGas\",\"type\":\"uint224\"}],\"internalType\":\"structInternal.GasPriceUpdate[]\",\"name\":\"gasPriceUpdates\",\"type\":\"tuple[]\"}],\"internalType\":\"structInternal.PriceUpdates\",\"name\":\"priceUpdates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"min\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"max\",\"type\":\"uint64\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.Interval\",\"name\":\"interval\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMMultiOffRamp.CommitReport\",\"name\":\"report\",\"type\":\"tuple\"}],\"name\":\"CommitReportAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMMultiOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"DynamicConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"state\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"returnData\",\"type\":\"bytes\"}],\"name\":\"ExecutionStateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"RootRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"SkippedAlreadyExecutedMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"metadataHash\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMMultiOffRamp.SourceChainConfig\",\"name\":\"sourceConfig\",\"type\":\"tuple\"}],\"name\":\"SourceChainConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"SourceChainSelectorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nonceManager\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"structEVM2EVMMultiOffRamp.StaticConfig\",\"name\":\"staticConfig\",\"type\":\"tuple\"}],\"name\":\"StaticConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"Transmitted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.SourceChainConfigArgs[]\",\"name\":\"sourceChainConfigUpdates\",\"type\":\"tuple[]\"}],\"name\":\"applySourceChainConfigUpdates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"sender\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"destTokenAmounts\",\"type\":\"tuple[]\"}],\"internalType\":\"structClient.Any2EVMMessage\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"ccipReceive\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"rs\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"ss\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"rawVs\",\"type\":\"bytes32\"}],\"name\":\"commit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[3]\",\"name\":\"reportContext\",\"type\":\"bytes32[3]\"},{\"internalType\":\"bytes\",\"name\":\"report\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes[]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[]\"}],\"name\":\"executeSingleMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDynamicConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.DynamicConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"}],\"name\":\"getExecutionState\",\"outputs\":[{\"internalType\":\"enumInternal.MessageExecutionState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestPriceSequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"getMerkleRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"}],\"name\":\"getSourceChainConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isEnabled\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"onRamp\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"metadataHash\",\"type\":\"bytes32\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.SourceChainConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStaticConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"rmnProxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAdminRegistry\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nonceManager\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.StaticConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"}],\"name\":\"latestConfigDetails\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"n\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\"}],\"internalType\":\"structMultiOCR3Base.ConfigInfo\",\"name\":\"configInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"}],\"internalType\":\"structMultiOCR3Base.OCRConfig\",\"name\":\"ocrConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"strict\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structClient.EVMTokenAmount[]\",\"name\":\"tokenAmounts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"sourceTokenData\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"messageId\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.EVM2EVMMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[][]\",\"name\":\"offchainTokenData\",\"type\":\"bytes[][]\"},{\"internalType\":\"bytes32[]\",\"name\":\"proofs\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"proofFlagBits\",\"type\":\"uint256\"}],\"internalType\":\"structInternal.ExecutionReportSingleChain[]\",\"name\":\"reports\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[][]\",\"name\":\"gasLimitOverrides\",\"type\":\"uint256[][]\"}],\"name\":\"manuallyExecute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.UnblessedRoot[]\",\"name\":\"rootToReset\",\"type\":\"tuple[]\"}],\"name\":\"resetUnblessedRoots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"permissionLessExecutionThresholdSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxTokenTransferGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxPoolReleaseOrMintGas\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"messageValidator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"priceRegistry\",\"type\":\"address\"}],\"internalType\":\"structEVM2EVMMultiOffRamp.DynamicConfig\",\"name\":\"dynamicConfig\",\"type\":\"tuple\"}],\"name\":\"setDynamicConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"configDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"ocrPluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isSignatureVerificationEnabled\",\"type\":\"bool\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"transmitters\",\"type\":\"address[]\"}],\"internalType\":\"structMultiOCR3Base.OCRConfigArgs[]\",\"name\":\"ocrConfigArgs\",\"type\":\"tuple[]\"}],\"name\":\"setOCR3Configs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x6101206040523480156200001257600080fd5b506040516200641738038062006417833981016040819052620000359162000631565b33806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf81620001ee565b5050466080525060208201516001600160a01b03161580620000ec575060408201516001600160a01b0316155b8062000103575060608201516001600160a01b0316155b1562000122576040516342bcdf7f60e11b815260040160405180910390fd5b81516001600160401b03166000036200014e5760405163c656089560e01b815260040160405180910390fd5b81516001600160401b0390811660a052602080840180516001600160a01b0390811660c05260408087018051831660e0526060808901805185166101005283518a519098168852945184169587019590955251821690850152905116908201527f683eb52ee924eb817377cfa8f41f238f4bb7a877da5267869dfffbad85f564d89060800160405180910390a1620001e68162000299565b5050620007b8565b336001600160a01b03821603620002485760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005b815181101562000505576000828281518110620002bd57620002bd620007a2565b60200260200101519050600081600001519050806001600160401b0316600003620002fb5760405163c656089560e01b815260040160405180910390fd5b60408201516001600160a01b031662000327576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160401b03811660009081526007602052604090208054690100000000000000000090046001600160a01b03166200041957620003938284604001517f8acd72527118c8324937b1a42e02cd246697c3b633f1742f3cae11de233722b36200050960201b60201c565b60018201556040838101518254610100600160481b03196001600160a01b0390921669010000000000000000000291909116610100600160e81b031990911617610100178255516001600160401b03831681527ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb99060200160405180910390a162000465565b60408301518154690100000000000000000090046001600160a01b03908116911614620004655760405163c39a620560e01b81526001600160401b038316600482015260240162000083565b6020830151815490151560ff199091161781556040516001600160401b038316907fb8f0c74385134334c728fcac437ec6c6397c9f2c1440532b0c44175a090b140190620004ee908490815460ff811615158252600881901c6001600160401b0316602083015260481c6001600160a01b03166040820152600190910154606082015260800190565b60405180910390a25050508060010190506200029c565b5050565b60a0805160408051602081018590526001600160401b0380881692820192909252911660608201526001600160a01b0384166080820152600091016040516020818303038152906040528051906020012090509392505050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b03811182821017156200059e576200059e62000563565b60405290565b604051606081016001600160401b03811182821017156200059e576200059e62000563565b604051601f8201601f191681016001600160401b0381118282101715620005f457620005f462000563565b604052919050565b80516001600160401b03811681146200061457600080fd5b919050565b80516001600160a01b03811681146200061457600080fd5b60008082840360a08112156200064657600080fd5b60808112156200065557600080fd5b506200066062000579565b6200066b84620005fc565b815260206200067c81860162000619565b818301526040620006906040870162000619565b60408401526060620006a56060880162000619565b606085015260808701519395506001600160401b0380851115620006c857600080fd5b848801945088601f860112620006dd57600080fd5b845181811115620006f257620006f262000563565b62000702858260051b01620005c9565b8181528581019250606090910286018501908a8211156200072257600080fd5b958501955b81871015620007915783878c031215620007415760008081fd5b6200074b620005a4565b6200075688620005fc565b81528688015180151581146200076c5760008081fd5b818801526200077d88870162000619565b818701528352958301959185019162000727565b809750505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b60805160a05160c05160e05161010051615bf0620008276000396000818161023e0152612b1d01526000818161020f0152612ed60152600081816101e001528181611557015261160e0152600081816101b00152612df8015260008181611baa0152611bf60152615bf06000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806385572ffb116100d8578063d2a15d351161008c578063f52121a511610066578063f52121a514610662578063f716f99f14610675578063ff888fb11461068857600080fd5b8063d2a15d3514610556578063e9d68a8e14610569578063f2fde38b1461064f57600080fd5b80638e7da1af116100bd5780638e7da1af146104de578063c673e584146104f1578063ccd37ba31461051157600080fd5b806385572ffb146104b55780638da5cb5b146104c357600080fd5b8063403b2d631161012f5780635e36480c116101145780635e36480c146103785780637437ff9f1461039857806379ba5097146104ad57600080fd5b8063403b2d6314610352578063542625af1461036557600080fd5b80632d04ab76116101605780632d04ab761461030e578063311cd513146103235780633f4b04aa1461033657600080fd5b806306285c691461017c578063181f5a77146102c5575b600080fd5b61026e60408051608081018252600080825260208201819052918101829052606081019190915260405180608001604052807f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250905090565b6040516102bc9190815167ffffffffffffffff1681526020808301516001600160a01b0390811691830191909152604080840151821690830152606092830151169181019190915260800190565b60405180910390f35b6103016040518060400160405280601d81526020017f45564d3245564d4d756c74694f666652616d7020312e362e302d64657600000081525081565b6040516102bc9190613f13565b61032161031c366004613fbe565b6106ab565b005b610321610331366004614071565b610a71565b600a5460405167ffffffffffffffff90911681526020016102bc565b6103216103603660046141fb565b610ada565b610321610373366004614816565b610c97565b61038b610386366004614941565b610e3c565b6040516102bc919061499e565b6104446040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c0810182526004546001600160a01b03808216835263ffffffff74010000000000000000000000000000000000000000830481166020850152600160c01b8304811694840194909452600160e01b90910490921660608201526005548216608082015260065490911660a082015290565b6040516102bc9190600060c0820190506001600160a01b03808451168352602084015163ffffffff808216602086015280604087015116604086015280606087015116606086015250508060808501511660808401528060a08501511660a08401525092915050565b610321610e92565b6103216101773660046149ac565b6000546040516001600160a01b0390911681526020016102bc565b6103216104ec3660046149e7565b610f50565b6105046104ff366004614acf565b610f64565b6040516102bc9190614b2f565b61054861051f366004614ba4565b67ffffffffffffffff919091166000908152600960209081526040808320938352929052205490565b6040519081526020016102bc565b610321610564366004614bce565b6110c2565b610607610577366004614c43565b6040805160808101825260008082526020820181905291810182905260608101919091525067ffffffffffffffff9081166000908152600760209081526040918290208251608081018452815460ff81161515825261010081049095169281019290925269010000000000000000009093046001600160a01b031691810191909152600190910154606082015290565b6040516102bc919081511515815260208083015167ffffffffffffffff16908201526040808301516001600160a01b0316908201526060918201519181019190915260800190565b61032161065d366004614c5e565b61117c565b610321610670366004614c7b565b61118d565b610321610683366004614d47565b6114bf565b61069b610696366004614e92565b611501565b60405190151581526020016102bc565b60006106b98789018961501b565b805151519091501515806106d257508051602001515115155b156107d257600a5460208a01359067ffffffffffffffff8083169116101561079157600a805467ffffffffffffffff191667ffffffffffffffff831617905560065482516040517f3937306f0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691633937306f9161075a9160040161524d565b600060405180830381600087803b15801561077457600080fd5b505af1158015610788573d6000803e3d6000fd5b505050506107d0565b8160200151516000036107d0576040517f2261116700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b60005b8160200151518110156109ba576000826020015182815181106107fa576107fa615186565b60200260200101519050600081600001519050610816816115c2565b6000610821826116c4565b602084015151815491925067ffffffffffffffff90811661010090920416141580610863575060208084015190810151905167ffffffffffffffff9182169116115b156108ac57825160208401516040517feefb0cac0000000000000000000000000000000000000000000000000000000081526108a3929190600401615260565b60405180910390fd5b6040830151806108e8576040517f504570e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b835167ffffffffffffffff1660009081526009602090815260408083208484529091529020541561095b5783516040517f32cf0cbf00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff9091166004820152602481018290526044016108a3565b602080850151015161096e9060016152ab565b825468ffffffffffffffff00191661010067ffffffffffffffff9283160217909255925116600090815260096020908152604080832094835293905291909120429055506001016107d5565b507f3a3950e13dd607cc37980db0ef14266c40d2bba9c01b2e44bfe549808883095d816040516109ea91906152d3565b60405180910390a1610a6660008a8a8a8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c9182918501908490808284376000920191909152508b9250611724915050565b505050505050505050565b610ab1610a8082840184615370565b6040805160008082526020820190925290610aab565b6060815260200190600190039081610a965790505b50611a9b565b604080516000808252602082019092529050610ad4600185858585866000611724565b50505050565b610ae2611b4b565b60a08101516001600160a01b03161580610b04575080516001600160a01b0316155b15610b3b576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516004805460208085018051604080880180516060808b0180516001600160a01b039b8c167fffffffffffffffff000000000000000000000000000000000000000000000000909a168a177401000000000000000000000000000000000000000063ffffffff988916021777ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b948816949094026001600160e01b031693909317600160e01b93871693909302929092179098556080808b0180516005805473ffffffffffffffffffffffffffffffffffffffff19908116928e1692909217905560a0808e01805160068054909416908f161790925586519a8b5297518716988a0198909852925185169388019390935251909216958501959095525185169383019390935251909216908201527f0da37fd00459f4f5f0b8210d31525e4910ae674b8bab34b561d146bb45773a4c9060c00160405180910390a150565b610c9f611ba7565b815181518114610cdb576040517f83e3f56400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015610e2c576000848281518110610cfa57610cfa615186565b60200260200101519050600081602001515190506000858481518110610d2257610d22615186565b6020026020010151905080518214610d66576040517f83e3f56400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82811015610e1d576000828281518110610d8557610d85615186565b6020026020010151905080600014158015610dc0575084602001518281518110610db157610db1615186565b60200260200101516080015181105b15610e145784516040517fc8e9605100000000000000000000000000000000000000000000000000000000815267ffffffffffffffff909116600482015260248101839052604481018290526064016108a3565b50600101610d69565b50505050806001019050610cde565b50610e378383611a9b565b505050565b6000610e4a600160046153a5565b6002610e576080856153ce565b67ffffffffffffffff16610e6b91906153f5565b610e758585611c28565b901c166003811115610e8957610e89614974565b90505b92915050565b6001546001600160a01b03163314610eec5760405162461bcd60e51b815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016108a3565b600080543373ffffffffffffffffffffffffffffffffffffffff19808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610f58611b4b565b610f6181611c6f565b50565b610fa76040805160e081019091526000606082018181526080830182905260a0830182905260c08301919091528190815260200160608152602001606081525090565b60ff808316600090815260026020818152604092839020835160e081018552815460608201908152600183015480881660808401526101008104881660a0840152620100009004909616151560c08201529485529182018054845181840281018401909552808552929385830193909283018282801561105057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611032575b50505050508152602001600382018054806020026020016040519081016040528092919081815260200182805480156110b257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611094575b5050505050815250509050919050565b6110ca611b4b565b60005b81811015610e375760008383838181106110e9576110e9615186565b9050604002018036038101906110ff919061540c565b905061110e8160200151611501565b61117357805167ffffffffffffffff1660009081526009602090815260408083208285018051855290835281842093909355915191519182527f202f1139a3e334b6056064c0e9b19fd07e44a88d8f6e5ded571b24cf8c371f12910160405180910390a15b506001016110cd565b611184611b4b565b610f6181611f30565b3330146111c6576040517f371a732800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160008082526020820190925281611203565b60408051808201909152600080825260208201528152602001906001900390816111dc5790505b50610140840151519091501561126457611261836101400151846020015160405160200161124091906001600160a01b0391909116815260200190565b60408051601f19818403018152918152860151865161016088015187611fe6565b90505b60006112708483612093565b6005549091506001600160a01b0316801561135d576040517f08d450a10000000000000000000000000000000000000000000000000000000081526001600160a01b038216906308d450a1906112ca9085906004016154f3565b600060405180830381600087803b1580156112e457600080fd5b505af19250505080156112f5575060015b61135d573d808015611323576040519150601f19603f3d011682016040523d82523d6000602084013e611328565b606091505b50806040517f09c253250000000000000000000000000000000000000000000000000000000081526004016108a39190613f13565b6101208501515115801561137357506080850151155b8061138a575060408501516001600160a01b03163b155b806113ca575060408501516113c8906001600160a01b03167f85572ffb00000000000000000000000000000000000000000000000000000000612136565b155b156113d6575050505050565b60048054608087015160408089015190517f3cf9798300000000000000000000000000000000000000000000000000000000815260009485946001600160a01b031693633cf9798393611431938a9361138893929101615506565b6000604051808303816000875af1158015611450573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114789190810190615587565b5091509150816114b657806040517f0a8d6e8c0000000000000000000000000000000000000000000000000000000081526004016108a39190613f13565b50505050505050565b6114c7611b4b565b60005b81518110156114fd576114f58282815181106114e8576114e8615186565b6020026020010151612152565b6001016114ca565b5050565b6040805180820182523081526020810183815291517f4d61677100000000000000000000000000000000000000000000000000000000815290516001600160a01b039081166004830152915160248201526000917f00000000000000000000000000000000000000000000000000000000000000001690634d61677190604401602060405180830381865afa15801561159e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8c91906155e1565b6040517f2cbc26bb000000000000000000000000000000000000000000000000000000008152608082901b77ffffffffffffffff000000000000000000000000000000001660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632cbc26bb90602401602060405180830381865afa15801561165d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168191906155e1565b15610f61576040517ffdbd6a7200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016108a3565b67ffffffffffffffff81166000908152600760205260408120805460ff16610e8c576040517fed053c5900000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016108a3565b60ff878116600090815260026020908152604080832081516080810183528154815260019091015480861693820193909352610100830485169181019190915262010000909104909216151560608301528735906117838760a46155fe565b90508260600151156117cb57845161179c9060206153f5565b86516117a99060206153f5565b6117b49060a06155fe565b6117be91906155fe565b6117c890826155fe565b90505b36811461180d576040517f8e1192e1000000000000000000000000000000000000000000000000000000008152600481018290523660248201526044016108a3565b50815181146118555781516040517f93df584c0000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016108a3565b61185d611ba7565b60ff808a16600090815260036020908152604080832033845282528083208151808301909252805480861683529394919390928401916101009091041660028111156118ab576118ab614974565b60028111156118bc576118bc614974565b90525090506002816020015160028111156118d9576118d9614974565b14801561192d5750600260008b60ff1660ff168152602001908152602001600020600301816000015160ff168154811061191557611915615186565b6000918252602090912001546001600160a01b031633145b611963576040517fda0f08e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50816060015115611a4557602082015161197e906001615611565b60ff168551146119ba576040517f71253a2500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83518551146119f5576040517fa75d88af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008787604051611a0792919061562a565b604051908190038120611a1e918b9060200161563a565b604051602081830303815290604052805190602001209050611a438a8288888861245d565b505b6040805182815260208a81013567ffffffffffffffff169082015260ff8b16917f198d6990ef96613a9026203077e422916918b03ff47f0be6bee7b02d8e139ef0910160405180910390a2505050505050505050565b8151600003611ad5576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805160408051600080825260208201909252911591905b8451811015611b4457611b3c858281518110611b0a57611b0a615186565b602002602001015184611b3657858381518110611b2957611b29615186565b6020026020010151612674565b83612674565b600101611aec565b5050505050565b6000546001600160a01b03163314611ba55760405162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016108a3565b565b467f000000000000000000000000000000000000000000000000000000000000000014611ba5576040517f0f01ce850000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201524660248201526044016108a3565b67ffffffffffffffff8216600090815260086020526040812081611c4d60808561564e565b67ffffffffffffffff1681526020810191909152604001600020549392505050565b60005b81518110156114fd576000828281518110611c8f57611c8f615186565b602002602001015190506000816000015190508067ffffffffffffffff16600003611ce6576040517fc656089500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516001600160a01b0316611d2a576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff811660009081526007602052604090208054690100000000000000000090046001600160a01b0316611e2c57611d8e8284604001517f8acd72527118c8324937b1a42e02cd246697c3b633f1742f3cae11de233722b3612df2565b6001820155604083810151825468ffffffffffffffff00196001600160a01b03909216690100000000000000000002919091167fffffff00000000000000000000000000000000000000000000000000000000ff909116176101001782555167ffffffffffffffff831681527ff4c1390c70e5c0f491ae1ccbc06f9117cbbadf2767b247b3bc203280f24c0fb99060200160405180910390a1611e90565b60408301518154690100000000000000000090046001600160a01b03908116911614611e90576040517fc39a620500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff831660048201526024016108a3565b6020830151815490151560ff1990911617815560405167ffffffffffffffff8316907fb8f0c74385134334c728fcac437ec6c6397c9f2c1440532b0c44175a090b140190611f1a908490815460ff811615158252600881901c67ffffffffffffffff16602083015260481c6001600160a01b03166040820152600190910154606082015260800190565b60405180910390a2505050806001019050611c72565b336001600160a01b03821603611f885760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016108a3565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b8560005b87518110156120885761206388828151811061200857612008615186565b60200260200101516020015188888888868151811061202957612029615186565b60200260200101518060200190518101906120449190615675565b88878151811061205657612056615186565b6020026020010151612e75565b82828151811061207557612075615186565b6020908102919091010152600101611fea565b509695505050505050565b6040805160a08101825260008082526020820152606091810182905281810182905260808101919091526040518060a001604052808461018001518152602001846000015167ffffffffffffffff168152602001846020015160405160200161210b91906001600160a01b0391909116815260200190565b6040516020818303038152906040528152602001846101200151815260200183815250905092915050565b6000612141836131ee565b8015610e895750610e89838361323a565b806040015160ff1660000361217d576000604051631b3fab5160e11b81526004016108a3919061572a565b60208082015160ff808216600090815260029093526040832060018101549293909283921690036121ce576060840151600182018054911515620100000262ff000019909216919091179055612223565b6060840151600182015460ff6201000090910416151590151514612223576040517f87f6037c00000000000000000000000000000000000000000000000000000000815260ff841660048201526024016108a3565b60a08401518051601f60ff82161115612252576001604051631b3fab5160e11b81526004016108a3919061572a565b6122b885856003018054806020026020016040519081016040528092919081815260200182805480156122ae57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612290575b50505050506132dc565b8560600151156123ca5761232685856002018054806020026020016040519081016040528092919081815260200182805480156122ae576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116122905750505050506132dc565b608086015180516123409060028701906020840190613e21565b50805160018501805461ff00191661010060ff841690810291909117909155601f1015612383576002604051631b3fab5160e11b81526004016108a3919061572a565b6040880151612393906003615744565b60ff168160ff16116123bb576003604051631b3fab5160e11b81526004016108a3919061572a565b6123c787836001613345565b50505b6123d685836002613345565b81516123eb9060038601906020850190613e21565b5060408681015160018501805460ff191660ff8316179055875180865560a089015192517fab8b1b57514019638d7b5ce9c638fe71366fe8e2be1c40a7a80f1733d0e9f54793612444938a939260028b01929190615760565b60405180910390a1612455856134c5565b505050505050565b612465613e8f565b835160005b8181101561266a57600060018886846020811061248957612489615186565b61249691901a601b615611565b8985815181106124a8576124a8615186565b60200260200101518986815181106124c2576124c2615186565b602002602001015160405160008152602001604052604051612500949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015612522573d6000803e3d6000fd5b505060408051601f1981015160ff808e166000908152600360209081528582206001600160a01b0385168352815285822085870190965285548084168652939750909550929392840191610100900416600281111561258357612583614974565b600281111561259457612594614974565b90525090506001816020015160028111156125b1576125b1614974565b146125e8576040517fca31867a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051859060ff16601f81106125ff576125ff615186565b60200201511561263b576040517ff67bc7c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600185826000015160ff16601f811061265657612656615186565b91151560209092020152505060010161246a565b5050505050505050565b815161267f816115c2565b600061268a826116c4565b60208501515190915060008190036126cd576040517ebf199700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b846040015151811461270b576040517f57e0e08300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff811115612726576127266140c5565b60405190808252806020026020018201604052801561274f578160200160208202803683370190505b50905060005b828110156128145760008760200151828151811061277557612775615186565b6020026020010151905061278d8186600101546134e1565b83838151811061279f5761279f615186565b6020026020010181815250508061018001518383815181106127c3576127c3615186565b60200260200101511461280b578061018001516040517f345039be0000000000000000000000000000000000000000000000000000000081526004016108a391815260200190565b50600101612755565b50600061282b858389606001518a6080015161363d565b905080600003612873576040517f7dd17a7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff861660048201526024016108a3565b8551151560005b84811015610a665760008960200151828151811061289a5761289a615186565b6020026020010151905060006128b4898360600151610e3c565b905060028160038111156128ca576128ca614974565b036129205760608201516040805167ffffffffffffffff808d16825290921660208301527f3b575419319662b2a6f5e2467d84521517a3382b908eb3d557bb3fdb0c50e23c910160405180910390a15050612dea565b600081600381111561293457612934614974565b14806129515750600381600381111561294f5761294f614974565b145b6129a15760608201516040517f25507e7f00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808c16600483015290911660248201526044016108a3565b8315612a825760045460009074010000000000000000000000000000000000000000900463ffffffff166129d587426153a5565b11905080806129f5575060038260038111156129f3576129f3614974565b145b612a37576040517fa9cfc86200000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8b1660048201526024016108a3565b8a8481518110612a4957612a49615186565b6020026020010151600014612a7c578a8481518110612a6a57612a6a615186565b60200260200101518360800181815250505b50612ae7565b6000816003811115612a9657612a96614974565b14612ae75760608201516040517f3ef2a99c00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808c16600483015290911660248201526044016108a3565b60008260c0015167ffffffffffffffff16118015612b1657506000816003811115612b1457612b14614974565b145b15612bef577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e0e03cae8a8460c001518560200151604051602001612b7491906001600160a01b0391909116815260200190565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401612ba1939291906157e6565b6020604051808303816000875af1158015612bc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be491906155e1565b612bef575050612dea565b60008b604001518481518110612c0757612c07615186565b6020026020010151905080518361014001515114612c6b5760608301516040517f1cfe6d8b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff808d16600483015290911660248201526044016108a3565b612c7b8a84606001516001613693565b600080612c88858461373b565b91509150612c9b8c866060015184613693565b868015612cb957506003826003811115612cb757612cb7614974565b145b8015612cd757506000846003811115612cd457612cd4614974565b14155b15612d1757846101800151816040517f2b11b8d90000000000000000000000000000000000000000000000000000000081526004016108a3929190615813565b6003826003811115612d2b57612d2b614974565b14158015612d4b57506002826003811115612d4857612d48614974565b14155b15612d8b5760608501516040517f926c5a3e0000000000000000000000000000000000000000000000000000000081526108a3918e91859060040161582c565b846101800151856060015167ffffffffffffffff168d67ffffffffffffffff167f8c324ce1367b83031769f6a813e3bb4c117aba2185789d66b98b791405be6df28585604051612ddc929190615852565b60405180910390a450505050505b60010161287a565b600081847f000000000000000000000000000000000000000000000000000000000000000085604051602001612e55949392919093845267ffffffffffffffff9283166020850152911660408301526001600160a01b0316606082015260800190565b6040516020818303038152906040528051906020012090505b9392505050565b60408051808201909152600080825260208201526000612e988460200151613986565b6040517fbbe4f6db0000000000000000000000000000000000000000000000000000000081526001600160a01b0380831660048301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063bbe4f6db90602401602060405180830381865afa158015612f1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f419190615872565b90506001600160a01b0381161580612f895750612f876001600160a01b0382167faff2afbf00000000000000000000000000000000000000000000000000000000612136565b155b15612fcb576040517fae9b4ce90000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108a3565b600080613096633907753760e01b6040518061010001604052808d81526020018b67ffffffffffffffff1681526020018c6001600160a01b031681526020018e8152602001876001600160a01b031681526020018a6000015181526020018a60400151815260200189815250604051602401613047919061588f565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152600454859063ffffffff600160e01b9091041661138860846139c8565b5091509150816130bb578060405163e1cd550960e01b81526004016108a39190613f13565b80516020146131035780516040517f78ef80240000000000000000000000000000000000000000000000000000000081526020600482015260248101919091526044016108a3565b6000818060200190518101906131199190615966565b604080516001600160a01b038d16602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905260045491925061319c918790600160c01b900463ffffffff1661138860846139c8565b509093509150826131c2578160405163e1cd550960e01b81526004016108a39190613f13565b604080518082019091526001600160a01b03909516855260208501525091925050509695505050505050565b600061321a827f01ffc9a70000000000000000000000000000000000000000000000000000000061323a565b8015610e8c5750613233826001600160e01b031961323a565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d915060005190508280156132c5575060208210155b80156132d15750600081115b979650505050505050565b60005b8151811015610e375760ff83166000908152600360205260408120835190919084908490811061331157613311615186565b6020908102919091018101516001600160a01b03168252810191909152604001600020805461ffff191690556001016132df565b60005b82518160ff161015610ad4576000838260ff168151811061336b5761336b615186565b602002602001015190506000600281111561338857613388614974565b60ff80871660009081526003602090815260408083206001600160a01b038716845290915290205461010090041660028111156133c7576133c7614974565b146133e8576004604051631b3fab5160e11b81526004016108a3919061572a565b6001600160a01b038116613428576040517fd6c62c9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180604001604052808360ff16815260200184600281111561344e5761344e614974565b905260ff80871660009081526003602090815260408083206001600160a01b0387168452825290912083518154931660ff198416811782559184015190929091839161ffff1916176101008360028111156134ab576134ab614974565b021790555090505050806134be9061597f565b9050613348565b60ff8116610f6157600a805467ffffffffffffffff1916905550565b60008060001b8284602001518560400151866060015187608001518860a001518960c001518a60e001518b61010001516040516020016135779897969594939291906001600160a01b039889168152968816602088015267ffffffffffffffff95861660408801526060870194909452911515608086015290921660a0840152921660c082015260e08101919091526101000190565b60405160208183030381529060405280519060200120856101200151805190602001208661014001516040516020016135b0919061599e565b604051602081830303815290604052805190602001208761016001516040516020016135dc9190615a53565b60408051601f198184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915260e0015b60405160208183030381529060405280519060200120905092915050565b60008061364b858585613aee565b905061365681611501565b61366457600091505061368b565b67ffffffffffffffff86166000908152600960209081526040808320938352929052205490505b949350505050565b600060026136a26080856153ce565b67ffffffffffffffff166136b691906153f5565b905060006136c48585611c28565b9050816136d3600160046153a5565b901b1916818360038111156136ea576136ea614974565b67ffffffffffffffff871660009081526008602052604081209190921b9290921791829161371960808861564e565b67ffffffffffffffff1681526020810191909152604001600020555050505050565b6040517ff52121a5000000000000000000000000000000000000000000000000000000008152600090606090309063f52121a59061377f9087908790600401615a66565b600060405180830381600087803b15801561379957600080fd5b505af19250505080156137aa575060015b61396a573d8080156137d8576040519150601f19603f3d011682016040523d82523d6000602084013e6137dd565b606091505b5060006137e982615bab565b90507f0a8d6e8c000000000000000000000000000000000000000000000000000000006001600160e01b031982161480613833575063e1cd550960e01b6001600160e01b03198216145b8061384e575063046b337b60e51b6001600160e01b03198216145b8061388257507f78ef8024000000000000000000000000000000000000000000000000000000006001600160e01b03198216145b806138b657507f0c3b563c000000000000000000000000000000000000000000000000000000006001600160e01b03198216145b806138ea57507fae9b4ce9000000000000000000000000000000000000000000000000000000006001600160e01b03198216145b8061391e57507f09c25325000000000000000000000000000000000000000000000000000000006001600160e01b03198216145b1561392f575060039250905061397f565b856101800151826040517f2b11b8d90000000000000000000000000000000000000000000000000000000081526004016108a3929190615813565b50506040805160208101909152600081526002905b9250929050565b600081516020146139ac578160405163046b337b60e51b81526004016108a39190613f13565b610e8c828060200190518101906139c39190615966565b613d8c565b6000606060008361ffff1667ffffffffffffffff8111156139eb576139eb6140c5565b6040519080825280601f01601f191660200182016040528015613a15576020820181803683370190505b509150863b613a48577f0c3b563c0000000000000000000000000000000000000000000000000000000060005260046000fd5b5a85811015613a7b577fafa32a2c0000000000000000000000000000000000000000000000000000000060005260046000fd5b8590036040810481038710613ab4577f37c3be290000000000000000000000000000000000000000000000000000000060005260046000fd5b505a6000808a5160208c0160008c8cf193505a900390503d84811115613ad75750835b808352806000602085013e50955095509592505050565b8251825160009190818303613b2f576040517f11a6b26400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101018211801590613b4357506101018111155b613b60576040516309bde33960e01b815260040160405180910390fd5b60001982820101610100811115613b8a576040516309bde33960e01b815260040160405180910390fd5b80600003613bb75786600081518110613ba557613ba5615186565b60200260200101519350505050612e6e565b60008167ffffffffffffffff811115613bd257613bd26140c5565b604051908082528060200260200182016040528015613bfb578160200160208202803683370190505b50905060008080805b85811015613d255760006001821b8b811603613c5f5788851015613c48578c5160018601958e918110613c3957613c39615186565b60200260200101519050613c81565b8551600185019487918110613c3957613c39615186565b8b5160018401938d918110613c7657613c76615186565b602002602001015190505b600089861015613cb1578d5160018701968f918110613ca257613ca2615186565b60200260200101519050613cd3565b8651600186019588918110613cc857613cc8615186565b602002602001015190505b82851115613cf4576040516309bde33960e01b815260040160405180910390fd5b613cfe8282613de0565b878481518110613d1057613d10615186565b60209081029190910101525050600101613c04565b506001850382148015613d3757508683145b8015613d4257508581145b613d5f576040516309bde33960e01b815260040160405180910390fd5b836001860381518110613d7457613d74615186565b60200260200101519750505050505050509392505050565b60006001600160a01b03821180613da4575061040082105b15613ddc5760408051602081018490520160408051601f198184030181529082905263046b337b60e51b82526108a391600401613f13565b5090565b6000818310613df857613df38284613dfe565b610e89565b610e8983835b60408051600160208201529081018390526060810182905260009060800161361f565b828054828255906000526020600020908101928215613e83579160200282015b82811115613e83578251825473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116178255602090920191600190910190613e41565b50613ddc929150613eae565b604051806103e00160405280601f906020820280368337509192915050565b5b80821115613ddc5760008155600101613eaf565b60005b83811015613ede578181015183820152602001613ec6565b50506000910152565b60008151808452613eff816020860160208601613ec3565b601f01601f19169290920160200192915050565b602081526000610e896020830184613ee7565b8060608101831015610e8c57600080fd5b60008083601f840112613f4957600080fd5b50813567ffffffffffffffff811115613f6157600080fd5b60208301915083602082850101111561397f57600080fd5b60008083601f840112613f8b57600080fd5b50813567ffffffffffffffff811115613fa357600080fd5b6020830191508360208260051b850101111561397f57600080fd5b60008060008060008060008060e0898b031215613fda57600080fd5b613fe48a8a613f26565b9750606089013567ffffffffffffffff8082111561400157600080fd5b61400d8c838d01613f37565b909950975060808b013591508082111561402657600080fd5b6140328c838d01613f79565b909750955060a08b013591508082111561404b57600080fd5b506140588b828c01613f79565b999c989b50969995989497949560c00135949350505050565b60008060006080848603121561408657600080fd5b6140908585613f26565b9250606084013567ffffffffffffffff8111156140ac57600080fd5b6140b886828701613f37565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156140fe576140fe6140c5565b60405290565b6040805190810167ffffffffffffffff811182821017156140fe576140fe6140c5565b6040516101a0810167ffffffffffffffff811182821017156140fe576140fe6140c5565b60405160a0810167ffffffffffffffff811182821017156140fe576140fe6140c5565b6040516060810167ffffffffffffffff811182821017156140fe576140fe6140c5565b604051601f8201601f1916810167ffffffffffffffff811182821017156141ba576141ba6140c5565b604052919050565b6001600160a01b0381168114610f6157600080fd5b80356141e2816141c2565b919050565b803563ffffffff811681146141e257600080fd5b600060c0828403121561420d57600080fd5b6142156140db565b8235614220816141c2565b815261422e602084016141e7565b602082015261423f604084016141e7565b6040820152614250606084016141e7565b60608201526080830135614263816141c2565b608082015260a0830135614276816141c2565b60a08201529392505050565b600067ffffffffffffffff82111561429c5761429c6140c5565b5060051b60200190565b803567ffffffffffffffff811681146141e257600080fd5b8015158114610f6157600080fd5b80356141e2816142be565b600067ffffffffffffffff8211156142f1576142f16140c5565b50601f01601f191660200190565b600082601f83011261431057600080fd5b813561432361431e826142d7565b614191565b81815284602083860101111561433857600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011261436657600080fd5b8135602061437661431e83614282565b82815260069290921b8401810191818101908684111561439557600080fd5b8286015b8481101561208857604081890312156143b25760008081fd5b6143ba614104565b81356143c5816141c2565b81528185013585820152835291830191604001614399565b600082601f8301126143ee57600080fd5b813560206143fe61431e83614282565b82815260059290921b8401810191818101908684111561441d57600080fd5b8286015b8481101561208857803567ffffffffffffffff8111156144415760008081fd5b61444f8986838b01016142ff565b845250918301918301614421565b60006101a0828403121561447057600080fd5b614478614127565b9050614483826142a6565b8152614491602083016141d7565b60208201526144a2604083016141d7565b60408201526144b3606083016142a6565b6060820152608082013560808201526144ce60a083016142cc565b60a08201526144df60c083016142a6565b60c08201526144f060e083016141d7565b60e082015261010082810135908201526101208083013567ffffffffffffffff8082111561451d57600080fd5b614529868387016142ff565b8385015261014092508285013591508082111561454557600080fd5b61455186838701614355565b8385015261016092508285013591508082111561456d57600080fd5b5061457a858286016143dd565b82840152505061018080830135818301525092915050565b600082601f8301126145a357600080fd5b813560206145b361431e83614282565b82815260059290921b840181019181810190868411156145d257600080fd5b8286015b8481101561208857803567ffffffffffffffff8111156145f65760008081fd5b6146048986838b010161445d565b8452509183019183016145d6565b600082601f83011261462357600080fd5b8135602061463361431e83614282565b82815260059290921b8401810191818101908684111561465257600080fd5b8286015b8481101561208857803567ffffffffffffffff8111156146765760008081fd5b6146848986838b01016143dd565b845250918301918301614656565b600082601f8301126146a357600080fd5b813560206146b361431e83614282565b8083825260208201915060208460051b8701019350868411156146d557600080fd5b602086015b8481101561208857803583529183019183016146da565b600082601f83011261470257600080fd5b8135602061471261431e83614282565b82815260059290921b8401810191818101908684111561473157600080fd5b8286015b8481101561208857803567ffffffffffffffff808211156147565760008081fd5b9088019060a0828b03601f19018113156147705760008081fd5b61477861414b565b6147838885016142a6565b8152604080850135848111156147995760008081fd5b6147a78e8b83890101614592565b8a84015250606080860135858111156147c05760008081fd5b6147ce8f8c838a0101614612565b83850152506080915081860135858111156147e95760008081fd5b6147f78f8c838a0101614692565b9184019190915250919093013590830152508352918301918301614735565b600080604080848603121561482a57600080fd5b833567ffffffffffffffff8082111561484257600080fd5b61484e878388016146f1565b945060209150818601358181111561486557600080fd5b8601601f8101881361487657600080fd5b803561488461431e82614282565b81815260059190911b8201840190848101908a8311156148a357600080fd5b8584015b8381101561492f578035868111156148bf5760008081fd5b8501603f81018d136148d15760008081fd5b878101356148e161431e82614282565b81815260059190911b82018a0190898101908f8311156149015760008081fd5b928b01925b8284101561491f5783358252928a0192908a0190614906565b86525050509186019186016148a7565b50809750505050505050509250929050565b6000806040838503121561495457600080fd5b61495d836142a6565b915061496b602084016142a6565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b6004811061499a5761499a614974565b9052565b60208101610e8c828461498a565b6000602082840312156149be57600080fd5b813567ffffffffffffffff8111156149d557600080fd5b820160a08185031215612e6e57600080fd5b600060208083850312156149fa57600080fd5b823567ffffffffffffffff811115614a1157600080fd5b8301601f81018513614a2257600080fd5b8035614a3061431e82614282565b81815260609182028301840191848201919088841115614a4f57600080fd5b938501935b83851015614ab25780858a031215614a6c5760008081fd5b614a7461416e565b614a7d866142a6565b815286860135614a8c816142be565b81880152604086810135614a9f816141c2565b9082015283529384019391850191614a54565b50979650505050505050565b803560ff811681146141e257600080fd5b600060208284031215614ae157600080fd5b610e8982614abe565b60008151808452602080850194506020840160005b83811015614b245781516001600160a01b031687529582019590820190600101614aff565b509495945050505050565b60208152600082518051602084015260ff602082015116604084015260ff604082015116606084015260608101511515608084015250602083015160c060a0840152614b7e60e0840182614aea565b90506040840151601f198483030160c0850152614b9b8282614aea565b95945050505050565b60008060408385031215614bb757600080fd5b614bc0836142a6565b946020939093013593505050565b60008060208385031215614be157600080fd5b823567ffffffffffffffff80821115614bf957600080fd5b818501915085601f830112614c0d57600080fd5b813581811115614c1c57600080fd5b8660208260061b8501011115614c3157600080fd5b60209290920196919550909350505050565b600060208284031215614c5557600080fd5b610e89826142a6565b600060208284031215614c7057600080fd5b8135612e6e816141c2565b60008060408385031215614c8e57600080fd5b823567ffffffffffffffff80821115614ca657600080fd5b614cb28683870161445d565b93506020850135915080821115614cc857600080fd5b50614cd5858286016143dd565b9150509250929050565b600082601f830112614cf057600080fd5b81356020614d0061431e83614282565b8083825260208201915060208460051b870101935086841115614d2257600080fd5b602086015b84811015612088578035614d3a816141c2565b8352918301918301614d27565b60006020808385031215614d5a57600080fd5b823567ffffffffffffffff80821115614d7257600080fd5b818501915085601f830112614d8657600080fd5b8135614d9461431e82614282565b81815260059190911b83018401908481019088831115614db357600080fd5b8585015b83811015614e8557803585811115614dce57600080fd5b860160c0818c03601f19011215614de55760008081fd5b614ded6140db565b8882013581526040614e00818401614abe565b8a8301526060614e11818501614abe565b8284015260809150614e248285016142cc565b9083015260a08381013589811115614e3c5760008081fd5b614e4a8f8d83880101614cdf565b838501525060c0840135915088821115614e645760008081fd5b614e728e8c84870101614cdf565b9083015250845250918601918601614db7565b5098975050505050505050565b600060208284031215614ea457600080fd5b5035919050565b80356001600160e01b03811681146141e257600080fd5b600082601f830112614ed357600080fd5b81356020614ee361431e83614282565b82815260069290921b84018101918181019086841115614f0257600080fd5b8286015b848110156120885760408189031215614f1f5760008081fd5b614f27614104565b614f30826142a6565b8152614f3d858301614eab565b81860152835291830191604001614f06565b600082601f830112614f6057600080fd5b81356020614f7061431e83614282565b82815260079290921b84018101918181019086841115614f8f57600080fd5b8286015b84811015612088578088036080811215614fad5760008081fd5b614fb561416e565b614fbe836142a6565b8152604080601f1984011215614fd45760008081fd5b614fdc614104565b9250614fe98785016142a6565b8352614ff68185016142a6565b8388015281870192909252606083013591810191909152835291830191608001614f93565b6000602080838503121561502e57600080fd5b823567ffffffffffffffff8082111561504657600080fd5b8185019150604080838803121561505c57600080fd5b615064614104565b83358381111561507357600080fd5b84016040818a03121561508557600080fd5b61508d614104565b81358581111561509c57600080fd5b8201601f81018b136150ad57600080fd5b80356150bb61431e82614282565b81815260069190911b8201890190898101908d8311156150da57600080fd5b928a01925b8284101561512a5787848f0312156150f75760008081fd5b6150ff614104565b843561510a816141c2565b8152615117858d01614eab565b818d0152825292870192908a01906150df565b84525050508187013593508484111561514257600080fd5b61514e8a858401614ec2565b818801528252508385013591508282111561516857600080fd5b61517488838601614f4f565b85820152809550505050505092915050565b634e487b7160e01b600052603260045260246000fd5b805160408084528151848201819052600092602091908201906060870190855b818110156151f357835180516001600160a01b031684528501516001600160e01b03168584015292840192918501916001016151bc565b50508583015187820388850152805180835290840192506000918401905b80831015614ab2578351805167ffffffffffffffff1683528501516001600160e01b031685830152928401926001929092019190850190615211565b602081526000610e89602083018461519c565b67ffffffffffffffff8316815260608101612e6e6020830184805167ffffffffffffffff908116835260209182015116910152565b634e487b7160e01b600052601160045260246000fd5b67ffffffffffffffff8181168382160190808211156152cc576152cc615295565b5092915050565b6000602080835260608451604080848701526152f2606087018361519c565b87850151878203601f19016040890152805180835290860193506000918601905b80831015614e8557845167ffffffffffffffff81511683528781015161535289850182805167ffffffffffffffff908116835260209182015116910152565b50840151828701529386019360019290920191608090910190615313565b60006020828403121561538257600080fd5b813567ffffffffffffffff81111561539957600080fd5b61368b848285016146f1565b81810381811115610e8c57610e8c615295565b634e487b7160e01b600052601260045260246000fd5b600067ffffffffffffffff808416806153e9576153e96153b8565b92169190910692915050565b8082028115828204841417610e8c57610e8c615295565b60006040828403121561541e57600080fd5b615426614104565b61542f836142a6565b8152602083013560208201528091505092915050565b60008151808452602080850194506020840160005b83811015614b2457815180516001600160a01b03168852602090810151908801526040870196509082019060010161545a565b8051825267ffffffffffffffff60208201511660208301526000604082015160a060408501526154c060a0850182613ee7565b9050606083015184820360608601526154d98282613ee7565b91505060808301518482036080860152614b9b8282615445565b602081526000610e89602083018461548d565b608081526000615519608083018761548d565b61ffff9590951660208301525060408101929092526001600160a01b0316606090910152919050565b600082601f83011261555357600080fd5b815161556161431e826142d7565b81815284602083860101111561557657600080fd5b61368b826020830160208701613ec3565b60008060006060848603121561559c57600080fd5b83516155a7816142be565b602085015190935067ffffffffffffffff8111156155c457600080fd5b6155d086828701615542565b925050604084015190509250925092565b6000602082840312156155f357600080fd5b8151612e6e816142be565b80820180821115610e8c57610e8c615295565b60ff8181168382160190811115610e8c57610e8c615295565b8183823760009101908152919050565b828152606082602083013760800192915050565b600067ffffffffffffffff80841680615669576156696153b8565b92169190910492915050565b60006020828403121561568757600080fd5b815167ffffffffffffffff8082111561569f57600080fd5b90830190606082860312156156b357600080fd5b6156bb61416e565b8251828111156156ca57600080fd5b6156d687828601615542565b8252506020830151828111156156eb57600080fd5b6156f787828601615542565b60208301525060408301518281111561570f57600080fd5b61571b87828601615542565b60408301525095945050505050565b602081016005831061573e5761573e614974565b91905290565b60ff81811683821602908116908181146152cc576152cc615295565b600060a0820160ff88168352602087602085015260a0604085015281875480845260c086019150886000526020600020935060005b818110156157ba5784546001600160a01b031683526001948501949284019201615795565b505084810360608601526157ce8188614aea565b935050505060ff831660808301529695505050505050565b600067ffffffffffffffff808616835280851660208401525060606040830152614b9b6060830184613ee7565b82815260406020820152600061368b6040830184613ee7565b67ffffffffffffffff8481168252831660208201526060810161368b604083018461498a565b61585c818461498a565b60406020820152600061368b6040830184613ee7565b60006020828403121561588457600080fd5b8151612e6e816141c2565b60208152600082516101008060208501526158ae610120850183613ee7565b915060208501516158cb604086018267ffffffffffffffff169052565b5060408501516001600160a01b03811660608601525060608501516080850152608085015161590560a08601826001600160a01b03169052565b5060a0850151601f19808685030160c08701526159228483613ee7565b935060c08701519150808685030160e087015261593f8483613ee7565b935060e087015191508086850301838701525061595c8382613ee7565b9695505050505050565b60006020828403121561597857600080fd5b5051919050565b600060ff821660ff810361599557615995615295565b60010192915050565b6020808252825182820181905260009190848201906040850190845b818110156159ed57835180516001600160a01b0316845260209081015190840152604083019385019392506001016159ba565b50909695505050505050565b60008282518085526020808601955060208260051b8401016020860160005b84811015615a4657601f19868403018952615a34838351613ee7565b98840198925090830190600101615a18565b5090979650505050505050565b602081526000610e8960208301846159f9565b60408152615a8160408201845167ffffffffffffffff169052565b60006020840151615a9d60608401826001600160a01b03169052565b5060408401516001600160a01b038116608084015250606084015167ffffffffffffffff811660a084015250608084015160c083015260a084015180151560e08401525060c0840151610100615afe8185018367ffffffffffffffff169052565b60e08601519150610120615b1c818601846001600160a01b03169052565b81870151925061014091508282860152808701519250506101a06101608181870152615b4c6101e0870185613ee7565b9350828801519250603f19610180818887030181890152615b6d8686615445565b9550828a01519450818887030184890152615b8886866159f9565b9550808a01516101c089015250505050508281036020840152614b9b81856159f9565b6000815160208301516001600160e01b031980821693506004831015615bdb5780818460040360031b1b83161693505b50505091905056fea164736f6c6343000818000a", } var EVM2EVMMultiOffRampABI = EVM2EVMMultiOffRampMetaData.ABI @@ -404,28 +403,6 @@ func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampCallerSession) GetMerkleRoot(sour return _EVM2EVMMultiOffRamp.Contract.GetMerkleRoot(&_EVM2EVMMultiOffRamp.CallOpts, sourceChainSelector, root) } -func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampCaller) GetSenderNonce(opts *bind.CallOpts, sourceChainSelector uint64, sender common.Address) (uint64, error) { - var out []interface{} - err := _EVM2EVMMultiOffRamp.contract.Call(opts, &out, "getSenderNonce", sourceChainSelector, sender) - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampSession) GetSenderNonce(sourceChainSelector uint64, sender common.Address) (uint64, error) { - return _EVM2EVMMultiOffRamp.Contract.GetSenderNonce(&_EVM2EVMMultiOffRamp.CallOpts, sourceChainSelector, sender) -} - -func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampCallerSession) GetSenderNonce(sourceChainSelector uint64, sender common.Address) (uint64, error) { - return _EVM2EVMMultiOffRamp.Contract.GetSenderNonce(&_EVM2EVMMultiOffRamp.CallOpts, sourceChainSelector, sender) -} - func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampCaller) GetSourceChainConfig(opts *bind.CallOpts, sourceChainSelector uint64) (EVM2EVMMultiOffRampSourceChainConfig, error) { var out []interface{} err := _EVM2EVMMultiOffRamp.contract.Call(opts, &out, "getSourceChainConfig", sourceChainSelector) @@ -1687,244 +1664,6 @@ func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampFilterer) ParseSkippedAlreadyExec return event, nil } -type EVM2EVMMultiOffRampSkippedIncorrectNonceIterator struct { - Event *EVM2EVMMultiOffRampSkippedIncorrectNonce - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *EVM2EVMMultiOffRampSkippedIncorrectNonceIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(EVM2EVMMultiOffRampSkippedIncorrectNonce) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(EVM2EVMMultiOffRampSkippedIncorrectNonce) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *EVM2EVMMultiOffRampSkippedIncorrectNonceIterator) Error() error { - return it.fail -} - -func (it *EVM2EVMMultiOffRampSkippedIncorrectNonceIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type EVM2EVMMultiOffRampSkippedIncorrectNonce struct { - SourceChainSelector uint64 - Nonce uint64 - Sender common.Address - Raw types.Log -} - -func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampFilterer) FilterSkippedIncorrectNonce(opts *bind.FilterOpts) (*EVM2EVMMultiOffRampSkippedIncorrectNonceIterator, error) { - - logs, sub, err := _EVM2EVMMultiOffRamp.contract.FilterLogs(opts, "SkippedIncorrectNonce") - if err != nil { - return nil, err - } - return &EVM2EVMMultiOffRampSkippedIncorrectNonceIterator{contract: _EVM2EVMMultiOffRamp.contract, event: "SkippedIncorrectNonce", logs: logs, sub: sub}, nil -} - -func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampFilterer) WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *EVM2EVMMultiOffRampSkippedIncorrectNonce) (event.Subscription, error) { - - logs, sub, err := _EVM2EVMMultiOffRamp.contract.WatchLogs(opts, "SkippedIncorrectNonce") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(EVM2EVMMultiOffRampSkippedIncorrectNonce) - if err := _EVM2EVMMultiOffRamp.contract.UnpackLog(event, "SkippedIncorrectNonce", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampFilterer) ParseSkippedIncorrectNonce(log types.Log) (*EVM2EVMMultiOffRampSkippedIncorrectNonce, error) { - event := new(EVM2EVMMultiOffRampSkippedIncorrectNonce) - if err := _EVM2EVMMultiOffRamp.contract.UnpackLog(event, "SkippedIncorrectNonce", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -type EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflightIterator struct { - Event *EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight - - contract *bind.BoundContract - event string - - logs chan types.Log - sub ethereum.Subscription - done bool - fail error -} - -func (it *EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Next() bool { - - if it.fail != nil { - return false - } - - if it.done { - select { - case log := <-it.logs: - it.Event = new(EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - - select { - case log := <-it.logs: - it.Event = new(EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -func (it *EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Error() error { - return it.fail -} - -func (it *EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflightIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -type EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight struct { - SourceChainSelector uint64 - Nonce uint64 - Sender common.Address - Raw types.Log -} - -func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampFilterer) FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts) (*EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) { - - logs, sub, err := _EVM2EVMMultiOffRamp.contract.FilterLogs(opts, "SkippedSenderWithPreviousRampMessageInflight") - if err != nil { - return nil, err - } - return &EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflightIterator{contract: _EVM2EVMMultiOffRamp.contract, event: "SkippedSenderWithPreviousRampMessageInflight", logs: logs, sub: sub}, nil -} - -func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampFilterer) WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight) (event.Subscription, error) { - - logs, sub, err := _EVM2EVMMultiOffRamp.contract.WatchLogs(opts, "SkippedSenderWithPreviousRampMessageInflight") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - - event := new(EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight) - if err := _EVM2EVMMultiOffRamp.contract.UnpackLog(event, "SkippedSenderWithPreviousRampMessageInflight", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRampFilterer) ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight, error) { - event := new(EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight) - if err := _EVM2EVMMultiOffRamp.contract.UnpackLog(event, "SkippedSenderWithPreviousRampMessageInflight", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - type EVM2EVMMultiOffRampSourceChainConfigSetIterator struct { Event *EVM2EVMMultiOffRampSourceChainConfigSet @@ -2434,10 +2173,6 @@ func (_EVM2EVMMultiOffRamp *EVM2EVMMultiOffRamp) ParseLog(log types.Log) (genera return _EVM2EVMMultiOffRamp.ParseRootRemoved(log) case _EVM2EVMMultiOffRamp.abi.Events["SkippedAlreadyExecutedMessage"].ID: return _EVM2EVMMultiOffRamp.ParseSkippedAlreadyExecutedMessage(log) - case _EVM2EVMMultiOffRamp.abi.Events["SkippedIncorrectNonce"].ID: - return _EVM2EVMMultiOffRamp.ParseSkippedIncorrectNonce(log) - case _EVM2EVMMultiOffRamp.abi.Events["SkippedSenderWithPreviousRampMessageInflight"].ID: - return _EVM2EVMMultiOffRamp.ParseSkippedSenderWithPreviousRampMessageInflight(log) case _EVM2EVMMultiOffRamp.abi.Events["SourceChainConfigSet"].ID: return _EVM2EVMMultiOffRamp.ParseSourceChainConfigSet(log) case _EVM2EVMMultiOffRamp.abi.Events["SourceChainSelectorAdded"].ID: @@ -2484,16 +2219,8 @@ func (EVM2EVMMultiOffRampSkippedAlreadyExecutedMessage) Topic() common.Hash { return common.HexToHash("0x3b575419319662b2a6f5e2467d84521517a3382b908eb3d557bb3fdb0c50e23c") } -func (EVM2EVMMultiOffRampSkippedIncorrectNonce) Topic() common.Hash { - return common.HexToHash("0x852dc8e405695593e311bd83991cf39b14a328f304935eac6d3d55617f911d89") -} - -func (EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight) Topic() common.Hash { - return common.HexToHash("0x5444a3301c7c42dd164cbf6ba4b72bf02504f86c049b06a27fc2b662e334bdbd") -} - func (EVM2EVMMultiOffRampSourceChainConfigSet) Topic() common.Hash { - return common.HexToHash("0xa73c588738263db34ef8c1942db8f99559bc6696f6a812d42e76bafb4c0e8d30") + return common.HexToHash("0xb8f0c74385134334c728fcac437ec6c6397c9f2c1440532b0c44175a090b1401") } func (EVM2EVMMultiOffRampSourceChainSelectorAdded) Topic() common.Hash { @@ -2501,7 +2228,7 @@ func (EVM2EVMMultiOffRampSourceChainSelectorAdded) Topic() common.Hash { } func (EVM2EVMMultiOffRampStaticConfigSet) Topic() common.Hash { - return common.HexToHash("0x2f56698ec552a5d53d27d6f4b3dd8b6989f6426b6151a36aff61160c1d07efdf") + return common.HexToHash("0x683eb52ee924eb817377cfa8f41f238f4bb7a877da5267869dfffbad85f564d8") } func (EVM2EVMMultiOffRampTransmitted) Topic() common.Hash { @@ -2523,8 +2250,6 @@ type EVM2EVMMultiOffRampInterface interface { GetMerkleRoot(opts *bind.CallOpts, sourceChainSelector uint64, root [32]byte) (*big.Int, error) - GetSenderNonce(opts *bind.CallOpts, sourceChainSelector uint64, sender common.Address) (uint64, error) - GetSourceChainConfig(opts *bind.CallOpts, sourceChainSelector uint64) (EVM2EVMMultiOffRampSourceChainConfig, error) GetStaticConfig(opts *bind.CallOpts) (EVM2EVMMultiOffRampStaticConfig, error) @@ -2605,18 +2330,6 @@ type EVM2EVMMultiOffRampInterface interface { ParseSkippedAlreadyExecutedMessage(log types.Log) (*EVM2EVMMultiOffRampSkippedAlreadyExecutedMessage, error) - FilterSkippedIncorrectNonce(opts *bind.FilterOpts) (*EVM2EVMMultiOffRampSkippedIncorrectNonceIterator, error) - - WatchSkippedIncorrectNonce(opts *bind.WatchOpts, sink chan<- *EVM2EVMMultiOffRampSkippedIncorrectNonce) (event.Subscription, error) - - ParseSkippedIncorrectNonce(log types.Log) (*EVM2EVMMultiOffRampSkippedIncorrectNonce, error) - - FilterSkippedSenderWithPreviousRampMessageInflight(opts *bind.FilterOpts) (*EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflightIterator, error) - - WatchSkippedSenderWithPreviousRampMessageInflight(opts *bind.WatchOpts, sink chan<- *EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight) (event.Subscription, error) - - ParseSkippedSenderWithPreviousRampMessageInflight(log types.Log) (*EVM2EVMMultiOffRampSkippedSenderWithPreviousRampMessageInflight, error) - FilterSourceChainConfigSet(opts *bind.FilterOpts, sourceChainSelector []uint64) (*EVM2EVMMultiOffRampSourceChainConfigSetIterator, error) WatchSourceChainConfigSet(opts *bind.WatchOpts, sink chan<- *EVM2EVMMultiOffRampSourceChainConfigSet, sourceChainSelector []uint64) (event.Subscription, error) diff --git a/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go b/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go new file mode 100644 index 0000000000..399ae5dbd6 --- /dev/null +++ b/core/gethwrappers/ccip/generated/ocr3_config_encoder/ocr3_config_encoder.go @@ -0,0 +1,196 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ocr3_config_encoder + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +type CCIPConfigTypesOCR3Config struct { + PluginType uint8 + ChainSelector uint64 + F uint8 + OffchainConfigVersion uint64 + OfframpAddress []byte + BootstrapP2PIds [][32]byte + P2pIds [][32]byte + Signers [][]byte + Transmitters [][]byte + OffchainConfig []byte +} + +var IOCR3ConfigEncoderMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"components\":[{\"internalType\":\"enumInternal.OCRPluginType\",\"name\":\"pluginType\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"chainSelector\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"F\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"offchainConfigVersion\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"offrampAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"bootstrapP2PIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"p2pIds\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes[]\",\"name\":\"signers\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes[]\",\"name\":\"transmitters\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"offchainConfig\",\"type\":\"bytes\"}],\"internalType\":\"structCCIPConfigTypes.OCR3Config[]\",\"name\":\"config\",\"type\":\"tuple[]\"}],\"name\":\"exposeOCR3Config\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +var IOCR3ConfigEncoderABI = IOCR3ConfigEncoderMetaData.ABI + +type IOCR3ConfigEncoder struct { + address common.Address + abi abi.ABI + IOCR3ConfigEncoderCaller + IOCR3ConfigEncoderTransactor + IOCR3ConfigEncoderFilterer +} + +type IOCR3ConfigEncoderCaller struct { + contract *bind.BoundContract +} + +type IOCR3ConfigEncoderTransactor struct { + contract *bind.BoundContract +} + +type IOCR3ConfigEncoderFilterer struct { + contract *bind.BoundContract +} + +type IOCR3ConfigEncoderSession struct { + Contract *IOCR3ConfigEncoder + CallOpts bind.CallOpts + TransactOpts bind.TransactOpts +} + +type IOCR3ConfigEncoderCallerSession struct { + Contract *IOCR3ConfigEncoderCaller + CallOpts bind.CallOpts +} + +type IOCR3ConfigEncoderTransactorSession struct { + Contract *IOCR3ConfigEncoderTransactor + TransactOpts bind.TransactOpts +} + +type IOCR3ConfigEncoderRaw struct { + Contract *IOCR3ConfigEncoder +} + +type IOCR3ConfigEncoderCallerRaw struct { + Contract *IOCR3ConfigEncoderCaller +} + +type IOCR3ConfigEncoderTransactorRaw struct { + Contract *IOCR3ConfigEncoderTransactor +} + +func NewIOCR3ConfigEncoder(address common.Address, backend bind.ContractBackend) (*IOCR3ConfigEncoder, error) { + abi, err := abi.JSON(strings.NewReader(IOCR3ConfigEncoderABI)) + if err != nil { + return nil, err + } + contract, err := bindIOCR3ConfigEncoder(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IOCR3ConfigEncoder{address: address, abi: abi, IOCR3ConfigEncoderCaller: IOCR3ConfigEncoderCaller{contract: contract}, IOCR3ConfigEncoderTransactor: IOCR3ConfigEncoderTransactor{contract: contract}, IOCR3ConfigEncoderFilterer: IOCR3ConfigEncoderFilterer{contract: contract}}, nil +} + +func NewIOCR3ConfigEncoderCaller(address common.Address, caller bind.ContractCaller) (*IOCR3ConfigEncoderCaller, error) { + contract, err := bindIOCR3ConfigEncoder(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IOCR3ConfigEncoderCaller{contract: contract}, nil +} + +func NewIOCR3ConfigEncoderTransactor(address common.Address, transactor bind.ContractTransactor) (*IOCR3ConfigEncoderTransactor, error) { + contract, err := bindIOCR3ConfigEncoder(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IOCR3ConfigEncoderTransactor{contract: contract}, nil +} + +func NewIOCR3ConfigEncoderFilterer(address common.Address, filterer bind.ContractFilterer) (*IOCR3ConfigEncoderFilterer, error) { + contract, err := bindIOCR3ConfigEncoder(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IOCR3ConfigEncoderFilterer{contract: contract}, nil +} + +func bindIOCR3ConfigEncoder(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IOCR3ConfigEncoderMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IOCR3ConfigEncoder.Contract.IOCR3ConfigEncoderCaller.contract.Call(opts, result, method, params...) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IOCR3ConfigEncoder.Contract.IOCR3ConfigEncoderTransactor.contract.Transfer(opts) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IOCR3ConfigEncoder.Contract.IOCR3ConfigEncoderTransactor.contract.Transact(opts, method, params...) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IOCR3ConfigEncoder.Contract.contract.Call(opts, result, method, params...) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IOCR3ConfigEncoder.Contract.contract.Transfer(opts) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IOCR3ConfigEncoder.Contract.contract.Transact(opts, method, params...) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCaller) ExposeOCR3Config(opts *bind.CallOpts, config []CCIPConfigTypesOCR3Config) ([]byte, error) { + var out []interface{} + err := _IOCR3ConfigEncoder.contract.Call(opts, &out, "exposeOCR3Config", config) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderSession) ExposeOCR3Config(config []CCIPConfigTypesOCR3Config) ([]byte, error) { + return _IOCR3ConfigEncoder.Contract.ExposeOCR3Config(&_IOCR3ConfigEncoder.CallOpts, config) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoderCallerSession) ExposeOCR3Config(config []CCIPConfigTypesOCR3Config) ([]byte, error) { + return _IOCR3ConfigEncoder.Contract.ExposeOCR3Config(&_IOCR3ConfigEncoder.CallOpts, config) +} + +func (_IOCR3ConfigEncoder *IOCR3ConfigEncoder) Address() common.Address { + return _IOCR3ConfigEncoder.address +} + +type IOCR3ConfigEncoderInterface interface { + ExposeOCR3Config(opts *bind.CallOpts, config []CCIPConfigTypesOCR3Config) ([]byte, error) + + Address() common.Address +} diff --git a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 8b5f3055ff..d2d6fbcc2a 100644 --- a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -5,11 +5,11 @@ burn_from_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnFromMintTokenPool burn_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnMintTokenPool/BurnMintTokenPool.bin fee3f82935ce7a26c65e12f19a472a4fccdae62755abdb42d8b0a01f0f06981a burn_mint_token_pool_and_proxy: ../../../contracts/solc/v0.8.24/BurnMintTokenPoolAndProxy/BurnMintTokenPoolAndProxy.abi ../../../contracts/solc/v0.8.24/BurnMintTokenPoolAndProxy/BurnMintTokenPoolAndProxy.bin c7efa00d2be62a97a814730c8e13aa70794ebfdd38a9f3b3c11554a5dfd70478 burn_with_from_mint_token_pool: ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.abi ../../../contracts/solc/v0.8.24/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.bin a0728e186af74968101135a58a483320ced9ab79b22b1b24ac6994254ee79097 -ccip_config: ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.abi ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.bin ef9e1f61b288bc31dda1c4e9d0bb8885b7b0bf1fe35bf74af8b12568e7532010 +ccip_config: ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.abi ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.bin c44460757ca0e1b228734b32b9ab03221b93d77bb9f8e2970830779a8be2cb78 commit_store: ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.abi ../../../contracts/solc/v0.8.24/CommitStore/CommitStore.bin ddc26c10c2a52b59624faae9005827b09b98db4566887a736005e8cc37cf8a51 commit_store_helper: ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.abi ../../../contracts/solc/v0.8.24/CommitStoreHelper/CommitStoreHelper.bin ebd8aac686fa28a71d4212bcd25a28f8f640d50dce5e50498b2f6b8534890b69 ether_sender_receiver: ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.abi ../../../contracts/solc/v0.8.24/EtherSenderReceiver/EtherSenderReceiver.bin 09510a3f773f108a3c231e8d202835c845ded862d071ec54c4f89c12d868b8de -evm_2_evm_multi_offramp: ../../../contracts/solc/v0.8.24/EVM2EVMMultiOffRamp/EVM2EVMMultiOffRamp.abi ../../../contracts/solc/v0.8.24/EVM2EVMMultiOffRamp/EVM2EVMMultiOffRamp.bin 4bd848e0d37d36bec5cad3b50dce994e53c1c753668af6fc4a60658e7c3149a2 +evm_2_evm_multi_offramp: ../../../contracts/solc/v0.8.24/EVM2EVMMultiOffRamp/EVM2EVMMultiOffRamp.abi ../../../contracts/solc/v0.8.24/EVM2EVMMultiOffRamp/EVM2EVMMultiOffRamp.bin 035e69cf7dc9682f720022e2c7a89566a849163bf8a043e3e0aea2b19cce4aa7 evm_2_evm_multi_onramp: ../../../contracts/solc/v0.8.24/EVM2EVMMultiOnRamp/EVM2EVMMultiOnRamp.abi ../../../contracts/solc/v0.8.24/EVM2EVMMultiOnRamp/EVM2EVMMultiOnRamp.bin f62d32fffd8f9f1e6e48a6e146c29415d67b081d31b9667f701b088c558f3bcf evm_2_evm_offramp: ../../../contracts/solc/v0.8.24/EVM2EVMOffRamp/EVM2EVMOffRamp.abi ../../../contracts/solc/v0.8.24/EVM2EVMOffRamp/EVM2EVMOffRamp.bin b6132cb22370d62b1b20174bbe832ec87df61f6ab65f7fe2515733bdd10a30f5 evm_2_evm_onramp: ../../../contracts/solc/v0.8.24/EVM2EVMOnRamp/EVM2EVMOnRamp.abi ../../../contracts/solc/v0.8.24/EVM2EVMOnRamp/EVM2EVMOnRamp.bin 383e9930fbc1b7fbb6554cc8857229d207fd6742e87c7fb1a37002347e8de8e2 @@ -23,6 +23,7 @@ mock_usdc_token_transmitter: ../../../contracts/solc/v0.8.24/MockE2EUSDCTransmit mock_v3_aggregator_contract: ../../../contracts/solc/v0.8.24/MockV3Aggregator/MockV3Aggregator.abi ../../../contracts/solc/v0.8.24/MockV3Aggregator/MockV3Aggregator.bin 518e19efa2ff52b0fefd8e597b05765317ee7638189bfe34ca43de2f6599faf4 multi_aggregate_rate_limiter: ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.abi ../../../contracts/solc/v0.8.24/MultiAggregateRateLimiter/MultiAggregateRateLimiter.bin abb0ecb1ed8621f26e43b39f5fa25f3d0b6d6c184fa37c404c4389605ecb74e7 nonce_manager: ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.abi ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.bin cdc11c1ab4c1c3fd77f30215e9c579404a6e60eb9adc213d73ca0773c3bb5784 +ocr3_config_encoder: ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.abi ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.bin e21180898e1ad54a045ee20add85a2793c681425ea06f66d1a9e5cab128b6487 ping_pong_demo: ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.abi ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.bin 1588313bb5e781d181a825247d30828f59007700f36b4b9b00391592b06ff4b4 price_registry: ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.abi ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.bin 0b3e253684d7085aa11f9179b71453b9db9d11cabea41605d5b4ac4128f85bfb registry_module_owner_custom: ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.abi ../../../contracts/solc/v0.8.24/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.bin cbe7698bfd811b485ac3856daf073a7bdebeefdf2583403ca4a19d5b7e2d4ae8 diff --git a/core/gethwrappers/ccip/go_generate.go b/core/gethwrappers/ccip/go_generate.go index 864c73d785..a5eaa37523 100644 --- a/core/gethwrappers/ccip/go_generate.go +++ b/core/gethwrappers/ccip/go_generate.go @@ -29,6 +29,7 @@ package ccip //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/Router/Router.abi ../../../contracts/solc/v0.8.24/Router/Router.bin Router router //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.abi ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.bin PriceRegistry price_registry //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.abi ../../../contracts/solc/v0.8.24/CCIPConfig/CCIPConfig.bin CCIPConfig ccip_config +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.abi ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.bin IOCR3ConfigEncoder ocr3_config_encoder //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.abi ../../../contracts/solc/v0.8.24/MaybeRevertMessageReceiver/MaybeRevertMessageReceiver.bin MaybeRevertMessageReceiver maybe_revert_message_receiver //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.abi ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.bin PingPongDemo ping_pong_demo diff --git a/core/scripts/go.mod b/core/scripts/go.mod index ded34e9065..727954da03 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -109,7 +109,7 @@ require ( github.com/danieljoos/wincred v1.1.2 // indirect github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.3.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -376,5 +376,4 @@ replace ( // until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69 github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f - ) diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 7de4c22a4a..01552ea368 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -310,8 +310,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g= -github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= diff --git a/core/services/ccipcapability/launcher/README.md b/core/services/ccipcapability/launcher/README.md new file mode 100644 index 0000000000..e3cdc14205 --- /dev/null +++ b/core/services/ccipcapability/launcher/README.md @@ -0,0 +1,69 @@ +# CCIP Capability Launcher + +The CCIP capability launcher is responsible for listening to +[Capabilities Registry](../../../../contracts/src/v0.8/keystone/CapabilitiesRegistry.sol) (CR) updates +for the particular CCIP capability (labelled name, version) pair and reacting to them. In +particular, there are three kinds of events that would affect a particular capability: + +1. DON Creation: when `addDON` is called on the CR, the capabilities of this new DON are specified. +If CCIP is one of those capabilities, the launcher will launch a commit and an execution plugin +with the OCR configuration specified in the DON creation process. See +[Types.sol](../../../../contracts/src/v0.8/ccip/capability/libraries/Types.sol) for more details +on what the OCR configuration contains. +2. DON update: when `updateDON` is called on the CR, capabilities of the DON can be updated. In the +CCIP use case specifically, `updateDON` is used to update OCR configuration of that DON. Updates +follow the blue/green deployment pattern (explained in detail below with a state diagram). In this +scenario the launcher must either launch brand new instances of the commit and execution plugins +(in the event a green deployment is made) or promote the currently running green instance to be +the blue instance. +3. DON deletion: when `deleteDON` is called on the CR, the launcher must shut down all running plugins +related to that DON. When a DON is deleted it effectively means that it should no longer function. +DON deletion is permanent. + +## Architecture Diagram + +![CCIP Capability Launcher](./ccip_capability_launcher.png) + +The above diagram shows how the CCIP capability launcher interacts with the rest of the components +in the CCIP system. + +The CCIP capability job, which is created on the Chainlink node, will spin up the CCIP capability +launcher alongside the home chain reader, which reads the [CCIPConfig.sol](../../../../contracts/src/v0.8/ccip/capability/CCIPConfig.sol) +contract deployed on the home chain (typically Ethereum Mainnet, though could be "any chain" in theory). + +Injected into the launcher is the [OracleCreator](../types/types.go) object which knows how to spin up CCIP +oracles (both bootstrap and plugin oracles). This is used by the launcher at the appropriate time in order +to create oracle instances but not start them right away. + +After all the required oracles have been created, the launcher will start and shut them down as required +in order to match the configuration that was posted on-chain in the CR and the CCIPConfig.sol contract. + + +## Config State Diagram + +![CCIP Config State Machine](./ccip_config_state_machine.png) + +CCIP's blue/green deployment paradigm is intentionally kept as simple as possible. + +Every CCIP DON starts in the `Init` state. Upon DON creation, which must provide a valid OCR +configuration, the CCIP DON will move into the `Running` state. In this state, the DON is +presumed to be fully functional from a configuration standpoint. + +When we want to update configuration, we propose a new configuration to the CR that consists of +an array of two OCR configurations: + +1. The first element of the array is the current OCR configuration that is running (termed "blue"). +2. The second element of the array is the future OCR configuration that we want to run (termed "green"). + +Various checks are done on-chain in order to validate this particular state transition, in particular, +related to config counts. Doing this will move the state of the configuration to the `Staging` state. + +In the `Staging` state, there are effectively four plugins running - one (commit, execution) pair for the +blue configuration, and one (commit, execution) pair for the green configuration. However, only the blue +configuration will actually be writing on-chain, where as the green configuration will be "dry running", +i.e doing everything except transmitting. + +This allows us to test out new configurations without committing to them immediately. + +Finally, from the `Staging` state, there is only one transition, which is to promote the green configuration +to be the new blue configuration, and go back into the `Running` state. diff --git a/core/services/ccipcapability/launcher/bluegreen.go b/core/services/ccipcapability/launcher/bluegreen.go new file mode 100644 index 0000000000..442925c04e --- /dev/null +++ b/core/services/ccipcapability/launcher/bluegreen.go @@ -0,0 +1,177 @@ +package launcher + +import ( + "fmt" + + "go.uber.org/multierr" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types" +) + +// blueGreenDeployment represents a blue-green deployment of OCR instances. +type blueGreenDeployment struct { + // blue is the blue OCR instance. + // blue must always be present. + blue cctypes.CCIPOracle + + // bootstrapBlue is the bootstrap node of the blue OCR instance. + // Only a subset of the DON will be running bootstrap instances, + // so this may be nil. + bootstrapBlue cctypes.CCIPOracle + + // green is the green OCR instance. + // green may or may not be present. + // green must never be present if blue is not present. + // TODO: should we enforce this invariant somehow? + green cctypes.CCIPOracle + + // bootstrapGreen is the bootstrap node of the green OCR instance. + // Only a subset of the DON will be running bootstrap instances, + // so this may be nil, even when green is not nil. + bootstrapGreen cctypes.CCIPOracle +} + +// ccipDeployment represents blue-green deployments of both commit and exec +// OCR instances. +type ccipDeployment struct { + commit blueGreenDeployment + exec blueGreenDeployment +} + +// Close shuts down all OCR instances in the deployment. +func (c *ccipDeployment) Close() error { + var err error + + // shutdown blue commit instances. + err = multierr.Append(err, c.commit.blue.Close()) + if c.commit.bootstrapBlue != nil { + err = multierr.Append(err, c.commit.bootstrapBlue.Close()) + } + + // shutdown green commit instances. + if c.commit.green != nil { + err = multierr.Append(err, c.commit.green.Close()) + } + if c.commit.bootstrapGreen != nil { + err = multierr.Append(err, c.commit.bootstrapGreen.Close()) + } + + // shutdown blue exec instances. + err = multierr.Append(err, c.exec.blue.Close()) + if c.exec.bootstrapBlue != nil { + err = multierr.Append(err, c.exec.bootstrapBlue.Close()) + } + + // shutdown green exec instances. + if c.exec.green != nil { + err = multierr.Append(err, c.exec.green.Close()) + } + if c.exec.bootstrapGreen != nil { + err = multierr.Append(err, c.exec.bootstrapGreen.Close()) + } + + return err +} + +// StartBlue starts the blue OCR instances. +func (c *ccipDeployment) StartBlue() error { + var err error + + err = multierr.Append(err, c.commit.blue.Start()) + if c.commit.bootstrapBlue != nil { + err = multierr.Append(err, c.commit.bootstrapBlue.Start()) + } + err = multierr.Append(err, c.exec.blue.Start()) + if c.exec.bootstrapBlue != nil { + err = multierr.Append(err, c.exec.bootstrapBlue.Start()) + } + + return err +} + +// CloseBlue shuts down the blue OCR instances. +func (c *ccipDeployment) CloseBlue() error { + var err error + + err = multierr.Append(err, c.commit.blue.Close()) + if c.commit.bootstrapBlue != nil { + err = multierr.Append(err, c.commit.bootstrapBlue.Close()) + } + err = multierr.Append(err, c.exec.blue.Close()) + if c.exec.bootstrapBlue != nil { + err = multierr.Append(err, c.exec.bootstrapBlue.Close()) + } + + return err +} + +// HandleBlueGreen handles the blue-green deployment transition. +// prevDeployment is the previous deployment state. +// there are two possible cases: +// +// 1. both blue and green are present in prevDeployment, but only blue is present in c. +// this is a promotion of green to blue, so we need to shut down the blue deployment +// and make green the new blue. In this case green is already running, so there's no +// need to start it. However, we need to shut down the blue deployment. +// +// 2. only blue is present in prevDeployment, both blue and green are present in c. +// In this case, blue is already running, so there's no need to start it. We need to +// start green. +func (c *ccipDeployment) HandleBlueGreen(prevDeployment *ccipDeployment) error { + if prevDeployment == nil { + return fmt.Errorf("previous deployment is nil") + } + + var err error + if prevDeployment.commit.green != nil && c.commit.green == nil { + err = multierr.Append(err, prevDeployment.commit.blue.Close()) + if prevDeployment.commit.bootstrapBlue != nil { + err = multierr.Append(err, prevDeployment.commit.bootstrapBlue.Close()) + } + } else if prevDeployment.commit.green == nil && c.commit.green != nil { + err = multierr.Append(err, c.commit.green.Start()) + if c.commit.bootstrapGreen != nil { + err = multierr.Append(err, c.commit.bootstrapGreen.Start()) + } + } else { + return fmt.Errorf("invalid blue-green deployment transition") + } + + if prevDeployment.exec.green != nil && c.exec.green == nil { + err = multierr.Append(err, prevDeployment.exec.blue.Close()) + if prevDeployment.exec.bootstrapBlue != nil { + err = multierr.Append(err, prevDeployment.exec.bootstrapBlue.Close()) + } + } else if prevDeployment.exec.green == nil && c.exec.green != nil { + err = multierr.Append(err, c.exec.green.Start()) + if c.exec.bootstrapGreen != nil { + err = multierr.Append(err, c.exec.bootstrapGreen.Start()) + } + } else { + return fmt.Errorf("invalid blue-green deployment transition") + } + + return err +} + +// HasGreenInstance returns true if the deployment has a green instance for the +// given plugin type. +func (c *ccipDeployment) HasGreenInstance(pluginType cctypes.PluginType) bool { + switch pluginType { + case cctypes.PluginTypeCCIPCommit: + return c.commit.green != nil + case cctypes.PluginTypeCCIPExec: + return c.exec.green != nil + default: + return false + } +} + +func isNewGreenInstance(pluginType cctypes.PluginType, ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta, prevDeployment ccipDeployment) bool { + return len(ocrConfigs) == 2 && !prevDeployment.HasGreenInstance(pluginType) +} + +func isPromotion(pluginType cctypes.PluginType, ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta, prevDeployment ccipDeployment) bool { + return len(ocrConfigs) == 1 && prevDeployment.HasGreenInstance(pluginType) +} diff --git a/core/services/ccipcapability/launcher/bluegreen_test.go b/core/services/ccipcapability/launcher/bluegreen_test.go new file mode 100644 index 0000000000..a18e02eda3 --- /dev/null +++ b/core/services/ccipcapability/launcher/bluegreen_test.go @@ -0,0 +1,1042 @@ +package launcher + +import ( + "errors" + "testing" + + "github.com/stretchr/testify/require" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types" + mocktypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types/mocks" +) + +func Test_ccipDeployment_Close(t *testing.T) { + type args struct { + commitBlue *mocktypes.CCIPOracle + commitBlueBootstrap *mocktypes.CCIPOracle + commitGreen *mocktypes.CCIPOracle + commitGreenBootstrap *mocktypes.CCIPOracle + execBlue *mocktypes.CCIPOracle + execBlueBootstrap *mocktypes.CCIPOracle + execGreen *mocktypes.CCIPOracle + execGreenBootstrap *mocktypes.CCIPOracle + } + tests := []struct { + name string + args args + expect func(t *testing.T, args args) + asserts func(t *testing.T, args args) + wantErr bool + }{ + { + name: "no errors, blue only", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + commitGreenBootstrap: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + execGreenBootstrap: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "no errors, blue and green", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.commitGreen.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + args.execGreen.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.commitGreen.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "error on commit blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(errors.New("failed")).Once() + args.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "bootstrap blue also closed", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.commitBlueBootstrap.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + args.execBlueBootstrap.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.commitBlueBootstrap.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + args.execBlueBootstrap.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "bootstrap green also closed", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + commitGreenBootstrap: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + execGreenBootstrap: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.commitBlueBootstrap.On("Close").Return(nil).Once() + args.commitGreen.On("Close").Return(nil).Once() + args.commitGreenBootstrap.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + args.execBlueBootstrap.On("Close").Return(nil).Once() + args.execGreen.On("Close").Return(nil).Once() + args.execGreenBootstrap.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.commitBlueBootstrap.AssertExpectations(t) + args.commitGreen.AssertExpectations(t) + args.commitGreenBootstrap.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + args.execBlueBootstrap.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + args.execGreenBootstrap.AssertExpectations(t) + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.args.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.args.execBlue, + }, + } + if tt.args.commitGreen != nil { + c.commit.green = tt.args.commitGreen + } + if tt.args.commitBlueBootstrap != nil { + c.commit.bootstrapBlue = tt.args.commitBlueBootstrap + } + if tt.args.commitGreenBootstrap != nil { + c.commit.bootstrapGreen = tt.args.commitGreenBootstrap + } + + if tt.args.execGreen != nil { + c.exec.green = tt.args.execGreen + } + if tt.args.execBlueBootstrap != nil { + c.exec.bootstrapBlue = tt.args.execBlueBootstrap + } + if tt.args.execGreenBootstrap != nil { + c.exec.bootstrapGreen = tt.args.execGreenBootstrap + } + + tt.expect(t, tt.args) + defer tt.asserts(t, tt.args) + err := c.Close() + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_ccipDeployment_StartBlue(t *testing.T) { + type args struct { + commitBlue *mocktypes.CCIPOracle + commitBlueBootstrap *mocktypes.CCIPOracle + execBlue *mocktypes.CCIPOracle + execBlueBootstrap *mocktypes.CCIPOracle + } + tests := []struct { + name string + args args + expect func(t *testing.T, args args) + asserts func(t *testing.T, args args) + wantErr bool + }{ + { + name: "no errors, no bootstrap", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: nil, + execBlueBootstrap: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Start").Return(nil).Once() + args.execBlue.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "no errors, with bootstrap", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Start").Return(nil).Once() + args.commitBlueBootstrap.On("Start").Return(nil).Once() + args.execBlue.On("Start").Return(nil).Once() + args.execBlueBootstrap.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.commitBlueBootstrap.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + args.execBlueBootstrap.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "error on commit blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: nil, + execBlueBootstrap: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Start").Return(errors.New("failed")).Once() + args.execBlue.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on exec blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: nil, + execBlueBootstrap: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Start").Return(nil).Once() + args.execBlue.On("Start").Return(errors.New("failed")).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on commit blue bootstrap", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Start").Return(nil).Once() + args.commitBlueBootstrap.On("Start").Return(errors.New("failed")).Once() + args.execBlue.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.commitBlueBootstrap.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on exec blue bootstrap", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: nil, + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Start").Return(nil).Once() + args.execBlue.On("Start").Return(nil).Once() + args.execBlueBootstrap.On("Start").Return(errors.New("failed")).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + args.execBlueBootstrap.AssertExpectations(t) + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.args.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.args.execBlue, + }, + } + if tt.args.commitBlueBootstrap != nil { + c.commit.bootstrapBlue = tt.args.commitBlueBootstrap + } + if tt.args.execBlueBootstrap != nil { + c.exec.bootstrapBlue = tt.args.execBlueBootstrap + } + + tt.expect(t, tt.args) + defer tt.asserts(t, tt.args) + err := c.StartBlue() + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_ccipDeployment_CloseBlue(t *testing.T) { + type args struct { + commitBlue *mocktypes.CCIPOracle + commitBlueBootstrap *mocktypes.CCIPOracle + execBlue *mocktypes.CCIPOracle + execBlueBootstrap *mocktypes.CCIPOracle + } + tests := []struct { + name string + args args + expect func(t *testing.T, args args) + asserts func(t *testing.T, args args) + wantErr bool + }{ + { + name: "no errors, no bootstrap", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: nil, + execBlueBootstrap: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "no errors, with bootstrap", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.commitBlueBootstrap.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + args.execBlueBootstrap.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.commitBlueBootstrap.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + args.execBlueBootstrap.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "error on commit blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: nil, + execBlueBootstrap: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(errors.New("failed")).Once() + args.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on exec blue", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: nil, + execBlueBootstrap: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(errors.New("failed")).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on commit blue bootstrap", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: nil, + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.commitBlueBootstrap.On("Close").Return(errors.New("failed")).Once() + args.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.commitBlueBootstrap.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on exec blue bootstrap", + args: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: nil, + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args) { + args.commitBlue.On("Close").Return(nil).Once() + args.execBlue.On("Close").Return(nil).Once() + args.execBlueBootstrap.On("Close").Return(errors.New("failed")).Once() + }, + asserts: func(t *testing.T, args args) { + args.commitBlue.AssertExpectations(t) + args.execBlue.AssertExpectations(t) + args.execBlueBootstrap.AssertExpectations(t) + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.args.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.args.execBlue, + }, + } + if tt.args.commitBlueBootstrap != nil { + c.commit.bootstrapBlue = tt.args.commitBlueBootstrap + } + if tt.args.execBlueBootstrap != nil { + c.exec.bootstrapBlue = tt.args.execBlueBootstrap + } + + tt.expect(t, tt.args) + defer tt.asserts(t, tt.args) + err := c.CloseBlue() + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_ccipDeployment_HandleBlueGreen_PrevDeploymentNil(t *testing.T) { + require.Error(t, (&ccipDeployment{}).HandleBlueGreen(nil)) +} + +func Test_ccipDeployment_HandleBlueGreen(t *testing.T) { + type args struct { + commitBlue *mocktypes.CCIPOracle + commitBlueBootstrap *mocktypes.CCIPOracle + commitGreen *mocktypes.CCIPOracle + commitGreenBootstrap *mocktypes.CCIPOracle + execBlue *mocktypes.CCIPOracle + execBlueBootstrap *mocktypes.CCIPOracle + execGreen *mocktypes.CCIPOracle + execGreenBootstrap *mocktypes.CCIPOracle + } + tests := []struct { + name string + argsPrevDeployment args + argsFutureDeployment args + expect func(t *testing.T, args args, argsPrevDeployment args) + asserts func(t *testing.T, args args, argsPrevDeployment args) + wantErr bool + }{ + { + name: "promotion blue to green, no bootstrap", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + argsPrevDeployment.commitBlue.On("Close").Return(nil).Once() + argsPrevDeployment.execBlue.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + argsPrevDeployment.commitBlue.AssertExpectations(t) + argsPrevDeployment.execBlue.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "promotion blue to green, with bootstrap", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + commitGreenBootstrap: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + execGreenBootstrap: mocktypes.NewCCIPOracle(t), + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + commitGreenBootstrap: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + execGreen: nil, + execGreenBootstrap: nil, + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + argsPrevDeployment.commitBlue.On("Close").Return(nil).Once() + argsPrevDeployment.commitBlueBootstrap.On("Close").Return(nil).Once() + argsPrevDeployment.execBlue.On("Close").Return(nil).Once() + argsPrevDeployment.execBlueBootstrap.On("Close").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + argsPrevDeployment.commitBlue.AssertExpectations(t) + argsPrevDeployment.commitBlueBootstrap.AssertExpectations(t) + argsPrevDeployment.execBlue.AssertExpectations(t) + argsPrevDeployment.execBlueBootstrap.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "new green deployment, no bootstrap", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(nil).Once() + args.execGreen.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "new green deployment, with bootstrap", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + commitGreenBootstrap: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + execGreen: nil, + execGreenBootstrap: nil, + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + commitGreenBootstrap: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + execGreenBootstrap: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(nil).Once() + args.commitGreenBootstrap.On("Start").Return(nil).Once() + args.execGreen.On("Start").Return(nil).Once() + args.execGreenBootstrap.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + args.commitGreenBootstrap.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + args.execGreenBootstrap.AssertExpectations(t) + }, + wantErr: false, + }, + { + name: "error on commit green start", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(errors.New("failed")).Once() + args.execGreen.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on exec green start", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: nil, + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(nil).Once() + args.execGreen.On("Start").Return(errors.New("failed")).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "error on commit green bootstrap start", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + commitGreenBootstrap: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + execGreen: nil, + execGreenBootstrap: nil, + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitBlueBootstrap: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + commitGreenBootstrap: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execBlueBootstrap: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + execGreenBootstrap: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(nil).Once() + args.commitGreenBootstrap.On("Start").Return(errors.New("failed")).Once() + args.execGreen.On("Start").Return(nil).Once() + args.execGreenBootstrap.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + args.commitGreenBootstrap.AssertExpectations(t) + args.execGreen.AssertExpectations(t) + args.execGreenBootstrap.AssertExpectations(t) + }, + wantErr: true, + }, + { + name: "invalid blue-green deployment transition commit: both prev and future deployment have green", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) {}, + asserts: func(t *testing.T, args args, argsPrevDeployment args) {}, + wantErr: true, + }, + { + name: "invalid blue-green deployment transition exec: both prev and future deployment have green", + argsPrevDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: nil, + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + argsFutureDeployment: args{ + commitBlue: mocktypes.NewCCIPOracle(t), + commitGreen: mocktypes.NewCCIPOracle(t), + execBlue: mocktypes.NewCCIPOracle(t), + execGreen: mocktypes.NewCCIPOracle(t), + }, + expect: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.On("Start").Return(nil).Once() + }, + asserts: func(t *testing.T, args args, argsPrevDeployment args) { + args.commitGreen.AssertExpectations(t) + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + futDeployment := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.argsFutureDeployment.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.argsFutureDeployment.execBlue, + }, + } + if tt.argsFutureDeployment.commitGreen != nil { + futDeployment.commit.green = tt.argsFutureDeployment.commitGreen + } + if tt.argsFutureDeployment.commitBlueBootstrap != nil { + futDeployment.commit.bootstrapBlue = tt.argsFutureDeployment.commitBlueBootstrap + } + if tt.argsFutureDeployment.commitGreenBootstrap != nil { + futDeployment.commit.bootstrapGreen = tt.argsFutureDeployment.commitGreenBootstrap + } + if tt.argsFutureDeployment.execGreen != nil { + futDeployment.exec.green = tt.argsFutureDeployment.execGreen + } + if tt.argsFutureDeployment.execBlueBootstrap != nil { + futDeployment.exec.bootstrapBlue = tt.argsFutureDeployment.execBlueBootstrap + } + if tt.argsFutureDeployment.execGreenBootstrap != nil { + futDeployment.exec.bootstrapGreen = tt.argsFutureDeployment.execGreenBootstrap + } + + prevDeployment := &ccipDeployment{ + commit: blueGreenDeployment{ + blue: tt.argsPrevDeployment.commitBlue, + }, + exec: blueGreenDeployment{ + blue: tt.argsPrevDeployment.execBlue, + }, + } + if tt.argsPrevDeployment.commitGreen != nil { + prevDeployment.commit.green = tt.argsPrevDeployment.commitGreen + } + if tt.argsPrevDeployment.commitBlueBootstrap != nil { + prevDeployment.commit.bootstrapBlue = tt.argsPrevDeployment.commitBlueBootstrap + } + if tt.argsPrevDeployment.commitGreenBootstrap != nil { + prevDeployment.commit.bootstrapGreen = tt.argsPrevDeployment.commitGreenBootstrap + } + if tt.argsPrevDeployment.execGreen != nil { + prevDeployment.exec.green = tt.argsPrevDeployment.execGreen + } + if tt.argsPrevDeployment.execBlueBootstrap != nil { + prevDeployment.exec.bootstrapBlue = tt.argsPrevDeployment.execBlueBootstrap + } + if tt.argsPrevDeployment.execGreenBootstrap != nil { + prevDeployment.exec.bootstrapGreen = tt.argsPrevDeployment.execGreenBootstrap + } + + tt.expect(t, tt.argsFutureDeployment, tt.argsPrevDeployment) + defer tt.asserts(t, tt.argsFutureDeployment, tt.argsPrevDeployment) + err := futDeployment.HandleBlueGreen(prevDeployment) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_isNewGreenInstance(t *testing.T) { + type args struct { + pluginType cctypes.PluginType + ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta + prevDeployment ccipDeployment + } + tests := []struct { + name string + args args + want bool + }{ + { + "prev deployment only blue", + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + ocrConfigs: []ccipreaderpkg.OCR3ConfigWithMeta{ + {}, {}, + }, + prevDeployment: ccipDeployment{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + }, + }, + }, + true, + }, + { + "green -> blue promotion", + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + ocrConfigs: []ccipreaderpkg.OCR3ConfigWithMeta{ + {}, + }, + prevDeployment: ccipDeployment{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + green: mocktypes.NewCCIPOracle(t), + }, + }, + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := isNewGreenInstance(tt.args.pluginType, tt.args.ocrConfigs, tt.args.prevDeployment) + require.Equal(t, tt.want, got) + }) + } +} + +func Test_isPromotion(t *testing.T) { + type args struct { + pluginType cctypes.PluginType + ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta + prevDeployment ccipDeployment + } + tests := []struct { + name string + args args + want bool + }{ + { + "prev deployment only blue", + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + ocrConfigs: []ccipreaderpkg.OCR3ConfigWithMeta{ + {}, {}, + }, + prevDeployment: ccipDeployment{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + }, + }, + }, + false, + }, + { + "green -> blue promotion", + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + ocrConfigs: []ccipreaderpkg.OCR3ConfigWithMeta{ + {}, + }, + prevDeployment: ccipDeployment{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + green: mocktypes.NewCCIPOracle(t), + }, + }, + }, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := isPromotion(tt.args.pluginType, tt.args.ocrConfigs, tt.args.prevDeployment); got != tt.want { + t.Errorf("isPromotion() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_ccipDeployment_HasGreenInstance(t *testing.T) { + type fields struct { + commit blueGreenDeployment + exec blueGreenDeployment + } + type args struct { + pluginType cctypes.PluginType + } + tests := []struct { + name string + fields fields + args args + want bool + }{ + { + "commit green present", + fields{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + green: mocktypes.NewCCIPOracle(t), + }, + }, + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + }, + true, + }, + { + "commit green not present", + fields{ + commit: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + }, + }, + args{ + pluginType: cctypes.PluginTypeCCIPCommit, + }, + false, + }, + { + "exec green present", + fields{ + exec: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + green: mocktypes.NewCCIPOracle(t), + }, + }, + args{ + pluginType: cctypes.PluginTypeCCIPExec, + }, + true, + }, + { + "exec green not present", + fields{ + exec: blueGreenDeployment{ + blue: mocktypes.NewCCIPOracle(t), + }, + }, + args{ + pluginType: cctypes.PluginTypeCCIPExec, + }, + false, + }, + { + "invalid plugin type", + fields{}, + args{ + pluginType: cctypes.PluginType(100), + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &ccipDeployment{} + if tt.fields.commit.blue != nil { + c.commit.blue = tt.fields.commit.blue + } + if tt.fields.commit.green != nil { + c.commit.green = tt.fields.commit.green + } + if tt.fields.exec.blue != nil { + c.exec.blue = tt.fields.exec.blue + } + if tt.fields.exec.green != nil { + c.exec.green = tt.fields.exec.green + } + got := c.HasGreenInstance(tt.args.pluginType) + require.Equal(t, tt.want, got) + }) + } +} diff --git a/core/services/ccipcapability/launcher/ccip_capability_launcher.png b/core/services/ccipcapability/launcher/ccip_capability_launcher.png new file mode 100644 index 0000000000..5e90d5ff7d Binary files /dev/null and b/core/services/ccipcapability/launcher/ccip_capability_launcher.png differ diff --git a/core/services/ccipcapability/launcher/ccip_config_state_machine.png b/core/services/ccipcapability/launcher/ccip_config_state_machine.png new file mode 100644 index 0000000000..ece40e6c19 Binary files /dev/null and b/core/services/ccipcapability/launcher/ccip_config_state_machine.png differ diff --git a/core/services/ccipcapability/launcher/diff.go b/core/services/ccipcapability/launcher/diff.go new file mode 100644 index 0000000000..d56bf9dd12 --- /dev/null +++ b/core/services/ccipcapability/launcher/diff.go @@ -0,0 +1,180 @@ +package launcher + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/crypto" + + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" +) + +// diffResult contains the added, removed and updated CCIP DONs. +// It is determined by using the `diff` function below. +type diffResult struct { + added map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo + removed map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo + updated map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo +} + +// diff compares the old and new state and returns the added, removed and updated CCIP DONs. +func diff( + capabilityVersion, + capabilityLabelledName string, + oldState, + newState registrysyncer.State, +) (diffResult, error) { + ccipCapability, err := checkCapabilityPresence(capabilityVersion, capabilityLabelledName, newState) + if err != nil { + return diffResult{}, fmt.Errorf("failed to check capability presence: %w", err) + } + + newCCIPDONs, err := filterCCIPDONs(ccipCapability, newState) + if err != nil { + return diffResult{}, fmt.Errorf("failed to filter CCIP DONs from new state: %w", err) + } + + currCCIPDONs, err := filterCCIPDONs(ccipCapability, oldState) + if err != nil { + return diffResult{}, fmt.Errorf("failed to filter CCIP DONs from old state: %w", err) + } + + // compare curr with new and launch or update OCR instances as needed + diffRes, err := compareDONs(currCCIPDONs, newCCIPDONs) + if err != nil { + return diffResult{}, fmt.Errorf("failed to compare CCIP DONs: %w", err) + } + + return diffRes, nil +} + +// compareDONs compares the current and new CCIP DONs and returns the added, removed and updated DONs. +func compareDONs( + currCCIPDONs, + newCCIPDONs map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo, +) ( + dr diffResult, + err error, +) { + added := make(map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo) + removed := make(map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo) + updated := make(map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo) + + for id, don := range newCCIPDONs { + if currDONState, ok := currCCIPDONs[id]; !ok { + // Not in current state, so mark as added. + added[id] = don + } else { + // If its in the current state and the config count for the DON has changed, mark as updated. + // Since the registry returns the full state we need to compare the config count. + if don.ConfigCount > currDONState.ConfigCount { + updated[id] = don + } + } + } + + for id, don := range currCCIPDONs { + if _, ok := newCCIPDONs[id]; !ok { + // In current state but not in latest registry state, so should remove. + removed[id] = don + } + } + + return diffResult{ + added: added, + removed: removed, + updated: updated, + }, nil +} + +// filterCCIPDONs filters the CCIP DONs from the given state. +func filterCCIPDONs( + ccipCapability kcr.CapabilitiesRegistryCapabilityInfo, + state registrysyncer.State, +) (map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo, error) { + ccipDONs := make(map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo) + for _, don := range state.IDsToDONs { + for _, donCapabilities := range don.CapabilityConfigurations { + hid, err := hashedCapabilityId(ccipCapability.LabelledName, ccipCapability.Version) + if err != nil { + return nil, fmt.Errorf("failed to hash capability id: %w", err) + } + if donCapabilities.CapabilityId == hid { + ccipDONs[registrysyncer.DonID(don.Id)] = don + } + } + } + + return ccipDONs, nil +} + +// checkCapabilityPresence checks if the capability with the given version and +// labelled name is present in the given capability registry state. +func checkCapabilityPresence( + capabilityVersion, + capabilityLabelledName string, + state registrysyncer.State, +) (kcr.CapabilitiesRegistryCapabilityInfo, error) { + // Sanity check to make sure the capability registry has the capability we are looking for. + hid, err := hashedCapabilityId(capabilityLabelledName, capabilityVersion) + if err != nil { + return kcr.CapabilitiesRegistryCapabilityInfo{}, fmt.Errorf("failed to hash capability id: %w", err) + } + ccipCapability, ok := state.IDsToCapabilities[hid] + if !ok { + return kcr.CapabilitiesRegistryCapabilityInfo{}, + fmt.Errorf("failed to find capability with name %s and version %s in capability registry state", + capabilityLabelledName, capabilityVersion) + } + + return ccipCapability, nil +} + +// hashedCapabilityId returns the hashed capability id in a manner equivalent to the capability registry. +func hashedCapabilityId(capabilityLabelledName, capabilityVersion string) (r [32]byte, err error) { + tabi := `[{"type": "string"}, {"type": "string"}]` + abiEncoded, err := utils.ABIEncode(tabi, capabilityLabelledName, capabilityVersion) + if err != nil { + return r, fmt.Errorf("failed to ABI encode capability version and labelled name: %w", err) + } + + h := crypto.Keccak256(abiEncoded) + copy(r[:], h) + return r, nil +} + +// mustHashedCapabilityId is a helper function that panics if the hashedCapabilityId function returns an error. +// should only use in tests. +func mustHashedCapabilityId(capabilityLabelledName, capabilityVersion string) [32]byte { + r, err := hashedCapabilityId(capabilityLabelledName, capabilityVersion) + if err != nil { + panic(err) + } + return r +} + +// isMemberOfDON returns true if and only if the given p2pID is a member of the given DON. +func isMemberOfDON(don kcr.CapabilitiesRegistryDONInfo, p2pID ragep2ptypes.PeerID) bool { + for _, node := range don.NodeP2PIds { + if node == p2pID { + return true + } + } + return false +} + +// isMemberOfBootstrapSubcommittee returns true if and only if the given p2pID is a member of the given bootstrap subcommittee. +func isMemberOfBootstrapSubcommittee( + bootstrapP2PIDs [][32]byte, + p2pID ragep2ptypes.PeerID, +) bool { + for _, bootstrapID := range bootstrapP2PIDs { + if bootstrapID == p2pID { + return true + } + } + return false +} diff --git a/core/services/ccipcapability/launcher/diff_test.go b/core/services/ccipcapability/launcher/diff_test.go new file mode 100644 index 0000000000..c7a54cad2f --- /dev/null +++ b/core/services/ccipcapability/launcher/diff_test.go @@ -0,0 +1,508 @@ +package launcher + +import ( + "math/big" + "reflect" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" +) + +func Test_diff(t *testing.T) { + type args struct { + capabilityVersion string + capabilityLabelledName string + oldState registrysyncer.State + newState registrysyncer.State + } + tests := []struct { + name string + args args + want diffResult + wantErr bool + }{ + { + "no diff", + args{ + capabilityVersion: "v1.0.0", + capabilityLabelledName: "ccip", + oldState: registrysyncer.State{ + IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ + mustHashedCapabilityId("ccip", "v1.0.0"): { + LabelledName: "ccip", + Version: "v1.0.0", + }, + }, + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.0.0"), + }, + }, + }, + }, + IDsToNodes: map[types.PeerID]kcr.CapabilitiesRegistryNodeInfo{}, + }, + newState: registrysyncer.State{ + IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ + mustHashedCapabilityId("ccip", "v1.0.0"): { + LabelledName: "ccip", + Version: "v1.0.0", + }, + }, + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.0.0"), + }, + }, + }, + }, + IDsToNodes: map[types.PeerID]kcr.CapabilitiesRegistryNodeInfo{}, + }, + }, + diffResult{ + added: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + removed: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + updated: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + }, + false, + }, + { + "capability not present", + args{ + capabilityVersion: "v1.0.0", + capabilityLabelledName: "ccip", + oldState: registrysyncer.State{ + IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ + mustHashedCapabilityId("ccip", "v1.1.0"): { + LabelledName: "ccip", + Version: "v1.1.0", + }, + }, + }, + newState: registrysyncer.State{ + IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ + mustHashedCapabilityId("ccip", "v1.1.0"): { + LabelledName: "ccip", + Version: "v1.1.0", + }, + }, + }, + }, + diffResult{}, + true, + }, + { + "diff present, new don", + args{ + capabilityVersion: "v1.0.0", + capabilityLabelledName: "ccip", + oldState: registrysyncer.State{ + IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ + mustHashedCapabilityId("ccip", "v1.0.0"): { + LabelledName: "ccip", + Version: "v1.0.0", + }, + }, + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + }, + newState: registrysyncer.State{ + IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ + mustHashedCapabilityId("ccip", "v1.0.0"): { + LabelledName: "ccip", + Version: "v1.0.0", + }, + }, + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.0.0"), + }, + }, + }, + }, + }, + }, + diffResult{ + added: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.0.0"), + }, + }, + }, + }, + removed: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + updated: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := diff(tt.args.capabilityVersion, tt.args.capabilityLabelledName, tt.args.oldState, tt.args.newState) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, got) + } + }) + } +} + +func Test_compareDONs(t *testing.T) { + type args struct { + currCCIPDONs map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo + newCCIPDONs map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo + } + tests := []struct { + name string + args args + wantAdded map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo + wantRemoved map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo + wantUpdated map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo + wantErr bool + }{ + { + "added dons", + args{ + currCCIPDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + newCCIPDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + }, + }, + }, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + }, + }, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + false, + }, + { + "removed dons", + args{ + currCCIPDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + }, + }, + newCCIPDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + }, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + }, + }, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + false, + }, + { + "updated dons", + args{ + currCCIPDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + ConfigCount: 1, + }, + }, + newCCIPDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + ConfigCount: 2, + }, + }, + }, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + ConfigCount: 2, + }, + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dr, err := compareDONs(tt.args.currCCIPDONs, tt.args.newCCIPDONs) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.wantAdded, dr.added) + require.Equal(t, tt.wantRemoved, dr.removed) + require.Equal(t, tt.wantUpdated, dr.updated) + } + }) + } +} + +func Test_filterCCIPDONs(t *testing.T) { + type args struct { + ccipCapability kcr.CapabilitiesRegistryCapabilityInfo + state registrysyncer.State + } + tests := []struct { + name string + args args + want map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo + wantErr bool + }{ + { + "one ccip don", + args{ + ccipCapability: kcr.CapabilitiesRegistryCapabilityInfo{ + LabelledName: "ccip", + Version: "v1.0.0", + }, + state: registrysyncer.State{ + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.0.0"), + }, + }, + }, + }, + }, + }, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.0.0"), + }, + }, + }, + }, + false, + }, + { + "no ccip dons", + args{ + ccipCapability: kcr.CapabilitiesRegistryCapabilityInfo{ + LabelledName: "ccip", + Version: "v1.0.0", + }, + state: registrysyncer.State{ + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.1.0"), + }, + }, + }, + }, + }, + }, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + false, + }, + { + "don with multiple capabilities, one of them ccip", + args{ + ccipCapability: kcr.CapabilitiesRegistryCapabilityInfo{ + LabelledName: "ccip", + Version: "v1.0.0", + }, + state: registrysyncer.State{ + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.0.0"), + }, + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.1.0"), + }, + }, + }, + }, + }, + }, + map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + CapabilityConfigurations: []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.0.0"), + }, + { + CapabilityId: mustHashedCapabilityId("ccip", "v1.1.0"), + }, + }, + }, + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := filterCCIPDONs(tt.args.ccipCapability, tt.args.state) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, got) + } + }) + } +} + +func Test_checkCapabilityPresence(t *testing.T) { + type args struct { + capabilityVersion string + capabilityLabelledName string + state registrysyncer.State + } + tests := []struct { + name string + args args + want kcr.CapabilitiesRegistryCapabilityInfo + wantErr bool + }{ + { + "in registry state", + args{ + capabilityVersion: "v1.0.0", + capabilityLabelledName: "ccip", + state: registrysyncer.State{ + IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ + mustHashedCapabilityId("ccip", "v1.0.0"): { + LabelledName: "ccip", + Version: "v1.0.0", + }, + mustHashedCapabilityId("ccip", "v1.1.0"): { + LabelledName: "ccip", + Version: "v1.1.0", + }, + }, + }, + }, + kcr.CapabilitiesRegistryCapabilityInfo{ + LabelledName: "ccip", + Version: "v1.0.0", + }, + false, + }, + { + "not in registry state", + args{ + capabilityVersion: "v1.0.0", + capabilityLabelledName: "ccip", + state: registrysyncer.State{ + IDsToCapabilities: map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo{ + mustHashedCapabilityId("ccip", "v1.1.0"): { + LabelledName: "ccip", + Version: "v1.1.0", + }, + }, + }, + }, + kcr.CapabilitiesRegistryCapabilityInfo{}, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := checkCapabilityPresence(tt.args.capabilityVersion, tt.args.capabilityLabelledName, tt.args.state) + if (err != nil) != tt.wantErr { + t.Errorf("checkCapabilityPresence() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("checkCapabilityPresence() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_hashedCapabilityId(t *testing.T) { + transactor := testutils.MustNewSimTransactor(t) + sb := backends.NewSimulatedBackend(core.GenesisAlloc{ + transactor.From: {Balance: assets.Ether(1000).ToInt()}, + }, 30e6) + + crAddress, _, _, err := kcr.DeployCapabilitiesRegistry(transactor, sb) + require.NoError(t, err) + sb.Commit() + + cr, err := kcr.NewCapabilitiesRegistry(crAddress, sb) + require.NoError(t, err) + + // add a capability, ignore cap config for simplicity. + _, err = cr.AddCapabilities(transactor, []kcr.CapabilitiesRegistryCapability{ + { + LabelledName: "ccip", + Version: "v1.0.0", + CapabilityType: 0, + ResponseType: 0, + ConfigurationContract: common.Address{}, + }, + }) + require.NoError(t, err) + sb.Commit() + + hidExpected, err := cr.GetHashedCapabilityId(nil, "ccip", "v1.0.0") + require.NoError(t, err) + + hid, err := hashedCapabilityId("ccip", "v1.0.0") + require.NoError(t, err) + + require.Equal(t, hidExpected, hid) +} + +func Test_isMemberOfDON(t *testing.T) { + var p2pIDs [][32]byte + for i := range [4]struct{}{} { + p2pIDs = append(p2pIDs, p2pkey.MustNewV2XXXTestingOnly(big.NewInt(int64(i+1))).PeerID()) + } + don := kcr.CapabilitiesRegistryDONInfo{ + Id: 1, + NodeP2PIds: p2pIDs, + } + require.True(t, isMemberOfDON(don, ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID()))) + require.False(t, isMemberOfDON(don, ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(5)).PeerID()))) +} + +func Test_isMemberOfBootstrapSubcommittee(t *testing.T) { + var bootstrapKeys [][32]byte + for i := range [4]struct{}{} { + bootstrapKeys = append(bootstrapKeys, p2pkey.MustNewV2XXXTestingOnly(big.NewInt(int64(i+1))).PeerID()) + } + require.True(t, isMemberOfBootstrapSubcommittee(bootstrapKeys, ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID()))) + require.False(t, isMemberOfBootstrapSubcommittee(bootstrapKeys, ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(5)).PeerID()))) +} diff --git a/core/services/ccipcapability/launcher/integration_test.go b/core/services/ccipcapability/launcher/integration_test.go new file mode 100644 index 0000000000..5c6adc4308 --- /dev/null +++ b/core/services/ccipcapability/launcher/integration_test.go @@ -0,0 +1,374 @@ +package launcher + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/onsi/gomega" + "github.com/stretchr/testify/require" + + ccipreader "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ocr3_config_encoder" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +const ( + chainA uint64 = 1 + fChainA uint8 = 1 + + chainB uint64 = 2 + fChainB uint8 = 2 + + chainC uint64 = 3 + fChainC uint8 = 3 + + ccipCapabilityLabelledName = "ccip" + ccipCapabilityVersion = "v1.0" +) + +type testUniverse struct { + transactor *bind.TransactOpts + backend *backends.SimulatedBackend + capReg *kcr.CapabilitiesRegistry + cc *ccip_config.CCIPConfig + testingT *testing.T + lp logpoller.LogPoller + simClient client.Client +} + +func newTestUniverse(t *testing.T) testUniverse { + transactor := testutils.MustNewSimTransactor(t) + backend := backends.NewSimulatedBackend(core.GenesisAlloc{ + transactor.From: {Balance: assets.Ether(1000).ToInt()}, + }, 30e6) + + crAddress, _, _, err := kcr.DeployCapabilitiesRegistry(transactor, backend) + require.NoError(t, err) + backend.Commit() + + capReg, err := kcr.NewCapabilitiesRegistry(crAddress, backend) + require.NoError(t, err) + + ccAddress, _, _, err := ccip_config.DeployCCIPConfig(transactor, backend, crAddress) + require.NoError(t, err) + backend.Commit() + + cc, err := ccip_config.NewCCIPConfig(ccAddress, backend) + require.NoError(t, err) + + return testUniverse{ + transactor: transactor, + backend: backend, + capReg: capReg, + cc: cc, + testingT: t, + } +} + +func (t testUniverse) NewContractReader(ctx context.Context, cfg []byte) (types.ContractReader, error) { + var config evmrelaytypes.ChainReaderConfig + err := json.Unmarshal(cfg, &config) + require.NoError(t.testingT, err) + return evm.NewChainReaderService(ctx, logger.TestLogger(t.testingT), t.lp, t.simClient, config) +} + +func addCapabilities( + t *testing.T, + backend *backends.SimulatedBackend, + transactor *bind.TransactOpts, + capReg *kcr.CapabilitiesRegistry, + capConfAddress common.Address) [][32]byte { + // add the CCIP capability to the registry + _, err := capReg.AddCapabilities(transactor, []kcr.CapabilitiesRegistryCapability{ + { + LabelledName: ccipCapabilityLabelledName, + Version: ccipCapabilityVersion, + CapabilityType: 0, + ResponseType: 0, + ConfigurationContract: capConfAddress, + }, + }) + require.NoError(t, err, "failed to add capability to registry") + backend.Commit() + + ccipCapabilityID, err := capReg.GetHashedCapabilityId(nil, ccipCapabilityLabelledName, ccipCapabilityVersion) + require.NoError(t, err) + + // Add the p2p ids of the ccip nodes + var p2pIDs [][32]byte + for i := 0; i < 4; i++ { + p2pID := p2pkey.MustNewV2XXXTestingOnly(big.NewInt(int64(i + 1))).PeerID() + p2pIDs = append(p2pIDs, p2pID) + _, err = capReg.AddNodeOperators(transactor, []kcr.CapabilitiesRegistryNodeOperator{ + { + Admin: transactor.From, + Name: fmt.Sprintf("nop-%d", i), + }, + }) + require.NoError(t, err) + backend.Commit() + + // get the node operator id from the event + it, err := capReg.FilterNodeOperatorAdded(nil, nil, nil) + require.NoError(t, err) + var nodeOperatorID uint32 + for it.Next() { + if it.Event.Name == fmt.Sprintf("nop-%d", i) { + nodeOperatorID = it.Event.NodeOperatorId + break + } + } + require.NotZero(t, nodeOperatorID) + + _, err = capReg.AddNodes(transactor, []kcr.CapabilitiesRegistryNodeParams{ + { + NodeOperatorId: nodeOperatorID, + Signer: testutils.Random32Byte(), + P2pId: p2pID, + HashedCapabilityIds: [][32]byte{ccipCapabilityID}, + }, + }) + require.NoError(t, err) + backend.Commit() + + // verify that the node was added successfully + nodeInfo, err := capReg.GetNode(nil, p2pID) + require.NoError(t, err) + + require.Equal(t, nodeOperatorID, nodeInfo.NodeOperatorId) + require.Equal(t, p2pID[:], nodeInfo.P2pId[:]) + } + return p2pIDs +} + +func setupConfigInfo(chainSelector uint64, readers [][32]byte, fChain uint8, cfg []byte) ccip_config.CCIPConfigTypesChainConfigInfo { + return ccip_config.CCIPConfigTypesChainConfigInfo{ + ChainSelector: chainSelector, + ChainConfig: ccip_config.CCIPConfigTypesChainConfig{ + Readers: readers, + FChain: fChain, + Config: cfg, + }, + } +} + +func newHomeChainReader(t *testing.T, logPoller logpoller.LogPoller, client client.Client, ccAddress common.Address) cctypes.HomeChainReader { + cfg := evmrelaytypes.ChainReaderConfig{ + Contracts: map[string]evmrelaytypes.ChainContractReader{ + "CCIPConfig": { + ContractABI: ccip_config.CCIPConfigMetaData.ABI, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + "getAllChainConfigs": { + ChainSpecificName: "getAllChainConfigs", + }, + "getOCRConfig": { + ChainSpecificName: "getOCRConfig", + }, + }, + }, + }, + } + cr, err := evm.NewChainReaderService(testutils.Context(t), logger.TestLogger(t), logPoller, client, cfg) + require.NoError(t, err) + + err = cr.Bind(testutils.Context(t), []types.BoundContract{ + { + Address: ccAddress.String(), + Name: "CCIPConfig", + }, + }) + require.NoError(t, err) + require.NoError(t, cr.Start(testutils.Context(t))) + + hcr := ccipreader.NewHomeChainReader(cr, logger.TestLogger(t), time.Second) + require.NoError(t, hcr.Start(testutils.Context(t))) + + return hcr +} + +func addDONToRegistry(t *testing.T, + transactor *bind.TransactOpts, + ccipCapabilityID [32]byte, + chainSelector uint64, + f uint8, + capReg *kcr.CapabilitiesRegistry, + backend *backends.SimulatedBackend, + bootstrapP2PID [32]byte, + p2pIDs [][32]byte, +) { + tabi, err := ocr3_config_encoder.IOCR3ConfigEncoderMetaData.GetAbi() + require.NoError(t, err) + + var ( + signers [][]byte + transmitters [][]byte + ) + for range p2pIDs { + signers = append(signers, testutils.NewAddress().Bytes()) + transmitters = append(transmitters, testutils.NewAddress().Bytes()) + } + + var ocr3Configs []ocr3_config_encoder.CCIPConfigTypesOCR3Config + for _, pluginType := range []cctypes.PluginType{cctypes.PluginTypeCCIPCommit, cctypes.PluginTypeCCIPExec} { + ocr3Configs = append(ocr3Configs, ocr3_config_encoder.CCIPConfigTypesOCR3Config{ + PluginType: uint8(pluginType), + ChainSelector: chainSelector, + F: f, + OffchainConfigVersion: 30, + OfframpAddress: testutils.NewAddress().Bytes(), + BootstrapP2PIds: [][32]byte{bootstrapP2PID}, + P2pIds: p2pIDs, + Signers: signers, + Transmitters: transmitters, + OffchainConfig: []byte("offchain config"), + }) + } + + encodedCall, err := tabi.Pack("exposeOCR3Config", ocr3Configs) + require.NoError(t, err) + + // Trim first four bytes to remove function selector. + encodedConfigs := encodedCall[4:] + + _, err = capReg.AddDON(transactor, p2pIDs, []kcr.CapabilitiesRegistryCapabilityConfiguration{ + { + CapabilityId: ccipCapabilityID, + Config: encodedConfigs, + }, + }, false, false, f) + require.NoError(t, err) + backend.Commit() +} + +func TestIntegration_Launcher(t *testing.T) { + ctx := testutils.Context(t) + lggr := logger.TestLogger(t) + uni := newTestUniverse(t) + + db := pgtest.NewSqlxDB(t) + lpOpts := logpoller.Opts{ + PollPeriod: time.Millisecond, + FinalityDepth: 0, + BackfillBatchSize: 10, + RpcBatchSize: 10, + KeepFinalizedBlocksDepth: 100000, + } + cl := client.NewSimulatedBackendClient(t, uni.backend, big.NewInt(1337)) + lp := logpoller.NewLogPoller(logpoller.NewORM(big.NewInt(1337), db, lggr), cl, logger.NullLogger, lpOpts) + require.NoError(t, lp.Start(ctx)) + t.Cleanup(func() { require.NoError(t, lp.Close()) }) + + uni.lp = lp + uni.simClient = cl + + p2pIDs := addCapabilities(t, uni.backend, uni.transactor, uni.capReg, uni.cc.Address()) + + regSyncer, err := registrysyncer.New(lggr, uni, uni.capReg.Address().String()) + require.NoError(t, err) + + hcr := newHomeChainReader(t, lp, cl, uni.cc.Address()) + launcher := New( + ccipCapabilityVersion, + ccipCapabilityLabelledName, + p2pIDs[0], + logger.TestLogger(t), + hcr, + &oracleCreatorPrints{ + t: t, + }, + 3*time.Second, + ) + regSyncer.AddLauncher(launcher) + + require.NoError(t, launcher.Start(ctx)) + require.NoError(t, regSyncer.Start(ctx)) + t.Cleanup(func() { require.NoError(t, regSyncer.Close()) }) + t.Cleanup(func() { require.NoError(t, launcher.Close()) }) + + chainAConf := setupConfigInfo(chainA, p2pIDs, fChainA, []byte("chainA")) + chainBConf := setupConfigInfo(chainB, p2pIDs[1:], fChainB, []byte("chainB")) + chainCConf := setupConfigInfo(chainC, p2pIDs[2:], fChainC, []byte("chainC")) + inputConfig := []ccip_config.CCIPConfigTypesChainConfigInfo{ + chainAConf, + chainBConf, + chainCConf, + } + _, err = uni.cc.ApplyChainConfigUpdates(uni.transactor, nil, inputConfig) + require.NoError(t, err) + uni.backend.Commit() + + ccipCapabilityID, err := uni.capReg.GetHashedCapabilityId(nil, ccipCapabilityLabelledName, ccipCapabilityVersion) + require.NoError(t, err) + + addDONToRegistry( + t, + uni.transactor, + ccipCapabilityID, + chainA, + fChainA, + uni.capReg, + uni.backend, + p2pIDs[1], // we're not bootstrapping + p2pIDs, + ) + + gomega.NewWithT(t).Eventually(func() bool { + return len(launcher.runningDONIDs()) == 1 + }, testutils.WaitTimeout(t), testutils.TestInterval).Should(gomega.BeTrue()) +} + +type oraclePrints struct { + t *testing.T + pluginType cctypes.PluginType + config cctypes.OCR3ConfigWithMeta + isBootstrap bool +} + +func (o *oraclePrints) Start() error { + o.t.Logf("Starting oracle (pluginType: %s, isBootstrap: %t) with config %+v\n", o.pluginType, o.isBootstrap, o.config) + return nil +} + +func (o *oraclePrints) Close() error { + o.t.Logf("Closing oracle (pluginType: %s, isBootstrap: %t) with config %+v\n", o.pluginType, o.isBootstrap, o.config) + return nil +} + +type oracleCreatorPrints struct { + t *testing.T +} + +func (o *oracleCreatorPrints) CreatePluginOracle(pluginType cctypes.PluginType, config cctypes.OCR3ConfigWithMeta) (cctypes.CCIPOracle, error) { + o.t.Logf("Creating plugin oracle (pluginType: %s) with config %+v\n", pluginType, config) + return &oraclePrints{pluginType: pluginType, config: config, t: o.t}, nil +} + +func (o *oracleCreatorPrints) CreateBootstrapOracle(config cctypes.OCR3ConfigWithMeta) (cctypes.CCIPOracle, error) { + o.t.Logf("Creating bootstrap oracle with config %+v\n", config) + return &oraclePrints{pluginType: cctypes.PluginTypeCCIPCommit, config: config, isBootstrap: true, t: o.t}, nil +} + +var _ cctypes.OracleCreator = &oracleCreatorPrints{} +var _ cctypes.CCIPOracle = &oraclePrints{} diff --git a/core/services/ccipcapability/launcher/launcher.go b/core/services/ccipcapability/launcher/launcher.go new file mode 100644 index 0000000000..fb46fe40c0 --- /dev/null +++ b/core/services/ccipcapability/launcher/launcher.go @@ -0,0 +1,433 @@ +package launcher + +import ( + "context" + "fmt" + "sync" + "time" + + "go.uber.org/multierr" + + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + "github.com/smartcontractkit/chainlink-common/pkg/services" + + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/logger" + cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types" + "github.com/smartcontractkit/chainlink/v2/core/services/job" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" +) + +var ( + _ job.ServiceCtx = (*launcher)(nil) + _ registrysyncer.Launcher = (*launcher)(nil) +) + +func New( + capabilityVersion, + capabilityLabelledName string, + p2pID ragep2ptypes.PeerID, + lggr logger.Logger, + homeChainReader cctypes.HomeChainReader, + oracleCreator cctypes.OracleCreator, + tickInterval time.Duration, +) *launcher { + return &launcher{ + capabilityVersion: capabilityVersion, + capabilityLabelledName: capabilityLabelledName, + p2pID: p2pID, + lggr: lggr, + homeChainReader: homeChainReader, + regState: registrysyncer.State{ + IDsToDONs: make(map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo), + IDsToNodes: make(map[p2ptypes.PeerID]kcr.CapabilitiesRegistryNodeInfo), + IDsToCapabilities: make(map[registrysyncer.HashedCapabilityID]kcr.CapabilitiesRegistryCapabilityInfo), + }, + oracleCreator: oracleCreator, + dons: make(map[registrysyncer.DonID]*ccipDeployment), + tickInterval: tickInterval, + } +} + +// launcher manages the lifecycles of the CCIP capability on all chains. +type launcher struct { + services.StateMachine + + capabilityVersion string + capabilityLabelledName string + p2pID ragep2ptypes.PeerID + lggr logger.Logger + homeChainReader cctypes.HomeChainReader + stopChan chan struct{} + // latestState is the latest capability registry state received from the syncer. + latestState registrysyncer.State + // regState is the latest capability registry state that we have successfully processed. + regState registrysyncer.State + oracleCreator cctypes.OracleCreator + lock sync.RWMutex + wg sync.WaitGroup + tickInterval time.Duration + + // dons is a map of CCIP DON IDs to the OCR instances that are running on them. + // we can have up to two OCR instances per CCIP plugin, since we are running two plugins, + // thats four OCR instances per CCIP DON maximum. + dons map[registrysyncer.DonID]*ccipDeployment +} + +// Launch implements registrysyncer.Launcher. +func (l *launcher) Launch(ctx context.Context, state registrysyncer.State) error { + l.lock.Lock() + defer l.lock.Unlock() + l.lggr.Debugw("Received new state from syncer", "dons", state.IDsToDONs) + l.latestState = state + return nil +} + +func (l *launcher) getLatestState() registrysyncer.State { + l.lock.RLock() + defer l.lock.RUnlock() + return l.latestState +} + +func (l *launcher) runningDONIDs() []registrysyncer.DonID { + l.lock.RLock() + defer l.lock.RUnlock() + var runningDONs []registrysyncer.DonID + for id := range l.dons { + runningDONs = append(runningDONs, id) + } + return runningDONs +} + +// Close implements job.ServiceCtx. +func (l *launcher) Close() error { + return l.StateMachine.StopOnce("launcher", func() error { + // shut down the monitor goroutine. + close(l.stopChan) + l.wg.Wait() + + // shut down all running oracles. + var err error + for _, ceDep := range l.dons { + err = multierr.Append(err, ceDep.Close()) + } + + return err + }) +} + +// Start implements job.ServiceCtx. +func (l *launcher) Start(context.Context) error { + return l.StartOnce("launcher", func() error { + l.stopChan = make(chan struct{}) + l.wg.Add(1) + go l.monitor() + return nil + }) +} + +func (l *launcher) monitor() { + defer l.wg.Done() + ticker := time.NewTicker(l.tickInterval) + for { + select { + case <-l.stopChan: + return + case <-ticker.C: + if err := l.tick(); err != nil { + l.lggr.Errorw("Failed to tick", "err", err) + } + } + } +} + +func (l *launcher) tick() error { + // Ensure that the home chain reader is healthy. + // For new jobs it may be possible that the home chain reader is not yet ready + // so we won't be able to fetch configs and start any OCR instances. + if ready := l.homeChainReader.Ready(); ready != nil { + return fmt.Errorf("home chain reader is not ready: %w", ready) + } + + // Fetch the latest state from the capability registry and determine if we need to + // launch or update any OCR instances. + latestState := l.getLatestState() + + diffRes, err := diff(l.capabilityVersion, l.capabilityLabelledName, l.regState, latestState) + if err != nil { + return fmt.Errorf("failed to diff capability registry states: %w", err) + } + + err = l.processDiff(diffRes) + if err != nil { + return fmt.Errorf("failed to process diff: %w", err) + } + + return nil +} + +// processDiff processes the diff between the current and latest capability registry states. +// for any added OCR instances, it will launch them. +// for any removed OCR instances, it will shut them down. +// for any updated OCR instances, it will restart them with the new configuration. +func (l *launcher) processDiff(diff diffResult) error { + err := l.processRemoved(diff.removed) + err = multierr.Append(err, l.processAdded(diff.added)) + err = multierr.Append(err, l.processUpdate(diff.updated)) + + return err +} + +func (l *launcher) processUpdate(updated map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo) error { + l.lock.Lock() + defer l.lock.Unlock() + + for donID, don := range updated { + prevDeployment, ok := l.dons[registrysyncer.DonID(don.Id)] + if !ok { + return fmt.Errorf("invariant violation: expected to find CCIP DON %d in the map of running deployments", don.Id) + } + + futDeployment, err := updateDON( + l.lggr, + l.p2pID, + l.homeChainReader, + l.oracleCreator, + *prevDeployment, + don, + ) + if err != nil { + return err + } + if err := futDeployment.HandleBlueGreen(prevDeployment); err != nil { + // TODO: how to handle a failed blue-green deployment? + return fmt.Errorf("failed to handle blue-green deployment for CCIP DON %d: %w", donID, err) + } + + // update state. + l.dons[donID] = futDeployment + // update the state with the latest config. + // this way if one of the starts errors, we don't retry all of them. + l.regState.IDsToDONs[donID] = updated[donID] + } + + return nil +} + +func (l *launcher) processAdded(added map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo) error { + l.lock.Lock() + defer l.lock.Unlock() + + for donID, don := range added { + dep, err := createDON( + l.lggr, + l.p2pID, + l.homeChainReader, + l.oracleCreator, + don, + ) + if err != nil { + return err + } + if dep == nil { + // not a member of this DON. + continue + } + + if err := dep.StartBlue(); err != nil { + if shutdownErr := dep.CloseBlue(); shutdownErr != nil { + l.lggr.Errorw("Failed to shutdown blue instance after failed start", "donId", donID, "err", shutdownErr) + } + return fmt.Errorf("failed to start oracles for CCIP DON %d: %w", donID, err) + } + + // update state. + l.dons[donID] = dep + // update the state with the latest config. + // this way if one of the starts errors, we don't retry all of them. + l.regState.IDsToDONs[donID] = added[donID] + } + + return nil +} + +func (l *launcher) processRemoved(removed map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo) error { + l.lock.Lock() + defer l.lock.Unlock() + + for id := range removed { + ceDep, ok := l.dons[id] + if !ok { + // not running this particular DON. + continue + } + + if err := ceDep.Close(); err != nil { + return fmt.Errorf("failed to shutdown oracles for CCIP DON %d: %w", id, err) + } + + // after a successful shutdown we can safely remove the DON deployment from the map. + delete(l.dons, id) + delete(l.regState.IDsToDONs, id) + } + + return nil +} + +// updateDON is a pure function that handles the case where a DON in the capability registry +// has received a new configuration. +// It returns a new ccipDeployment that can then be used to perform the blue-green deployment, +// based on the previous deployment. +func updateDON( + lggr logger.Logger, + p2pID ragep2ptypes.PeerID, + homeChainReader cctypes.HomeChainReader, + oracleCreator cctypes.OracleCreator, + prevDeployment ccipDeployment, + don kcr.CapabilitiesRegistryDONInfo, +) (futDeployment *ccipDeployment, err error) { + if !isMemberOfDON(don, p2pID) { + lggr.Infow("Not a member of this DON, skipping", "donId", don.Id, "p2pId", p2pID.String()) + return nil, nil + } + + // this should be a retryable error. + commitOCRConfigs, err := homeChainReader.GetOCRConfigs(context.Background(), don.Id, uint8(cctypes.PluginTypeCCIPCommit)) + if err != nil { + return nil, fmt.Errorf("failed to fetch OCR configs for CCIP commit plugin (don id: %d) from home chain config contract: %w", + don.Id, err) + } + + execOCRConfigs, err := homeChainReader.GetOCRConfigs(context.Background(), don.Id, uint8(cctypes.PluginTypeCCIPExec)) + if err != nil { + return nil, fmt.Errorf("failed to fetch OCR configs for CCIP exec plugin (don id: %d) from home chain config contract: %w", + don.Id, err) + } + + commitBgd, err := createFutureBlueGreenDeployment(prevDeployment, commitOCRConfigs, oracleCreator, cctypes.PluginTypeCCIPCommit) + if err != nil { + return nil, fmt.Errorf("failed to create future blue-green deployment for CCIP commit plugin: %w, don id: %d", err, don.Id) + } + + execBgd, err := createFutureBlueGreenDeployment(prevDeployment, execOCRConfigs, oracleCreator, cctypes.PluginTypeCCIPExec) + if err != nil { + return nil, fmt.Errorf("failed to create future blue-green deployment for CCIP exec plugin: %w, don id: %d", err, don.Id) + } + + return &ccipDeployment{ + commit: commitBgd, + exec: execBgd, + }, nil +} + +// valid cases: +// a) len(ocrConfigs) == 2 && !prevDeployment.HasGreenInstance(pluginType): this is a new green instance. +// b) len(ocrConfigs) == 1 && prevDeployment.HasGreenInstance(): this is a promotion of green->blue. +// All other cases are invalid. This is enforced in the ccip config contract. +func createFutureBlueGreenDeployment( + prevDeployment ccipDeployment, + ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta, + oracleCreator cctypes.OracleCreator, + pluginType cctypes.PluginType, +) (blueGreenDeployment, error) { + var deployment blueGreenDeployment + if isNewGreenInstance(pluginType, ocrConfigs, prevDeployment) { + // this is a new green instance. + greenOracle, err := oracleCreator.CreatePluginOracle(pluginType, cctypes.OCR3ConfigWithMeta(ocrConfigs[1])) + if err != nil { + return blueGreenDeployment{}, fmt.Errorf("failed to create CCIP commit oracle: %w", err) + } + + deployment.blue = prevDeployment.commit.blue + deployment.green = greenOracle + } else if isPromotion(pluginType, ocrConfigs, prevDeployment) { + // this is a promotion of green->blue. + deployment.blue = prevDeployment.commit.green + } else { + return blueGreenDeployment{}, fmt.Errorf("invariant violation: expected 1 or 2 OCR configs for CCIP plugin (type: %d), got %d", pluginType, len(ocrConfigs)) + } + + return deployment, nil +} + +// createDON is a pure function that handles the case where a new DON is added to the capability registry. +// It returns a new ccipDeployment that can then be used to start the blue instance. +func createDON( + lggr logger.Logger, + p2pID ragep2ptypes.PeerID, + homeChainReader cctypes.HomeChainReader, + oracleCreator cctypes.OracleCreator, + don kcr.CapabilitiesRegistryDONInfo, +) (*ccipDeployment, error) { + if !isMemberOfDON(don, p2pID) { + lggr.Infow("Not a member of this DON, skipping", "donId", don.Id, "p2pId", p2pID.String()) + return nil, nil + } + + // this should be a retryable error. + commitOCRConfigs, err := homeChainReader.GetOCRConfigs(context.Background(), don.Id, uint8(cctypes.PluginTypeCCIPCommit)) + if err != nil { + return nil, fmt.Errorf("failed to fetch OCR configs for CCIP commit plugin (don id: %d) from home chain config contract: %w", + don.Id, err) + } + + execOCRConfigs, err := homeChainReader.GetOCRConfigs(context.Background(), don.Id, uint8(cctypes.PluginTypeCCIPExec)) + if err != nil { + return nil, fmt.Errorf("failed to fetch OCR configs for CCIP exec plugin (don id: %d) from home chain config contract: %w", + don.Id, err) + } + + // upon creation we should only have one OCR config per plugin type. + if len(commitOCRConfigs) != 1 { + return nil, fmt.Errorf("expected exactly one OCR config for CCIP commit plugin (don id: %d), got %d", don.Id, len(commitOCRConfigs)) + } + + if len(execOCRConfigs) != 1 { + return nil, fmt.Errorf("expected exactly one OCR config for CCIP exec plugin (don id: %d), got %d", don.Id, len(execOCRConfigs)) + } + + commitOracle, commitBootstrap, err := createOracle(p2pID, oracleCreator, cctypes.PluginTypeCCIPCommit, commitOCRConfigs) + if err != nil { + return nil, fmt.Errorf("failed to create CCIP commit oracle: %w", err) + } + + execOracle, execBootstrap, err := createOracle(p2pID, oracleCreator, cctypes.PluginTypeCCIPExec, execOCRConfigs) + if err != nil { + return nil, fmt.Errorf("failed to create CCIP exec oracle: %w", err) + } + + return &ccipDeployment{ + commit: blueGreenDeployment{ + blue: commitOracle, + bootstrapBlue: commitBootstrap, + }, + exec: blueGreenDeployment{ + blue: execOracle, + bootstrapBlue: execBootstrap, + }, + }, nil +} + +func createOracle( + p2pID ragep2ptypes.PeerID, + oracleCreator cctypes.OracleCreator, + pluginType cctypes.PluginType, + ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta, +) (pluginOracle, bootstrapOracle cctypes.CCIPOracle, err error) { + pluginOracle, err = oracleCreator.CreatePluginOracle(pluginType, cctypes.OCR3ConfigWithMeta(ocrConfigs[0])) + if err != nil { + return nil, nil, fmt.Errorf("failed to create CCIP plugin oracle (plugintype: %d): %w", pluginType, err) + } + + if isMemberOfBootstrapSubcommittee(ocrConfigs[0].Config.BootstrapP2PIds, p2pID) { + bootstrapOracle, err = oracleCreator.CreateBootstrapOracle(cctypes.OCR3ConfigWithMeta(ocrConfigs[0])) + if err != nil { + return nil, nil, fmt.Errorf("failed to create CCIP bootstrap oracle (plugintype: %d): %w", pluginType, err) + } + } + + return pluginOracle, bootstrapOracle, nil +} diff --git a/core/services/ccipcapability/launcher/launcher_test.go b/core/services/ccipcapability/launcher/launcher_test.go new file mode 100644 index 0000000000..6f8fa7b664 --- /dev/null +++ b/core/services/ccipcapability/launcher/launcher_test.go @@ -0,0 +1,495 @@ +package launcher + +import ( + "errors" + "math/big" + "reflect" + "testing" + + ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types" + mockcctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types/mocks" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" +) + +func Test_createOracle(t *testing.T) { + var p2pKeys []ragep2ptypes.PeerID + for i := 0; i < 3; i++ { + p2pKeys = append(p2pKeys, ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(int64(i+1))).PeerID())) + } + myP2PKey := p2pKeys[0] + type args struct { + p2pID ragep2ptypes.PeerID + oracleCreator *mockcctypes.OracleCreator + pluginType cctypes.PluginType + ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta + } + tests := []struct { + name string + args args + expect func(t *testing.T, args args, oracleCreator *mockcctypes.OracleCreator) + wantErr bool + }{ + { + "success, no bootstrap", + args{ + myP2PKey, + mockcctypes.NewOracleCreator(t), + cctypes.PluginTypeCCIPCommit, + []ccipreaderpkg.OCR3ConfigWithMeta{ + { + Config: ccipreaderpkg.OCR3Config{}, + ConfigCount: 1, + ConfigDigest: testutils.Random32Byte(), + }, + }, + }, + func(t *testing.T, args args, oracleCreator *mockcctypes.OracleCreator) { + oracleCreator. + On("CreatePluginOracle", cctypes.PluginTypeCCIPCommit, cctypes.OCR3ConfigWithMeta(args.ocrConfigs[0])). + Return(mockcctypes.NewCCIPOracle(t), nil) + }, + false, + }, + { + "success, with bootstrap", + args{ + myP2PKey, + mockcctypes.NewOracleCreator(t), + cctypes.PluginTypeCCIPCommit, + []ccipreaderpkg.OCR3ConfigWithMeta{ + { + Config: ccipreaderpkg.OCR3Config{ + BootstrapP2PIds: [][32]byte{myP2PKey}, + }, + ConfigCount: 1, + ConfigDigest: testutils.Random32Byte(), + }, + }, + }, + func(t *testing.T, args args, oracleCreator *mockcctypes.OracleCreator) { + oracleCreator. + On("CreatePluginOracle", cctypes.PluginTypeCCIPCommit, cctypes.OCR3ConfigWithMeta(args.ocrConfigs[0])). + Return(mockcctypes.NewCCIPOracle(t), nil) + oracleCreator. + On("CreateBootstrapOracle", cctypes.OCR3ConfigWithMeta(args.ocrConfigs[0])). + Return(mockcctypes.NewCCIPOracle(t), nil) + }, + false, + }, + { + "error creating plugin oracle", + args{ + myP2PKey, + mockcctypes.NewOracleCreator(t), + cctypes.PluginTypeCCIPCommit, + []ccipreaderpkg.OCR3ConfigWithMeta{ + { + Config: ccipreaderpkg.OCR3Config{}, + ConfigCount: 1, + ConfigDigest: testutils.Random32Byte(), + }, + }, + }, + func(t *testing.T, args args, oracleCreator *mockcctypes.OracleCreator) { + oracleCreator. + On("CreatePluginOracle", cctypes.PluginTypeCCIPCommit, cctypes.OCR3ConfigWithMeta(args.ocrConfigs[0])). + Return(nil, errors.New("error creating oracle")) + }, + true, + }, + { + "error creating bootstrap oracle", + args{ + myP2PKey, + mockcctypes.NewOracleCreator(t), + cctypes.PluginTypeCCIPCommit, + []ccipreaderpkg.OCR3ConfigWithMeta{ + { + Config: ccipreaderpkg.OCR3Config{ + BootstrapP2PIds: [][32]byte{myP2PKey}, + }, + ConfigCount: 1, + ConfigDigest: testutils.Random32Byte(), + }, + }, + }, + func(t *testing.T, args args, oracleCreator *mockcctypes.OracleCreator) { + oracleCreator. + On("CreatePluginOracle", cctypes.PluginTypeCCIPCommit, cctypes.OCR3ConfigWithMeta(args.ocrConfigs[0])). + Return(mockcctypes.NewCCIPOracle(t), nil) + oracleCreator. + On("CreateBootstrapOracle", cctypes.OCR3ConfigWithMeta(args.ocrConfigs[0])). + Return(nil, errors.New("error creating oracle")) + }, + true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.expect(t, tt.args, tt.args.oracleCreator) + _, _, err := createOracle(tt.args.p2pID, tt.args.oracleCreator, tt.args.pluginType, tt.args.ocrConfigs) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_createDON(t *testing.T) { + type args struct { + lggr logger.Logger + p2pID ragep2ptypes.PeerID + homeChainReader *mockcctypes.HomeChainReader + oracleCreator *mockcctypes.OracleCreator + don kcr.CapabilitiesRegistryDONInfo + } + tests := []struct { + name string + args args + expect func(t *testing.T, args args, oracleCreator *mockcctypes.OracleCreator, homeChainReader *mockcctypes.HomeChainReader) + wantErr bool + }{ + { + "not a member of the DON", + args{ + logger.TestLogger(t), + ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID()), + mockcctypes.NewHomeChainReader(t), + mockcctypes.NewOracleCreator(t), + kcr.CapabilitiesRegistryDONInfo{ + NodeP2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(2)).PeerID(), + }, + Id: 2, + }, + }, + func(t *testing.T, args args, oracleCreator *mockcctypes.OracleCreator, homeChainReader *mockcctypes.HomeChainReader) { + }, + false, + }, + { + "success, no bootstrap", + args{ + logger.TestLogger(t), + ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID()), + mockcctypes.NewHomeChainReader(t), + mockcctypes.NewOracleCreator(t), + kcr.CapabilitiesRegistryDONInfo{ + NodeP2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID(), + }, + Id: 1, + }, + }, + func(t *testing.T, args args, oracleCreator *mockcctypes.OracleCreator, homeChainReader *mockcctypes.HomeChainReader) { + homeChainReader. + On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPCommit)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{}}, nil) + homeChainReader. + On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPExec)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{}}, nil) + oracleCreator. + On("CreatePluginOracle", cctypes.PluginTypeCCIPCommit, mock.Anything). + Return(mockcctypes.NewCCIPOracle(t), nil) + oracleCreator. + On("CreatePluginOracle", cctypes.PluginTypeCCIPExec, mock.Anything). + Return(mockcctypes.NewCCIPOracle(t), nil) + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if tt.expect != nil { + tt.expect(t, tt.args, tt.args.oracleCreator, tt.args.homeChainReader) + } + _, err := createDON(tt.args.lggr, tt.args.p2pID, tt.args.homeChainReader, tt.args.oracleCreator, tt.args.don) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func Test_createFutureBlueGreenDeployment(t *testing.T) { + type args struct { + prevDeployment ccipDeployment + ocrConfigs []ccipreaderpkg.OCR3ConfigWithMeta + oracleCreator *mockcctypes.OracleCreator + pluginType cctypes.PluginType + } + tests := []struct { + name string + args args + want blueGreenDeployment + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := createFutureBlueGreenDeployment(tt.args.prevDeployment, tt.args.ocrConfigs, tt.args.oracleCreator, tt.args.pluginType) + if (err != nil) != tt.wantErr { + t.Errorf("createFutureBlueGreenDeployment() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("createFutureBlueGreenDeployment() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_updateDON(t *testing.T) { + type args struct { + lggr logger.Logger + p2pID ragep2ptypes.PeerID + homeChainReader *mockcctypes.HomeChainReader + oracleCreator *mockcctypes.OracleCreator + prevDeployment ccipDeployment + don kcr.CapabilitiesRegistryDONInfo + } + tests := []struct { + name string + args args + wantFutDeployment *ccipDeployment + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotFutDeployment, err := updateDON(tt.args.lggr, tt.args.p2pID, tt.args.homeChainReader, tt.args.oracleCreator, tt.args.prevDeployment, tt.args.don) + if (err != nil) != tt.wantErr { + t.Errorf("updateDON() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotFutDeployment, tt.wantFutDeployment) { + t.Errorf("updateDON() = %v, want %v", gotFutDeployment, tt.wantFutDeployment) + } + }) + } +} + +func Test_launcher_processDiff(t *testing.T) { + type fields struct { + lggr logger.Logger + p2pID ragep2ptypes.PeerID + homeChainReader *mockcctypes.HomeChainReader + oracleCreator *mockcctypes.OracleCreator + dons map[registrysyncer.DonID]*ccipDeployment + regState registrysyncer.State + } + type args struct { + diff diffResult + } + tests := []struct { + name string + fields fields + args args + assert func(t *testing.T, l *launcher) + wantErr bool + }{ + { + "don removed success", + fields{ + dons: map[registrysyncer.DonID]*ccipDeployment{ + 1: { + commit: blueGreenDeployment{ + blue: newMock(t, + func(t *testing.T) *mockcctypes.CCIPOracle { return mockcctypes.NewCCIPOracle(t) }, + func(m *mockcctypes.CCIPOracle) { + m.On("Close").Return(nil) + }), + }, + exec: blueGreenDeployment{ + blue: newMock(t, + func(t *testing.T) *mockcctypes.CCIPOracle { return mockcctypes.NewCCIPOracle(t) }, + func(m *mockcctypes.CCIPOracle) { + m.On("Close").Return(nil) + }), + }, + }, + }, + regState: registrysyncer.State{ + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + }, + }, + }, + }, + args{ + diff: diffResult{ + removed: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + }, + }, + }, + }, + func(t *testing.T, l *launcher) { + require.Len(t, l.dons, 0) + require.Len(t, l.regState.IDsToDONs, 0) + }, + false, + }, + { + "don added success", + fields{ + lggr: logger.TestLogger(t), + p2pID: ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID()), + homeChainReader: newMock(t, func(t *testing.T) *mockcctypes.HomeChainReader { + return mockcctypes.NewHomeChainReader(t) + }, func(m *mockcctypes.HomeChainReader) { + m.On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPCommit)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{}}, nil) + m.On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPExec)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{}}, nil) + }), + oracleCreator: newMock(t, func(t *testing.T) *mockcctypes.OracleCreator { + return mockcctypes.NewOracleCreator(t) + }, func(m *mockcctypes.OracleCreator) { + commitOracle := mockcctypes.NewCCIPOracle(t) + commitOracle.On("Start").Return(nil) + execOracle := mockcctypes.NewCCIPOracle(t) + execOracle.On("Start").Return(nil) + m.On("CreatePluginOracle", cctypes.PluginTypeCCIPCommit, mock.Anything). + Return(commitOracle, nil) + m.On("CreatePluginOracle", cctypes.PluginTypeCCIPExec, mock.Anything). + Return(execOracle, nil) + }), + dons: map[registrysyncer.DonID]*ccipDeployment{}, + regState: registrysyncer.State{ + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{}, + }, + }, + args{ + diff: diffResult{ + added: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + NodeP2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID(), + }, + }, + }, + }, + }, + func(t *testing.T, l *launcher) { + require.Len(t, l.dons, 1) + require.Len(t, l.regState.IDsToDONs, 1) + }, + false, + }, + { + "don updated new green instance success", + fields{ + lggr: logger.TestLogger(t), + p2pID: ragep2ptypes.PeerID(p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID()), + homeChainReader: newMock(t, func(t *testing.T) *mockcctypes.HomeChainReader { + return mockcctypes.NewHomeChainReader(t) + }, func(m *mockcctypes.HomeChainReader) { + m.On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPCommit)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{}, {}}, nil) + m.On("GetOCRConfigs", mock.Anything, uint32(1), uint8(cctypes.PluginTypeCCIPExec)). + Return([]ccipreaderpkg.OCR3ConfigWithMeta{{}, {}}, nil) + }), + oracleCreator: newMock(t, func(t *testing.T) *mockcctypes.OracleCreator { + return mockcctypes.NewOracleCreator(t) + }, func(m *mockcctypes.OracleCreator) { + commitOracle := mockcctypes.NewCCIPOracle(t) + commitOracle.On("Start").Return(nil) + execOracle := mockcctypes.NewCCIPOracle(t) + execOracle.On("Start").Return(nil) + m.On("CreatePluginOracle", cctypes.PluginTypeCCIPCommit, mock.Anything). + Return(commitOracle, nil) + m.On("CreatePluginOracle", cctypes.PluginTypeCCIPExec, mock.Anything). + Return(execOracle, nil) + }), + dons: map[registrysyncer.DonID]*ccipDeployment{ + 1: { + commit: blueGreenDeployment{ + blue: newMock(t, func(t *testing.T) *mockcctypes.CCIPOracle { + return mockcctypes.NewCCIPOracle(t) + }, func(m *mockcctypes.CCIPOracle) {}), + }, + exec: blueGreenDeployment{ + blue: newMock(t, func(t *testing.T) *mockcctypes.CCIPOracle { + return mockcctypes.NewCCIPOracle(t) + }, func(m *mockcctypes.CCIPOracle) {}), + }, + }, + }, + regState: registrysyncer.State{ + IDsToDONs: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + NodeP2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID(), + }, + }, + }, + }, + }, + args{ + diff: diffResult{ + updated: map[registrysyncer.DonID]kcr.CapabilitiesRegistryDONInfo{ + 1: { + Id: 1, + NodeP2PIds: [][32]byte{ + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)).PeerID(), + p2pkey.MustNewV2XXXTestingOnly(big.NewInt(2)).PeerID(), // new node in don + }, + }, + }, + }, + }, + func(t *testing.T, l *launcher) { + require.Len(t, l.dons, 1) + require.Len(t, l.regState.IDsToDONs, 1) + require.Len(t, l.regState.IDsToDONs[1].NodeP2PIds, 2) + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + l := &launcher{ + dons: tt.fields.dons, + regState: tt.fields.regState, + p2pID: tt.fields.p2pID, + lggr: tt.fields.lggr, + homeChainReader: tt.fields.homeChainReader, + oracleCreator: tt.fields.oracleCreator, + } + err := l.processDiff(tt.args.diff) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + tt.assert(t, l) + }) + } +} + +func newMock[T any](t *testing.T, newer func(t *testing.T) T, expect func(m T)) T { + o := newer(t) + expect(o) + return o +} diff --git a/core/services/ccipcapability/types/mocks/ccip_oracle.go b/core/services/ccipcapability/types/mocks/ccip_oracle.go new file mode 100644 index 0000000000..ebb3ad6801 --- /dev/null +++ b/core/services/ccipcapability/types/mocks/ccip_oracle.go @@ -0,0 +1,60 @@ +// Code generated by mockery v2.42.2. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// CCIPOracle is an autogenerated mock type for the CCIPOracle type +type CCIPOracle struct { + mock.Mock +} + +// Close provides a mock function with given fields: +func (_m *CCIPOracle) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Start provides a mock function with given fields: +func (_m *CCIPOracle) Start() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Start") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// NewCCIPOracle creates a new instance of CCIPOracle. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewCCIPOracle(t interface { + mock.TestingT + Cleanup(func()) +}) *CCIPOracle { + mock := &CCIPOracle{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ccipcapability/types/mocks/home_chain_reader.go b/core/services/ccipcapability/types/mocks/home_chain_reader.go new file mode 100644 index 0000000000..b2576324c8 --- /dev/null +++ b/core/services/ccipcapability/types/mocks/home_chain_reader.go @@ -0,0 +1,81 @@ +package mocks + +import ( + "context" + + mock "github.com/stretchr/testify/mock" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + + cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types" +) + +var _ cctypes.HomeChainReader = (*HomeChainReader)(nil) + +type HomeChainReader struct { + mock.Mock +} + +// GetOCRConfigs provides a mock function with given fields: ctx, donID, pluginType +func (_m *HomeChainReader) GetOCRConfigs(ctx context.Context, donID uint32, pluginType uint8) ([]ccipreaderpkg.OCR3ConfigWithMeta, error) { + ret := _m.Called(ctx, donID, pluginType) + + if len(ret) == 0 { + panic("no return value specified for GetOCRConfigs") + } + + var r0 []ccipreaderpkg.OCR3ConfigWithMeta + var r1 error + if rf, ok := ret.Get(0).(func(ctx context.Context, donID uint32, pluginType uint8) ([]ccipreaderpkg.OCR3ConfigWithMeta, error)); ok { + return rf(ctx, donID, pluginType) + } + if rf, ok := ret.Get(0).(func(ctx context.Context, donID uint32, pluginType uint8) []ccipreaderpkg.OCR3ConfigWithMeta); ok { + r0 = rf(ctx, donID, pluginType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ccipreaderpkg.OCR3ConfigWithMeta) + } + } + + if rf, ok := ret.Get(1).(func(ctx context.Context, donID uint32, pluginType uint8) error); ok { + r1 = rf(ctx, donID, pluginType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +func (_m *HomeChainReader) Ready() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Ready") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// NewHomeChainReader creates a new instance of HomeChainReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewHomeChainReader(t interface { + mock.TestingT + Cleanup(func()) +}) *HomeChainReader { + mock := &HomeChainReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ccipcapability/types/mocks/oracle_creator.go b/core/services/ccipcapability/types/mocks/oracle_creator.go new file mode 100644 index 0000000000..ce729d1afe --- /dev/null +++ b/core/services/ccipcapability/types/mocks/oracle_creator.go @@ -0,0 +1,87 @@ +// Code generated by mockery v2.42.2. DO NOT EDIT. + +package mocks + +import ( + types "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types" + mock "github.com/stretchr/testify/mock" +) + +// OracleCreator is an autogenerated mock type for the OracleCreator type +type OracleCreator struct { + mock.Mock +} + +// CreateBootstrapOracle provides a mock function with given fields: config +func (_m *OracleCreator) CreateBootstrapOracle(config types.OCR3ConfigWithMeta) (types.CCIPOracle, error) { + ret := _m.Called(config) + + if len(ret) == 0 { + panic("no return value specified for CreateBootstrapOracle") + } + + var r0 types.CCIPOracle + var r1 error + if rf, ok := ret.Get(0).(func(types.OCR3ConfigWithMeta) (types.CCIPOracle, error)); ok { + return rf(config) + } + if rf, ok := ret.Get(0).(func(types.OCR3ConfigWithMeta) types.CCIPOracle); ok { + r0 = rf(config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(types.CCIPOracle) + } + } + + if rf, ok := ret.Get(1).(func(types.OCR3ConfigWithMeta) error); ok { + r1 = rf(config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CreatePluginOracle provides a mock function with given fields: pluginType, config +func (_m *OracleCreator) CreatePluginOracle(pluginType types.PluginType, config types.OCR3ConfigWithMeta) (types.CCIPOracle, error) { + ret := _m.Called(pluginType, config) + + if len(ret) == 0 { + panic("no return value specified for CreatePluginOracle") + } + + var r0 types.CCIPOracle + var r1 error + if rf, ok := ret.Get(0).(func(types.PluginType, types.OCR3ConfigWithMeta) (types.CCIPOracle, error)); ok { + return rf(pluginType, config) + } + if rf, ok := ret.Get(0).(func(types.PluginType, types.OCR3ConfigWithMeta) types.CCIPOracle); ok { + r0 = rf(pluginType, config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(types.CCIPOracle) + } + } + + if rf, ok := ret.Get(1).(func(types.PluginType, types.OCR3ConfigWithMeta) error); ok { + r1 = rf(pluginType, config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewOracleCreator creates a new instance of OracleCreator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewOracleCreator(t interface { + mock.TestingT + Cleanup(func()) +}) *OracleCreator { + mock := &OracleCreator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/services/ccipcapability/types/types.go b/core/services/ccipcapability/types/types.go new file mode 100644 index 0000000000..da99785896 --- /dev/null +++ b/core/services/ccipcapability/types/types.go @@ -0,0 +1,58 @@ +package types + +import ( + "context" + + ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" +) + +// OCR3ConfigWithMeta is a type alias in order to generate correct mocks for the OracleCreator interface. +type OCR3ConfigWithMeta ccipreaderpkg.OCR3ConfigWithMeta + +type HomeChainReader interface { + // GetOCRConfigs Gets the OCR3Configs for a given donID and pluginType + GetOCRConfigs(ctx context.Context, donID uint32, pluginType uint8) ([]ccipreaderpkg.OCR3ConfigWithMeta, error) + Ready() error +} + +// PluginType represents the type of CCIP plugin. +// It mirrors the OCRPluginType in Internal.sol. +type PluginType uint8 + +const ( + PluginTypeCCIPCommit PluginType = 0 + PluginTypeCCIPExec PluginType = 1 +) + +func (pt PluginType) String() string { + switch pt { + case PluginTypeCCIPCommit: + return "CCIPCommit" + case PluginTypeCCIPExec: + return "CCIPExec" + default: + return "Unknown" + } +} + +// CCIPOracle represents either a CCIP commit or exec oracle or a bootstrap node. +// +//go:generate mockery --name CCIPOracle --output ./mocks/ --case underscore +type CCIPOracle interface { + Close() error + Start() error +} + +// OracleCreator is an interface for creating CCIP oracles. +// Whether the oracle uses a LOOPP or not is an implementation detail. +// +//go:generate mockery --name OracleCreator --output ./mocks/ --case underscore +type OracleCreator interface { + // CreatePlugin creates a new oracle that will run either the commit or exec ccip plugin. + // The oracle must be returned unstarted. + CreatePluginOracle(pluginType PluginType, config OCR3ConfigWithMeta) (CCIPOracle, error) + + // CreateBootstrapOracle creates a new bootstrap node with the given OCR config. + // The oracle must be returned unstarted. + CreateBootstrapOracle(config OCR3ConfigWithMeta) (CCIPOracle, error) +} diff --git a/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go b/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go index 448ce74fef..0ba086bac6 100644 --- a/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go +++ b/core/services/ocr2/plugins/ccip/ccipcommit/initializers.go @@ -139,6 +139,7 @@ func NewCommitServices(ctx context.Context, ds sqlutil.DataSource, srcProvider c // Prom wrappers onRampReader = observability.NewObservedOnRampReader(onRampReader, sourceChainID, ccip.CommitPluginLabel) commitStoreReader = observability.NewObservedCommitStoreReader(commitStoreReader, destChainID, ccip.CommitPluginLabel) + offRampReader = observability.NewObservedOffRampReader(offRampReader, destChainID, ccip.CommitPluginLabel) metricsCollector := ccip.NewPluginMetricsCollector(ccip.CommitPluginLabel, sourceChainID, destChainID) chainHealthCheck := cache.NewObservedChainHealthCheck( diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2.go b/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2.go index 072bcd4dfa..fc424d8f67 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2.go @@ -56,6 +56,7 @@ type l1ToL2Bridge struct { } func NewL1ToL2Bridge( + ctx context.Context, lggr logger.Logger, localSelector, remoteSelector models.NetworkSelector, @@ -95,8 +96,6 @@ func NewL1ToL2Bridge( remoteChain.Name, "", ) - // FIXME Makram please pass the valid context - ctx := context.Background() err = l1LogPoller.RegisterFilter(ctx, logpoller.Filter{ Addresses: []common.Address{l1LiquidityManagerAddress}, Name: l1FilterName, diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l2_to_l1.go b/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l2_to_l1.go index ea06c363e0..f71a3bd40a 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l2_to_l1.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l2_to_l1.go @@ -54,6 +54,7 @@ type l2ToL1Bridge struct { } func NewL2ToL1Bridge( + ctx context.Context, lggr logger.Logger, localSelector, remoteSelector models.NetworkSelector, @@ -81,8 +82,6 @@ func NewL2ToL1Bridge( remoteChain.Name, "", ) - // FIXME Makram fix the context plax - ctx := context.Background() err := l2LogPoller.RegisterFilter( ctx, logpoller.Filter{ diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/bridge.go b/core/services/ocr2/plugins/liquiditymanager/bridge/bridge.go index c6fb25d3d1..24af25c48e 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/bridge.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/bridge.go @@ -60,7 +60,8 @@ type Bridge interface { //go:generate mockery --name Factory --output ./mocks --filename bridge_factory_mock.go --case=underscore type Factory interface { - NewBridge(source, dest models.NetworkSelector) (Bridge, error) + NewBridge(ctx context.Context, source, dest models.NetworkSelector) (Bridge, error) + GetBridge(source, dest models.NetworkSelector) (Bridge, error) } type Opt func(c *factory) @@ -106,7 +107,7 @@ func WithEvmDep( } } -func (f *factory) NewBridge(source, dest models.NetworkSelector) (Bridge, error) { +func (f *factory) NewBridge(ctx context.Context, source, dest models.NetworkSelector) (Bridge, error) { if source == dest { return nil, fmt.Errorf("no bridge between the same network and itself: %d", source) } @@ -114,12 +115,12 @@ func (f *factory) NewBridge(source, dest models.NetworkSelector) (Bridge, error) bridge, err := f.GetBridge(source, dest) if errors.Is(err, ErrBridgeNotFound) { f.lggr.Infow("Bridge not found, initializing new bridge", "source", source, "dest", dest) - return f.initBridge(source, dest) + return f.initBridge(ctx, source, dest) } return bridge, err } -func (f *factory) initBridge(source, dest models.NetworkSelector) (Bridge, error) { +func (f *factory) initBridge(ctx context.Context, source, dest models.NetworkSelector) (Bridge, error) { f.lggr.Debugw("Initializing bridge", "source", source, "dest", dest) var bridge Bridge @@ -155,6 +156,7 @@ func (f *factory) initBridge(source, dest models.NetworkSelector) (Bridge, error "l2BridgeAdapter", l2BridgeAdapter, ) bridge, err = arb.NewL2ToL1Bridge( + ctx, f.lggr, source, dest, @@ -198,6 +200,7 @@ func (f *factory) initBridge(source, dest models.NetworkSelector) (Bridge, error "l2BridgeAdapter", l2BridgeAdapter, ) bridge, err = opstack.NewL2ToL1Bridge( + ctx, f.lggr, source, dest, @@ -245,6 +248,7 @@ func (f *factory) initBridge(source, dest models.NetworkSelector) (Bridge, error "l1BridgeAdapter", l1BridgeAdapter, ) bridge, err = arb.NewL1ToL2Bridge( + ctx, f.lggr, source, dest, @@ -267,6 +271,7 @@ func (f *factory) initBridge(source, dest models.NetworkSelector) (Bridge, error "l1BridgeAdapter", l1BridgeAdapter, ) bridge, err = opstack.NewL1ToL2Bridge( + ctx, f.lggr, source, dest, @@ -310,6 +315,7 @@ func (f *factory) initBridge(source, dest models.NetworkSelector) (Bridge, error return nil, fmt.Errorf("bridge adapter not found for dest selector %d in deps for selector %d", dest, source) } bridge, err = testonlybridge.New( + ctx, source, dest, sourceDeps.liquidityManagerAddress, diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/mocks/bridge_factory_mock.go b/core/services/ocr2/plugins/liquiditymanager/bridge/mocks/bridge_factory_mock.go index ca0781b149..53f1bf86cd 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/mocks/bridge_factory_mock.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/mocks/bridge_factory_mock.go @@ -3,7 +3,10 @@ package mocks import ( + context "context" + bridge "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/liquiditymanager/bridge" + mock "github.com/stretchr/testify/mock" models "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/liquiditymanager/models" @@ -14,12 +17,12 @@ type Factory struct { mock.Mock } -// NewBridge provides a mock function with given fields: source, dest -func (_m *Factory) NewBridge(source models.NetworkSelector, dest models.NetworkSelector) (bridge.Bridge, error) { +// GetBridge provides a mock function with given fields: source, dest +func (_m *Factory) GetBridge(source models.NetworkSelector, dest models.NetworkSelector) (bridge.Bridge, error) { ret := _m.Called(source, dest) if len(ret) == 0 { - panic("no return value specified for NewBridge") + panic("no return value specified for GetBridge") } var r0 bridge.Bridge @@ -44,6 +47,36 @@ func (_m *Factory) NewBridge(source models.NetworkSelector, dest models.NetworkS return r0, r1 } +// NewBridge provides a mock function with given fields: ctx, source, dest +func (_m *Factory) NewBridge(ctx context.Context, source models.NetworkSelector, dest models.NetworkSelector) (bridge.Bridge, error) { + ret := _m.Called(ctx, source, dest) + + if len(ret) == 0 { + panic("no return value specified for NewBridge") + } + + var r0 bridge.Bridge + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, models.NetworkSelector, models.NetworkSelector) (bridge.Bridge, error)); ok { + return rf(ctx, source, dest) + } + if rf, ok := ret.Get(0).(func(context.Context, models.NetworkSelector, models.NetworkSelector) bridge.Bridge); ok { + r0 = rf(ctx, source, dest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(bridge.Bridge) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, models.NetworkSelector, models.NetworkSelector) error); ok { + r1 = rf(ctx, source, dest) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // NewFactory creates a new instance of Factory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFactory(t interface { diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l1_to_l2.go b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l1_to_l2.go index f80cc86634..e9cf63c98a 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l1_to_l2.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l1_to_l2.go @@ -47,6 +47,7 @@ type l1ToL2Bridge struct { } func NewL1ToL2Bridge( + ctx context.Context, lggr logger.Logger, localSelector, remoteSelector models.NetworkSelector, @@ -77,8 +78,6 @@ func NewL1ToL2Bridge( "", ) - // TODO: FIXME pass valid context - ctx := context.Background() err := l1LogPoller.RegisterFilter(ctx, logpoller.Filter{ Addresses: []common.Address{l1LiquidityManagerAddress}, // emits LiquidityTransferred Name: l1FilterName, diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l2_to_l1.go b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l2_to_l1.go index ce354593a7..ea04652e31 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l2_to_l1.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l2_to_l1.go @@ -41,6 +41,7 @@ type l2ToL1Bridge struct { } func NewL2ToL1Bridge( + ctx context.Context, lggr logger.Logger, localSelector, remoteSelector models.NetworkSelector, @@ -68,8 +69,6 @@ func NewL2ToL1Bridge( remoteChain.Name, "", ) - // TODO (ogtownsend): pass context from above - ctx := context.Background() err := l2LogPoller.RegisterFilter( ctx, logpoller.Filter{ diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/testonlybridge/l1_to_l1.go b/core/services/ocr2/plugins/liquiditymanager/bridge/testonlybridge/l1_to_l1.go index 7bed294bbb..1ee8096df2 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/testonlybridge/l1_to_l1.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/testonlybridge/l1_to_l1.go @@ -51,13 +51,13 @@ type testBridge struct { } func New( + ctx context.Context, sourceSelector, destSelector models.NetworkSelector, sourceLiquidityManagerAddress, destLiquidityManagerAddress, sourceAdapter, destAdapter models.Address, sourceLogPoller, destLogPoller logpoller.LogPoller, sourceClient, destClient client.Client, lggr logger.Logger, ) (*testBridge, error) { - ctx := context.Background() err := sourceLogPoller.RegisterFilter( ctx, logpoller.Filter{ diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/testonlybridge/l1_to_l1_test.go b/core/services/ocr2/plugins/liquiditymanager/bridge/testonlybridge/l1_to_l1_test.go index af0c5b002d..24cc849e8e 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/testonlybridge/l1_to_l1_test.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/testonlybridge/l1_to_l1_test.go @@ -728,7 +728,7 @@ func TestNew(t *testing.T) { t.Run(tt.name, func(t *testing.T) { tt.expect(t, tt.args) defer tt.assert(t, tt.args) - got, err := New(tt.args.sourceSelector, tt.args.destSelector, tt.args.sourceLiquidityManagerAddress, tt.args.destLiquidityManagerAddress, tt.args.sourceAdapter, tt.args.destAdapter, tt.args.sourceLogPoller, tt.args.destLogPoller, tt.args.sourceClient, tt.args.destClient, tt.args.lggr) + got, err := New(testutils.Context(t), tt.args.sourceSelector, tt.args.destSelector, tt.args.sourceLiquidityManagerAddress, tt.args.destLiquidityManagerAddress, tt.args.sourceAdapter, tt.args.destAdapter, tt.args.sourceLogPoller, tt.args.destLogPoller, tt.args.sourceClient, tt.args.destClient, tt.args.lggr) if tt.wantErr { require.Error(t, err) } else { diff --git a/core/services/ocr2/plugins/liquiditymanager/plugin.go b/core/services/ocr2/plugins/liquiditymanager/plugin.go index e5b0d37ec3..9917196061 100644 --- a/core/services/ocr2/plugins/liquiditymanager/plugin.go +++ b/core/services/ocr2/plugins/liquiditymanager/plugin.go @@ -507,7 +507,7 @@ func (p *Plugin) loadPendingTransfers(ctx context.Context, lggr logger.Logger) ( } for _, edge := range edges { logger := lggr.With("sourceNetwork", edge.Source, "sourceChainID", edge.Source.ChainID(), "destNetwork", edge.Dest, "destChainID", edge.Dest.ChainID()) - bridge, err := p.bridgeFactory.NewBridge(edge.Source, edge.Dest) + bridge, err := p.bridgeFactory.NewBridge(ctx, edge.Source, edge.Dest) if err != nil { return nil, fmt.Errorf("init bridge: %w", err) } @@ -607,7 +607,7 @@ func (p *Plugin) computeResolvedTransfersQuorum(observations []models.Observatio } medianizedNativeFee := rebalcalc.BigIntSortedMiddle(bridgeFees) medianizedDateUnix := rebalcalc.BigIntSortedMiddle(datesUnix) - bridge, err := p.bridgeFactory.NewBridge(k.From, k.To) + bridge, err := p.bridgeFactory.GetBridge(k.From, k.To) if err != nil { return nil, fmt.Errorf("init bridge: %w", err) } @@ -650,7 +650,7 @@ func (p *Plugin) resolveProposedTransfers(ctx context.Context, lggr logger.Logge resolvedTransfers := make([]models.Transfer, 0, len(outcome.ProposedTransfers)) for _, proposedTransfer := range outcome.ProposedTransfers { - bridge, err := p.bridgeFactory.NewBridge(proposedTransfer.From, proposedTransfer.To) + bridge, err := p.bridgeFactory.NewBridge(ctx, proposedTransfer.From, proposedTransfer.To) if err != nil { return nil, fmt.Errorf("init bridge: %w", err) } diff --git a/core/services/ocr2/plugins/liquiditymanager/plugin_test.go b/core/services/ocr2/plugins/liquiditymanager/plugin_test.go index cb3af9d08f..aeb0501083 100644 --- a/core/services/ocr2/plugins/liquiditymanager/plugin_test.go +++ b/core/services/ocr2/plugins/liquiditymanager/plugin_test.go @@ -289,7 +289,7 @@ func TestPlugin_Observation(t *testing.T) { for sourceDest, bridgeFn := range tc.bridges { br, err2 := bridgeFn(t) p.bridgeFactory. - On("NewBridge", sourceDest[0], sourceDest[1]). + On("NewBridge", ctx, sourceDest[0], sourceDest[1]). Return(br, err2) } @@ -660,7 +660,7 @@ func TestPlugin_Outcome(t *testing.T) { for sourceDest, bridgeFn := range tc.bridges { br, err := bridgeFn(t) p.bridgeFactory. - On("NewBridge", sourceDest[0], sourceDest[1]). + On("GetBridge", sourceDest[0], sourceDest[1]). Return(br, err) } @@ -1135,7 +1135,8 @@ func TestPlugin_E2EWithMocks(t *testing.T) { for _, edge := range edges { br, ok := n.bridges[[2]models.NetworkSelector{edge.Source, edge.Dest}] require.True(t, ok, "the test case is wrong, bridge is not defined %d->%d", edge.Source, edge.Dest) - n.bridgeFactory.On("NewBridge", edge.Source, edge.Dest).Return(br, nil).Maybe() + n.bridgeFactory.On("NewBridge", mock.Anything /* cancelContext */, edge.Source, edge.Dest).Return(br, nil).Maybe() + n.bridgeFactory.On("GetBridge", edge.Source, edge.Dest).Return(br, nil).Maybe() pendingTransfers := make([]models.PendingTransfer, 0) for _, tr := range round.pendingTransfersPerNode[i] { diff --git a/core/services/ocr3/plugins/ccip_integration_tests/chainreader/chainreader_test.go b/core/services/ocr3/plugins/ccip_integration_tests/chainreader/chainreader_test.go index caff62c795..c36f786bc9 100644 --- a/core/services/ocr3/plugins/ccip_integration_tests/chainreader/chainreader_test.go +++ b/core/services/ocr3/plugins/ccip_integration_tests/chainreader/chainreader_test.go @@ -18,6 +18,8 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/assert" + "github.com/smartcontractkit/chainlink-common/pkg/codec" types2 "github.com/smartcontractkit/chainlink-common/pkg/types" query2 "github.com/smartcontractkit/chainlink-common/pkg/types/query" @@ -28,7 +30,6 @@ import ( logger2 "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" - "github.com/stretchr/testify/assert" ) const chainID = 1337 diff --git a/core/services/ocr3/plugins/ccip_integration_tests/home_chain/home_chain_test.go b/core/services/ocr3/plugins/ccip_integration_tests/home_chain/home_chain_test.go new file mode 100644 index 0000000000..a84786328c --- /dev/null +++ b/core/services/ocr3/plugins/ccip_integration_tests/home_chain/home_chain_test.go @@ -0,0 +1,234 @@ +package home_chain + +import ( + "fmt" + "math/big" + "testing" + "time" + + mapset "github.com/deckarep/golang-set/v2" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/onsi/gomega" + + libocrtypes "github.com/smartcontractkit/libocr/ragep2p/types" + + ccipreader "github.com/smartcontractkit/chainlink-ccip/pkg/reader" + cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + capcfg "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + helpers "github.com/smartcontractkit/chainlink/v2/core/services/ocr3/plugins/ccip_integration_tests" + + "github.com/stretchr/testify/require" + + evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +const ( + chainA uint64 = 1 + fChainA uint8 = 1 + + chainB uint64 = 2 + fChainB uint8 = 2 + + chainC uint64 = 3 + fChainC uint8 = 3 +) + +func TestHomeChainReader(t *testing.T) { + // Initialize chainReader + cfg := evmtypes.ChainReaderConfig{ + Contracts: map[string]evmtypes.ChainContractReader{ + "CCIPConfig": { + ContractABI: capcfg.CCIPConfigMetaData.ABI, + Configs: map[string]*evmtypes.ChainReaderDefinition{ + "getAllChainConfigs": { + ChainSpecificName: "getAllChainConfigs", + }, + }, + }, + }, + } + //============================Setup Backend=================================== + transactor := testutils.MustNewSimTransactor(t) + backend := backends.NewSimulatedBackend(core.GenesisAlloc{ + transactor.From: {Balance: assets.Ether(1000).ToInt()}, + }, 30e6) + //==============================Setup Contracts - Add capabilities================================= + capRegAddress, capRegContract, err := prepareCapabilityRegistry(t, backend, transactor) + require.NoError(t, err) + capConfAddress, capConfContract, err := prepareCCIPCapabilityConfig(t, backend, transactor, capRegAddress) + require.NoError(t, err) + p2pIDS := addCapabilities(t, backend, transactor, capRegContract, capConfAddress) + //==============================Apply configs to Capability Contract================================= + chainAConf := setupConfigInfo(chainA, p2pIDS, fChainA, []byte("chainA")) + chainBConf := setupConfigInfo(chainB, p2pIDS[1:], fChainB, []byte("chainB")) + chainCConf := setupConfigInfo(chainC, p2pIDS[2:], fChainC, []byte("chainC")) + inputConfig := []capcfg.CCIPConfigTypesChainConfigInfo{ + chainAConf, + chainBConf, + chainCConf, + } + _, err = capConfContract.ApplyChainConfigUpdates(transactor, nil, inputConfig) + require.NoError(t, err) + backend.Commit() + //================================Setup HomeChainReader=============================== + ctx := testutils.Context(t) + testData := helpers.SetupReaderTestData(ctx, t, backend, capConfAddress, cfg, "CCIPConfig") + chainReader := testData.ChainReader + logPoller := testData.LogPoller + require.NoError(t, err) + pollDuration := 5 * time.Millisecond + homeChain := ccipreader.NewHomeChainReader(chainReader, logger.TestLogger(t), pollDuration) + require.NoError(t, homeChain.Start(ctx)) + + gomega.NewWithT(t).Eventually(func() bool { + configs, _ := homeChain.GetAllChainConfigs() + return configs != nil + }, testutils.WaitTimeout(t), pollDuration*5).Should(gomega.BeTrue()) + + t.Logf("homchain reader is ready") + //================================Test HomeChain Reader=============================== + expectedChainConfigs := map[cciptypes.ChainSelector]ccipreader.ChainConfig{} + for _, c := range inputConfig { + expectedChainConfigs[cciptypes.ChainSelector(c.ChainSelector)] = ccipreader.ChainConfig{ + FChain: int(c.ChainConfig.FChain), + SupportedNodes: toPeerIDs(c.ChainConfig.Readers), + } + } + configs, err := homeChain.GetAllChainConfigs() + require.NoError(t, err) + require.Equal(t, expectedChainConfigs, configs) + //=================================Remove ChainC from OnChainConfig========================================= + _, err = capConfContract.ApplyChainConfigUpdates(transactor, []uint64{chainC}, nil) + require.NoError(t, err) + backend.Commit() + time.Sleep(pollDuration * 5) // Wait for the chain reader to update + configs, err = homeChain.GetAllChainConfigs() + require.NoError(t, err) + delete(expectedChainConfigs, cciptypes.ChainSelector(chainC)) + require.Equal(t, expectedChainConfigs, configs) + //================================Close HomeChain Reader=============================== + require.NoError(t, homeChain.Close()) + require.NoError(t, logPoller.Close()) + require.NoError(t, chainReader.Close()) + t.Logf("homchain reader successfully closed") +} + +func toPeerIDs(readers [][32]byte) mapset.Set[libocrtypes.PeerID] { + peerIDs := mapset.NewSet[libocrtypes.PeerID]() + for _, r := range readers { + peerIDs.Add(r) + } + return peerIDs +} + +func setupConfigInfo(chainSelector uint64, readers [][32]byte, fChain uint8, cfg []byte) capcfg.CCIPConfigTypesChainConfigInfo { + return capcfg.CCIPConfigTypesChainConfigInfo{ + ChainSelector: chainSelector, + ChainConfig: capcfg.CCIPConfigTypesChainConfig{ + Readers: readers, + FChain: fChain, + Config: cfg, + }, + } +} + +func prepareCCIPCapabilityConfig(t *testing.T, backend *backends.SimulatedBackend, transactor *bind.TransactOpts, capRegAddress common.Address) (common.Address, *capcfg.CCIPConfig, error) { + ccAddress, _, _, err := capcfg.DeployCCIPConfig(transactor, backend, capRegAddress) + require.NoError(t, err) + backend.Commit() + + contract, err := capcfg.NewCCIPConfig(ccAddress, backend) + require.NoError(t, err) + backend.Commit() + + return ccAddress, contract, nil +} + +func prepareCapabilityRegistry(t *testing.T, backend *backends.SimulatedBackend, transactor *bind.TransactOpts) (common.Address, *capabilities_registry.CapabilitiesRegistry, error) { + crAddress, _, _, err := capabilities_registry.DeployCapabilitiesRegistry(transactor, backend) + require.NoError(t, err) + backend.Commit() + + capReg, err := capabilities_registry.NewCapabilitiesRegistry(crAddress, backend) + require.NoError(t, err) + backend.Commit() + + return crAddress, capReg, nil +} + +func addCapabilities( + t *testing.T, + backend *backends.SimulatedBackend, + transactor *bind.TransactOpts, + capReg *capabilities_registry.CapabilitiesRegistry, + capConfAddress common.Address) [][32]byte { + // add the CCIP capability to the registry + _, err := capReg.AddCapabilities(transactor, []capabilities_registry.CapabilitiesRegistryCapability{ + { + LabelledName: "ccip", + Version: "v1.0", + CapabilityType: 0, + ResponseType: 0, + ConfigurationContract: capConfAddress, + }, + }) + require.NoError(t, err, "failed to add capability to registry") + backend.Commit() + + ccipCapabilityID, err := capReg.GetHashedCapabilityId(nil, "ccip", "v1.0") + require.NoError(t, err) + + // Add the p2p ids of the ccip nodes + var p2pIDs [][32]byte + for i := 0; i < 4; i++ { + p2pID := p2pkey.MustNewV2XXXTestingOnly(big.NewInt(int64(i + 1))).PeerID() + p2pIDs = append(p2pIDs, p2pID) + _, err = capReg.AddNodeOperators(transactor, []capabilities_registry.CapabilitiesRegistryNodeOperator{ + { + Admin: transactor.From, + Name: fmt.Sprintf("nop-%d", i), + }, + }) + require.NoError(t, err) + backend.Commit() + + // get the node operator id from the event + it, err := capReg.FilterNodeOperatorAdded(nil, nil, nil) + require.NoError(t, err) + var nodeOperatorID uint32 + for it.Next() { + if it.Event.Name == fmt.Sprintf("nop-%d", i) { + nodeOperatorID = it.Event.NodeOperatorId + break + } + } + require.NotZero(t, nodeOperatorID) + + _, err = capReg.AddNodes(transactor, []capabilities_registry.CapabilitiesRegistryNodeParams{ + { + NodeOperatorId: nodeOperatorID, + Signer: testutils.Random32Byte(), + P2pId: p2pID, + HashedCapabilityIds: [][32]byte{ccipCapabilityID}, + }, + }) + require.NoError(t, err) + backend.Commit() + + // verify that the node was added successfully + nodeInfo, err := capReg.GetNode(nil, p2pID) + require.NoError(t, err) + + require.Equal(t, nodeOperatorID, nodeInfo.NodeOperatorId) + require.Equal(t, p2pID[:], nodeInfo.P2pId[:]) + } + return p2pIDs +} diff --git a/core/services/ocr3/plugins/ccip_integration_tests/integration_helpers.go b/core/services/ocr3/plugins/ccip_integration_tests/integration_helpers.go new file mode 100644 index 0000000000..9a30a7469f --- /dev/null +++ b/core/services/ocr3/plugins/ccip_integration_tests/integration_helpers.go @@ -0,0 +1,65 @@ +package ccip_integration_tests + +import ( + "context" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + + types2 "github.com/smartcontractkit/chainlink-common/pkg/types" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" + "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" + evmtypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +const chainID = 1337 + +type TestSetupData struct { + LogPoller logpoller.LogPoller + ChainReader evm.ChainReaderService +} + +func SetupReaderTestData(ctx context.Context, t *testing.T, simulatedBackend *backends.SimulatedBackend, address common.Address, chainReaderConfig evmtypes.ChainReaderConfig, contractName string) TestSetupData { + lggr := logger.TestLogger(t) + db := pgtest.NewSqlxDB(t) + lpOpts := logpoller.Opts{ + PollPeriod: time.Millisecond, + FinalityDepth: 1, + BackfillBatchSize: 1, + RpcBatchSize: 1, + KeepFinalizedBlocksDepth: 10000, + } + cl := client.NewSimulatedBackendClient(t, simulatedBackend, big.NewInt(chainID)) + lp := logpoller.NewLogPoller(logpoller.NewORM(big.NewInt(chainID), db, lggr), cl, lggr, lpOpts) + require.NoError(t, lp.Start(ctx)) + + cr, err := evm.NewChainReaderService(ctx, lggr, lp, cl, chainReaderConfig) + require.NoError(t, err) + err = cr.Bind(ctx, []types2.BoundContract{ + { + Address: address.String(), + Name: contractName, + Pending: false, + }, + }) + require.NoError(t, err) + require.NoError(t, cr.Start(ctx)) + for { + if err := cr.Ready(); err == nil { + break + } + } + return TestSetupData{ + LogPoller: lp, + ChainReader: cr, + } +} diff --git a/go.md b/go.md index dda7192c1a..eeff43e365 100644 --- a/go.md +++ b/go.md @@ -28,6 +28,8 @@ flowchart LR click chain-selectors href "https://github.com/smartcontractkit/chain-selectors" chainlink/v2 --> chainlink-automation click chainlink-automation href "https://github.com/smartcontractkit/chainlink-automation" + chainlink/v2 --> chainlink-ccip + click chainlink-ccip href "https://github.com/smartcontractkit/chainlink-ccip" chainlink/v2 --> chainlink-common click chainlink-common href "https://github.com/smartcontractkit/chainlink-common" chainlink/v2 --> chainlink-cosmos @@ -52,6 +54,8 @@ flowchart LR click wsrpc href "https://github.com/smartcontractkit/wsrpc" chainlink-automation --> chainlink-common chainlink-automation --> libocr + chainlink-ccip --> chainlink-common + chainlink-ccip --> libocr chainlink-common --> libocr chainlink-cosmos --> chainlink-common chainlink-cosmos --> libocr diff --git a/go.mod b/go.mod index 5fd9f32114..ee07ef8922 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/cometbft/cometbft v0.37.5 github.com/cosmos/cosmos-sdk v0.47.11 github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e - github.com/deckarep/golang-set/v2 v2.3.0 + github.com/deckarep/golang-set/v2 v2.6.0 github.com/dominikbraun/graph v0.23.0 github.com/esote/minmaxheap v1.0.0 github.com/ethereum/go-ethereum v1.13.8 @@ -74,6 +74,7 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/chain-selectors v1.0.17 github.com/smartcontractkit/chainlink-automation v1.0.4 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20240702134133-a6d2f429671f github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625144005-556a7ba7b11c github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240621143432-85370a54b141 github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 diff --git a/go.sum b/go.sum index 8965d8b9c6..ea0257c953 100644 --- a/go.sum +++ b/go.sum @@ -296,8 +296,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g= -github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= @@ -1084,6 +1084,8 @@ github.com/smartcontractkit/chain-selectors v1.0.17 h1:otOlYUnutS8oQBEAi9RLQICqZ github.com/smartcontractkit/chain-selectors v1.0.17/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8= github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240702134133-a6d2f429671f h1:ohB9VgjJ+cvfOSzVEykZqpB/wGlzhzy3IjtdG3ZiO9E= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20240702134133-a6d2f429671f/go.mod h1:vy2vEF1K61khqGcbOCrHBKFPvSQW0O1eg19Sv74Xq/4= github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625144005-556a7ba7b11c h1:dR2y3uzuZ8cJOaMSij8LQIdySuImwxkiZFjZ62ML5S0= github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625144005-556a7ba7b11c/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240621143432-85370a54b141 h1:TMOoYaeSDkkI3jkCH7lKHOZaLkeDuxFTNC+XblD6M0M= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index d6adecc238..fa92bce013 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -154,7 +154,7 @@ require ( github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.3.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index cd35f59008..46bb8bcab3 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -383,8 +383,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g= -github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 3c25889506..44d38aee55 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -122,7 +122,7 @@ require ( github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.3.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 10818b0544..967a7e9b88 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -377,8 +377,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g= -github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=