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

Eip4844 Point Evaluation precompile #2701

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

mariaKt
Copy link

@mariaKt mariaKt commented Feb 3, 2025

This PR implements the point evaluation precompile for EIP-4844. It relies on this PR, that implements a new hook for verify_kzg_proof in the blockchain-k-plugin.

kevm-pyk/src/kevm_pyk/kproj/evm-semantics/evm.md Outdated Show resolved Hide resolved
kevm-pyk/src/kevm_pyk/kproj/evm-semantics/evm.md Outdated Show resolved Hide resolved
@@ -2414,6 +2438,7 @@ The intrinsic gas calculation mirrors the style of the YellowPaper (appendix H).
rule <k> #gasExec(SCHED, ECMUL) => Gecmul < SCHED > ... </k>
rule <k> #gasExec(SCHED, ECPAIRING) => Gecpairconst < SCHED > +Int (lengthBytes(DATA) /Int 192) *Int Gecpaircoeff < SCHED > ... </k> <callData> DATA </callData>
rule <k> #gasExec(SCHED, BLAKE2F) => Gfround < SCHED > *Int #asWord(#range(DATA, 0, 4) ) ... </k> <callData> DATA </callData>
rule <k> #gasExec(_, KZGPOINTEVAL) => 50000 ... </k>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better to use a schedule variable here,

Suggested change
rule <k> #gasExec(_, KZGPOINTEVAL) => 50000 ... </k>
rule <k> #gasExec(SCHED , KZGPOINTEVAL) => Gpointeval < SCHED > ... </k>

Where Gpointeval would be defined in schedule.md as

rule Gpointeval < DEFAULT > => 0
rule Gpointeval < CANCUN > => 50000

This ensures that the 50000 value is preserved and can be updated dynamically in future hardforks without modifying this rule directly.

Copy link
Author

Choose a reason for hiding this comment

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

Got it, I believe I addressed it.

@mariaKt mariaKt changed the title Eip4844 pointevalprec Eip4844 Point Evaluation precompile Feb 4, 2025
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.

2 participants