Skip to content
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
36 changes: 29 additions & 7 deletions src/lib/mina_base/account_update.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1087,13 +1087,35 @@ module Body = struct
let hash_fold_array f init x = Array.fold ~init ~f x

module Events' = struct
(* NOTE: in the "Increase events&actions Limit MIP", we claimed that the
limit is unbounded, the reason we're still using [Bounded_types.ArrayN],
lies in that the serialization of this type is a bit different from a
normal array. Setting the array size limit to [max_event_elements] remove
the limit on event level in practice. Same goes for types in[Actions']. *)
module Bounded = Mina_stdlib.Bounded_types.ArrayN (struct
let max_array_len = Node_config.max_event_elements
end)

[%%versioned
module Stable = struct
module V1 = struct
type t =
Pickles.Backend.Tick.Field.Stable.V1.t
Mina_stdlib.Bounded_types.ArrayN16.Stable.V1.t
list
type t = Pickles.Backend.Tick.Field.Stable.V1.t Bounded.Stable.V1.t list
[@@deriving sexp, equal, hash, compare, yojson]

let to_latest = Fn.id
end
end]
end

module Actions' = struct
module Bounded = Mina_stdlib.Bounded_types.ArrayN (struct
let max_array_len = Node_config.max_action_elements
end)

[%%versioned
module Stable = struct
module V1 = struct
type t = Pickles.Backend.Tick.Field.Stable.V1.t Bounded.Stable.V1.t list
[@@deriving sexp, equal, hash, compare, yojson]

let to_latest = Fn.id
Expand All @@ -1113,7 +1135,7 @@ module Body = struct
(Amount.Stable.V1.t, Sgn.Stable.V1.t) Signed_poly.Stable.V1.t
; increment_nonce : bool
; events : Events'.Stable.V1.t
; actions : Events'.Stable.V1.t
; actions : Actions'.Stable.V1.t
; call_data : Pickles.Backend.Tick.Field.Stable.V1.t
; call_depth : int
; preconditions : Preconditions.Stable.V1.t
Expand Down Expand Up @@ -1171,7 +1193,7 @@ module Body = struct
(Amount.Stable.V1.t, Sgn.Stable.V1.t) Signed_poly.Stable.V1.t
; increment_nonce : bool
; events : Events'.Stable.V1.t
; actions : Events'.Stable.V1.t
; actions : Actions'.Stable.V1.t
; call_data : Pickles.Backend.Tick.Field.Stable.V1.t
; call_depth : int
; preconditions : Preconditions.Stable.V1.t
Expand All @@ -1198,7 +1220,7 @@ module Body = struct
(Amount.Stable.V1.t, Sgn.Stable.V1.t) Signed_poly.Stable.V1.t
; increment_nonce : bool
; events : Events'.Stable.V1.t
; actions : Events'.Stable.V1.t
; actions : Actions'.Stable.V1.t
; call_data : Pickles.Backend.Tick.Field.Stable.V1.t
; preconditions : Preconditions.Stable.V1.t
; use_full_commitment : bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ let zkapp_signed_single_update_cost = 9.14

let zkapp_transaction_cost_limit = 69.45

let max_event_elements = 100
let max_event_elements = 1024

let max_action_elements = 100
let max_action_elements = 1024

let zkapp_cmd_limit_hardcap = 128

Expand Down