Skip to content

Commit e0a8b82

Browse files
authored
Fix/refacto blockdata files (#572)
1 parent 094fb72 commit e0a8b82

File tree

6 files changed

+29
-66
lines changed

6 files changed

+29
-66
lines changed

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,13 @@ BLOCKDATA_FOR_REFERENCE_TESTS := $(wildcard blockdata/*.lisp) \
5959
$(wildcard blockdata/processing/*.lisp) \
6060
$(wildcard blockdata/processing/gaslimit/common.lisp) \
6161
$(wildcard blockdata/processing/gaslimit/ethereum.lisp) \
62-
$(wildcard blockdata/processing/gaslimit/constants-ethereum.lisp) \
6362
$(wildcard blockdata/lookups/*.lisp)
6463

6564
# with gaslimit for linea file
6665
BLOCKDATA_FOR_LINEA := $(wildcard blockdata/*.lisp) \
6766
$(wildcard blockdata/processing/*.lisp) \
6867
$(wildcard blockdata/processing/gaslimit/common.lisp) \
6968
$(wildcard blockdata/processing/gaslimit/linea.lisp) \
70-
$(wildcard blockdata/processing/gaslimit/constants-linea.lisp) \
7169
$(wildcard blockdata/lookups/*.lisp)
7270

7371
BLOCKHASH := $(wildcard blockhash/columns/*.lisp) \
@@ -139,12 +137,13 @@ TXN_DATA_FOR_REFERENCE_TESTS := $(wildcard txndata/*.lisp) \
139137
140138
WCP := wcp
141139

142-
ZKEVM_MODULES := ${ALU} \
140+
# Corset is order sensitive - to compile, we load the constants first
141+
ZKEVM_MODULES := ${CONSTANTS} \
142+
${ALU} \
143143
${BIN} \
144144
${BLAKE2f_MODEXP_DATA} \
145145
${BLOCKDATA_FOR_LINEA} \
146146
${BLOCKHASH} \
147-
${CONSTANTS} \
148147
${EC_DATA} \
149148
${EUC} \
150149
${EXP} \
@@ -181,13 +180,13 @@ zkevm.bin: ${ZKEVM_MODULES}
181180
zkevm.go.bin: ${ZKEVM_MODULES}
182181
${GO_CORSET} compile -o $@ ${ZKEVM_MODULES}
183182

184-
185-
ZKEVM_MODULES_FOR_REFERENCE_TESTS := ${ALU} \
183+
# Corset is order sensitive - to compile, we load the constants first
184+
ZKEVM_MODULES_FOR_REFERENCE_TESTS := ${CONSTANTS} \
185+
${ALU} \
186186
${BIN} \
187187
${BLAKE2f_MODEXP_DATA} \
188188
${BLOCKDATA_FOR_REFERENCE_TESTS} \
189189
${BLOCKHASH} \
190-
${CONSTANTS} \
191190
${EC_DATA} \
192191
${EUC} \
193192
${EXP} \

blockdata/processing/gaslimit/common.lisp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,25 @@
2222

2323
;; row i + 0
2424
;; row i + 1
25-
;; are ethereum vs. linea dependent, see ethereum.lisp and linea.lisp
25+
;; are ethereum vs. linea dependent, see constants in ethereum.lisp and linea.lisp
26+
27+
(defconstraint gaslimit---lower-bound
28+
(:guard (gaslimit-precondition))
29+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30+
(wcp-call-to-GEQ 0
31+
(curr-GASLIMIT-hi)
32+
(curr-GASLIMIT-lo)
33+
0
34+
GAS_LIMIT_MINIMUM))
35+
36+
(defconstraint gaslimit---upper-bound
37+
(:guard (gaslimit-precondition))
38+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39+
(wcp-call-to-LEQ 1
40+
(curr-GASLIMIT-hi)
41+
(curr-GASLIMIT-lo)
42+
0
43+
GAS_LIMIT_MAXIMUM))
2644

2745
(defconstraint gaslimit---compute-maximum-deviation
2846
(:guard (gaslimit-precondition))

blockdata/processing/gaslimit/constants-ethereum.lisp

Lines changed: 0 additions & 5 deletions
This file was deleted.

blockdata/processing/gaslimit/constants-linea.lisp

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
11
(module blockdata)
22

3-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4-
;; ;;
5-
;; 3 Computations and checks ;;
6-
;; 3.X For GASLIMIT for Ethereum ;;
7-
;; ;;
8-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9-
10-
(defconstraint gaslimit---lower-bound---ETHEREUM
11-
(:guard (gaslimit-precondition))
12-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13-
(wcp-call-to-GEQ 0
14-
(curr-GASLIMIT-hi)
15-
(curr-GASLIMIT-lo)
16-
0
17-
GAS_LIMIT_MINIMUM))
18-
19-
(defconstraint gaslimit---upper-bound---ETHEREUM
20-
(:guard (gaslimit-precondition))
21-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22-
(wcp-call-to-LEQ 1
23-
(curr-GASLIMIT-hi)
24-
(curr-GASLIMIT-lo)
25-
0
26-
GAS_LIMIT_MAXIMUM))
3+
(defconst GAS_LIMIT_MINIMUM ETHEREUM_GAS_LIMIT_MINIMUM)
4+
(defconst GAS_LIMIT_MAXIMUM ETHEREUM_GAS_LIMIT_MAXIMUM)
Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
11
(module blockdata)
22

3-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4-
;; ;;
5-
;; 3 Computations and checks ;;
6-
;; 3.X For GASLIMIT for Linea ;;
7-
;; ;;
8-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9-
10-
(defconstraint gaslimit---lower-bound---LINEA
11-
(:guard (gaslimit-precondition))
12-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13-
(wcp-call-to-GEQ 0
14-
(curr-GASLIMIT-hi)
15-
(curr-GASLIMIT-lo)
16-
0
17-
GAS_LIMIT_MINIMUM))
18-
19-
(defconstraint gaslimit---upper-bound---LINEA
20-
(:guard (gaslimit-precondition))
21-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22-
(wcp-call-to-LEQ 1
23-
(curr-GASLIMIT-hi)
24-
(curr-GASLIMIT-lo)
25-
0
26-
GAS_LIMIT_MAXIMUM))
3+
(defconst GAS_LIMIT_MINIMUM LINEA_GAS_LIMIT_MINIMUM)
4+
(defconst GAS_LIMIT_MAXIMUM LINEA_GAS_LIMIT_MAXIMUM)

0 commit comments

Comments
 (0)