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

CCIP-4659 New Modified ERC165Checker library #15743

Merged
merged 24 commits into from
Dec 20, 2024
Merged

Conversation

jhweintraub
Copy link
Collaborator

@jhweintraub jhweintraub commented Dec 17, 2024

To prevent issues with the OZ ERC165Checker's enforcement of 32k gas on external calls, this library adds a check that enough gas exists before making the call, and reverts if it does not.

The OffRamp will use this version of the supportsInterface library to prevent message delivery issues.
The 31k gas requirement was chosen due to the 63/64 gas rule and that the staticcall required 30k gas.

30k gas is required to make the staticcall. Under the 63/64 rule this means that 30,477 gas must be available
  /// to ensure that at least 30k is forwarded. Checking for at least 31,000 ensures that after additional
  /// operations are performed there is still >= 30,477 gas remaining.
  /// 30,000 = ((30,477 * 63) / 64)

@jhweintraub jhweintraub requested a review from a team as a code owner December 17, 2024 17:18
Copy link
Contributor

github-actions bot commented Dec 17, 2024

Solidity Review Jira issue

Hey! We have taken the liberty to link this PR to a Jira issue for Solidity Review.

This is a new feature, that's currently in the pilot phase, so please make sure that the linkage is correct. In a contrary case, please update it manually in JIRA and replace Solidity Review issue key in the changeset file with the correct one.
Please reach out to the Test Tooling team and notify them about any issues you encounter.

Any changes to the Solidity Review Jira issue should be reflected in the changeset file. If you need to update the issue key, please do so manually in the following changeset file: contracts/.changeset/violet-lamps-pump.md

This PR has been linked to Solidity Review Jira issue: CCIP-3966

Copy link
Contributor

github-actions bot commented Dec 17, 2024

Static analysis results are available

Hey @jhweintraub, you can view Slither reports in the job summary here or download them as artifact here.
Please check them before merging and make sure you have addressed all issues.

Copy link
Contributor

github-actions bot commented Dec 18, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@jhweintraub jhweintraub force-pushed the fix/erc165Checker_fix branch from 0c13696 to 477f94c Compare December 18, 2024 19:03
Copy link
Contributor

@RensR RensR left a comment

Choose a reason for hiding this comment

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

Can you show how you got to 32k (or 31k as the comment suggests)?

Copy link
Contributor

I see you added a changeset file but it does not contain a tag. Please edit the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@jhweintraub jhweintraub force-pushed the fix/erc165Checker_fix branch from 0413369 to 435d955 Compare December 19, 2024 17:59
RensR
RensR previously approved these changes Dec 20, 2024
@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

@jhweintraub jhweintraub added this pull request to the merge queue Dec 20, 2024
Merged via the queue into develop with commit 4a19318 Dec 20, 2024
207 of 208 checks passed
@jhweintraub jhweintraub deleted the fix/erc165Checker_fix branch December 20, 2024 16:18
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