Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
1be5328
feat: file structure
OlivierBBB Mar 21, 2025
8c7f570
feat: common columns
OlivierBBB Mar 22, 2025
1c3b71b
feat: decoder columns
OlivierBBB Mar 22, 2025
51421d1
feat: macro columns
OlivierBBB Mar 22, 2025
6d4445b
feat: scenario columns + shorthands
OlivierBBB Mar 22, 2025
f55ba8d
feat: computation columns + module call macros
OlivierBBB Mar 22, 2025
d08bd41
feat: some generalities/
OlivierBBB Mar 22, 2025
8f42563
feat: generalities/heartbeat constraints
OlivierBBB Mar 22, 2025
d85f04e
feat: generalities/perspectives constraints
OlivierBBB Mar 22, 2025
176d1ce
ras
OlivierBBB Mar 22, 2025
6784afa
feat: make it compile
OlivierBBB Mar 22, 2025
b2120d7
feat: computations/generalities constraints
OlivierBBB Mar 22, 2025
aa2dd96
ras: reorganizing constants / shorthands ...
OlivierBBB Mar 22, 2025
cd7907f
feat: computations/generalities and msize
OlivierBBB Mar 22, 2025
0e70e13
feat: computations/non_msize constraints
OlivierBBB Mar 22, 2025
931619d
feat: computations/not_msize_nor_trivial constraints
OlivierBBB Mar 22, 2025
6ee825f
feat: computations/state_update constraints
OlivierBBB Mar 22, 2025
0fea6f8
feat: computations/state_update_word_pricing
OlivierBBB Mar 23, 2025
f253c10
feat: computations/state_update_byte_pricing
OlivierBBB Mar 23, 2025
49ac8bf
feat: make it compile
OlivierBBB Mar 24, 2025
86b2a55
feat: consistency arguments
OlivierBBB Mar 24, 2025
f11c13a
feat: new columns in the instruction decoder
OlivierBBB Mar 24, 2025
8629304
feat: remove IS_CALL column from MXP module
OlivierBBB Mar 24, 2025
8d77be9
ras
OlivierBBB Mar 24, 2025
ad7ea6e
feat: MXP into EUC lookup
OlivierBBB Mar 24, 2025
76c5fad
feat: MXP into WCP lookup
OlivierBBB Mar 24, 2025
e75df4f
feat: MXP into ID lookup
OlivierBBB Mar 24, 2025
9f278fa
ras: make it compile again
OlivierBBB Mar 24, 2025
963de92
feat: added `(wcp-call-to-LEQ ...)` to MXP module
OlivierBBB Mar 29, 2025
08b08d0
feat: LT -> LEQ for comparisons against MXPX_THRESHOLD
OlivierBBB Mar 29, 2025
af27c27
fix: make compile + noop in MSIZE case is debug
OlivierBBB Mar 29, 2025
eb9ccf2
renamed mxp_v3 to mxp and old mxp to mxp_v2 and substituted force-boo…
lorenzogentile404 Apr 4, 2025
b34c230
added MCOPY bytecode
lorenzogentile404 Apr 22, 2025
f8599ed
add mxp previous design columns and consts
amkCha May 5, 2025
0c9678f
feat: merge mxp and mxp_v2 into one folder and rename
amkCha May 7, 2025
e1edc72
feat: add EVM_FORK constants
amkCha May 13, 2025
ac19835
add conditional in module mxp
amkCha May 13, 2025
19bf05f
fix constraints with go-corset 1.1.4
amkCha May 13, 2025
f7266bc
feat: updated instruction decoder
OlivierBBB May 14, 2025
be336c9
feat: remove IS_MXP_INSTRUCTION from MXP and ID
OlivierBBB May 14, 2025
722f4e1
feat: adding MCOPY_FLAG to hub/stack perspective
OlivierBBB May 14, 2025
09919e9
feat: new MXP instructions from HUB pov
OlivierBBB May 14, 2025
16416f8
ras: splitting of the stack patterns
OlivierBBB May 14, 2025
2596078
feat: instruction handling for MCOPY
OlivierBBB May 14, 2025
35e1a63
feat: old and new instruction decoder
OlivierBBB May 14, 2025
deb4a96
fix: typos
OlivierBBB May 14, 2025
5a0aa9d
feat: ras
OlivierBBB May 14, 2025
ab2c595
feat: fully remove T4MTNTOP columns and shorthands
OlivierBBB May 15, 2025
7708465
feat: adding FAMILY_MCOPY to inst_decoder_cancun
OlivierBBB May 15, 2025
628e7ac
feat: retire MXP instruction of TYPE_1 (for MSIZE opcode)
OlivierBBB May 15, 2025
8c2296d
feat: retire MXP instruction of TYPE_5 (for CALL family)
OlivierBBB May 15, 2025
1f56bcc
feat: retire MXP instruction of TYPE_4 (for COPY family)
OlivierBBB May 15, 2025
7f4269e
feat: retire MXP instruction of TYPE_4 (for CREATE family)
OlivierBBB May 15, 2025
e79dd2b
feat: retire MXP instruction of TYPE_4 (for RETURN opcode)
OlivierBBB May 15, 2025
72b0d6a
feat: retire MXP instruction of TYPE_4 (for KEC family)
OlivierBBB May 15, 2025
6c110af
feat: retire MXP instruction of TYPE_4 (for LOG family)
OlivierBBB May 15, 2025
ce6651e
feat: retire MXP instruction of TYPE_2/3 (for STACKRAM family)
OlivierBBB May 15, 2025
1c2bff1
feat: duplicate + update lookup HUB -> MXP
OlivierBBB May 15, 2025
39f04eb
feat: retire MXP instruction of TYPE_4 (for REVERT opcode)
OlivierBBB May 15, 2025
b15d577
ras: formatting for REVERT opcode
OlivierBBB May 15, 2025
1db730a
feat: remove deprecated TYPE_1/2/3/4/5 MXP instructions
OlivierBBB May 15, 2025
0ffc721
ras
OlivierBBB May 15, 2025
0c5b416
rebase + use folders for mxp fork + merge hub files
amkCha Jun 16, 2025
bd122a7
fix module mxp names
amkCha Jun 17, 2025
4c7e1b9
fix rebase issues: mtntop, type-4, extra files
amkCha Jun 17, 2025
4e1fa22
hub into mxp pending
amkCha Jun 17, 2025
0fc86d0
fix makefile
amkCha Jun 17, 2025
ec6b376
fix: Makefile
amkCha Jun 18, 2025
598d0c1
rebase master
amkCha Jun 18, 2025
1c4a62b
update Makefile
amkCha Jun 19, 2025
31e8852
fix: typos, computation naming, may_trigger_mmu removal
amkCha Jun 24, 2025
f96e50c
fix: guard for byte pricing
amkCha Jun 24, 2025
7f2b445
feat: hub_into_mxp cancun and lookup cleanup
amkCha Jun 26, 2025
09804fb
feat: update hub_into_instruction_decoder
amkCha Jun 26, 2025
307c929
fix: shorthand naming, rearrange constants
amkCha Jun 26, 2025
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
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ LOG_INFO := loginfo

MMU := mmu

MMIO := mmio
MMIO := mmio

MXP := mxp
MXP_LONDON := mxp/london

MXP_CANCUN := mxp/cancun

OOB_LONDON := oob/london

Expand Down Expand Up @@ -123,27 +125,31 @@ ZKEVM_MODULES_COMMON := ${CONSTANTS} \
ZKEVM_MODULES_LONDON := ${ZKEVM_MODULES_COMMON} \
${BLOCKDATA_LONDON} \
${HUB_LONDON} \
${MXP_LONDON} \
${OOB_LONDON} \
${INST_DECODER_LONDON} \
${TXN_DATA_LONDON}

ZKEVM_MODULES_PARIS := ${ZKEVM_MODULES_COMMON} \
${BLOCKDATA_PARIS} \
${HUB_LONDON} \
${MXP_LONDON} \
${OOB_LONDON} \
${INST_DECODER_LONDON} \
${TXN_DATA_LONDON}

ZKEVM_MODULES_SHANGHAI := ${ZKEVM_MODULES_COMMON} \
${BLOCKDATA_PARIS} \
${HUB_SHANGHAI} \
${MXP_LONDON} \
${OOB_SHANGHAI} \
${INST_DECODER_LONDON} \
${TXN_DATA_SHANGHAI}

ZKEVM_MODULES_CANCUN := ${ZKEVM_MODULES_COMMON} \
${BLOCKDATA_CANCUN} \
${HUB_CANCUN} \
${MXP_CANCUN} \
${OOB_SHANGHAI} \
${INST_DECODER_CANCUN} \
${TXN_DATA_CANCUN}
Expand Down
5 changes: 2 additions & 3 deletions constants/constants.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
;; Transient Operations ;; appear in Cancun (EIP-1153)
EVM_INST_TLOAD 0x5C
EVM_INST_TSTORE 0x5D
EVM_INST_MCOPY 0x5E
;; Push Operations
EVM_INST_PUSH0 0x5F ;; post Shanghai
EVM_INST_PUSH1 0x60
Expand Down Expand Up @@ -508,6 +509,4 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
WCP_INST_GEQ 0x0E
WCP_INST_LEQ 0x0F)


WCP_INST_LEQ 0x0F)
1 change: 0 additions & 1 deletion hub/cancun/columns/miscellaneous.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
( MXP_SIZE_2_LO :i128 )
( MXP_WORDS :i128 )
( MXP_GAS_MXP :i128 )
( MXP_MTNTOP :binary@prove )
( MXP_SIZE_1_NONZERO_NO_MXPX :binary@prove )
( MXP_SIZE_2_NONZERO_NO_MXPX :binary@prove )

Expand Down
1 change: 1 addition & 0 deletions hub/cancun/columns/stack.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
( CALL_FLAG :binary )
( CON_FLAG :binary )
( COPY_FLAG :binary )
( MCOPY_FLAG :binary )
( CREATE_FLAG :binary )
( DUP_FLAG :binary )
( EXT_FLAG :binary )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@

(defconstraint call-instruction---setting-MXP-instruction-parameters (:guard (call-instruction---standard-precondition))
(if-not-zero (shift misc/MXP_FLAG CALL_misc_row___row_offset)
(set-MXP-instruction-type-5 CALL_misc_row___row_offset ;; row offset kappa
(call-instruction---STACK-instruction) ;; instruction
(call-instruction---STACK-cdo-hi) ;; call data offset high
(call-instruction---STACK-cdo-lo) ;; call data offset low
(call-instruction---STACK-cds-hi) ;; call data size high
(call-instruction---STACK-cds-lo) ;; call data size low
(call-instruction---STACK-r@o-hi) ;; return at offset high
(call-instruction---STACK-r@o-lo) ;; return at offset low
(call-instruction---STACK-r@c-hi) ;; return at capacity high
(call-instruction---STACK-r@c-lo) ;; return at capacity low
)
(set-MXP-instruction---for-CALL-type CALL_misc_row___row_offset ;; row offset kappa
(call-instruction---STACK-instruction) ;; instruction
(call-instruction---STACK-cdo-hi) ;; call data offset high
(call-instruction---STACK-cdo-lo) ;; call data offset low
(call-instruction---STACK-cds-hi) ;; call data size high
(call-instruction---STACK-cds-lo) ;; call data size low
(call-instruction---STACK-r@o-hi) ;; return at offset high
(call-instruction---STACK-r@o-lo) ;; return at offset low
(call-instruction---STACK-r@c-hi) ;; return at capacity high
(call-instruction---STACK-r@c-lo) ;; return at capacity low
)
))

(defconstraint call-instruction---justifying-mxpx (:guard (call-instruction---standard-precondition))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@

(defun (copy-instruction---trigger_OOB) (copy-instruction---is-RETURNDATACOPY))
(defun (copy-instruction---trigger_MXP) (- 1 stack/RDCX))
(defun (copy-instruction---trigger_MMU) (* (- 1 XAHOY) (shift misc/MXP_MTNTOP ROFF_COPY_INST_MISCELLANEOUS_ROW)))
(defun (copy-instruction---trigger_MMU) (* (- 1 XAHOY) (shift misc/MXP_SIZE_1_NONZERO_NO_MXPX ROFF_COPY_INST_MISCELLANEOUS_ROW)))

(defconstraint copy-instruction---misc-row---setting-OOB-instruction (:guard (copy-instruction---standard-precondition))
(if-not-zero (shift misc/OOB_FLAG ROFF_COPY_INST_MISCELLANEOUS_ROW)
Expand All @@ -178,13 +178,13 @@

(defconstraint copy-instruction---misc-row---setting-MXP-instruction (:guard (copy-instruction---standard-precondition))
(if-not-zero (shift misc/MXP_FLAG ROFF_COPY_INST_MISCELLANEOUS_ROW)
(set-MXP-instruction-type-4 ROFF_COPY_INST_MISCELLANEOUS_ROW ;; row offset kappa
stack/INSTRUCTION ;; instruction
0 ;; deploys (bit modifying the behaviour of RETURN pricing)
(copy-instruction---target-offset-hi) ;; offset high
(copy-instruction---target-offset-lo) ;; offset low
(copy-instruction---size-hi) ;; size high
(copy-instruction---size-lo)))) ;; size low
(set-MXP-instruction---single-mxp-offset-instructions ROFF_COPY_INST_MISCELLANEOUS_ROW ;; row offset kappa
stack/INSTRUCTION ;; instruction
0 ;; deploys (bit modifying the behaviour of RETURN pricing)
(copy-instruction---target-offset-hi) ;; offset high
(copy-instruction---target-offset-lo) ;; offset low
(copy-instruction---size-hi) ;; size high
(copy-instruction---size-lo)))) ;; size low

(defconstraint copy-instruction---misc-row---setting-MXPX (:guard (copy-instruction---standard-precondition))
(if-zero (shift misc/MXP_FLAG ROFF_COPY_INST_MISCELLANEOUS_ROW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@

(defconstraint create-instruction---setting-the-MXP-instruction (:guard (create-instruction---generic-precondition))
(if-not-zero (shift misc/MXP_FLAG CREATE_miscellaneous_row___row_offset)
(set-MXP-instruction-type-4 CREATE_miscellaneous_row___row_offset ;; row offset kappa
(create-instruction---instruction) ;; instruction
0 ;; bit modifying the behaviour of RETURN pricing
(create-instruction---STACK-offset-hi) ;; offset high
(create-instruction---STACK-offset-lo) ;; offset low
(create-instruction---STACK-size-hi) ;; size high
(create-instruction---STACK-size-lo)) ;; size low
))
(set-MXP-instruction---single-mxp-offset-instructions CREATE_miscellaneous_row___row_offset ;; row offset kappa
(create-instruction---instruction) ;; instruction
0 ;; bit modifying the behaviour of RETURN pricing
(create-instruction---STACK-offset-hi) ;; offset high
(create-instruction---STACK-offset-lo) ;; offset low
(create-instruction---STACK-size-hi) ;; size high
(create-instruction---STACK-size-lo)) ;; size low
))

(defconstraint create-instruction---setting-the-memory-expansion-exception (:guard (create-instruction---generic-precondition))
(if-zero (shift misc/MXP_FLAG CREATE_miscellaneous_row___row_offset)
Expand Down Expand Up @@ -136,7 +136,7 @@
(:guard (create-instruction---generic-precondition))
(if-not-zero (scenario-shorthand---CREATE---not-rebuffed)
(eq! (scenario-shorthand---CREATE---not-rebuffed-nonempty-init-code)
(create-instruction---MXP-mtntop))))
(create-instruction---MXP-s1nznomxpx))))

(defconstraint create-instruction---setting-the-CREATE-scenario---not-rebuffed-nonempty-init-code
(:guard (create-instruction---generic-precondition))
Expand Down Expand Up @@ -202,4 +202,4 @@
(if-not-zero (scenario-shorthand---CREATE---failure-condition) (eq! GAS_NEXT (- GAS_ACTUAL (create-instruction---full-gas-cost))))
(if-not-zero (scenario-shorthand---CREATE---not-rebuffed-empty-init-code) (eq! GAS_NEXT (- GAS_ACTUAL (create-instruction---upfront-gas-cost))))
(if-not-zero (scenario-shorthand---CREATE---not-rebuffed-nonempty-init-code) (eq! GAS_NEXT (- GAS_ACTUAL (create-instruction---full-gas-cost))))
))
))
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
(defun (create-instruction---OOB-failure-condition) (shift [misc/OOB_DATA 8] CREATE_miscellaneous_row___row_offset))
(defun (create-instruction---MXP-mxpx) (shift misc/MXP_MXPX CREATE_miscellaneous_row___row_offset))
(defun (create-instruction---MXP-gas) (shift misc/MXP_GAS_MXP CREATE_miscellaneous_row___row_offset))
(defun (create-instruction---MXP-mtntop) (shift misc/MXP_MTNTOP CREATE_miscellaneous_row___row_offset))
(defun (create-instruction---MXP-s1nznomxpx) (shift misc/MXP_SIZE_1_NONZERO_NO_MXPX CREATE_miscellaneous_row___row_offset))
(defun (create-instruction---STP-gas-paid-out-of-pocket) (shift misc/STP_GAS_PAID_OUT_OF_POCKET CREATE_miscellaneous_row___row_offset))
(defun (create-instruction---STP-oogx) (shift misc/STP_OOGX CREATE_miscellaneous_row___row_offset))
(defun (create-instruction---compute-createe-address) (shift account/RLPADDR_FLAG CREATE_first_creator_account_row___row_offset))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

(defun (create-instruction---trigger_HASHINFO) (* (create-instruction---is-CREATE2)
(+ (* (scenario-shorthand---CREATE---failure-condition)
(create-instruction---MXP-mtntop))
(create-instruction---MXP-s1nznomxpx))
(scenario-shorthand---CREATE---not-rebuffed-nonempty-init-code))))

(defun (create-instruction---trigger_RLPADDR) (scenario-shorthand---CREATE---compute-deployment-address))
Expand All @@ -42,7 +42,7 @@

;; auxiliary shorthands required for (create-instruction---trigger_MMU)
(defun (create-instruction---hash-init-code) (* (scenario-shorthand---CREATE---failure-condition)
(create-instruction---MXP-mtntop)
(create-instruction---MXP-s1nznomxpx)
(create-instruction---is-CREATE2)))

(defun (create-instruction---hash-init-code-and-send-to-ROM) (* (scenario-shorthand---CREATE---not-rebuffed-nonempty-init-code)
Expand Down
Loading
Loading