1559 only txlist rlp decode #41
Annotations
2 errors
|
Invalid format 'GIT_PATCH_OUTPUT=From 3620c07c954a7d2bba7b60b9f8d8d8cb4e055390 Mon Sep 17 00:00:00 2001 From: Victor Lopes <[email protected]> Date: Wed, 26 Jul 2023 13:17:25 +0200 Subject: [PATCH 01/47] feat: add precompile skeleton (#128) This commit introduces the support for precompiled contracts. For more information, check the appendix E of the Ethereum Yellow Paper. It is a simplified version of the identity precompile PR of PSE. It strips the implementation of the identity precompile variant, leaving only the skeleton for the lookup table calls. [Ethereum Yellow Paper](https://ethereum.github.io/yellowpaper/paper.pdf) [Identity (dataCopy) precompile #1396](https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1396) --- .../src/circuit_input_builder/execution.rs | 4 +- .../circuit_input_builder/input_state_ref.rs | 2 +- bus-mapping/src/evm.rs | 3 + bus-mapping/src/evm/opcodes.rs | 5 + bus-mapping/src/evm/opcodes/callop.rs | 334 +++++++++++++----- bus-mapping/src/evm/opcodes/precompiles.rs | 55 +++ bus-mapping/src/precompile.rs | 85 ++++- eth-types/src/evm_types.rs | 24 ++ zkevm-circuits/src/evm_circuit/execution.rs | 1 + .../src/evm_circuit/execution/callop.rs | 251 +++++++++++-- .../src/evm_circuit/execution/precompiles.rs | 1 + zkevm-circuits/src/evm_circuit/step.rs | 38 ++ zkevm-circuits/src/evm_circuit/table.rs | 14 +- zkevm-circuits/src/evm_circuit/util.rs | 1 + .../evm_circuit/util/constraint_builder.rs | 16 + .../src/evm_circuit/util/math_gadget.rs | 1 + .../src/evm_circuit/util/precompile.rs | 42 +++ 17 files changed, 757 insertions(+), 120 deletions(-) create mode 100644 bus-mapping/src/evm/opcodes/precompiles.rs create mode 100644 zkevm-circuits/src/evm_circuit/execution/precompiles.rs create mode 100644 zkevm-circuits/src/evm_circuit/util/precompile.rs diff --git a/bus-mapping/src/circuit_input_builder/execution.rs b/bus-mapping/src/circuit_input_builder/execution.rs index 20b3048682..a269b8e177 100644 --- a/bus-mapping/src/circuit_input_builder/execution.rs +++ b/bus-mapping/src/circuit_input_builder/execution.rs @@ -2,7 +2,7 @@ use crate::{ circuit_input_builder::CallContext, error::ExecError, exec_trace::OperationRef, - operation::RWCounter, + operation::RWCounter, precompile::PrecompileCalls, }; use eth_types::{ evm_types::{Gas, GasCost, OpcodeId, ProgramCounter}, @@ -132,6 +132,8 @@ impl ExecStep { pub enum ExecState { /// EVM Opcode ID Op(OpcodeId), + /// Precompile call + Precompile(PrecompileCalls), /// Virtual step Begin Tx BeginTx, /// Virtual step End Tx diff --git a/bus-mapping/src/circuit_input_builder/input_state_ref.rs b/bus-mapping/src/circuit_input_builder/input_state_ref.rs index b012115263..836a690ef7 100644 --- a/bus-mapping/src/circuit_input_builder/input_state_ref.rs +++ b/bus-mapping/src/circuit_input_builder/input_state_ref.rs @@ -1147,7 +1147,7 @@ impl<'a> CircuitInputStateRef<'a> { /// Push a copy event to the state. pub fn push_copy(&mut self, step: &mut ExecStep, event: CopyEvent) { - step.copy_rw_counter_delta = event.rw_counter_delta(); + step.copy_rw_counter_delta += event.rw_counter_delta(); self.block.add_copy_event(event); } diff --git a/bus-mapping/src/evm.rs b/bus-mapping/src/evm.rs index 39cd478c9f..cd94acc190 100644 --- a/bus-mapping/src/evm.rs +++ b/bus-mapping/src/evm.rs @@ -6,3 +6,6 @@ pub use eth_types::evm_types::opcode_ids::OpcodeId; pub use opcodes::Opcode; pub use opcodes::Sha3CodeGen; + +#[cfg(feature = "test")] +pub use opcodes::PrecompileCallArgs; diff --git a/bus-mapping/src/evm/opcodes.rs b/bus-mapping/src/evm/opcodes.rs index 781d724882..8efcf3d598 100644 --- a/bus-mapping/src/evm/opcodes.rs +++ b/bus-mapping/src/evm/opcodes.rs @@ -56,6 +56,8 @@ mod error_return_data_outofbound; mod error_simple; mod error_write_protection; +mod precompiles; + #[cfg(test)] mod memory_expansion_test; @@ -101,6 +103,9 @@ use stackonlyop::StackOnlyOpcode; use stop::Stop; use swap::Swap; +#[cfg(feature = "test")] +pub use callop::tests::PrecompileCallArgs; + /// Generic opcode trait which defines the logic of the /// [`Operation`](crate::operation::Operation
|
The logs for this run have expired and are no longer available.
Loading