Skip to content

Commit

Permalink
update arithmetization to 0.1.5-rc4 (#36)
Browse files Browse the repository at this point in the history
* update arithmetization to 1.5.0-rc4

Signed-off-by: Sally MacFarlane <[email protected]>

* update module limits files

Signed-off-by: Sally MacFarlane <[email protected]>

* ordering and add missing modules

Signed-off-by: Sally MacFarlane <[email protected]>

* added missing modules blake_modexp_data and shakira_data and gas

Signed-off-by: Sally MacFarlane <[email protected]>

* rename rlp txnrcpt

Signed-off-by: Sally MacFarlane <[email protected]>

* Update module limit files and fix test

Signed-off-by: Gabriel-Trintinalia <[email protected]>

---------

Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Co-authored-by: Gabriel-Trintinalia <[email protected]>
  • Loading branch information
macfarla and Gabriel-Trintinalia authored Jul 4, 2024
1 parent c755e1c commit 8c23fe0
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ public void estimateGasFailsForExceedingModuleLineCountTest() throws Exception {
final var respLinea = reqLinea.execute(minerNode.nodeRequests());
assertThat(respLinea.getCode()).isEqualTo(-32000);
assertThat(respLinea.getMessage())
.isEqualTo("Transaction line count for module SHF=32 is above the limit 20");
.isEqualTo("Transaction line count for module SHF=31 is above the limit 20");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void transactionOverModuleLineCountNotAccepted() throws Exception {

assertThat(signedTxContractInteractionResp.hasError()).isTrue();
assertThat(signedTxContractInteractionResp.getError().getMessage())
.isEqualTo("Transaction line count for module ADD=2018 is above the limit 70");
.isEqualTo("Transaction line count for module ADD=2017 is above the limit 70");

assertThat(getTxPoolContent()).isEmpty();

Expand Down
116 changes: 65 additions & 51 deletions acceptance-tests/src/test/resources/moduleLimits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,77 @@
#
# Arithmetization module limits
#
ADD = 7000
ADD = 524288
BIN = 262144
BIN_RT = 262144
EC_DATA = 4096
EUC = 16384 # can probably be lower
EXP = 32760
EXT = 32768
HUB = 2097152
INSTRUCTION_DECODER = 512 # Ugly hack, TODO: @franklin
MMIO = 1048576
MMU = 524288
MMU_ID = 256
MOD = 131072
MUL = 65536
MXP = 524288
PHONEY_RLP = 65536 # can probably get lower
PUB_HASH = 32768
PUB_HASH_INFO = 8192
PUB_LOG = 16384
PUB_LOG_INFO = 16384
RLP = 128
ROM = 1048576
ROM_LEX = 1048576
SHF = 65536
SHF_RT = 262144
TX_RLP = 131072
TRM = 131072
BLAKE_MODEXP_DATA = 262144
BLOCK_DATA = 16384
BLOCK_HASH = 1024
EC_DATA = 512
EUC = 262144
EXP = 65536
EXT = 8192
GAS = 1
HUB = 65536
LOG_DATA = 65536
LOG_INFO = 2097152
MMIO = 65536
MMU = 4096
MOD = 4194304
MUL = 2097152
MXP = 131072
OOB = 65536
PUB_LOG = 524288
PUB_LOG_INFO = 262144
RLP_ADDR = 4096
RLP_TXN = 131072
RLP_TXN_RCPT = 32768
ROM = 8388608
ROM_LEX = 1024
SHAKIRA_DATA = 1
SHF = 32768
STP = 65536
TRM = 32768
TXN_DATA = 8192
TX_RLP = 8192
WCP = 262144
LOG_DATA = 262144
LOG_INFO = 262144
RLP_ADDR = 262144
RLP_TXN = 262144
RLP_TXRCPT = 262144
TXN_DATA = 262144
STP = 262144
OOB = 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)

#
# Block-specific limits
# Fixed size, static tables
#
BLOCK_TX = 200 # max number of tx in an L2 block
BLOCK_L2L1LOGS = 16
BLOCK_KECCAK = 8192
BLOCK_L1SIZE = 1000000
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

BLOCKDATA = 13
BLOCKHASH = 1
#
# 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_CALL = 10000
PRECOMPILE_SHA2_BLOCKS = 10000
PRECOMPILE_RIPEMD_BLOCKS = 10000
PRECOMPILE_IDENTITY = 10000
PRECOMPILE_MODEXP_EFFECTIVE_CALL = 10000
PRECOMPILE_ECADD_EFFECTIVE_CALL = 10000
PRECOMPILE_ECMUL_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_MILLER_LOOP = 10000
PRECOMPILE_BLAKE2F_ROUNDS = 512
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_EFFECTIVE_CALLS = 16
PRECOMPILE_ECPAIRING_MILLER_LOOPS = 64
PRECOMPILE_BLAKE_EFFECTIVE_CALLS = 600
PRECOMPILE_BLAKE_ROUNDS = 600 # 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;
61 changes: 32 additions & 29 deletions acceptance-tests/src/test/resources/noModuleLimits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,63 @@
ADD = 262144
BIN = 262144
BIN_RT = 262144
BLAKE_MODEXP_DATA = 262144
BLOCK_DATA = 13
BLOCK_HASH = 1
EC_DATA = 4096
EUC = 16384 # can probably be lower
EXP = 32760
EXT = 32768
GAS = 262144
HUB = 2097152
INSTRUCTION_DECODER = 512 # Ugly hack, TODO: @franklin
LOG_DATA = 262144
LOG_INFO = 262144
MMIO = 1048576
MMU = 524288
MMU_ID = 256
MOD = 131072
MUL = 65536
MXP = 524288
OOB = 262144
PHONEY_RLP = 65536 # can probably get lower
PUB_HASH = 32768
PUB_HASH_INFO = 8192
PUB_LOG = 16384
PUB_LOG_INFO = 16384
RLP = 128
RLP_ADDR = 262144
RLP_TXN = 262144
RLP_TXN_RCPT = 262144
ROM = 1048576
ROM_LEX = 1048576
SHAKIRA_DATA = 262144
SHF = 65536
SHF_RT = 262144
TX_RLP = 131072
STP = 262144
TRM = 131072
WCP = 262144
LOG_DATA = 262144
LOG_INFO = 262144
RLP_ADDR = 262144
RLP_TXN = 262144
RLP_TXRCPT = 262144
TXN_DATA = 262144
STP = 262144
OOB = 262144
BLOCKDATA = 13
BLOCKHASH = 1
TX_RLP = 131072
WCP = 262144

#
# 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_TX = 200 # max number of tx in an L2 block
BLOCK_L2L1LOGS = 16
BLOCK_KECCAK = 8192
BLOCK_L1SIZE = 1000000
BLOCK_L1_SIZE = 1000000
BLOCK_L2_L1_LOGS = 16
BLOCK_TRANSACTIONS = 200 # max number of tx in an L2 block

#
# Precompiles limits
#
PRECOMPILE_ECRECOVER_EFFECTIVE_CALL = 10000
PRECOMPILE_ECRECOVER_EFFECTIVE_CALLS = 10000
PRECOMPILE_SHA2_BLOCKS = 10000
PRECOMPILE_RIPEMD_BLOCKS = 10000
PRECOMPILE_IDENTITY = 10000
PRECOMPILE_MODEXP_EFFECTIVE_CALL = 10000
PRECOMPILE_ECADD_EFFECTIVE_CALL = 10000
PRECOMPILE_ECMUL_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_MILLER_LOOPS = 64
PRECOMPILE_MODEXP_EFFECTIVE_CALLS = 10000
PRECOMPILE_ECADD_EFFECTIVE_CALLS = 10000
PRECOMPILE_ECMUL_EFFECTIVE_CALLS = 10000
PRECOMPILE_ECPAIRING_EFFECTIVE_CALLS = 10000
PRECOMPILE_ECPAIRING_MILLER_LOOP = 10000
PRECOMPILE_BLAKE2F_ROUNDS = 512
PRECOMPILE_BLAKE_EFFECTIVE_CALLS = 10000
PRECOMPILE_BLAKE_ROUNDS = 512
44 changes: 24 additions & 20 deletions acceptance-tests/src/test/resources/strictModuleLimits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,65 @@
#
ADD = 7000
BIN = 262144
BIN_RT = 262144
BLAKE_MODEXP_DATA = 262144
EC_DATA = 4096
EUC = 16384 # can probably be lower
EXP = 32760
EXT = 32768
GAS = 262144
HUB = 10000
INSTRUCTION_DECODER = 512 # Ugly hack, TODO: @franklin
MMIO = 1048576
MMU = 524288
MMU_ID = 256
MOD = 131072
MUL = 65536
MXP = 524288
PHONEY_RLP = 65536 # can probably get lower
PUB_HASH = 32768
PUB_HASH_INFO = 8192
PUB_LOG = 16384
PUB_LOG_INFO = 16384
RLP = 128
ROM = 1048576
ROM_LEX = 1048576
SHF = 65536
SHF_RT = 262144
TX_RLP = 131072
TRM = 131072
WCP = 262144
LOG_DATA = 262144
LOG_INFO = 262144
RLP_ADDR = 262144
RLP_TXN = 262144
RLP_TXRCPT = 262144
RLP_TXN_RCPT = 262144
TXN_DATA = 262144
SHAKIRA_DATA = 262144
STP = 262144
OOB = 262144
BLOCKDATA = 13
BLOCKHASH = 1
BLOCK_DATA = 13
BLOCK_HASH = 1

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

#
# 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

#
# Precompiles limits
#
PRECOMPILE_ECRECOVER_EFFECTIVE_CALL = 10000
PRECOMPILE_ECRECOVER_EFFECTIVE_CALLS = 10000
PRECOMPILE_SHA2_BLOCKS = 10000
PRECOMPILE_RIPEMD_BLOCKS = 10000
PRECOMPILE_IDENTITY = 10000
PRECOMPILE_MODEXP_EFFECTIVE_CALL = 10000
PRECOMPILE_ECADD_EFFECTIVE_CALL = 10000
PRECOMPILE_ECMUL_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_MILLER_LOOPS = 64
PRECOMPILE_MODEXP_EFFECTIVE_CALLS = 10000
PRECOMPILE_ECADD_EFFECTIVE_CALLS = 10000
PRECOMPILE_ECMUL_EFFECTIVE_CALLS = 10000
PRECOMPILE_ECPAIRING_EFFECTIVE_CALLS = 10000
PRECOMPILE_ECPAIRING_MILLER_LOOP = 10000
PRECOMPILE_BLAKE2F_ROUNDS = 512
PRECOMPILE_BLAKE_EFFECTIVE_CALLS = 10000
PRECOMPILE_BLAKE_ROUNDS = 512
Loading

0 comments on commit 8c23fe0

Please sign in to comment.