Skip to content

Commit

Permalink
CCIP-2815 commit report event updates (#1407)
Browse files Browse the repository at this point in the history
## Motivation

OffRamp contract emits commitReport event as a Struct
to make the event Log filtering and searching more optimized, the report
properties are emitted as a event fields rather than emitting the struct

---------

Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
  • Loading branch information
1 parent fc50683 commit fd212e6
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 57 deletions.
74 changes: 41 additions & 33 deletions contracts/gas-snapshots/ccip.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ MultiOCR3Base_transmit:test_UnauthorizedSigner_Revert() (gas: 61131)
MultiOCR3Base_transmit:test_UnconfiguredPlugin_Revert() (gas: 39888)
MultiOCR3Base_transmit:test_ZeroSignatures_Revert() (gas: 32971)
MultiOnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 411709)
MultiRampsE2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1527960)
MultiRampsE2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1526954)
NonceManager_NonceIncrementation:test_getIncrementedOutboundNonce_Success() (gas: 37916)
NonceManager_NonceIncrementation:test_incrementInboundNonce_Skip() (gas: 23709)
NonceManager_NonceIncrementation:test_incrementInboundNonce_Success() (gas: 38799)
Expand Down Expand Up @@ -608,7 +608,7 @@ OCR2Base_transmit:test_Transmit2SignersSuccess_gas() (gas: 51689)
OCR2Base_transmit:test_UnAuthorizedTransmitter_Revert() (gas: 23499)
OCR2Base_transmit:test_UnauthorizedSigner_Revert() (gas: 39695)
OCR2Base_transmit:test_WrongNumberOfSignatures_Revert() (gas: 20572)
OffRamp_afterOC3ConfigSet:test_afterOCR3ConfigSet_SignatureVerificationDisabled_Revert() (gas: 5849491)
OffRamp_afterOC3ConfigSet:test_afterOCR3ConfigSet_SignatureVerificationDisabled_Revert() (gas: 5841071)
OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains_Success() (gas: 468052)
OffRamp_applySourceChainConfigUpdates:test_AddNewChain_Success() (gas: 99216)
OffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates_Success() (gas: 12392)
Expand All @@ -626,42 +626,45 @@ OffRamp_batchExecute:test_SingleReport_Success() (gas: 155963)
OffRamp_batchExecute:test_Unhealthy_Success() (gas: 573311)
OffRamp_batchExecute:test_ZeroReports_Revert() (gas: 10440)
OffRamp_ccipReceive:test_Reverts() (gas: 15705)
OffRamp_commit:test_FailedRMNVerification_Reverts() (gas: 64462)
OffRamp_commit:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 67674)
OffRamp_commit:test_InvalidInterval_Revert() (gas: 59928)
OffRamp_commit:test_InvalidRootRevert() (gas: 58963)
OffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6454659)
OffRamp_commit:test_NoConfig_Revert() (gas: 6038472)
OffRamp_commit:test_OnlyGasPriceUpdates_Success() (gas: 113541)
OffRamp_commit:test_OnlyPriceUpdateStaleReport_Revert() (gas: 121576)
OffRamp_commit:test_OnlyTokenPriceUpdates_Success() (gas: 113562)
OffRamp_commit:test_PriceSequenceNumberCleared_Success() (gas: 355724)
OffRamp_commit:test_ReportAndPriceUpdate_Success() (gas: 166923)
OffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 141978)
OffRamp_commit:test_RootAlreadyCommitted_Revert() (gas: 142982)
OffRamp_commit:test_SourceChainNotEnabled_Revert() (gas: 59250)
OffRamp_commit:test_StaleReportWithRoot_Success() (gas: 240065)
OffRamp_commit:test_UnauthorizedTransmitter_Revert() (gas: 122475)
OffRamp_commit:test_Unhealthy_Revert() (gas: 57991)
OffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 212393)
OffRamp_commit:test_ZeroEpochAndRound_Revert() (gas: 51324)
OffRamp_constructor:test_Constructor_Success() (gas: 6038780)
OffRamp_constructor:test_SourceChainSelector_Revert() (gas: 136917)
OffRamp_constructor:test_ZeroChainSelector_Revert() (gas: 103646)
OffRamp_constructor:test_ZeroNonceManager_Revert() (gas: 101523)
OffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 139565)
OffRamp_constructor:test_ZeroRMNRemote_Revert() (gas: 101452)
OffRamp_constructor:test_ZeroTokenAdminRegistry_Revert() (gas: 101467)
OffRamp_commit:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 67657)
OffRamp_commit:test_InvalidInterval_Revert() (gas: 59911)
OffRamp_commit:test_InvalidRootRevert() (gas: 58946)
OffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6445240)
OffRamp_commit:test_NoConfig_Revert() (gas: 6029053)
OffRamp_commit:test_OnlyGasPriceUpdates_Success() (gas: 112542)
OffRamp_commit:test_OnlyPriceUpdateStaleReport_Revert() (gas: 120551)
OffRamp_commit:test_OnlyTokenPriceUpdates_Success() (gas: 112563)
OffRamp_commit:test_PriceSequenceNumberCleared_Success() (gas: 353726)
OffRamp_commit:test_ReportAndPriceUpdate_Success() (gas: 165014)
OffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 140069)
OffRamp_commit:test_RootAlreadyCommitted_Revert() (gas: 141975)
OffRamp_commit:test_SourceChainNotEnabled_Revert() (gas: 59233)
OffRamp_commit:test_StaleReportWithRoot_Success() (gas: 236247)
OffRamp_commit:test_UnauthorizedTransmitter_Revert() (gas: 121476)
OffRamp_commit:test_Unhealthy_Revert() (gas: 57974)
OffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 209485)
OffRamp_commit:test_WrongConfigWithoutSigners_Revert() (gas: 6582277)
OffRamp_commit:test_ZeroEpochAndRound_Revert() (gas: 51298)
OffRamp_commit:test_FailedRMNVerification_Reverts() (gas: 64445)
OffRamp_constructor:test_ZeroRMNRemote_Revert() (gas: 101442)
OffRamp_manuallyExecute:test_manuallyExecute_SourceChainSelectorMismatch_Revert() (gas: 162246)
OffRamp_constructor:test_Constructor_Success() (gas: 6030360)
OffRamp_constructor:test_SourceChainSelector_Revert() (gas: 136908)
OffRamp_constructor:test_ZeroChainSelector_Revert() (gas: 103636)
OffRamp_constructor:test_ZeroNonceManager_Revert() (gas: 101513)
OffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 139555)
OffRamp_constructor:test_ZeroRMNProxy_Revert() (gas: 101652)
OffRamp_constructor:test_ZeroTokenAdminRegistry_Revert() (gas: 101457)
OffRamp_execute:test_IncorrectArrayType_Revert() (gas: 17281)
OffRamp_execute:test_LargeBatch_Success() (gas: 3378308)
OffRamp_execute:test_MultipleReportsWithPartialValidationFailures_Success() (gas: 372457)
OffRamp_execute:test_MultipleReports_Success() (gas: 298416)
OffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6861122)
OffRamp_execute:test_NoConfig_Revert() (gas: 6085920)
OffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6852702)
OffRamp_execute:test_NoConfig_Revert() (gas: 6077500)
OffRamp_execute:test_NonArray_Revert() (gas: 27721)
OffRamp_execute:test_SingleReport_Success() (gas: 175215)
OffRamp_execute:test_UnauthorizedTransmitter_Revert() (gas: 147455)
OffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 6863865)
OffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 6855445)
OffRamp_execute:test_ZeroReports_Revert() (gas: 17162)
OffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 18212)
OffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 249178)
Expand All @@ -678,7 +681,7 @@ OffRamp_executeSingleReport:test_EmptyReport_Revert() (gas: 21860)
OffRamp_executeSingleReport:test_InvalidSourcePoolAddress_Success() (gas: 502029)
OffRamp_executeSingleReport:test_ManualExecutionNotYetEnabled_Revert() (gas: 47635)
OffRamp_executeSingleReport:test_MismatchingDestChainSelector_Revert() (gas: 33895)
OffRamp_executeSingleReport:test_MismatchingOnRampRoot_Revert() (gas: 155054)
OffRamp_executeSingleReport:test_MismatchingOnRampRoot_Revert() (gas: 154048)
OffRamp_executeSingleReport:test_NonExistingSourceChain_Revert() (gas: 28472)
OffRamp_executeSingleReport:test_ReceiverError_Success() (gas: 187688)
OffRamp_executeSingleReport:test_RetryFailedMessageWithoutManualExecution_Revert() (gas: 198173)
Expand Down Expand Up @@ -712,7 +715,6 @@ OffRamp_manuallyExecute:test_manuallyExecute_GasLimitMismatchMultipleReports_Rev
OffRamp_manuallyExecute:test_manuallyExecute_LowGasLimit_Success() (gas: 529914)
OffRamp_manuallyExecute:test_manuallyExecute_MultipleReportsWithSingleCursedLane_Revert() (gas: 310504)
OffRamp_manuallyExecute:test_manuallyExecute_ReentrancyFails_Success() (gas: 2327501)
OffRamp_manuallyExecute:test_manuallyExecute_SourceChainSelectorMismatch_Revert() (gas: 162246)
OffRamp_manuallyExecute:test_manuallyExecute_Success() (gas: 224130)
OffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride_Success() (gas: 224711)
OffRamp_manuallyExecute:test_manuallyExecute_WithMultiReportGasOverride_Success() (gas: 768287)
Expand All @@ -731,6 +733,8 @@ OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidEVMAddress_Revert()
OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_PoolDoesNotSupportDest_Reverts() (gas: 83403)
OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 178169)
OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 191356)
OffRamp_resetUnblessedRoots:test_OnlyOwner_Revert() (gas: 11379)
OffRamp_resetUnblessedRoots:test_ResetUnblessedRoots_Success() (gas: 214632)
OffRamp_setDynamicConfig:test_FeeQuoterZeroAddress_Revert() (gas: 11610)
OffRamp_setDynamicConfig:test_NonOwner_Revert() (gas: 14177)
OffRamp_setDynamicConfig:test_SetDynamicConfigWithValidator_Success() (gas: 49192)
Expand All @@ -739,6 +743,10 @@ OffRamp_trialExecute:test_RateLimitError_Success() (gas: 225885)
OffRamp_trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 234506)
OffRamp_trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 309185)
OffRamp_trialExecute:test_trialExecute_Success() (gas: 284141)
OffRamp_verify:test_Blessed_Success() (gas: 175973)
OffRamp_verify:test_NotBlessedWrongChainSelector_Success() (gas: 178063)
OffRamp_verify:test_NotBlessed_Success() (gas: 140902)
OffRamp_verify:test_TooManyLeaves_Revert() (gas: 51510)
OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 390910)
OnRamp_applyAllowListUpdates:test_applyAllowListUpdates_InvalidAllowListRequestDisabledAllowListWithAdds() (gas: 17746)
OnRamp_applyAllowListUpdates:test_applyAllowListUpdates_Revert() (gas: 66535)
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/v0.8/ccip/offRamp/OffRamp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base {
event SkippedAlreadyExecutedMessage(uint64 sourceChainSelector, uint64 sequenceNumber);
event AlreadyAttempted(uint64 sourceChainSelector, uint64 sequenceNumber);
/// @dev RMN depends on this event, if changing, please notify the RMN maintainers.
event CommitReportAccepted(CommitReport report);
event CommitReportAccepted(Internal.MerkleRoot[] merkleRoots, Internal.PriceUpdates priceUpdates);
event RootRemoved(bytes32 root);
event SkippedReportExecution(uint64 sourceChainSelector);

Expand Down Expand Up @@ -635,7 +635,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base {
s_roots[root.sourceChainSelector][merkleRoot] = block.timestamp;
}

emit CommitReportAccepted(commitReport);
emit CommitReportAccepted(commitReport.merkleRoots, commitReport.priceUpdates);

_transmit(uint8(Internal.OCRPluginType.Commit), reportContext, report, rs, ss, rawVs);
}
Expand Down
10 changes: 5 additions & 5 deletions contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3120,7 +3120,7 @@ contract OffRamp_commit is OffRampSetup {
OffRamp.CommitReport memory commitReport = _constructCommitReport();

vm.expectEmit();
emit OffRamp.CommitReportAccepted(commitReport);
emit OffRamp.CommitReportAccepted(commitReport.merkleRoots, commitReport.priceUpdates);

vm.expectEmit();
emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber);
Expand Down Expand Up @@ -3148,7 +3148,7 @@ contract OffRamp_commit is OffRampSetup {
OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures});

vm.expectEmit();
emit OffRamp.CommitReportAccepted(commitReport);
emit OffRamp.CommitReportAccepted(commitReport.merkleRoots, commitReport.priceUpdates);

vm.expectEmit();
emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber);
Expand Down Expand Up @@ -3176,7 +3176,7 @@ contract OffRamp_commit is OffRampSetup {
OffRamp.CommitReport({priceUpdates: _getEmptyPriceUpdates(), merkleRoots: roots, rmnSignatures: s_rmnSignatures});

vm.expectEmit();
emit OffRamp.CommitReportAccepted(commitReport);
emit OffRamp.CommitReportAccepted(commitReport.merkleRoots, commitReport.priceUpdates);

vm.expectEmit();
emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber);
Expand All @@ -3191,7 +3191,7 @@ contract OffRamp_commit is OffRampSetup {
commitReport.merkleRoots[0].merkleRoot = "stale report 2";

vm.expectEmit();
emit OffRamp.CommitReportAccepted(commitReport);
emit OffRamp.CommitReportAccepted(commitReport.merkleRoots, commitReport.priceUpdates);

vm.expectEmit();
emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber);
Expand Down Expand Up @@ -3327,7 +3327,7 @@ contract OffRamp_commit is OffRampSetup {
commitReport.merkleRoots = roots;

vm.expectEmit();
emit OffRamp.CommitReportAccepted(commitReport);
emit OffRamp.CommitReportAccepted(commitReport.merkleRoots, commitReport.priceUpdates);

vm.expectEmit();
emit MultiOCR3Base.Transmitted(uint8(Internal.OCRPluginType.Commit), s_configDigestCommit, s_latestSequenceNumber);
Expand Down
22 changes: 6 additions & 16 deletions core/gethwrappers/ccip/generated/offramp/offramp.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ multi_aggregate_rate_limiter: ../../../contracts/solc/v0.8.24/MultiAggregateRate
multi_ocr3_helper: ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.abi ../../../contracts/solc/v0.8.24/MultiOCR3Helper/MultiOCR3Helper.bin 6b56e0114a4d50797d30a34aecc2641ef340451d0c3fcb9d729bba4df2435122
nonce_manager: ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.abi ../../../contracts/solc/v0.8.24/NonceManager/NonceManager.bin 6f64e1083b356c06ee66b9138e398b9c97a4cd3e8c9ec38cf3010cebc79af536
ocr3_config_encoder: ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.abi ../../../contracts/solc/v0.8.24/IOCR3ConfigEncoder/IOCR3ConfigEncoder.bin 9254b35a86f00fde7b7193a033ca58f6521a66e87b9cf9da6ce5660082e79f5d
offramp: ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.abi ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.bin 741b4b66670c06c1b09408ec6706656c46e4c98b227111d99f80940cc5faad42
offramp: ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.abi ../../../contracts/solc/v0.8.24/OffRamp/OffRamp.bin ec0e067fe9cd81ff009b813be775638f53e6c4f17e38610a724304885c96cbf2
onramp: ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.abi ../../../contracts/solc/v0.8.24/OnRamp/OnRamp.bin 594439983f963f4158f9c5009dee7cba4ee56be61900bb1d5b9108eaeac3d6a6
ping_pong_demo: ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.abi ../../../contracts/solc/v0.8.24/PingPongDemo/PingPongDemo.bin c1c2f8a65c7ffd971899cae7fe62f2da57d09e936151e2b92163c4bebe699d6b
price_registry: ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.abi ../../../contracts/solc/v0.8.24/PriceRegistry/PriceRegistry.bin e7781d600c1bb7aa4620106af7f6e146a109b97f4cb6a7d06c9e15773340ecb2
Expand Down

0 comments on commit fd212e6

Please sign in to comment.