From 1d42a4ab7a832f4fdaab7b5f43f266f76e511cc3 Mon Sep 17 00:00:00 2001 From: 0xsuryansh Date: Wed, 2 Oct 2024 21:01:01 +0530 Subject: [PATCH] moving add instruction post sanity Signed-off-by: 0xsuryansh --- contracts/gas-snapshots/ccip.gas-snapshot | 34 ++++++++++----------- contracts/src/v0.8/ccip/offRamp/OffRamp.sol | 3 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 184e2a2b91..573c310525 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -610,16 +610,16 @@ OCR2Base_transmit:test_Transmit2SignersSuccess_gas() (gas: 51689) OCR2Base_transmit:test_UnAuthorizedTransmitter_Revert() (gas: 23511) OCR2Base_transmit:test_UnauthorizedSigner_Revert() (gas: 39707) OCR2Base_transmit:test_WrongNumberOfSignatures_Revert() (gas: 20584) -OffRamp_afterOC3ConfigSet:test_afterOCR3ConfigSet_SignatureVerificationDisabled_Revert() (gas: 5915989) -OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains_Success() (gas: 626169) -OffRamp_applySourceChainConfigUpdates:test_AddNewChain_Success() (gas: 166511) +OffRamp_afterOC3ConfigSet:test_afterOCR3ConfigSet_SignatureVerificationDisabled_Revert() (gas: 5913989) +OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains_Success() (gas: 626106) +OffRamp_applySourceChainConfigUpdates:test_AddNewChain_Success() (gas: 166490) OffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates_Success() (gas: 16763) -OffRamp_applySourceChainConfigUpdates:test_InvalidOnRampUpdate_Revert() (gas: 272499) -OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRamp_Success() (gas: 168614) -OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChain_Success() (gas: 181069) -OffRamp_applySourceChainConfigUpdates:test_RouterAddress_Revert() (gas: 80266) -OffRamp_applySourceChainConfigUpdates:test_ZeroOnRampAddress_Revert() (gas: 206352) -OffRamp_applySourceChainConfigUpdates:test_ZeroSourceChainSelector_Revert() (gas: 62422) +OffRamp_applySourceChainConfigUpdates:test_InvalidOnRampUpdate_Revert() (gas: 272148) +OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRamp_Success() (gas: 168572) +OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChain_Success() (gas: 181027) +OffRamp_applySourceChainConfigUpdates:test_RouterAddress_Revert() (gas: 13463) +OffRamp_applySourceChainConfigUpdates:test_ZeroOnRampAddress_Revert() (gas: 72746) +OffRamp_applySourceChainConfigUpdates:test_ZeroSourceChainSelector_Revert() (gas: 15519) OffRamp_batchExecute:test_MultipleReportsDifferentChainsSkipCursedChain_Success() (gas: 177947) OffRamp_batchExecute:test_MultipleReportsDifferentChains_Success() (gas: 335550) OffRamp_batchExecute:test_MultipleReportsSameChain_Success() (gas: 278816) @@ -634,8 +634,8 @@ OffRamp_commit:test_FailedRMNVerification_Reverts() (gas: 64099) OffRamp_commit:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 68173) OffRamp_commit:test_InvalidInterval_Revert() (gas: 64291) OffRamp_commit:test_InvalidRootRevert() (gas: 63356) -OffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6676780) -OffRamp_commit:test_NoConfig_Revert() (gas: 6260452) +OffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6674717) +OffRamp_commit:test_NoConfig_Revert() (gas: 6258389) OffRamp_commit:test_OnlyGasPriceUpdates_Success() (gas: 113042) OffRamp_commit:test_OnlyPriceUpdateStaleReport_Revert() (gas: 121403) OffRamp_commit:test_OnlyTokenPriceUpdates_Success() (gas: 113063) @@ -649,23 +649,23 @@ OffRamp_commit:test_UnauthorizedTransmitter_Revert() (gas: 125409) OffRamp_commit:test_Unhealthy_Revert() (gas: 58633) OffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 206778) OffRamp_commit:test_ZeroEpochAndRound_Revert() (gas: 51722) -OffRamp_constructor:test_Constructor_Success() (gas: 6221879) -OffRamp_constructor:test_SourceChainSelector_Revert() (gas: 182841) +OffRamp_constructor:test_Constructor_Success() (gas: 6219847) +OffRamp_constructor:test_SourceChainSelector_Revert() (gas: 135943) OffRamp_constructor:test_ZeroChainSelector_Revert() (gas: 103375) OffRamp_constructor:test_ZeroNonceManager_Revert() (gas: 101269) -OffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 228266) +OffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 161468) OffRamp_constructor:test_ZeroRMNRemote_Revert() (gas: 101189) OffRamp_constructor:test_ZeroTokenAdminRegistry_Revert() (gas: 101227) OffRamp_execute:test_IncorrectArrayType_Revert() (gas: 17639) OffRamp_execute:test_LargeBatch_Success() (gas: 3425675) OffRamp_execute:test_MultipleReportsWithPartialValidationFailures_Success() (gas: 372967) OffRamp_execute:test_MultipleReports_Success() (gas: 300913) -OffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 7085653) -OffRamp_execute:test_NoConfig_Revert() (gas: 6310128) +OffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 7083590) +OffRamp_execute:test_NoConfig_Revert() (gas: 6308065) OffRamp_execute:test_NonArray_Revert() (gas: 27562) OffRamp_execute:test_SingleReport_Success() (gas: 176332) OffRamp_execute:test_UnauthorizedTransmitter_Revert() (gas: 148350) -OffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 7088402) +OffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 7086339) OffRamp_execute:test_ZeroReports_Revert() (gas: 17361) OffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 18511) OffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 244057) diff --git a/contracts/src/v0.8/ccip/offRamp/OffRamp.sol b/contracts/src/v0.8/ccip/offRamp/OffRamp.sol index 49a085d7ff..0f991b7073 100644 --- a/contracts/src/v0.8/ccip/offRamp/OffRamp.sol +++ b/contracts/src/v0.8/ccip/offRamp/OffRamp.sol @@ -948,7 +948,6 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { for (uint256 i = 0; i < sourceChainConfigUpdates.length; ++i) { SourceChainConfigArgs memory sourceConfigUpdate = sourceChainConfigUpdates[i]; uint64 sourceChainSelector = sourceConfigUpdate.sourceChainSelector; - s_sourceChainSelectors.add(sourceChainSelector); if (sourceChainSelector == 0) { revert ZeroChainSelectorNotAllowed(); @@ -980,6 +979,8 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { currentConfig.isEnabled = sourceConfigUpdate.isEnabled; currentConfig.router = sourceConfigUpdate.router; + s_sourceChainSelectors.add(sourceChainSelector); + emit SourceChainConfigSet(sourceChainSelector, currentConfig); } }