Skip to content
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

add tests for more sufficient gas consumption testing in callWithExactGas library #13326

Merged
merged 10 commits into from
May 30, 2024

Conversation

jhweintraub
Copy link
Collaborator

This PR replaces the one I just closed, #13217 which could not be merged due to an issue with the sigchecker not signing every commit.

The helper library CallWithExactGas.sol did not have any tests that ensured that all of the gas provided is properly consumed in the event that an incorrect amount of gas is passed in. CCIP makes extensive use of this library and so this tests attempts to ensure that all gas is properly utilized when contracts are called with the helper functions.

Added two tests to callWithExactGas.t.sol

  1. test_callWithExactGasAndConsumeAll which creates a mock contract and ensures that the amount of gas consumed is the same as the amount passed in.
  2. test_callWithExactGasAndConsumeMoreThanProvided which attempts to consume more gas than is provided in the event that gasLimit > (63/64) of available gas passed to the child call in conjunction with EIP-150

"@chainlink/contracts": patch
---

Add Additional tests to the callWithExactGasLibrary to ensure proper gas usage
Copy link
Contributor

@RensR RensR May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo there is no changeset required for changes like these

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know but the the changeset checker kept causing problems without one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can ignore the failing CI for changeset checker. It's not required

@@ -0,0 +1,52 @@
BurnMintERC677_approve:testApproveSuccess() (gas: 55512)
Copy link
Contributor

@RensR RensR May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete, this is not the correct snapshot location. Any time you see an unexpected new file please ensure you intended to create it

@RensR
Copy link
Contributor

RensR commented May 27, 2024

#13331 fixes CI

@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@RensR RensR changed the title fresh commit to placate the sigchecker add tests for more sufficient gas consumption testing in callWithExactGas library May 28, 2024
@matYang matYang added this pull request to the merge queue May 30, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 30, 2024
@matYang matYang added this pull request to the merge queue May 30, 2024
Merged via the queue into develop with commit 732eea0 May 30, 2024
112 checks passed
@matYang matYang deleted the chore/callWithExactGasTest branch May 30, 2024 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants