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

Disable zkapp commands implementation #14885

Merged
merged 15 commits into from
Jan 25, 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
10 changes: 10 additions & 0 deletions src/lib/mina_base/user_command.ml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ let minimum_fee = Currency.Fee.minimum_user_command_fee

let has_insufficient_fee t = Currency.Fee.(fee t < minimum_fee)

let is_disabled = function
| Zkapp_command _ ->
Mina_compile_config.zkapps_disabled
| _ ->
false

(* always `Accessed` for fee payer *)
let accounts_accessed (t : t) (status : Transaction_status.t) :
(Account_id.t * [ `Accessed | `Not_accessed ]) list =
Expand Down Expand Up @@ -396,6 +402,7 @@ module Well_formedness_error = struct
| Insufficient_fee
| Zero_vesting_period
| Zkapp_too_big of (Error.t[@to_yojson Error_json.error_to_yojson])
| Transaction_type_disabled
| Incompatible_version
[@@deriving compare, to_yojson, sexp]

Expand All @@ -408,6 +415,8 @@ module Well_formedness_error = struct
sprintf "Zkapp too big (%s)" (Error.to_string_hum err)
| Incompatible_version ->
"Set verification-key permission is updated to an incompatible version"
| Transaction_type_disabled ->
"Transaction type disabled"
end

let check_well_formedness ~genesis_constants t :
Expand All @@ -417,6 +426,7 @@ let check_well_formedness ~genesis_constants t :
[ (has_insufficient_fee, Insufficient_fee)
; (has_zero_vesting_period, Zero_vesting_period)
; (is_incompatible_version, Incompatible_version)
; (is_disabled, Transaction_type_disabled)
]
in
let errs0 =
Expand Down
2 changes: 2 additions & 0 deletions src/lib/mina_compile_config/mina_compile_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,5 @@ let zkapp_cmd_limit = Some zkapp_cmd_limit
[%%endif]

let zkapp_cmd_limit_hardcap = 128

let zkapps_disabled = false