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

Optimize gas fee for deregisterProvingKey in VRFCoordinator contract #399

Open
huyhuynh3103 opened this issue Mar 16, 2023 · 3 comments
Open

Comments

@huyhuynh3103
Copy link
Contributor

No description provided.

@martinkersner
Copy link
Member

Hello @huyhuynh3103 ,

Thank you for raising the issue! Could you be please more specific where is the exact problem?

We have noticed the same issue in chainlink smart contract and proposed a fix through smartcontractkit/chainlink#8248.

According to our understanding our implementation does not have this problem. We have added a break

to save a gas in deregisterProvingKey.

Cheers,
Martin

@huyhuynh3103
Copy link
Contributor Author

Hello @martinkersner,
I can save gas for deregisterProvingKeyHashes function by caching the length of array to memory, avoiding assigning defaults value for the index variable, and unchecking the overflow of the looping index while increasing its value.
I can not create a new development branch while creating an issue as well as pushing my changes from local branch. So I fork this project and create pull request into its forked repo. Here is pull request: #401.

@martinkersner
Copy link
Member

Thank you! Please check my comment at #401

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

No branches or pull requests

2 participants