Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ zkevm_paris.bin
zkevm_shanghai.bin
zkevm_cancun.bin
zkevm_prague.bin
zkevm_osaka.bin
zkevm.go.bin
zkevm_for_reference_tests.bin
zkevm_for_old_replay_tests.bin
Expand Down
41 changes: 38 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ HUB_LONDON := hub/london
HUB_SHANGHAI := hub/shanghai
HUB_CANCUN := hub/cancun
HUB_PRAGUE := hub/prague
HUB_OSAKA := hub/osaka

LIBRARY := library

Expand All @@ -54,13 +55,17 @@ MMU := mmu
MMIO_LONDON := mmio/london
MMIO_CANCUN := mmio/cancun

MMU_LONDON := mmu/london
MMU_OSAKA := mmu/osaka

MXP_LONDON := mxp/london
MXP_CANCUN := mxp/cancun

OOB_LONDON := oob/london
OOB_SHANGHAI := oob/shanghai
OOB_CANCUN := oob/cancun
OOB_PRAGUE := oob/prague
OOB_OSAKA := oob/osaka

RLP_ADDR := rlpaddr

Expand All @@ -69,6 +74,9 @@ RLP_TXN_CANCUN := rlptxn/cancun
RLP_TXN_PRAGUE := rlptxn/cancun
# TODO: update for Prague v2 + add RLP_AUTH

RLP_TXN_RCPT_LONDON := rlptxrcpt/london
RLP_TXN_RCPT_OSAKA := rlptxrcpt/osaka

RLP_TXRCPT := rlptxrcpt

RLP_UTILS_CANCUN := rlputils/cancun
Expand All @@ -93,6 +101,7 @@ TXN_DATA_LONDON := txndata/london
TXN_DATA_SHANGHAI := txndata/shanghai
TXN_DATA_CANCUN := txndata/cancun
TXN_DATA_PRAGUE := txndata/prague
TXN_DATA_OSAKA := txndata/osaka

WCP := wcp

Expand All @@ -113,9 +122,7 @@ ZKEVM_MODULES_COMMON := ${CONSTANTS} \
${GAS} \
${LIBRARY} \
${LOG_DATA} \
${MMU} \
${RLP_ADDR} \
${RLP_TXRCPT} \
${ROM} \
${ROM_LEX} \
${SHAKIRA_DATA} \
Expand All @@ -131,9 +138,11 @@ ZKEVM_MODULES_LONDON := ${ZKEVM_MODULES_COMMON} \
${HUB_LONDON} \
${LOG_INFO_LONDON} \
${MMIO_LONDON} \
${MMU_LONDON} \
${MXP_LONDON} \
${OOB_LONDON} \
${RLP_TXN_LONDON} \
${RLP_TXN_RCPT_LONDON} \
${TXN_DATA_LONDON}


Expand All @@ -146,9 +155,11 @@ ZKEVM_MODULES_SHANGHAI := ${ZKEVM_MODULES_COMMON} \
${HUB_SHANGHAI} \
${LOG_INFO_LONDON} \
${MMIO_LONDON} \
${MMU_LONDON} \
${MXP_LONDON} \
${OOB_SHANGHAI} \
${RLP_TXN_LONDON} \
${RLP_TXN_RCPT_LONDON} \
${TXN_DATA_SHANGHAI}

ZKEVM_MODULES_CANCUN := ${ZKEVM_MODULES_COMMON} \
Expand All @@ -159,9 +170,11 @@ ZKEVM_MODULES_CANCUN := ${ZKEVM_MODULES_COMMON} \
${HUB_CANCUN} \
${LOG_INFO_CANCUN} \
${MMIO_CANCUN} \
${MMU_LONDON} \
${MXP_CANCUN} \
${OOB_CANCUN} \
${RLP_TXN_CANCUN} \
${RLP_TXN_RCPT_LONDON} \
${RLP_UTILS_CANCUN} \
${TXN_DATA_CANCUN}

Expand All @@ -173,13 +186,31 @@ ZKEVM_MODULES_PRAGUE := ${ZKEVM_MODULES_COMMON} \
${HUB_PRAGUE} \
${LOG_INFO_CANCUN} \
${MMIO_CANCUN} \
${MMU_LONDON} \
${MXP_CANCUN} \
${OOB_PRAGUE} \
${RLP_TXN_PRAGUE} \
${RLP_TXN_RCPT_LONDON} \
${RLP_UTILS_CANCUN} \
${TXN_DATA_PRAGUE}

all: zkevm_london.bin zkevm_paris.bin zkevm_shanghai.bin zkevm_cancun.bin zkevm_prague.bin
ZKEVM_MODULES_OSAKA := ${ZKEVM_MODULES_COMMON} \
${CONSTANTS_PRAGUE} \
${TABLES_PRAGUE} \
${BLOCKDATA_CANCUN} \
${BLS_PRAGUE} \
${HUB_OSAKA} \
${LOG_INFO_CANCUN} \
${MMIO_CANCUN} \
${MMU_OSAKA} \
${MXP_CANCUN} \
${OOB_OSAKA} \
${RLP_TXN_PRAGUE} \
${RLP_TXN_RCPT_OSAKA} \
${RLP_UTILS_CANCUN} \
${TXN_DATA_OSAKA}

all: zkevm_london.bin zkevm_paris.bin zkevm_shanghai.bin zkevm_cancun.bin zkevm_prague.bin zkevm_osaka.bin

zkevm_london.bin: ${ZKEVM_MODULES_LONDON}
${GO_CORSET_COMPILE} -o $@ ${ZKEVM_MODULES_LONDON}
Expand All @@ -201,3 +232,7 @@ zkevm_cancun.bin: ${ZKEVM_MODULES_CANCUN}
zkevm_prague.bin: ${ZKEVM_MODULES_PRAGUE}
${GO_CORSET_COMPILE} -o $@ ${ZKEVM_MODULES_PRAGUE}
@$(call warn_lispX)

zkevm_osaka.bin: ${ZKEVM_MODULES_OSAKA}
${GO_CORSET_COMPILE} -o $@ ${ZKEVM_MODULES_OSAKA}
@$(call warn_lispX)
63 changes: 63 additions & 0 deletions hub/osaka/columns/account.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
(module hub)

(defperspective account

;; selector
PEEK_AT_ACCOUNT

;; account-row columns
((ADDRESS_HI :i32)
(ADDRESS_LO :i128)
(NONCE :i64 :display :dec)
(NONCE_NEW :i64 :display :dec)
(BALANCE :i128 :display :dec)
(BALANCE_NEW :i128 :display :dec)
(CODE_SIZE :i32 :display :dec)
(CODE_SIZE_NEW :i32 :display :dec)
(CODE_HASH_HI :i128)
(CODE_HASH_LO :i128)
(CODE_HASH_HI_NEW :i128)
(CODE_HASH_LO_NEW :i128)
(HAS_CODE :binary) ;; rmk1: explicitly set on every account row, de facto binary
(HAS_CODE_NEW :binary) ;; rmk1
(HAD_CODE_INITIALLY :binary)
(CODE_FRAGMENT_INDEX :i32 :display :dec)
(ROMLEX_FLAG :binary@prove)
(EXISTS :binary) ;; rmk1
(EXISTS_NEW :binary) ;; rmk1
(WARMTH :binary@prove) ;; rmk2: should be binary even without the explicit constraint; we keep it as a safety;
(WARMTH_NEW :binary@prove) ;; rmk2
(MARKED_FOR_DELETION :binary@prove) ;; rmk2
(MARKED_FOR_DELETION_NEW :binary@prove) ;; rmk2
(DEPLOYMENT_NUMBER :i32 :display :dec)
(DEPLOYMENT_NUMBER_NEW :i32 :display :dec)
(DEPLOYMENT_STATUS :binary@prove) ;; rmk2
(DEPLOYMENT_STATUS_NEW :binary@prove) ;; rmk2

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

(TRM_FLAG :binary@prove)
(IS_PRECOMPILE :binary@prove) ;; rmk: this flag is set from the TRM module the very first time an address is encountered in a conflation, and is conflation-constant; the @prove is redundant; we keep it for safety;
(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)
))


45 changes: 45 additions & 0 deletions hub/osaka/columns/context.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
(module hub)

(defperspective context

;; selector
PEEK_AT_CONTEXT

;; context-row columns
(
;; (immutable) context data
( CONTEXT_NUMBER :i32 ) ;; rmk: deduced from the HUB_STAMP; could likely be reduced to :i24 (i.e. ~ 16M); though: limitless prover ...
( CALL_STACK_DEPTH :i11 ) ;; in the range [0 .. 1024] (inclusive)
( IS_ROOT :binary@prove ) ;; rmk: set at the creation of the context explicitly to 0 or 1; imposed to be context-constant; the @prove is therefore redundant; we keep it for now as a safet;
( IS_STATIC :binary@prove ) ;; rmk: same remark

;; (immutable) account
( ACCOUNT_ADDRESS_HI :i32 )
( ACCOUNT_ADDRESS_LO :i128 )
( ACCOUNT_DEPLOYMENT_NUMBER :i32 )

;; (immutable) account whose bytecode is being executed
( BYTE_CODE_ADDRESS_HI :i32 )
( BYTE_CODE_ADDRESS_LO :i128 )
( BYTE_CODE_DEPLOYMENT_NUMBER :i32 )
( BYTE_CODE_DEPLOYMENT_STATUS :i32 )
( BYTE_CODE_CODE_FRAGMENT_INDEX :i32 )

;; (immutable) caller account
( CALL_DATA_CONTEXT_NUMBER :i32 )
( CALLER_ADDRESS_HI :i32 )
( CALLER_ADDRESS_LO :i128 )
( CALL_VALUE :i128 )

;; (immutable) parameters set at CALL
( CALL_DATA_OFFSET :i32 )
( CALL_DATA_SIZE :i32 )
( RETURN_AT_OFFSET :i32 )
( RETURN_AT_CAPACITY :i32 )

;; (mutable) parameters set when execution resumes after a CALL / CREATE
( UPDATE :binary@prove )
( RETURN_DATA_OFFSET :i32 )
( RETURN_DATA_SIZE :i32 )
( RETURN_DATA_CONTEXT_NUMBER :i32 )
))
74 changes: 74 additions & 0 deletions hub/osaka/columns/miscellaneous.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
(module hub)

(defperspective misc
;; selector
PEEK_AT_MISCELLANEOUS

;; miscellaneous-row columns
(
( EXP_FLAG :binary@prove )
( MMU_FLAG :binary@prove )
( MXP_FLAG :binary@prove )
( OOB_FLAG :binary@prove )
( STP_FLAG :binary@prove )

;; EXP columns (DONE)
( EXP_INST :i16 )
( EXP_DATA :array [5] :i128 )

;; MMU columns (DONE)
( MMU_INST :i16 :display :hex)
( MMU_SRC_ID :i32 )
( MMU_TGT_ID :i32 )
( MMU_AUX_ID :i32 )
( MMU_SRC_OFFSET_LO :i128 )
( MMU_SRC_OFFSET_HI :i128 )
( MMU_TGT_OFFSET_LO :i128 )
( MMU_SIZE :i32 )
( MMU_REF_OFFSET :i32 )
( MMU_REF_SIZE :i32 )
( MMU_SUCCESS_BIT :binary@prove )
( MMU_LIMB_1 :i128 )
( MMU_LIMB_2 :i128 )
( MMU_PHASE :i32 )
( MMU_EXO_SUM :i32 )

;; MXP colummns
( MXP_INST :byte )
( MXP_MXPX :binary )
( MXP_DEPLOYS :binary )
( MXP_OFFSET_1_HI :i128 )
( MXP_OFFSET_1_LO :i128 )
( MXP_OFFSET_2_HI :i128 )
( MXP_OFFSET_2_LO :i128 )
( MXP_SIZE_1_HI :i128 )
( MXP_SIZE_1_LO :i128 )
( MXP_SIZE_2_HI :i128 )
( MXP_SIZE_2_LO :i128 )
( MXP_WORDS :i128 )
( MXP_GAS_MXP :i128 )
( MXP_SIZE_1_NONZERO_NO_MXPX :binary@prove )
( MXP_SIZE_2_NONZERO_NO_MXPX :binary@prove )

;; OOB columns
(OOB_INST :i16 )
(OOB_DATA :array[1:10] :i128 )

;; STP columns
( STP_INSTRUCTION :byte )
( STP_GAS_HI :i128 )
( STP_GAS_LO :i128 )
( STP_VALUE_HI :i128 )
( STP_VALUE_LO :i128 )
( STP_EXISTS :binary)
( STP_WARMTH :binary)
( STP_OOGX :binary)
( STP_GAS_MXP :i64 )
( STP_GAS_UPFRONT_GAS_COST :i64 )
( STP_GAS_PAID_OUT_OF_POCKET :i64 )
( STP_GAS_STIPEND :i12 )

;; ``truly'' miscellaneous columns
( CCSR_FLAG :binary) ;; Child Context Self Reverts Flag;
( CCRS_STAMP :i32 ) ;; Child Context Revert Stamp
))
Loading
Loading