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

Extra scenario/CREATE shorthand #528

Merged
merged 5 commits into from
Dec 5, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@
(create-instruction---MXP-gas) ;; memory expansion gas
)))

(defconstraint create-instruction---setting-the-out-of-gas-exception (:guard (create-instruction---generic-precondition))
(defconstraint create-instruction---setting-the-out-of-gas-exception
(:guard (create-instruction---generic-precondition))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if-zero (shift misc/STP_FLAG CREATE_miscellaneous_row___row_offset)
;; STP_FLAG ≡ 0
(vanishes! (create-instruction---STACK-oogx))
Expand All @@ -83,10 +85,9 @@
(create-instruction---STP-oogx))
))

(defun (create-instruction---createe-nonce) (* (create-instruction---trigger_RLPADDR) (shift account/NONCE CREATE_first_createe_account_row___row_offset)))
(defun (create-instruction---createe-has-code) (* (create-instruction---trigger_RLPADDR) (shift account/HAS_CODE CREATE_first_createe_account_row___row_offset)))

(defconstraint create-instruction---setting-the-OOB-instruction (:guard (create-instruction---generic-precondition))
(defconstraint create-instruction---setting-the-OOB-instruction
(:guard (create-instruction---generic-precondition))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if-not-zero (shift misc/OOB_FLAG CREATE_miscellaneous_row___row_offset)
(set-OOB-instruction---create CREATE_miscellaneous_row___row_offset ;; offset
(create-instruction---STACK-value-hi) ;; value (high part)
Expand All @@ -98,6 +99,9 @@
(create-instruction---creator-nonce) ;; creator account nonce
)))

(defun (create-instruction---createe-nonce) (* (scenario-shorthand---CREATE---load-createe-account) (shift account/NONCE CREATE_first_createe_account_row___row_offset)))
(defun (create-instruction---createe-has-code) (* (scenario-shorthand---CREATE---load-createe-account) (shift account/HAS_CODE CREATE_first_createe_account_row___row_offset)))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

new shorthand replaces the old one

(defconstraint create-instruction---setting-the-CREATE-scenario---exceptional
(:guard (create-instruction---generic-precondition))
(eq! scenario/CREATE_EXCEPTION XAHOY))
Expand Down
7 changes: 7 additions & 0 deletions hub/constraints/scenario-rows/shorthands/create.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@
(scenario-shorthand---CREATE---not-rebuffed)
))

;;  CREATE/load_createe_account
(defun (scenario-shorthand---CREATE---load-createe-account)
(+
(scenario-shorthand---CREATE---failure-condition)
(scenario-shorthand---CREATE---not-rebuffed)
))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New shorthand

;;  CREATE/no_context_change
(defun (scenario-shorthand---CREATE---no-context-change)
(+
Expand Down
Loading