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

Precompiles and Keccak256 repricing #2666

Merged
merged 23 commits into from
Nov 9, 2020

Conversation

shamatar
Copy link
Contributor

@shamatar shamatar commented May 22, 2020

Main points:

  • Reprice sha256 and Ripemd160 precompiles after Reduced gas cost for static calls made to precompiles #2046 changes and to better reflect current performance and internal structures of the computations performed
  • Reprice Keccak256 native function and reflect internal structures of the computations performed

Edits:

  • BNADD and BNMUL are no longer required to reprice after faster inversion is implemented in Geth
  • Error handling is out of scope for now

@axic
Copy link
Member

axic commented May 22, 2020

Didn't we agree on ACD#84 to split these: ethereum/pm#162 (comment) ?

Also this seems to conflate even more EIPs into one, including EIP-1352 which has been discussed separately.

Furthermore I don't see too much benefit duplicating EIP-2046, when you could be added to it to reflect your work.

@shamatar
Copy link
Contributor Author

Here proposal is much more radical than EIP-2046: STATICCALL price is set to zero when calling a precompile.

I can set EIP-1352 as a requirement instead instead of talking about it explicitly.

Otherwise it's all merged into one EIP to reflect that all these changes should (at least in my mind) happen simultaneously to have logical correctness.

@axic
Copy link
Member

axic commented May 22, 2020

It was also mentioned multiple times that the figure in 2046 is not final and should be adjusted based on benchmarking.

@shamatar
Copy link
Contributor Author

Do you mind to update it to zero and I'll add it as a requirement instead of replacement?

@axic
Copy link
Member

axic commented May 22, 2020

I can update stuff next week (trying to wind down now).

I think it could help to have perhaps a semi-ad-hoc chat early next week, with some others interested in this topic, to get aligned, as it seems the ACD format doesn't really facilitates a good discussion. I'm sure it would be possible to resolve these small conflicts.

@shamatar shamatar changed the title STATICCALL, precompiles and Keccak256 repricing Precompiles and Keccak256 repricing May 22, 2020
@shamatar shamatar changed the title Precompiles and Keccak256 repricing Precompiles and Keccak256 repricing, homogeneous error handling for precompiles Jun 3, 2020
@shamatar shamatar changed the title Precompiles and Keccak256 repricing, homogeneous error handling for precompiles Precompiles and Keccak256 repricing Aug 31, 2020
@shamatar
Copy link
Contributor Author

Error handling was removed for now

Copy link
Contributor

@MicahZoltu MicahZoltu left a comment

Choose a reason for hiding this comment

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

I recommend making the suggested changes (or something similar) prior to Last Call, but this looks well formatted enough to merge as a draft.

EIPS/eip-2666.md Outdated Show resolved Hide resolved
EIPS/eip-2666.md Show resolved Hide resolved
EIPS/eip-2666.md Outdated Show resolved Hide resolved
EIPS/eip-2666.md Outdated Show resolved Hide resolved
@MicahZoltu
Copy link
Contributor

Note: I agree with @axic that this EIP should really be split up into one EIP per repricing so they can be easily discussed independently, rather than people having to agree on all or nothing. We don't currently have a hard rule against monolithic EIPs though so I'll stick with my approval for now, but I'll wait to see if the author would prefer to split this up before merging.

@shamatar If you want to merge this without splitting it up, let me know and I'll click the button.

@shamatar
Copy link
Contributor Author

More EIPs is more scary than less EIPs, so I'll keep it as it is for now. Let me refactor with your suggestions in mind and it will be ready to merge.

Since I'll be pushing further for this EIP and 2046 it may be good to return back to having this one supersede the 2046.

@MicahZoltu
Copy link
Contributor

More EIPs is more scary than less EIPs

It should be the opposite. You are much more likely to see things go through with more EIPs because people cannot hamstring the entire set of changes by only complaining about one thing. e.g., someone has some problem with the way you calculated SHA256 costs, so the entire EIP gets stuck while you debate about the merits of your strategy vs theirs. If they were separate EIPs then such a debate would only block SHA256, but not all of the other changes.

@github-actions
Copy link

There has been no activity on this pull request for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review.

@github-actions github-actions bot added the stale label Oct 30, 2020
@shamatar
Copy link
Contributor Author

Waiting for a next dev call to discuss inclusion.

@github-actions github-actions bot removed the stale label Oct 30, 2020
@shamatar
Copy link
Contributor Author

shamatar commented Nov 6, 2020

@MicahZoltu Last two commits should make it much more readable and simple

Copy link
Contributor

@MicahZoltu MicahZoltu left a comment

Choose a reason for hiding this comment

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

The only thing that must be fixed prior to merging as a draft is that all opcodes must include their numeric code in parenthesis after as described here: https://eips.ethereum.org/EIPS/eip-1#special-requirements-for-core-eips. All of the other feedback should probably be addressed/considered prior to moving this to Review, but isn't a blocker for Draft.

EIPS/eip-2666.md Outdated Show resolved Hide resolved
EIPS/eip-2666.md Outdated Show resolved Hide resolved
EIPS/eip-2666.md Outdated Show resolved Hide resolved
EIPS/eip-2666.md Outdated Show resolved Hide resolved
EIPS/eip-2666.md Outdated Show resolved Hide resolved
EIPS/eip-2666.md Outdated Show resolved Hide resolved
EIPS/eip-2666.md Outdated Show resolved Hide resolved
EIPS/eip-2666.md Outdated Show resolved Hide resolved
@shamatar
Copy link
Contributor Author

shamatar commented Nov 9, 2020

Should be in better shape now

@MicahZoltu MicahZoltu merged commit 1298426 into ethereum:master Nov 9, 2020
Arachnid pushed a commit to Arachnid/EIPs that referenced this pull request Mar 6, 2021
Main points:
- Reprice sha256 and Ripemd160 precompiles after ethereum#2046 changes and to better reflect current performance and internal structures of the computations performed
- Reprice Keccak256 native function and reflect internal structures of the computations performed
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