Skip to content

Commit 29e5b17

Browse files
committed
fix txndatalon
1 parent 954c244 commit 29e5b17

11 files changed

+20
-58
lines changed

txndata/txndatalontemp/columns.lisp renamed to txndata/txndatalon/columns.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module txndata (< EVM_FORK EVM_SHANGHAI))
1+
(module txndata)
22

33
(defcolumns
44
(ABS_TX_NUM_MAX :i16)

txndata/txndatalontemp/constants.lisp renamed to txndata/txndatalon/constants.lisp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
(module txndata)
22

3-
4-
53
(defconst
64
;; TODO: this is LONDON
75
CT_MAX_TYPE_0_LONDON 7
@@ -42,9 +40,8 @@
4240
TYPE_1_RLP_TXN_PHASE_NUMBER_7 RLP_TXN_PHASE_ACCESS_LIST
4341
TYPE_2_RLP_TXN_PHASE_NUMBER_6 RLP_TXN_PHASE_MAX_FEE_PER_GAS
4442
TYPE_2_RLP_TXN_PHASE_NUMBER_7 RLP_TXN_PHASE_ACCESS_LIST
45-
;;
4643

47-
;; TODO: this is LONDON
44+
;;
4845
row-offset---nonce-comparison 0
4946
row-offset---initial-balance-comparison 1
5047
row-offset---sufficient-gas-comparison 2
@@ -53,7 +50,6 @@
5350
row-offset---detecting-empty-call-data-comparison 5
5451
row-offset---max-fee-and-basefee-comparison 6
5552
row-offset---max-fee-and-max-priority-fee-comparison 7
56-
row-offset---computing-effective-gas-price-comparison 8
57-
)
53+
row-offset---computing-effective-gas-price-comparison 8)
5854

5955

txndata/txndatalontemp/constraints.lisp renamed to txndata/txndatalon/constraints.lisp

Lines changed: 17 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
;; 2.2 Constancies ;;
6262
;; ;;
6363
;;;;;;;;;;;;;;;;;;;;;;;;;;;
64-
6564
(defun (transaction-constant X)
6665
(if-not-zero CT
6766
(eq! X (prev X))))
@@ -155,7 +154,7 @@
155154
(defun (optional_to_addr_hi) (shift OUTGOING_HI 1))
156155
(defun (optional_to_addr_lo) (shift OUTGOING_LO 1))
157156
(defun (nonce) (shift OUTGOING_LO 2))
158-
(defun (is_dep) (force-bin (shift OUTGOING_HI 3)))
157+
(defun (is_dep) (shift OUTGOING_HI 3))
159158
(defun (value) (shift OUTGOING_LO 3))
160159
(defun (data_cost) (shift OUTGOING_HI 4))
161160
(defun (data_size) (shift OUTGOING_LO 4))
@@ -250,69 +249,36 @@
250249

251250
(defun (result-must-be-false row-offset) (vanishes! (shift RES row-offset)))
252251
(defun (result-must-be-true row-offset) (eq! (shift RES row-offset) 1))
253-
254-
255252
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
256253
;; ;;
257254
;; 2.9 Shared computations ;;
258255
;; ;;
259256
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
260257

261-
(defconstraint comparison---nonce-must-not-exceed-EIP-2681-max-nonce
262-
(:guard (first-row-of-new-transaction))
258+
(defconstraint comparison---nonce-must-not-exceed-EIP-2681-max-nonce (:guard (first-row-of-new-transaction))
263259
(begin
264260
(small-call-to-LT row-offset---nonce-comparison NONCE EIP2681_MAX_NONCE)
265261
(result-must-be-true row-offset---nonce-comparison)))
266262

267-
(defconstraint comparison---initial-balance-must-cover-value-plus-maximal-gas-cost
268-
(:guard (first-row-of-new-transaction))
263+
(defconstraint comparison---initial-balance-must-cover-value-plus-maximal-gas-cost (:guard (first-row-of-new-transaction))
269264
(begin
270265
(small-call-to-LEQ row-offset---initial-balance-comparison (+ (value) (* (max_fee) (gas_limit))) INITIAL_BALANCE)
271266
(result-must-be-true row-offset---initial-balance-comparison)))
272267

273-
(defconstraint comparaison---code-size-limit-check
274-
(:guard (first-row-of-new-transaction))
275-
(if-not-zero (is_dep)
276-
(begin
277-
(small-call-to-LEQ row-offset---init-code-size-limit
278-
(data_size)
279-
MAX_INIT_CODE_SIZE)
280-
(result-must-be-true row-offset---init-code-size-limit))))
281-
282-
(defconstraint euc-call---computing-number-of-words-in-init-code
283-
(:guard (first-row-of-new-transaction))
284-
(if-not-zero (is_dep)
285-
(begin
286-
(call-to-EUC row-offset---init-code-pricing
287-
(+ (data_size) WORD_SIZE_MO)
288-
WORD_SIZE))))
289-
290-
(defun (number_of_words_in_init_code) (shift RES row-offset---init-code-pricing))
291-
292-
(defun (init_code_cost)
293-
(* GAS_CONST_INIT_CODE_WORD
294-
(number_of_words_in_init_code)
295-
))
296-
297-
(defun (upfront_gas_cost)
298-
(+ (* TYPE0 (legacy_upfront_gas_cost))
299-
(* TYPE1 (access_upfront_gas_cost))
300-
(* TYPE2 (access_upfront_gas_cost))))
301-
302-
(defun (legacy_upfront_gas_cost)
303-
(+ (data_cost)
304-
(* (is_dep) GAS_CONST_G_TX_CREATE)
305-
(* (is_dep) (init_code_cost))
306-
GAS_CONST_G_TRANSACTION
307-
))
308-
309-
(defun (access_upfront_gas_cost)
310-
(+ (data_cost)
311-
(* (is_dep) GAS_CONST_G_TX_CREATE)
312-
(* (is_dep) (init_code_cost))
313-
GAS_CONST_G_TRANSACTION
314-
(* (num_addr) GAS_CONST_G_ACCESS_LIST_ADRESS)
315-
(* (num_keys) GAS_CONST_G_ACCESS_LIST_STORAGE)))
268+
(defun (upfront_gas_cost)
269+
(+ (* TYPE0 (legacy_upfront_gas_cost))
270+
(* TYPE1 (access_upfront_gas_cost))
271+
(* TYPE2 (access_upfront_gas_cost))))
272+
(defun (legacy_upfront_gas_cost)
273+
(+ (data_cost)
274+
GAS_CONST_G_TRANSACTION
275+
(* (is_dep) GAS_CONST_G_TX_CREATE)))
276+
(defun (access_upfront_gas_cost)
277+
(+ (data_cost)
278+
GAS_CONST_G_TRANSACTION
279+
(* (is_dep) GAS_CONST_G_TX_CREATE)
280+
(* (num_addr) GAS_CONST_G_ACCESS_LIST_ADRESS)
281+
(* (num_keys) GAS_CONST_G_ACCESS_LIST_STORAGE)))
316282

317283
(defconstraint comparison---gas-limit-must-cover-upfront-gas-cost (:guard (first-row-of-new-transaction))
318284
(begin

0 commit comments

Comments
 (0)