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-7793, EIP-7843: zk-vm sections #9224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions EIPS/eip-7793.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ The precompile is priced to match similar opcodes in the `W_base` set.

Making the feature a precompile rather than an opcode gives L2s flexibility to decide whether to implement it.

### ZK-VM proving

The TXINDEX precompile should not increase the complexity of proving EVM execution, as it is similar to existing opcodes such as GAS. If a whole block is proven then no additional inputs to the circuit are required to prove transaction indices, as they can be inferred from the transaction ordering. If a transaction is proved individually then the index must be provided as an input to the circuit, along with the remaining gas for GAS, and more for other introspective opcodes.

## Backwards Compatibility

No backward compatibility issues found.
Expand Down
8 changes: 6 additions & 2 deletions EIPS/eip-7843.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ The gas cost for `SLOT` is a fixed fee of `2`.

The slot number is calculated in the consensus layer and passed to the execution layer through the engine API.

#### newPayload change
#### Header extension

The `engine_newPayload` endpoint shall include a new parameter `slot_number` of type `uint64`.
The header encoding shall be extended to include a `slot_number` field of type `uint64`.

#### PayloadAttributes change

Expand All @@ -65,6 +65,10 @@ Making the feature a precompile rather than an opcode gives L2s flexibility to d

The slot number could alternatively be calculated in the execution layer using the timestamp, but it is more appropriate to calculate values pertaining to the beacon chain in the consensus layer. Additionally this avoids code duplication, as the slot number is already calculated in the consensus layer.

### ZK-VM proving

The SLOT precompile should not increase the complexity of proving EVM execution, as it is similar to existing opcodes such as TIMESTAMP. The slot number is included in the block header rather than as a `new_payload` parameter, ensuring that the block is self-contained for proving; no extra inputs to the circuit are required.

## Backwards Compatibility

No backward compatibility issues found.
Expand Down
Loading