From b18005ba0069fc58ee7ee00ecf2082b91a5768cd Mon Sep 17 00:00:00 2001 From: krlosMata Date: Wed, 18 Jan 2023 12:35:01 +0100 Subject: [PATCH] reduce steps max limit --- main/constants.zkasm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/main/constants.zkasm b/main/constants.zkasm index 64cb13e1..33c7e6be 100644 --- a/main/constants.zkasm +++ b/main/constants.zkasm @@ -69,18 +69,19 @@ CONST %SSTORE_CLEARS_SCHEDULE = 15000 ; COUNTERS CONST %MIN_STEPS_FINISH_BATCH = 200 ; min steps to finish tx -CONST %TOTAL_STEPS = 2**23 -CONST %MAX_CNT_STEPS = %TOTAL_STEPS - %MIN_STEPS_FINISH_BATCH +CONST %TOTAL_STEPS_LIMIT = 2**23 -CONST %MAX_CNT_ARITH_LIMIT = %TOTAL_STEPS / 32 -CONST %MAX_CNT_BINARY_LIMIT = %TOTAL_STEPS / 16 -CONST %MAX_CNT_MEM_ALIGN_LIMIT = %TOTAL_STEPS / 32 -CONST %MAX_CNT_KECCAK_F_LIMIT = (%TOTAL_STEPS / 155286) * 44 -CONST %MAX_CNT_PADDING_PG_LIMIT = (%TOTAL_STEPS / 56) -CONST %MAX_CNT_POSEIDON_G_LIMIT = (%TOTAL_STEPS / 30) +CONST %MAX_CNT_STEPS_LIMIT = %TOTAL_STEPS_LIMIT - %MIN_STEPS_FINISH_BATCH +CONST %MAX_CNT_ARITH_LIMIT = %TOTAL_STEPS_LIMIT / 32 +CONST %MAX_CNT_BINARY_LIMIT = %TOTAL_STEPS_LIMIT / 16 +CONST %MAX_CNT_MEM_ALIGN_LIMIT = %TOTAL_STEPS_LIMIT / 32 +CONST %MAX_CNT_KECCAK_F_LIMIT = (%TOTAL_STEPS_LIMIT / 155286) * 44 +CONST %MAX_CNT_PADDING_PG_LIMIT = (%TOTAL_STEPS_LIMIT / 56) +CONST %MAX_CNT_POSEIDON_G_LIMIT = (%TOTAL_STEPS_LIMIT / 30) CONST %SAFE_RANGE = 20 ; safe guard counters to not take into account (%RANGE = 1 / SAFE_RANGE) +CONST %MAX_CNT_STEPS = %MAX_CNT_STEPS_LIMIT - (%MAX_CNT_STEPS_LIMIT / %SAFE_RANGE) CONST %MAX_CNT_ARITH = %MAX_CNT_ARITH_LIMIT - (%MAX_CNT_ARITH_LIMIT / %SAFE_RANGE) CONST %MAX_CNT_BINARY = %MAX_CNT_BINARY_LIMIT - (%MAX_CNT_BINARY_LIMIT / %SAFE_RANGE) CONST %MAX_CNT_MEM_ALIGN = %MAX_CNT_MEM_ALIGN_LIMIT - (%MAX_CNT_MEM_ALIGN_LIMIT / %SAFE_RANGE)