Optimize precompiles to use STATICCALL#1930
Merged
Merged
Conversation
bacbc49 to
9bcbc9d
Compare
9bcbc9d to
af0200f
Compare
Codecov Report
@@ Coverage Diff @@
## master #1930 +/- ##
=======================================
Coverage 87.07% 87.07%
=======================================
Files 55 55
Lines 6335 6335
Branches 1629 1629
=======================================
Hits 5516 5516
Misses 520 520
Partials 299 299
Continue to review full report at Codecov.
|
iamdefinitelyahuman
approved these changes
Apr 22, 2020
Member
|
For some reason I thought I left a comment here but didn't .. github equivalent of not hitting reply I guess 🙃 My comment was that calls to the identity precompile (address |
charles-cooper
added a commit
to charles-cooper/vyper
that referenced
this pull request
Oct 17, 2021
If we use staticcall, we don't need to pass value=0, saving 2 bytes in bytecode / 3 gas at runtime Also, we do not need to have an assert after call to identity (the only way failure can happen is OOG and by that time it is too late to do anything anyway). Related: vyperlang#1929, vyperlang#1930
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: #1929
What I did
Our precompiled calls were using
CALLinstead ofSTATICCALL, overpaying by 660 gas per call. This change switches out how the call is made to cost less gas. No changes required for testing.Description for the changelog
Optimize precompiles to use
STATICCALLCute Animal Picture