Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding unpermuted columns to the ACC/STO perpectives #492

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ HUB := $(wildcard hub/columns/*lisp) \
$(wildcard hub/constraints/consistency/account/*lisp) \
$(wildcard hub/constraints/consistency/context/*lisp) \
$(wildcard hub/constraints/consistency/execution_environment/*lisp) \
$(wildcard hub/constraints/consistency/stack/*lisp) \
$(wildcard hub/constraints/consistency/storage/*lisp) \
$(wildcard hub/constraints/context-rows/*lisp) \
$(wildcard hub/constraints/generalities/*lisp) \
Expand Down Expand Up @@ -40,7 +39,8 @@ HUB := $(wildcard hub/columns/*lisp) \
hub/constants.lisp


# Missing from the above
# Missing from the above
# $(wildcard hub/constraints/consistency/stack/*lisp) \

ALU := $(wildcard alu/add/*.lisp) \
$(wildcard alu/ext/*.lisp) \
Expand Down Expand Up @@ -135,7 +135,7 @@ ZKEVM_MODULES := ${ALU} \
${EUC} \
${EXP} \
${GAS} \
${HUB_COLUMNS} \
${HUB} \
${LIBRARY} \
${LOG_DATA} \
${LOG_INFO} \
Expand Down
20 changes: 19 additions & 1 deletion hub/columns/account.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,44 @@
(DEPLOYMENT_STATUS :binary@prove) ;; TODO: demote to debug constraint
(DEPLOYMENT_STATUS_NEW :binary@prove) ;; TODO: demote to debug constraint
(DEPLOYMENT_STATUS_INFTY :binary@prove) ;; TODO: demote to debug constraint

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; TRM module lookup columns ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(TRM_FLAG :binary@prove)
(IS_PRECOMPILE :binary@prove) ;; TODO: demote to debug constraint
(TRM_RAW_ADDRESS_HI :i128)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; RLPADDR module lookup columns ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(RLPADDR_FLAG :binary@prove)
(RLPADDR_RECIPE :i8)
(RLPADDR_DEP_ADDR_HI :i32)
(RLPADDR_DEP_ADDR_LO :i128)
(RLPADDR_SALT_HI :i128)
(RLPADDR_SALT_LO :i128)
(RLPADDR_KEC_HI :i128)
(RLPADDR_KEC_LO :i128)))
(RLPADDR_KEC_LO :i128)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; ACCOUNT consistency temporal columns ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; the unpermuted columns whose permuted counter-parts will be used in account-consistency-arguments
( FIRST_IN_CNF :binary@prove ) ( FIRST_IN_BLK :binary@prove ) ( FIRST_IN_TXN :binary@prove )
( AGAIN_IN_CNF :binary@prove ) ( AGAIN_IN_BLK :binary@prove ) ( AGAIN_IN_TXN :binary@prove )
( FINAL_IN_CNF :binary@prove ) ( FINAL_IN_BLK :binary@prove ) ( FINAL_IN_TXN :binary@prove )
( DEPLOYMENT_NUMBER_FIRST_IN_BLOCK :i16)
( DEPLOYMENT_NUMBER_FINAL_IN_BLOCK :i16)
))


36 changes: 28 additions & 8 deletions hub/constraints/consistency/account/columns.lisp
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
(module hub)

(defcolumns
;; account consistency permutation related
( acp_FIRST_IN_CNF :binary@prove ) ( acp_FIRST_IN_BLK :binary@prove ) ( acp_FIRST_IN_TXN :binary@prove )
( acp_AGAIN_IN_CNF :binary@prove ) ( acp_AGAIN_IN_BLK :binary@prove ) ( acp_AGAIN_IN_TXN :binary@prove )
( acp_FINAL_IN_CNF :binary@prove ) ( acp_FINAL_IN_BLK :binary@prove ) ( acp_FINAL_IN_TXN :binary@prove )
( acp_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK :i16)
( acp_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK :i16)
)

;; acp_ ⇔ account consistency permutation
(defpermutation
Expand Down Expand Up @@ -44,6 +36,18 @@
acp_MARKED_FOR_SELFDESTRUCT_NEW
acp_TRM_FLAG
acp_IS_PRECOMPILE
;; permuted versions
acp_FIRST_IN_CNF
acp_FIRST_IN_BLK
acp_FIRST_IN_TXN
acp_AGAIN_IN_CNF
acp_AGAIN_IN_BLK
acp_AGAIN_IN_TXN
acp_FINAL_IN_CNF
acp_FINAL_IN_BLK
acp_FINAL_IN_TXN
acp_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK
acp_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK
)
;; original columns
;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -77,5 +81,21 @@
account/MARKED_FOR_SELFDESTRUCT_NEW
account/TRM_FLAG
account/IS_PRECOMPILE
;; un permuted versions
account/FIRST_IN_CNF
account/FIRST_IN_BLK
account/FIRST_IN_TXN
account/AGAIN_IN_CNF
account/AGAIN_IN_BLK
account/AGAIN_IN_TXN
account/FINAL_IN_CNF
account/FINAL_IN_BLK
account/FINAL_IN_TXN
account/DEPLOYMENT_NUMBER_FIRST_IN_BLOCK
account/DEPLOYMENT_NUMBER_FINAL_IN_BLOCK
)
)




2 changes: 1 addition & 1 deletion hub/lookups/hub_into_rlp_txn.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
(* rlptxn.ADDR_HI (hub-into-rlp-txn-tgt-selector))
(* rlptxn.ADDR_LO (hub-into-rlp-txn-tgt-selector))
(* [rlptxn.INPUT 1] (rlp-txn-depth-2) (hub-into-rlp-txn-tgt-selector))
(* [rlptxn.INPUT 2] (rlp-txn-depth-2) (hub-into-rlp-txn-tgt-selector)))
(* [rlptxn.INPUT 2] (rlp-txn-depth-2) (hub-into-rlp-txn-tgt-selector))
)
;; source columns
(
Expand Down
Loading