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

Update EIP-2537: Gas pricing pairing operations #9098

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

MarekM25
Copy link
Contributor

@MarekM25 MarekM25 commented Dec 6, 2024

Update: Changed numbers to Paweł's proposition, details here: https://gist.github.com/MarekM25/79982c313c1179cbfd68c9414f8925fa

ATTENTION: ERC-RELATED PULL REQUESTS NOW OCCUR IN ETHEREUM/ERCS

--

When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md

We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

@MarekM25 MarekM25 requested a review from eth-bot as a code owner December 6, 2024 11:06
@github-actions github-actions bot added c-update Modifies an existing proposal s-review This EIP is in Review t-core labels Dec 6, 2024
@eth-bot
Copy link
Collaborator

eth-bot commented Dec 6, 2024

✅ All reviewers have approved.

@MarekM25 MarekM25 changed the title Gas pricing pairing operations Update EIP-2537: Gas pricing pairing operations Dec 6, 2024
@eth-bot eth-bot added the a-review Waiting on author to review label Dec 6, 2024
@garyschulte
Copy link
Contributor

👍 from besu, implementing these gas costs and benchmarking on a nuc 13:
https://gist.github.com/garyschulte/c3e7a8015c8014707303e7f3a83dd117

@MarekM25
Copy link
Contributor Author

👍 from besu, implementing these gas costs and benchmarking on a nuc 13: https://gist.github.com/garyschulte/c3e7a8015c8014707303e7f3a83dd117

@garyschulte I updated the numbers, please recheck and approve if Besu is fine with those numbers

EIPS/eip-2537.md Outdated
@@ -287,7 +287,7 @@ Discounts table as a vector of pairs `[k, discount]`:

#### Pairing check operation

The cost of the pairing check operation is `43000*k + 65000` where `k` is a number of pairs.
The cost of the pairing check operation is `32587*k + 37698` where `k` is a number of pairs.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe let's round these to 32600 and 37700.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thx @chfast :)

@mratsim
Copy link
Contributor

mratsim commented Dec 16, 2024

As mentioned in #9145 2x pairing should have almost the same gas cost as the KZG_POINT_PRECOMPILE as it is doing the same thing, a pairing check with 2 pairs of (G1, G2) points.

EIP-4844 was priced with BLST and gnark.

I'm not sure what happened between the 1.8M gas (https://github.com/ethereum/EIPs/pull/4844/files#diff-c72ce77807acfea9e9693b7999f247841df938c9645be37013903805fa8b0c09R51) and the current 50k gas but I assume there are supporting benchmarks for both behind with hardware from 2022. cc @protolambda

@chfast
Copy link
Member

chfast commented Dec 16, 2024

I'm guessing the KZG proof verification precompile was very aggressively down-priced by 4844 champions because this was in their interest. I can realistically treat is as good baseline for anything. For me it runs at ~50 Mgas/s while ECRECOVER 130 Mgas/s. Because the gas limit increase is planned should should pick the higher baseline.

Copy link
Member

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

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

lgtm

@eth-bot eth-bot enabled auto-merge (squash) December 18, 2024 15:34
Copy link
Collaborator

@eth-bot eth-bot left a comment

Choose a reason for hiding this comment

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

All Reviewers Have Approved; Performing Automatic Merge...

@eth-bot eth-bot merged commit e37988a into ethereum:master Dec 18, 2024
12 checks passed
danceratopz added a commit to ethereum/execution-spec-tests that referenced this pull request Dec 18, 2024
marioevz pushed a commit to ethereum/execution-spec-tests that referenced this pull request Dec 19, 2024
* chore(tests): pairing ops gas pricing cf ethereum/EIPs#9098

* chore(tests): MAP, MUL & ADD gas pricing cf ethereum/EIPs#9097

* chore(tests): update G1/add G2 msm discount tables ethereum/EIPs#9116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-review Waiting on author to review c-update Modifies an existing proposal s-review This EIP is in Review t-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants