Skip to content

Commit

Permalink
Add arith checker at beginning of processTx
Browse files Browse the repository at this point in the history
  • Loading branch information
ignasirv committed May 29, 2023
1 parent fbf5a82 commit 33034b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main/process-tx.zkasm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ processTx:
; Minimum of 100000 steps left to process a tx
%MAX_CNT_STEPS - STEP - 100000 :JMPN(outOfCountersStep)
%MAX_CNT_BINARY - CNT_BINARY - 100 :JMPN(outOfCountersBinary)
%MAX_CNT_ARITH - CNT_ARITH - 2 :JMPN(outOfCountersArith)

$ => A :MLOAD(txHash)
; Check the signature
$ => B :MLOAD(txR)
Expand Down Expand Up @@ -69,7 +71,6 @@ endCheckChainId:
0 :MSTORE(depth) ; Initial depth is 0

;; Set gasPrice global var depending on effectivePercentage [0-255] -> txGasPrice = Floor((gasPrice * (effectivePercentage + 1)) / 256)
; _effGasPriceShifted = gasPrice * (effectivePercentage + 1)
; A => gasPrice
$ => A :MLOAD(txGasPriceRLP)
; B => effectivePercentage
Expand Down

0 comments on commit 33034b9

Please sign in to comment.