##
# This file specifies prover limit by each EVM module
# WARN: The prover/arithmetization team has the owneship of this.
# Changing this values may compromise the system.
# issue: https://github.com/ConsenSys/zkevm-monorepo/issues/525
##

[traces-limits]
#
# Arithmetization module limits
#
ADD                 = 524288
BIN                 = 262144
BLAKE_MODEXP_DATA   = 16384
BLOCK_DATA          = 4096
BLOCK_HASH          = 2048
EC_DATA             = 262144
EUC                 = 65536
EXP                 = 8192
EXT                 = 65536
GAS                 = 65536
HUB                 = 2097152
LOG_DATA            = 65536
LOG_INFO            = 4096
MMIO                = 4194304
MMU                 = 4194304
MOD                 = 131072
MUL                 = 65536
MXP                 = 524288
OOB                 = 262144
RLP_ADDR            = 4096
RLP_TXN             = 131072
RLP_TXN_RCPT        = 65536
ROM                 = 4194304
ROM_LEX             = 1024
SHAKIRA_DATA        = 32768
SHF                 = 65536
STP                 = 16384
TRM                 = 32768
TXN_DATA            = 8192
WCP                 = 262144

# NOTE: in the original file the limits were just shy of powers of 2, e.g. ADD = 524286
# Question: this seemed deliberate; it could be related to spillings; if so we may want
# to reduce all limits above by the corresponding spillings value (or 16 for simplicity)

#
# Fixed size, static tables
#
BIN_REFERENCE_TABLE = 262144 # contains 3 * 256^2 + 256 data rows + 1 padding row
SHF_REFERENCE_TABLE = 4096   # contains 9 * 256         data rows + 1 padding row
INSTRUCTION_DECODER = 512    # contains 256             data rows + 1 padding row

#
# Block-specific limits
#
BLOCK_KECCAK       = 8192
BLOCK_L1_SIZE      = 1000000
BLOCK_L2_L1_LOGS   = 16
BLOCK_TRANSACTIONS = 200 # max number of tx in an L2 block

#
# Precompiles limits
# compare with https://github.com/Consensys/linea-arithmetization/issues/257
#



PRECOMPILE_ECRECOVER_EFFECTIVE_CALLS        = 128
PRECOMPILE_SHA2_BLOCKS                      = 671
PRECOMPILE_RIPEMD_BLOCKS                    = 671
PRECOMPILE_MODEXP_EFFECTIVE_CALLS           = 4
PRECOMPILE_ECADD_EFFECTIVE_CALLS            = 16384
PRECOMPILE_ECMUL_EFFECTIVE_CALLS            = 32
PRECOMPILE_ECPAIRING_FINAL_EXPONENTIATIONS  = 16
PRECOMPILE_ECPAIRING_G2_MEMBERSHIP_CALLS    = 64
PRECOMPILE_ECPAIRING_MILLER_LOOPS           = 64
PRECOMPILE_BLAKE_EFFECTIVE_CALLS            = 0 # there are no gnarks circuit atm
PRECOMPILE_BLAKE_ROUNDS                     = 0 # it is possible to call BLAKE2f with r = 0; this is a nontrivial operation ...
# # Notes:
# - there are no IDENTITY related limits
# - we used to have the following limits
#      * PRECOMPILE_SHA2_EFFECTIVE_CALLS      = 1000000
#      * PRECOMPILE_RIPEMD_EFFECTIVE_CALLS    = 1000000
#   (the values are nonsensical);
#   as per Alex they are not required by the prover;
