-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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: double each discount table value in the MSM gas cost model #8910
base: master
Are you sure you want to change the base?
Conversation
File
|
8f0c82a
to
4bca23d
Compare
Maybe you did discusse it but it didn't make any sense now: up to 7 inputs the cost is higher than computing the multiplication one by one. |
The rationale from my side is: doubling the entries in the discount table is the simplest repricing we can do such that the pricing of g1 msm is at least that of the ecrecover precompile in the worst case (on Geth, concurrency disabled for MSM, benchmarked across several machines - x86/arm). I need to do some further research to come up with a justification for the reason that MSM is higher cost than naive method (muls) up to a threshold. From what I know right now, there is some setup overhead with MSM that makes it perform worse than muls for small input sizes. For example, here is the ratio of the runtime for the naive method vs the runtime of gnark's g1 msm on my M2 Macbook Pro:
|
Based on discussion during ACDE, we are repricing the bls MSM precompiles to be twice as expensive.