Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rlptxn/cancun/lookups/rlptxn_into_txndata.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
txndata.USER
txndata.RLP
txndata.USER_TXN_NUMBER
txndata.prover___USER_TXN_NUMBER_MAX
(txn-data-hub-view-cfi)
txndata.rlp/REQUIRES_EVM_EXECUTION
txndata.rlp/IS_DEPLOYMENT
Expand All @@ -35,6 +36,7 @@
1
1
rlptxn.USER_TXN_NUMBER
rlptxn.prover___USER_TXN_NUMBER_MAX
rlptxn.CODE_FRAGMENT_INDEX
rlptxn.REQUIRES_EVM_EXECUTION
rlptxn.IS_DEPLOYMENT
Expand Down
33 changes: 33 additions & 0 deletions rlptxn/cancun/prover/prover_columns_corset.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
(module rlptxn)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Constraints verification ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



(defcolumns
( prover___USER_TXN_NUMBER_MAX :i16 )
)

(defalias
USRMAX prover___USER_TXN_NUMBER_MAX
)



(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX---constancy ()
(if-not-zero USER_TXN_NUMBER
(will-remain-constant! USRMAX)))

(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX---finalization
(:domain {-1}) ;; ""
(eq! USRMAX USER_TXN_NUMBER))



;; TOTL|USER|SYSF|SYSI|prover
29 changes: 0 additions & 29 deletions todo

This file was deleted.

111 changes: 111 additions & 0 deletions txndata/cancun/prover/prover_columns_corset.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
(module txndata)



(defun
(block-constancy COL)
(if-not-zero (- (next BLK_NUMBER) (+ 1 BLK_NUMBER))
(eq! (next COL) COL)))
(defun
(conflation-constancy COL)
(if-not-zero (perspective-sum)
(eq! (next COL) COL)))
(defun
(transaction-constancy COL)
(if-not-zero (- (next TOTL_TXN_NUMBER) (+ 1 TOTL_TXN_NUMBER))
(eq! (next COL) COL)))
(defun
(user-transaction-constancy COL)
(if-not-zero (* (next USER ) USER )
(eq! (next COL ) COL )))




(defcomputedcolumn ( prover___RELATIVE_USER_TXN_NUMBER :i16 :fwd )
(if-eq-else BLK_NUMBER (prev BLK_NUMBER)
;; BLK# equality case
(* USER (+ (prev prover___RELATIVE_USER_TXN_NUMBER) (- USER_TXN_NUMBER (prev USER_TXN_NUMBER))))
;; BLK# change case
0
))

(defcomputedcolumn ( prover___IS_LAST_USER_TXN_OF_BLOCK :binary@prove :bwd )
(if-eq-else (next TOTL_TXN_NUMBER) TOTL_TXN_NUMBER
;; TOTL transaction number equality case
(next prover___IS_LAST_USER_TXN_OF_BLOCK)
;; BLK# change case
(* (next SYSF) USER)
))

(defalias
RELUSR prover___RELATIVE_USER_TXN_NUMBER
LSTUSR prover___IS_LAST_USER_TXN_OF_BLOCK
)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Property verification ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---const (transaction-constancy RELUSR))
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---vanish (if-zero (perspective-sum) (vanishes! RELUSR)))
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---transition (if-not-zero (- (next BLK_NUMBER) BLK_NUMBER) (vanishes! RELUSR)))
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---increment (if-not-zero (- (next BLK_NUMBER) (+ BLK_NUMBER 1))
(eq! (next RELUSR)
(* (next USER) (+ RELUSR (- (next USER_TXN_NUMBER) USER_TXN_NUMBER))))))

(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---const (transaction-constancy LSTUSR) )
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---vanish (if-zero USER (vanishes! LSTUSR)) )
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---last (if-not-zero (- TOTL_TXN_NUMBER (prev TOTL_TXN_NUMBER))
(eq! (prev LSTUSR)
(* (prev USER) SYSF)))
)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Constraints verification ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



(defcolumns
( prover___RELATIVE_USER_TXN_NUMBER_MAX :i16 )
( prover___USER_TXN_NUMBER_MAX :i16 )
)

(defalias
RELMAX prover___RELATIVE_USER_TXN_NUMBER_MAX
USRMAX prover___USER_TXN_NUMBER_MAX
)



(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---const () (user-transaction-constancy RELMAX))
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---zero () (if-zero (perspective-sum)
(vanishes! RELMAX)))
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---setting () (if-not-zero (* (- 1 (prev SYSF)) SYSF)
(eq! (prev RELMAX) (prev RELUSR))))

(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX ()
(begin
(conflation-constancy USRMAX)
(if-zero (perspective-sum)
(vanishes! USRMAX))
))

(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX---finalization
(:domain {-1}) ;; ""
(eq! USRMAX USER_TXN_NUMBER))



;; TOTL|USER|SYSF|SYSI|prover
111 changes: 111 additions & 0 deletions txndata/osaka/prover/prover_columns_corset.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
(module txndata)



(defun
(block-constancy COL)
(if-not-zero (- (next BLK_NUMBER) (+ 1 BLK_NUMBER))
(eq! (next COL) COL)))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Block Constancy Condition Mismatch

The block-constancy function in _corset.lisp files (Cancun, Osaka) uses (next BLK_NUMBER) != (BLK_NUMBER + 1). This condition is likely incorrect for enforcing constancy within a block, as it only allows changes when block numbers are consecutive. The .lispX files use (next BLK_NUMBER) != BLK_NUMBER, which aligns with typical within-block constancy.

Additional Locations (3)

Fix in Cursor Fix in Web

(defun
(conflation-constancy COL)
(if-not-zero (perspective-sum)
(eq! (next COL) COL)))
(defun
(transaction-constancy COL)
(if-not-zero (- (next TOTL_TXN_NUMBER) (+ 1 TOTL_TXN_NUMBER))
(eq! (next COL) COL)))
(defun
(user-transaction-constancy COL)
(if-not-zero (* (next USER ) USER )
(eq! (next COL ) COL )))




(defcomputedcolumn ( prover___RELATIVE_USER_TXN_NUMBER :i16 :fwd )
(if-eq-else BLK_NUMBER (prev BLK_NUMBER)
;; BLK# equality case
(* USER (+ (prev prover___RELATIVE_USER_TXN_NUMBER) (- USER_TXN_NUMBER (prev USER_TXN_NUMBER))))
;; BLK# change case
0
))

(defcomputedcolumn ( prover___IS_LAST_USER_TXN_OF_BLOCK :binary@prove :bwd )
(if-eq-else (next TOTL_TXN_NUMBER) TOTL_TXN_NUMBER
;; TOTL transaction number equality case
(next prover___IS_LAST_USER_TXN_OF_BLOCK)
;; BLK# change case
(* (next SYSF) USER)
))

(defalias
RELUSR prover___RELATIVE_USER_TXN_NUMBER
LSTUSR prover___IS_LAST_USER_TXN_OF_BLOCK
)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Property verification ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---const (transaction-constancy RELUSR))
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---vanish (if-zero (perspective-sum) (vanishes! RELUSR)))
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---transition (if-not-zero (- (next BLK_NUMBER) BLK_NUMBER) (vanishes! RELUSR)))
(defproperty prover-column-constraints---RELATIVE_USER_TXN_NUMBER---increment (if-not-zero (- (next BLK_NUMBER) (+ BLK_NUMBER 1))
(eq! (next RELUSR)
(* (next USER) (+ RELUSR (- (next USER_TXN_NUMBER) USER_TXN_NUMBER))))))

(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---const (transaction-constancy LSTUSR) )
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---vanish (if-zero USER (vanishes! LSTUSR)) )
(defproperty prover-column-constraints---IS_LAST_USER_TXN_OF_BLOCK---last (if-not-zero (- TOTL_TXN_NUMBER (prev TOTL_TXN_NUMBER))
(eq! (prev LSTUSR)
(* (prev USER) SYSF)))
)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Constraints verification ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



(defcolumns
( prover___RELATIVE_USER_TXN_NUMBER_MAX :i16 )
( prover___USER_TXN_NUMBER_MAX :i16 )
)

(defalias
RELMAX prover___RELATIVE_USER_TXN_NUMBER_MAX
USRMAX prover___USER_TXN_NUMBER_MAX
)



(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---const () (user-transaction-constancy RELMAX))
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---zero () (if-zero (perspective-sum)
(vanishes! RELMAX)))
(defconstraint prover-column-constraints---RELATIVE_USER_TXN_NUMBER_MAX---setting () (if-not-zero (* (- 1 (prev SYSF)) SYSF)
(eq! (prev RELMAX) (prev RELUSR))))

(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX ()
(begin
(conflation-constancy USRMAX)
(if-zero (perspective-sum)
(vanishes! USRMAX))
))

(defconstraint prover-column-constraints---USER_TXN_NUMBER_MAX---finalization
(:domain {-1}) ;; ""
(eq! USRMAX USER_TXN_NUMBER))



;; TOTL|USER|SYSF|SYSI|prover
6 changes: 3 additions & 3 deletions txndata/prague/generalities/flags_perspectives.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(defun (perspective-sum) (+ RLP
HUB
CMPTN))
(defun (perspective-sum) (force-bin (+ RLP
HUB
CMPTN)))

(defproperty perspective-sum-constraints---it-coincides-with-txn-flag-sum (eq! (perspective-sum) (txn-flag-sum)))
(defconstraint perspective-sum-constraints---it-vanishes-initially (:domain {0}) (eq! (perspective-sum) 0)) ;; ""
Expand Down
Loading
Loading