From 4471fbcf818b56da9fc76dd4c11a0fb83f71e704 Mon Sep 17 00:00:00 2001 From: Marc Harvey-Hill Date: Wed, 8 Jan 2025 21:46:44 +0000 Subject: [PATCH] zk-vm section for introspective precompiles --- EIPS/eip-7793.md | 4 ++++ EIPS/eip-7843.md | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/EIPS/eip-7793.md b/EIPS/eip-7793.md index 640ba81f3824e..9b5cb9efebd19 100644 --- a/EIPS/eip-7793.md +++ b/EIPS/eip-7793.md @@ -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. diff --git a/EIPS/eip-7843.md b/EIPS/eip-7843.md index 55c5a5a748dfb..38bf71954d7f8 100644 --- a/EIPS/eip-7843.md +++ b/EIPS/eip-7843.md @@ -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 @@ -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.