From d05db4973d8a7bbe64ba1bd0a1d4141c38c8b46a Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Mon, 15 May 2023 18:41:21 +0200 Subject: [PATCH] Don't touch contract address in DELEGATECALL or CALLCODE (#1036) * Don't touch address in DELEGATECALL or CALLCODE * Minor --- evm/src/cpu/kernel/asm/core/call.asm | 2 -- evm/src/prover.rs | 27 --------------------------- 2 files changed, 29 deletions(-) diff --git a/evm/src/cpu/kernel/asm/core/call.asm b/evm/src/cpu/kernel/asm/core/call.asm index 546694e3..736ed27e 100644 --- a/evm/src/cpu/kernel/asm/core/call.asm +++ b/evm/src/cpu/kernel/asm/core/call.asm @@ -72,7 +72,6 @@ global sys_callcode: SWAP2 // stack: address, gas, kexit_info, value, args_offset, args_size, ret_offset, ret_size %u256_to_addr // Truncate to 160 bits - DUP1 %insert_touched_addresses DUP1 %insert_accessed_addresses %call_charge_gas(1, 0) @@ -174,7 +173,6 @@ global sys_delegatecall: SWAP2 // stack: address, gas, kexit_info, args_offset, args_size, ret_offset, ret_size %u256_to_addr // Truncate to 160 bits - DUP1 %insert_touched_addresses DUP1 %insert_accessed_addresses // Add a value of 0 to the stack. Slightly inefficient but that way we can reuse %call_charge_gas. diff --git a/evm/src/prover.rs b/evm/src/prover.rs index c51f4995..414b8d50 100644 --- a/evm/src/prover.rs +++ b/evm/src/prover.rs @@ -90,33 +90,6 @@ where Ok((proof, outputs)) } -/// Generate traces, then create all STARK proofs. Returns information about the post-state, -/// intended for debugging, in addition to the proof. -pub fn dont_prove_with_outputs( - all_stark: &AllStark, - config: &StarkConfig, - inputs: GenerationInputs, - timing: &mut TimingTree, -) -> Result<(PublicValues, GenerationOutputs)> -where - F: RichField + Extendable, - C: GenericConfig, - [(); ArithmeticStark::::COLUMNS]:, - [(); CpuStark::::COLUMNS]:, - [(); KeccakStark::::COLUMNS]:, - [(); KeccakSpongeStark::::COLUMNS]:, - [(); LogicStark::::COLUMNS]:, - [(); MemoryStark::::COLUMNS]:, -{ - timed!(timing, "build kernel", Lazy::force(&KERNEL)); - let (_traces, public_values, outputs) = timed!( - timing, - "generate all traces", - generate_traces(all_stark, inputs, config, timing)? - ); - Ok((public_values, outputs)) -} - /// Compute all STARK proofs. pub(crate) fn prove_with_traces( all_stark: &AllStark,