Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Implement EIP-2046 Reduced gas cost for static calls made to precompiles in LegacyVM #5699

Merged
merged 4 commits into from
Sep 30, 2019

Conversation

gumb0
Copy link
Member

@gumb0 gumb0 commented Jul 24, 2019

https://eips.ethereum.org/EIPS/eip-2046

Note that it puts repricing behind account versioning, i.e. reduced cost will be in effect only in contracts deployed with external transaction after Istanbul fork.

If it's decided that it should be in effect for version 0, we'll need to introduce another EVMSchedule ("between" current ConstantinopleFixSchedule and IstanbulSchedule)
Account versioning is disabled in Istanbul.

@gumb0 gumb0 added this to the Istanbul milestone Jul 24, 2019
@gumb0 gumb0 force-pushed the staticcall-precompile-cost branch from 6e05686 to f2d070e Compare July 25, 2019 09:09
@codecov-io
Copy link

codecov-io commented Jul 25, 2019

Codecov Report

Merging #5699 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5699      +/-   ##
==========================================
+ Coverage   63.85%   63.92%   +0.06%     
==========================================
  Files         359      359              
  Lines       30609    30667      +58     
  Branches     3406     3410       +4     
==========================================
+ Hits        19545    19603      +58     
  Misses       9838     9838              
  Partials     1226     1226

@gumb0 gumb0 removed the in progress label Jul 25, 2019
@gumb0
Copy link
Member Author

gumb0 commented Jul 25, 2019

This is also not accepted yet, so shouldn't be merged.

@gumb0 gumb0 requested review from chfast, axic and halfalicious July 25, 2019 11:16
@gumb0 gumb0 force-pushed the staticcall-precompile-cost branch from 56e933d to fffd80e Compare August 5, 2019 15:14
@gumb0
Copy link
Member Author

gumb0 commented Aug 6, 2019

This is rebased and ready for review.
The current state of the EIP is "tentatively accepted"

@gumb0 gumb0 force-pushed the staticcall-precompile-cost branch from fffd80e to 13e0660 Compare August 6, 2019 09:12
@gumb0
Copy link
Member Author

gumb0 commented Aug 6, 2019

Rebased once again and updated changelog.

@gumb0 gumb0 mentioned this pull request Aug 7, 2019
18 tasks

void testCallHasCorrectCost()
{
// let r := call(10000, 0x4, 0, 0, 0, 0, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

(Nit) can we document these args e.g.:

call(10000 /* gas /, 0x4 / address /, 0 / value */, ...)

Makes the test code a little more readable 😀

Copy link
Contributor

@halfalicious halfalicious left a comment

Choose a reason for hiding this comment

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

Looks good, just one minor question/comment 😀

@gumb0
Copy link
Member Author

gumb0 commented Sep 2, 2019

@halfalicious Thanks for the review, this shouldn't be merged yet, as this EIP was not accepted for Istanbul, but probably will go into the next hard fork.

I will either put it into Experimental fork or create a new EVMSchedule for Berlin, next hard fork.

@gumb0 gumb0 force-pushed the staticcall-precompile-cost branch from 95e11aa to 6308d72 Compare September 2, 2019 14:36
@gumb0
Copy link
Member Author

gumb0 commented Sep 2, 2019

Rebased.

@gumb0 gumb0 force-pushed the staticcall-precompile-cost branch from 6308d72 to 2f1464b Compare September 3, 2019 12:52
@gumb0
Copy link
Member Author

gumb0 commented Sep 3, 2019

Moved to Berlin fork.

@gumb0 gumb0 removed the in progress label Sep 3, 2019
@gumb0 gumb0 modified the milestones: Istanbul, Berlin Sep 24, 2019
@gumb0 gumb0 force-pushed the staticcall-precompile-cost branch 2 times, most recently from daf150f to e2d46b3 Compare September 30, 2019 11:57
@gumb0 gumb0 force-pushed the staticcall-precompile-cost branch from e2d46b3 to b92624b Compare September 30, 2019 12:07
@gumb0 gumb0 force-pushed the staticcall-precompile-cost branch from b92624b to df6a681 Compare September 30, 2019 12:19
@gumb0 gumb0 merged commit 53ff6a3 into master Sep 30, 2019
@gumb0 gumb0 deleted the staticcall-precompile-cost branch September 30, 2019 13:36
@gumb0 gumb0 mentioned this pull request Oct 2, 2019
13 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants