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

Fix mainnet and ropsten configs for correct EC precompiles cost #5830

Merged
merged 2 commits into from
Nov 18, 2019

Conversation

gumb0
Copy link
Member

@gumb0 gumb0 commented Nov 18, 2019

Without this change cost of ECADD and ECADD stays the same in Istanbul.

See also EIP-1108 implementation #5705

@gumb0 gumb0 changed the base branch from master to release/1.7.1 November 18, 2019 11:16
@gumb0 gumb0 force-pushed the ec-precompiles-istnanbul-config branch from 68e838b to b88a487 Compare November 18, 2019 11:27
@codecov-io
Copy link

Codecov Report

Merging #5830 into release/1.7.1 will decrease coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                @@
##           release/1.7.1    #5830      +/-   ##
=================================================
- Coverage          63.88%   63.81%   -0.08%     
=================================================
  Files                358      358              
  Lines              30596    30596              
  Branches            3406     3406              
=================================================
- Hits               19547    19524      -23     
- Misses              9824     9845      +21     
- Partials            1225     1227       +2

@gumb0 gumb0 requested review from chfast and halfalicious November 18, 2019 13:10
@@ -47,10 +47,10 @@ R"E(
"0000000000000000000000000000000000000003": { "precompiled": { "name": "ripemd160", "linear": { "base": 600, "word": 120 } } },
"0000000000000000000000000000000000000004": { "precompiled": { "name": "identity", "linear": { "base": 15, "word": 3 } } },
"0000000000000000000000000000000000000005": { "precompiled": { "name": "modexp", "startingBlock": "0x42ae50" } },
"0000000000000000000000000000000000000006": { "precompiled": { "name": "alt_bn128_G1_add", "startingBlock": "0x42ae50", "linear": { "base": 500, "word": 0 } } },
Copy link
Member

Choose a reason for hiding this comment

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

So where is the new cost encoded then?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's now in the code, because it needs the current block number to figure out the precompile cost

return _blockNumber < _chainParams.istanbulForkBlock ? 500 : 150;

@gumb0 gumb0 merged commit 2150a8d into release/1.7.1 Nov 18, 2019
@gumb0 gumb0 deleted the ec-precompiles-istnanbul-config branch November 18, 2019 14:22
@chfast
Copy link
Member

chfast commented Nov 18, 2019

Oh, this should be still release/1.7 branch.

@gumb0 gumb0 restored the ec-precompiles-istnanbul-config branch November 18, 2019 14:37
@gumb0
Copy link
Member Author

gumb0 commented Nov 18, 2019

@chfast Same patch for release/1.7 branch #5833

chfast pushed a commit that referenced this pull request Nov 18, 2019
Fix mainnet and ropsten configs for correct EC precompiles cost
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