Skip to content

Commit

Permalink
Separate out of counters errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ignasirv committed Oct 3, 2022
1 parent 850bc87 commit 7accd8a
Show file tree
Hide file tree
Showing 6 changed files with 308 additions and 290 deletions.
2 changes: 1 addition & 1 deletion main/ecrecover/ecrecover.zkasm
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ ecrecover_v_y2_same_parity:

64 :HASHKLEN(E)
$ => A :MLOAD(cntKeccakPreProcess)
%MAX_CNT_KECCAK_F - CNT_KECCAK_F - A - 1 :JMPN(outOfCounters)
%MAX_CNT_KECCAK_F - CNT_KECCAK_F - A - 1 :JMPN(outOfCountersKeccak)
$ => A :HASHKDIGEST(E)

; for address take only last 20 bytes
Expand Down
4 changes: 2 additions & 2 deletions main/main.zkasm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ start: ; main zkROM entry point
A - 1 :HASHK(E)
%STATE_ROOT_STORAGE_POS :HASHK(E) ; Storage position of the batch hash
HASHPOS :HASHKLEN(E)
%MAX_CNT_KECCAK_F - CNT_KECCAK_F - %MIN_CNT_KECCAK_BATCH - 2:JMPN(outOfCounters)
%MAX_CNT_KECCAK_F - CNT_KECCAK_F - %MIN_CNT_KECCAK_BATCH - 2:JMPN(outOfCountersKeccak)
$ => C :HASHKDIGEST(E)
${eventLog(onStartBatch, C)}

Expand Down Expand Up @@ -88,7 +88,7 @@ start: ; main zkROM entry point
; Compute minimum necessary keccaks to finish the batch
B + %MIN_CNT_KECCAK_BATCH :MSTORE(cntKeccakPreProcess)
%MAX_CNT_KECCAK_F - CNT_KECCAK_F => A
$ :LT, JMPC(outOfCounters)
$ :LT, JMPC(outOfCountersKeccak)
;;;;;;;;;;;;;;;;;;
;; C - Loop parsing RLP transactions
;; - Load transaction RLP data and ensure it has correct RLP encoding
Expand Down
Loading

0 comments on commit 7accd8a

Please sign in to comment.