zkevm-specs
zkevm-specs copied to clipboard
Missing check `curr.rw_counter + reversible_write_counter == rw_counter_end_of_reversion` when the step is failing
To ensure rw_counter_end_of_reversion
is correct in the timeline, in the end of failing step we need to check if there is a gap of rw_counter
to the next step, where the gap size is exactly the reversible_write_counter
. And in the end of the gap, the rw_counter
should be rw_counter_end_of_reversion
.
Need to add this check into Instruction.step_state_transition_to_restored_context
:
if not is_success:
assert rw_counter_end_of_reversion == curr.rw_counter + reversible_write_counter
I will take a look at this one !
for circuit side work https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1030, it should be
assert rw_counter_end_of_reversion == curr.rw_counter + rw_counter_offset + reversible_write_counter - 1
as buss mapping set rw_counter_end_of_reversion = current_rw_counter -1 for call in https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/main/bus-mapping/src/circuit_input_builder/input_state_ref.rs#L798
I am thinking also need to add check for root call failure, what do you think? @han0110
I am thinking also need to add check for root call failure
That's right! We need to check this when it's reverting step no matter it's root or not. Thanks for catching this!
This issue has been resolved in the circuits via https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1030 and https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1177 but it's still missing in the specs.