ethereum / ethereum/execution-specs

Guest program: should it enforce execution witness canonicality?

Open
#2,474 2 comments 0 reactions 0 assignees View on GitHub
stale zkEVM
Dominant language
Python
Stars
1.2k
Forks
505
Avg merge
2d 14h
Merged PRs (30d)
116

Description

Today, the execution witness generation in the specs builds a minimal and canonical execution witness. However, the stateless guest only uses the witness to execute the block — it does not verify that:
- No more information than strictly needed is provided (e.g. no extra or duplicated entries in fields)
- Field ordering complies with the canonical witness definition (i.e. lexicographic or block-number ordering, depending on the field)

Strictly speaking, these checks aren't required for correct stateless execution. One could also argue that being strict increases the risk of consensus failure, since it opens the door to attacks that exploit witness-generation bugs in EL clients. For example: if some EL client generates a witness with extra (but harmless) data for an edge case not covered by tests, enforcing canonicality in the guest would reject that witness — causing a consensus split even though the block itself is valid.

There are also performance implications: canonicality checks (sorted order, no duplicates, minimality) must be proven inside the zkVM, adding overhead beyond what's needed for execution correctness.

Finally, this determines whether we should create test cases for witness canonicality validation.

cc @kevaundray for visibility/discussion

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.