From caf39d60bf39fc4250c4c5ade72ddd67be62c207 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Fri, 25 Mar 2022 16:19:01 -0400 Subject: [PATCH 1/3] Rename swc -> reversible_write_counter and state_write_counter -> reversible_write_counter --- bus-mapping/src/circuit_input_builder.rs | 50 +++++++++---------- bus-mapping/src/evm/opcodes/call.rs | 2 +- .../src/evm_circuit/execution/begin_tx.rs | 2 +- .../src/evm_circuit/execution/call.rs | 8 +-- .../src/evm_circuit/execution/extcodehash.rs | 2 +- .../src/evm_circuit/execution/sload.rs | 4 +- .../src/evm_circuit/execution/sstore.rs | 4 +- zkevm-circuits/src/evm_circuit/step.rs | 10 ++-- .../evm_circuit/util/constraint_builder.rs | 24 ++++----- zkevm-circuits/src/evm_circuit/witness.rs | 6 +-- 10 files changed, 56 insertions(+), 56 deletions(-) diff --git a/bus-mapping/src/circuit_input_builder.rs b/bus-mapping/src/circuit_input_builder.rs index 0d0d02b870..06a6d67bbc 100644 --- a/bus-mapping/src/circuit_input_builder.rs +++ b/bus-mapping/src/circuit_input_builder.rs @@ -178,9 +178,9 @@ pub struct ExecStep { pub call_index: usize, /// The global counter when this step was executed. pub rwc: RWCounter, - /// State Write Counter. Counter of state write operations in the call - /// that haven't been reverted yet up to this step. - pub swc: usize, + /// Reversible Write Counter. Counter of write operations in the call that will need to be + /// undone in case of a revert. + pub reversible_write_counter: usize, /// The list of references to Operations in the container pub bus_mapping_instance: Vec, /// Error generated by this step @@ -195,7 +195,7 @@ impl ExecStep { step: &GethExecStep, call_index: usize, rwc: RWCounter, - swc: usize, // State Write Counter + reversible_write_counter: usize, ) -> Self { ExecStep { exec_state: ExecState::Op(step.op), @@ -206,7 +206,7 @@ impl ExecStep { gas_cost: step.gas_cost, call_index, rwc, - swc, + reversible_write_counter, bus_mapping_instance: Vec::new(), error: None, aux_data: None, @@ -225,7 +225,7 @@ impl Default for ExecStep { gas_cost: GasCost(0), call_index: 0, rwc: RWCounter(0), - swc: 0, + reversible_write_counter: 0, bus_mapping_instance: Vec::new(), error: None, aux_data: None, @@ -431,10 +431,10 @@ impl Call { pub struct CallContext { /// Index of call pub index: usize, - /// State Write Counter tracks the count of state write operations in the - /// call. When a subcall in this call succeeds, the `swc` increases by the - /// number of successful state writes in the subcall. - pub swc: usize, + /// Reversible Write Counter tracks the number of write operations in the call. It is + /// incremented when a subcall in this call succeeds by the number of successful writes in the + /// subcall. + pub reversible_write_counter: usize, } /// A reversion group is the collection of calls and the operations which are @@ -443,8 +443,8 @@ pub struct CallContext { /// failure (and thus reverts). #[derive(Debug, Default)] pub struct ReversionGroup { - /// List of `index` and `swc_offset` of calls belong to this group. - /// `swc_offset` is the number of reversible operations that have + /// List of `index` and `reversible_write_counter_offset` of calls belong to this group. + /// `reversible_write_counter_offset` is the number of reversible operations that have /// happened before the call within the same reversion group. calls: Vec<(usize, usize)>, /// List of `step_index` and `OperationRef` that have been done in this @@ -567,8 +567,8 @@ impl TransactionContext { }) } else if let Some(reversion_group) = self.reversion_groups.last_mut() { let caller_ctx = self.calls.last().expect("calls should not be empty"); - let caller_swc = caller_ctx.swc; - let caller_swc_offset = reversion_group + let caller_reversible_write_counter = self.calls.last().expect("calls should not be empty").reversible_write_counter; + let caller_reversible_write_counter_offset = reversion_group .calls .iter() .find(|(call_idx, _)| *call_idx == caller_ctx.index) @@ -576,22 +576,22 @@ impl TransactionContext { .1; reversion_group .calls - .push((call_idx, caller_swc + caller_swc_offset)); + .push((call_idx, caller_reversible_write_counter + caller_reversible_write_counter_offset)); } self.calls.push(CallContext { index: call_idx, - swc: 0, + reversible_write_counter: 0, }); } /// Pop the last entry in the call stack. fn pop_call_ctx(&mut self) { let call = self.calls.pop().expect("calls should not be empty"); - // Accumulate state_write_counter if call is success + // Accumulate reversible_write_counter if call is success if self.call_is_success[call.index] { if let Some(caller) = self.calls.last_mut() { - caller.swc += call.swc; + caller.reversible_write_counter += call.reversible_write_counter; } } } @@ -738,7 +738,7 @@ impl<'a> CircuitInputStateRef<'a> { geth_step, call_ctx.index, self.block_ctx.rwc, - call_ctx.swc, + call_ctx.reversible_write_counter, )) } @@ -764,8 +764,8 @@ impl<'a> CircuitInputStateRef<'a> { gas_left: Gas(prev_step.gas_left.0 - prev_step.gas_cost.0), rwc: self.block_ctx.rwc, // For tx without code execution - swc: if let Some(call_ctx) = self.tx_ctx.calls().last() { - call_ctx.swc + reversible_write_counter: if let Some(call_ctx) = self.tx_ctx.calls().last() { + call_ctx.reversible_write_counter } else { 0 }, @@ -806,8 +806,8 @@ impl<'a> CircuitInputStateRef<'a> { )); step.bus_mapping_instance.push(op_ref); - // Increase state_write_counter - self.call_ctx_mut()?.swc += 1; + // Increase reversible_write_counter + self.call_ctx_mut()?.reversible_write_counter += 1; // Add the operation into reversible_ops if this call is not persistent if !self.call()?.is_persistent { @@ -1144,8 +1144,8 @@ impl<'a> CircuitInputStateRef<'a> { // Set calls' `rw_counter_end_of_reversion` let rwc = self.block_ctx.rwc.0 - 1; - for (call_idx, swc_offset) in reversion_group.calls { - self.tx.calls[call_idx].rw_counter_end_of_reversion = rwc - swc_offset; + for (call_idx, reversible_write_counter_offset) in reversion_group.calls { + self.tx.calls[call_idx].rw_counter_end_of_reversion = rwc - reversible_write_counter_offset; } } diff --git a/bus-mapping/src/evm/opcodes/call.rs b/bus-mapping/src/evm/opcodes/call.rs index a8471d8a8c..845ece1558 100644 --- a/bus-mapping/src/evm/opcodes/call.rs +++ b/bus-mapping/src/evm/opcodes/call.rs @@ -247,7 +247,7 @@ impl Opcode for Call { (CallContextField::MemorySize, next_memory_word_size.into()), ( CallContextField::StateWriteCounter, - (exec_step.swc + 1).into(), + (exec_step.reversible_write_counter + 1).into(), ), ] { state.push_op( diff --git a/zkevm-circuits/src/evm_circuit/execution/begin_tx.rs b/zkevm-circuits/src/evm_circuit/execution/begin_tx.rs index 7d3fb12756..a5877f9b2c 100644 --- a/zkevm-circuits/src/evm_circuit/execution/begin_tx.rs +++ b/zkevm-circuits/src/evm_circuit/execution/begin_tx.rs @@ -186,7 +186,7 @@ impl ExecutionGadget for BeginTxGadget { is_create: To(false.expr()), code_source: To(code_hash.expr()), gas_left: To(gas_left), - state_write_counter: To(2.expr()), + reversible_write_counter: To(2.expr()), ..StepStateTransition::new_context() }); diff --git a/zkevm-circuits/src/evm_circuit/execution/call.rs b/zkevm-circuits/src/evm_circuit/execution/call.rs index d93b69fd9c..4cec02bc87 100644 --- a/zkevm-circuits/src/evm_circuit/execution/call.rs +++ b/zkevm-circuits/src/evm_circuit/execution/call.rs @@ -147,7 +147,7 @@ impl ExecutionGadget for CallGadget { ); cb.condition(is_success.expr() * (1.expr() - reversion_info.is_persistent()), |cb| { cb.require_equal( - "callee_rw_counter_end_of_reversion == rw_counter_end_of_reversion - (state_write_counter + 1)", + "callee_rw_counter_end_of_reversion == rw_counter_end_of_reversion - (reversible_write_counter + 1)", callee_reversion_info.rw_counter_end_of_reversion(), reversion_info.rw_counter_of_reversion(), ); @@ -235,7 +235,7 @@ impl ExecutionGadget for CallGadget { has_value.clone() * GAS_STIPEND_CALL_WITH_VALUE.expr() - gas_cost.clone(), ), memory_word_size: To(memory_expansion.next_memory_word_size()), - state_write_counter: Delta(3.expr()), + reversible_write_counter: Delta(3.expr()), ..StepStateTransition::default() }); }); @@ -261,7 +261,7 @@ impl ExecutionGadget for CallGadget { ), ( CallContextFieldTag::StateWriteCounter, - cb.curr.state.state_write_counter.expr() + 1.expr(), + cb.curr.state.reversible_write_counter.expr() + 1.expr(), ), ] { cb.call_context_lookup(true.expr(), None, field_tag, value); @@ -301,7 +301,7 @@ impl ExecutionGadget for CallGadget { is_create: To(false.expr()), code_source: To(callee_code_hash.expr()), gas_left: To(callee_gas_left), - state_write_counter: To(2.expr()), + reversible_write_counter: To(2.expr()), ..StepStateTransition::new_context() }); }); diff --git a/zkevm-circuits/src/evm_circuit/execution/extcodehash.rs b/zkevm-circuits/src/evm_circuit/execution/extcodehash.rs index 9828638a84..d772d1d5fe 100644 --- a/zkevm-circuits/src/evm_circuit/execution/extcodehash.rs +++ b/zkevm-circuits/src/evm_circuit/execution/extcodehash.rs @@ -100,7 +100,7 @@ impl ExecutionGadget for ExtcodehashGadget { program_counter: Delta(1.expr()), stack_pointer: Delta(0.expr()), gas_left: Delta(-gas_cost), - state_write_counter: Delta(1.expr()), + reversible_write_counter: Delta(1.expr()), ..Default::default() }; diff --git a/zkevm-circuits/src/evm_circuit/execution/sload.rs b/zkevm-circuits/src/evm_circuit/execution/sload.rs index b1a3a609cd..f9ef47830c 100644 --- a/zkevm-circuits/src/evm_circuit/execution/sload.rs +++ b/zkevm-circuits/src/evm_circuit/execution/sload.rs @@ -74,7 +74,7 @@ impl ExecutionGadget for SloadGadget { let step_state_transition = StepStateTransition { rw_counter: Delta(8.expr()), program_counter: Delta(1.expr()), - state_write_counter: Delta(1.expr()), + reversible_write_counter: Delta(1.expr()), gas_left: Delta(-gas_cost), ..Default::default() }; @@ -279,7 +279,7 @@ mod test { stack_pointer: STACK_CAPACITY, gas_left: 0, opcode: Some(OpcodeId::STOP), - state_write_counter: 1, + reversible_write_counter: 1, ..Default::default() }, ], diff --git a/zkevm-circuits/src/evm_circuit/execution/sstore.rs b/zkevm-circuits/src/evm_circuit/execution/sstore.rs index 9d4e6c4a49..4772e2f20d 100644 --- a/zkevm-circuits/src/evm_circuit/execution/sstore.rs +++ b/zkevm-circuits/src/evm_circuit/execution/sstore.rs @@ -106,7 +106,7 @@ impl ExecutionGadget for SstoreGadget { rw_counter: Delta(9.expr()), program_counter: Delta(1.expr()), stack_pointer: Delta(2.expr()), - state_write_counter: Delta(3.expr()), + reversible_write_counter: Delta(3.expr()), gas_left: Delta(-gas_cost.expr()), ..Default::default() }; @@ -724,7 +724,7 @@ mod test { stack_pointer: STACK_CAPACITY, gas_left: 0, opcode: Some(OpcodeId::STOP), - state_write_counter: 3, + reversible_write_counter: 3, ..Default::default() }, ], diff --git a/zkevm-circuits/src/evm_circuit/step.rs b/zkevm-circuits/src/evm_circuit/step.rs index 84fbec8fdd..b28b3d6b14 100644 --- a/zkevm-circuits/src/evm_circuit/step.rs +++ b/zkevm-circuits/src/evm_circuit/step.rs @@ -463,8 +463,8 @@ pub(crate) struct StepState { pub(crate) gas_left: Cell, /// Memory size in words (32 bytes) pub(crate) memory_word_size: Cell, - /// The counter for state writes - pub(crate) state_write_counter: Cell, + /// The counter for reversible writes + pub(crate) reversible_write_counter: Cell, } #[derive(Clone, Debug)] @@ -511,7 +511,7 @@ impl Step { stack_pointer: cells.pop_front().unwrap(), gas_left: cells.pop_front().unwrap(), memory_word_size: cells.pop_front().unwrap(), - state_write_counter: cells.pop_front().unwrap(), + reversible_write_counter: cells.pop_front().unwrap(), } }; @@ -606,10 +606,10 @@ impl Step { offset, Some(F::from(step.memory_word_size())), )?; - self.state.state_write_counter.assign( + self.state.reversible_write_counter.assign( region, offset, - Some(F::from(step.state_write_counter as u64)), + Some(F::from(step.reversible_write_counter as u64)), )?; Ok(()) } diff --git a/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs b/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs index ea8ec919fd..c7a62173ed 100644 --- a/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs +++ b/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs @@ -56,7 +56,7 @@ pub(crate) struct StepStateTransition { pub(crate) stack_pointer: Transition>, pub(crate) gas_left: Transition>, pub(crate) memory_word_size: Transition>, - pub(crate) state_write_counter: Transition>, + pub(crate) reversible_write_counter: Transition>, } impl StepStateTransition { @@ -80,7 +80,7 @@ impl StepStateTransition { stack_pointer: Transition::Any, gas_left: Transition::Any, memory_word_size: Transition::Any, - state_write_counter: Transition::Any, + reversible_write_counter: Transition::Any, } } } @@ -88,7 +88,7 @@ impl StepStateTransition { /// ReversionInfo counts `rw_counter` of reversion for gadgets, by tracking how /// many reversions that have been used. Gadgets should call /// [`ConstraintBuilder::reversion_info`] to get [`ReversionInfo`] with -/// `state_write_counter` initialized at current tracking one if no `call_id` is +/// `reversible_write_counter` initialized at current tracking one if no `call_id` is /// specified, then pass it as mutable reference when doing state write. #[derive(Clone, Debug)] pub(crate) struct ReversionInfo { @@ -97,8 +97,8 @@ pub(crate) struct ReversionInfo { rw_counter_end_of_reversion: Cell, /// Field [`CallContextFieldTag::IsPersistent`] read from call context. is_persistent: Cell, - /// Current cumulative state_write_counter. - state_write_counter: Expression, + /// Current cumulative reversible_write_counter. + reversible_write_counter: Expression, } impl ReversionInfo { @@ -110,12 +110,12 @@ impl ReversionInfo { self.is_persistent.expr() } - /// Returns `rw_counter_end_of_reversion - state_write_counter` and - /// increases `state_write_counter` by `1`. + /// Returns `rw_counter_end_of_reversion - reversible_write_counter` and + /// increases `reversible_write_counter` by `1`. pub(crate) fn rw_counter_of_reversion(&mut self) -> Expression { let rw_counter_of_reversion = - self.rw_counter_end_of_reversion.expr() - self.state_write_counter.expr(); - self.state_write_counter = self.state_write_counter.clone() + 1.expr(); + self.rw_counter_end_of_reversion.expr() - self.reversible_write_counter.expr(); + self.reversible_write_counter = self.reversible_write_counter.clone() + 1.expr(); rw_counter_of_reversion } @@ -494,7 +494,7 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> { constrain!(stack_pointer); constrain!(gas_left); constrain!(memory_word_size); - constrain!(state_write_counter); + constrain!(reversible_write_counter); } // Fixed @@ -930,10 +930,10 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> { ReversionInfo { rw_counter_end_of_reversion, is_persistent, - state_write_counter: if call_id.is_some() { + reversible_write_counter: if call_id.is_some() { 0.expr() } else { - self.curr.state.state_write_counter.expr() + self.curr.state.reversible_write_counter.expr() }, } } diff --git a/zkevm-circuits/src/evm_circuit/witness.rs b/zkevm-circuits/src/evm_circuit/witness.rs index c4ae0a11f7..f9170a56ea 100644 --- a/zkevm-circuits/src/evm_circuit/witness.rs +++ b/zkevm-circuits/src/evm_circuit/witness.rs @@ -291,8 +291,8 @@ pub struct ExecStep { pub gas_cost: u64, /// The memory size in bytes pub memory_size: u64, - /// The counter for state writes - pub state_write_counter: usize, + /// The counter for reversible writes + pub reversible_write_counter: usize, /// The opcode corresponds to the step pub opcode: Option, /// Step auxiliary data @@ -1159,7 +1159,7 @@ fn step_convert(step: &circuit_input_builder::ExecStep) -> ExecStep { _ => None, }, memory_size: step.memory_size as u64, - state_write_counter: step.swc, + reversible_write_counter: step.reversible_write_counter, aux_data: step.aux_data.clone().map(Into::into), } } From ec33ad2ec8933e5367500c566b6544ae502f44b7 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Fri, 25 Mar 2022 16:27:49 -0400 Subject: [PATCH 2/3] fmt --- bus-mapping/src/circuit_input_builder.rs | 33 +++++++++++-------- .../evm_circuit/util/constraint_builder.rs | 5 +-- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/bus-mapping/src/circuit_input_builder.rs b/bus-mapping/src/circuit_input_builder.rs index 06a6d67bbc..43c297cbba 100644 --- a/bus-mapping/src/circuit_input_builder.rs +++ b/bus-mapping/src/circuit_input_builder.rs @@ -178,8 +178,8 @@ pub struct ExecStep { pub call_index: usize, /// The global counter when this step was executed. pub rwc: RWCounter, - /// Reversible Write Counter. Counter of write operations in the call that will need to be - /// undone in case of a revert. + /// Reversible Write Counter. Counter of write operations in the call that + /// will need to be undone in case of a revert. pub reversible_write_counter: usize, /// The list of references to Operations in the container pub bus_mapping_instance: Vec, @@ -431,9 +431,9 @@ impl Call { pub struct CallContext { /// Index of call pub index: usize, - /// Reversible Write Counter tracks the number of write operations in the call. It is - /// incremented when a subcall in this call succeeds by the number of successful writes in the - /// subcall. + /// Reversible Write Counter tracks the number of write operations in the + /// call. It is incremented when a subcall in this call succeeds by the + /// number of successful writes in the subcall. pub reversible_write_counter: usize, } @@ -443,9 +443,10 @@ pub struct CallContext { /// failure (and thus reverts). #[derive(Debug, Default)] pub struct ReversionGroup { - /// List of `index` and `reversible_write_counter_offset` of calls belong to this group. - /// `reversible_write_counter_offset` is the number of reversible operations that have - /// happened before the call within the same reversion group. + /// List of `index` and `reversible_write_counter_offset` of calls belong to + /// this group. `reversible_write_counter_offset` is the number of + /// reversible operations that have happened before the call within the + /// same reversion group. calls: Vec<(usize, usize)>, /// List of `step_index` and `OperationRef` that have been done in this /// group. @@ -567,16 +568,21 @@ impl TransactionContext { }) } else if let Some(reversion_group) = self.reversion_groups.last_mut() { let caller_ctx = self.calls.last().expect("calls should not be empty"); - let caller_reversible_write_counter = self.calls.last().expect("calls should not be empty").reversible_write_counter; + let caller_reversible_write_counter = self + .calls + .last() + .expect("calls should not be empty") + .reversible_write_counter; let caller_reversible_write_counter_offset = reversion_group .calls .iter() .find(|(call_idx, _)| *call_idx == caller_ctx.index) .expect("calls should not be empty") .1; - reversion_group - .calls - .push((call_idx, caller_reversible_write_counter + caller_reversible_write_counter_offset)); + reversion_group.calls.push(( + call_idx, + caller_reversible_write_counter + caller_reversible_write_counter_offset, + )); } self.calls.push(CallContext { @@ -1145,7 +1151,8 @@ impl<'a> CircuitInputStateRef<'a> { // Set calls' `rw_counter_end_of_reversion` let rwc = self.block_ctx.rwc.0 - 1; for (call_idx, reversible_write_counter_offset) in reversion_group.calls { - self.tx.calls[call_idx].rw_counter_end_of_reversion = rwc - reversible_write_counter_offset; + self.tx.calls[call_idx].rw_counter_end_of_reversion = + rwc - reversible_write_counter_offset; } } diff --git a/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs b/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs index c7a62173ed..6547580e1a 100644 --- a/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs +++ b/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs @@ -88,8 +88,9 @@ impl StepStateTransition { /// ReversionInfo counts `rw_counter` of reversion for gadgets, by tracking how /// many reversions that have been used. Gadgets should call /// [`ConstraintBuilder::reversion_info`] to get [`ReversionInfo`] with -/// `reversible_write_counter` initialized at current tracking one if no `call_id` is -/// specified, then pass it as mutable reference when doing state write. +/// `reversible_write_counter` initialized at current tracking one if no +/// `call_id` is specified, then pass it as mutable reference when doing state +/// write. #[derive(Clone, Debug)] pub(crate) struct ReversionInfo { /// Field [`CallContextFieldTag::RwCounterEndOfReversion`] read from call From dfdd355119aa1e9d29ecc91fe308b09aaf2bd26a Mon Sep 17 00:00:00 2001 From: z2trillion Date: Fri, 25 Mar 2022 16:31:06 -0400 Subject: [PATCH 3/3] Rename state_write -> reversible_write --- .../src/evm_circuit/util/constraint_builder.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs b/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs index 6547580e1a..0153506161 100644 --- a/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs +++ b/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs @@ -656,14 +656,17 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> { self.rw_counter_offset.clone() + self.cb.condition.clone().unwrap_or_else(|| 1.expr()); } - fn state_write( + fn reversible_write( &mut self, name: &'static str, tag: RwTableTag, mut values: [Expression; 8], reversion_info: Option<&mut ReversionInfo>, ) { - debug_assert!(tag.is_reversible(), "Only reversible tags are state write"); + debug_assert!( + tag.is_reversible(), + "Reversible write requires reversible tag" + ); self.rw_lookup(name, true.expr(), tag, values.clone()); @@ -694,7 +697,7 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> { value_prev: Expression, reversion_info: Option<&mut ReversionInfo>, ) { - self.state_write( + self.reversible_write( "TxAccessListAccount write", RwTableTag::TxAccessListAccount, [ @@ -720,7 +723,7 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> { value_prev: Expression, reversion_info: Option<&mut ReversionInfo>, ) { - self.state_write( + self.reversible_write( "TxAccessListAccountStorage write", RwTableTag::TxAccessListAccountStorage, [ @@ -764,7 +767,7 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> { value_prev: Expression, reversion_info: Option<&mut ReversionInfo>, ) { - self.state_write( + self.reversible_write( "TxRefund write", RwTableTag::TxRefund, [ @@ -814,7 +817,7 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> { value_prev: Expression, reversion_info: Option<&mut ReversionInfo>, ) { - self.state_write( + self.reversible_write( "Account write with reversion", RwTableTag::Account, [ @@ -869,7 +872,7 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> { committed_value: Expression, reversion_info: Option<&mut ReversionInfo>, ) { - self.state_write( + self.reversible_write( "AccountStorage write", RwTableTag::AccountStorage, [