-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: CCIP-1451 Offramp gasExecution data in event #1297
feat: CCIP-1451 Offramp gasExecution data in event #1297
Conversation
LCOV of commit
|
@@ -464,8 +466,13 @@ contract EVM2EVMMultiOffRamp is ITypeAndVersion, MultiOCR3Base { | |||
} | |||
} | |||
|
|||
uint256 gasUsed; | |||
unchecked { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please no unchecked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
@@ -27,6 +27,8 @@ import {MaybeRevertMessageReceiver} from "../helpers/receivers/MaybeRevertMessag | |||
import {MockCommitStore} from "../mocks/MockCommitStore.sol"; | |||
import {MultiOCR3BaseSetup} from "../ocr/MultiOCR3BaseSetup.t.sol"; | |||
import {PriceRegistrySetup} from "../priceRegistry/PriceRegistry.t.sol"; | |||
import {Vm} from "forge-std/Test.sol"; | |||
import "forge-std/console.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only allow explicit imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console logging import removed
@@ -489,4 +491,15 @@ contract EVM2EVMMultiOffRampSetup is TokenSetup, PriceRegistrySetup, MultiOCR3Ba | |||
vm.startPrank(s_validTransmitters[0]); | |||
s_offRamp.execute(reportContext, abi.encode(reports)); | |||
} | |||
|
|||
function printExecutionStateChangedEventLogs() public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this? Could you rework this function to assert on all things except gas and use it instead of the expectEmit with hard coded values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on this, hard coded values will be difficult to maintain. We can maybe have 1 or 2 tests using them and ignore the field for the rest, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RensR this is helper function to extract the Execution event from eventLogs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertion function added
…ertion for EVM2EVMMultiOffRamp test
26bf845
to
c2905b6
Compare
Quality Gate passedIssues Measures |
#1310) ## Motivation gasUsed for Execution to be emitted along with ExecutionStateChangedEvent ## Solution compute `gasUsed` for execution of a message in EVM2EVMMultiOffRamp this change is applicable to only 1.6 version Test Assertion must be added to assert the event body parameters (excluding the gasUsed as it cant be hardcoded in tests) ** This is extension of the closed PR: #1297 got signature verification issue with other PR. so moving all changes over here --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: Ryan <80392855+RayXpub@users.noreply.github.com>
#1310) ## Motivation gasUsed for Execution to be emitted along with ExecutionStateChangedEvent ## Solution compute `gasUsed` for execution of a message in EVM2EVMMultiOffRamp this change is applicable to only 1.6 version Test Assertion must be added to assert the event body parameters (excluding the gasUsed as it cant be hardcoded in tests) ** This is extension of the closed PR: smartcontractkit/ccip#1297 got signature verification issue with other PR. so moving all changes over here --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: Ryan <80392855+RayXpub@users.noreply.github.com>
#1310) ## Motivation gasUsed for Execution to be emitted along with ExecutionStateChangedEvent ## Solution compute `gasUsed` for execution of a message in EVM2EVMMultiOffRamp this change is applicable to only 1.6 version Test Assertion must be added to assert the event body parameters (excluding the gasUsed as it cant be hardcoded in tests) ** This is extension of the closed PR: smartcontractkit/ccip#1297 got signature verification issue with other PR. so moving all changes over here --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: Ryan <80392855+RayXpub@users.noreply.github.com>
#1310) ## Motivation gasUsed for Execution to be emitted along with ExecutionStateChangedEvent ## Solution compute `gasUsed` for execution of a message in EVM2EVMMultiOffRamp this change is applicable to only 1.6 version Test Assertion must be added to assert the event body parameters (excluding the gasUsed as it cant be hardcoded in tests) ** This is extension of the closed PR: smartcontractkit/ccip#1297 got signature verification issue with other PR. so moving all changes over here --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: Ryan <80392855+RayXpub@users.noreply.github.com>
#1310) ## Motivation gasUsed for Execution to be emitted along with ExecutionStateChangedEvent ## Solution compute `gasUsed` for execution of a message in EVM2EVMMultiOffRamp this change is applicable to only 1.6 version Test Assertion must be added to assert the event body parameters (excluding the gasUsed as it cant be hardcoded in tests) ** This is extension of the closed PR: smartcontractkit/ccip#1297 got signature verification issue with other PR. so moving all changes over here --------- Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> Co-authored-by: Ryan <80392855+RayXpub@users.noreply.github.com>
Motivation
Include execution gas cost in event emission ->
ExecutionStateChanged
eventJIRA: https://smartcontract-it.atlassian.net/browse/CCIP-1451
Solution