diff --git a/src/proto_alpha/lib_protocol/contract_storage.ml b/src/proto_alpha/lib_protocol/contract_storage.ml index 4e17ed75ccb66d1196853e61327d6246276f9c05..4fd545b2068eac26c67eda9370ce5288ec1b1647 100644 --- a/src/proto_alpha/lib_protocol/contract_storage.ml +++ b/src/proto_alpha/lib_protocol/contract_storage.ml @@ -441,10 +441,18 @@ let delete c contract = do not exist). An implicit contract deletion should not cost extra gas. *) Contract_delegate_storage.unlink c contract >>=? fun c -> - Storage.Contract.Spendable_balance.remove_existing c contract - >>=? fun c -> - Contract_manager_storage.remove_existing c contract >>=? fun c -> - Storage.Contract.Counter.remove_existing c contract + Storage.Contract.with_local_context + ~add_back:true + c + contract + (fun local -> + Storage.Contract.Spendable_balance.Local.remove_existing local () + >>=? fun local -> + Storage.Contract.Manager.Local.remove_existing local () + >>=? fun local -> + Storage.Contract.Counter.Local.remove_existing local () + >|=? fun local -> (local, ())) + >|=? fun (c, ()) -> c let allocated c contract = Storage.Contract.Spendable_balance.mem c contract diff --git a/src/proto_alpha/lib_protocol/lazy_storage_diff.ml b/src/proto_alpha/lib_protocol/lazy_storage_diff.ml index 791b3f828448f71a918fbe489b848a6e4e559c6b..7ad9016e67eb649d55ea3ed39cdc9610dd93e9e4 100644 --- a/src/proto_alpha/lib_protocol/lazy_storage_diff.ml +++ b/src/proto_alpha/lib_protocol/lazy_storage_diff.ml @@ -118,7 +118,8 @@ module Big_map = struct Storage.Big_map.Key_type.init ctxt id key_type >>=? fun ctxt -> Storage.Big_map.Value_type.init ctxt id value_type - let apply_update ctxt ~id + (* [local_ctxt] points to the directory of the big_map *) + let apply_update local_ctxt { key = _key_is_shown_only_on_the_receipt_in_print_big_map_diff; key_hash; @@ -126,27 +127,32 @@ module Big_map = struct } = match value with | None -> - Storage.Big_map.Contents.remove (ctxt, id) key_hash - >|=? fun (ctxt, freed, existed) -> + Storage.Big_map.Contents.Local.remove local_ctxt key_hash + >|=? fun (local_ctxt, freed, existed) -> let freed = if existed then freed + bytes_size_for_big_map_key else freed in - (ctxt, Z.of_int ~-freed) + (local_ctxt, Z.of_int ~-freed) | Some v -> - Storage.Big_map.Contents.add (ctxt, id) key_hash v - >|=? fun (ctxt, size_diff, existed) -> + Storage.Big_map.Contents.Local.add local_ctxt key_hash v + >|=? fun (local_ctxt, size_diff, existed) -> let size_diff = if existed then size_diff else size_diff + bytes_size_for_big_map_key in - (ctxt, Z.of_int size_diff) + (local_ctxt, Z.of_int size_diff) let apply_updates ctxt ~id updates = - List.fold_left_es - (fun (ctxt, size) update -> - apply_update ctxt ~id update >|=? fun (ctxt, added_size) -> - (ctxt, Z.add size added_size)) - (ctxt, Z.zero) - updates + Storage.Big_map.Contents.with_local_context + ~add_back:true + (ctxt, id) + (fun local_ctxt -> + List.fold_left_es + (fun (local_ctxt, size) update -> + apply_update local_ctxt update >|=? fun (local_ctxt, added_size) -> + (local_ctxt, Z.add size added_size)) + (local_ctxt, Z.zero) + updates) + >|=? fun ((ctxt, _id), size_diff) -> (ctxt, size_diff) include Storage.Big_map end diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index a34b0145576cbea7c545515a79ace8e55dadbc1c..960075715f1bd0290d0a5084fb4dd739f67e1fbc 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1553,3 +1553,108 @@ module Dal = struct let shards ctxt ~endorser = compute_shards ~index:0 ctxt ~endorser end + +(* The type for relative context accesses instead from the root. In order for + the carbonated storage functions to consume the gas, this has gas infomation +*) +type local_context = { + tree : tree; + path : key; + remaining_operation_gas : Gas_limit_repr.Arith.fp; + unlimited_operation_gas : bool; +} + +let with_local_context ~add_back ctxt key f = + (find_tree ctxt key >|= function None -> Tree.empty ctxt | Some tree -> tree) + >>= fun tree -> + let local_ctxt = + { + tree; + path = key; + remaining_operation_gas = remaining_operation_gas ctxt; + unlimited_operation_gas = unlimited_operation_gas ctxt; + } + in + f local_ctxt >>=? fun (local_ctxt, res) -> + (if add_back then add_tree ctxt key local_ctxt.tree else Lwt.return ctxt) + >|= fun ctxt -> + update_remaining_operation_gas ctxt local_ctxt.remaining_operation_gas + |> fun ctxt -> + update_unlimited_operation_gas ctxt local_ctxt.unlimited_operation_gas + |> fun ctxt -> ok (ctxt, res) + +module Local = struct + type t = local_context + + type context = t + + type nonrec key = key + + type nonrec value = value + + let consume_gas local cost = + match Gas_limit_repr.raw_consume local.remaining_operation_gas cost with + | Some gas_counter -> Ok {local with remaining_operation_gas = gas_counter} + | None -> + if local.unlimited_operation_gas then ok local + else error Operation_quota_exceeded + + let tree local = local.tree + + let update_root_tree local tree = {local with tree} + + let absolute_key local key = local.path @ key + + let find local = Tree.find (tree local) + + let find_tree local = Tree.find_tree (tree local) + + let mem local = Tree.mem (tree local) + + let mem_tree local = Tree.mem_tree (tree local) + + let get local = Tree.get (tree local) + + let get_tree local = Tree.get_tree (tree local) + + let update local key b = + Tree.update (tree local) key b >|=? update_root_tree local + + let update_tree local key b = + Tree.update_tree (tree local) key b >|=? update_root_tree local + + let init local key b = + Tree.init (tree local) key b >|=? update_root_tree local + + let init_tree local key t = + Tree.init_tree (tree local) key t >|=? update_root_tree local + + let add local i b = Tree.add (tree local) i b >|= update_root_tree local + + let add_tree local i t = + Tree.add_tree (tree local) i t >|= update_root_tree local + + let remove local i = Tree.remove (tree local) i >|= update_root_tree local + + let remove_existing local key = + Tree.remove_existing (tree local) key >|=? update_root_tree local + + let remove_existing_tree local key = + Tree.remove_existing_tree (tree local) key >|=? update_root_tree local + + let add_or_remove local key vopt = + Tree.add_or_remove (tree local) key vopt >|= update_root_tree local + + let add_or_remove_tree local key topt = + Tree.add_or_remove_tree (tree local) key topt >|= update_root_tree local + + let fold ?depth local key ~order ~init ~f = + Tree.fold ?depth (tree local) key ~order ~init ~f + + let list local ?offset ?length key = + Tree.list (tree local) ?offset ?length key + + let config local = Tree.config (tree local) + + let length local i = Tree.length (tree local) i +end diff --git a/src/proto_alpha/lib_protocol/raw_context.mli b/src/proto_alpha/lib_protocol/raw_context.mli index eef60d8c3117c1c550ed074203bf4586e57f8273..f261d227478ab8dc969a3adfe0b41c5a9c2d5ebb 100644 --- a/src/proto_alpha/lib_protocol/raw_context.mli +++ b/src/proto_alpha/lib_protocol/raw_context.mli @@ -181,6 +181,8 @@ type value = bytes type tree +type local_context + module type T = Raw_context_intf.T with type root := root @@ -188,7 +190,7 @@ module type T = and type value := value and type tree := tree -include T with type t := t +include T with type t := t and type local_context := local_context (** Initialize the local nonce used for preventing a script to duplicate an internal operation to replay it. *) diff --git a/src/proto_alpha/lib_protocol/raw_context_intf.ml b/src/proto_alpha/lib_protocol/raw_context_intf.ml index 39c8b058d78aa7a682d24b1d8e9095c4cb5a2645..9d838cd12d713db72f48d64c3b8691dc69304038 100644 --- a/src/proto_alpha/lib_protocol/raw_context_intf.ml +++ b/src/proto_alpha/lib_protocol/raw_context_intf.ml @@ -559,4 +559,44 @@ module type T = sig val check_enough_gas : t -> Gas_limit_repr.cost -> unit tzresult val description : t Storage_description.t + + (** The type for local context accesses instead from the root. In order for + the carbonated storage functions to consume the gas, this has gas + infomation *) + type local_context + + (** + Use for local access from the directory of [key]. + If you want to write access, set [add_back] to [true]. + Otherwise, the written content will be ignored. + *) + val with_local_context : + add_back:bool -> + t -> + key -> + (local_context -> (local_context * 'a) tzresult Lwt.t) -> + (t * 'a) tzresult Lwt.t + + module Local : sig + (** [Local] provides functions for local access from a specific + directory. *) + include + VIEW + with type t = local_context + and type tree := tree + and type key = key + and type value = value + + type context = t + + (** Internally used in {!Storage_functors} to consume gas from + within a view. May raise {!Block_quota_exceeded} or + {!Operation_quota_exceeded}. *) + val consume_gas : + local_context -> Gas_limit_repr.cost -> local_context tzresult + + (** Internally used in {!Storage_functors} to retrieve a full key + from partial key relative a view. *) + val absolute_key : local_context -> key -> key + end end diff --git a/src/proto_alpha/lib_protocol/storage.ml b/src/proto_alpha/lib_protocol/storage.ml index 637404e7263f23e9e5c08844b89d3e15dfae2693..1aa843130b395ac1e03cf1065afc03544c932dd1 100644 --- a/src/proto_alpha/lib_protocol/storage.ml +++ b/src/proto_alpha/lib_protocol/storage.ml @@ -188,6 +188,10 @@ module Contract = struct let list = Indexed_context.keys + type local_context = Indexed_context.local_context + + let with_local_context = Indexed_context.with_local_context + module Spendable_balance = Indexed_context.Make_map (struct @@ -252,7 +256,9 @@ module Contract = struct Storage_sigs.Non_iterable_indexed_carbonated_data_storage with type key = Contract_repr.t and type value = Script_repr.lazy_expr - and type t := Raw_context.t = struct + and type t := Raw_context.t + and type local_context = Counter.local_context + and type Local.key = unit = struct module I = Indexed_context.Make_carbonated_map (N) @@ -314,6 +320,12 @@ module Contract = struct I.add ctxt contract value let keys_unaccounted = I.keys_unaccounted + + type local_context = I.local_context + + let with_local_context = I.with_local_context + + module Local = I.Local end module Code = Make_carbonated_map_expr (struct @@ -387,7 +399,7 @@ end module Global_constants = struct module Map : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type t := Raw_context.t and type key = Script_expr_hash.t and type value = Script_repr.expr = @@ -498,6 +510,8 @@ module Big_map = struct type context = I.context + type local_context = I.local_context + type key = I.key type value = I.value @@ -539,6 +553,33 @@ module Big_map = struct consume_deserialize_gas ctxt value >|? fun ctxt -> (ctxt, value_opt) let keys_unaccounted = I.keys_unaccounted + + let with_local_context = I.with_local_context + + module Local = struct + include I.Local + + let consume_deserialize_gas local_ctxt value = + Raw_context.Local.consume_gas + local_ctxt + (Script_repr.deserialized_cost value) + + let get local_ctxt contract = + I.Local.get local_ctxt contract >>=? fun (local_ctxt, value) -> + Lwt.return + ( consume_deserialize_gas local_ctxt value >|? fun local_ctxt -> + (local_ctxt, value) ) + + let find local_ctxt contract = + I.Local.find local_ctxt contract >>=? fun (local_ctxt, value_opt) -> + Lwt.return + @@ + match value_opt with + | None -> ok (local_ctxt, None) + | Some value -> + consume_deserialize_gas local_ctxt value >|? fun local_ctxt -> + (local_ctxt, value_opt) + end end end @@ -605,7 +646,7 @@ module Sapling = struct (Sapling_repr.Memo_size) module Commitments : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type t := Raw_context.t * id and type key = int64 and type value = Sapling.Hash.t = @@ -653,7 +694,7 @@ module Sapling = struct >|= fun (ctx, _id) -> ctx module Ciphertexts : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type t := Raw_context.t * id and type key = int64 and type value = Sapling.Ciphertext.t = @@ -1238,11 +1279,14 @@ module Seed = struct Non_iterable_indexed_data_storage with type key := Level_repr.t and type value := nonce_status - and type t := Raw_context.t = struct + and type t := Raw_context.t + and type Local.key = Level_repr.t = struct open Level_repr type context = Raw_context.t + type local_context = Cycle.Nonce.Local.t + let mem ctxt (l : Level_repr.t) = Cycle.Nonce.mem (ctxt, l.cycle) l.level let get ctxt (l : Level_repr.t) = Cycle.Nonce.get (ctxt, l.cycle) l.level @@ -1266,6 +1310,34 @@ module Seed = struct let remove ctxt (l : Level_repr.t) = Cycle.Nonce.remove (ctxt, l.cycle) l.level + + module Local = struct + type t = local_context + + type context = t + + type key = Level_repr.t + + let mem c (l : Level_repr.t) = Cycle.Nonce.Local.mem c l.level + + let get c (l : Level_repr.t) = Cycle.Nonce.Local.get c l.level + + let find c (l : Level_repr.t) = Cycle.Nonce.Local.find c l.level + + let update c (l : Level_repr.t) v = Cycle.Nonce.Local.update c l.level v + + let init c (l : Level_repr.t) v = Cycle.Nonce.Local.init c l.level v + + let add c (l : Level_repr.t) v = Cycle.Nonce.Local.add c l.level v + + let add_or_remove c (l : Level_repr.t) v = + Cycle.Nonce.Local.add_or_remove c l.level v + + let remove_existing c (l : Level_repr.t) = + Cycle.Nonce.Local.remove_existing c l.level + + let remove c (l : Level_repr.t) = Cycle.Nonce.Local.remove c l.level + end end module VDF_setup = @@ -1567,6 +1639,37 @@ module Sc_rollup = struct key -> value option -> (Raw_context.t * int * bool) tzresult Lwt.t + + module Local : sig + type t + + type context + + type key + + val mem : context -> key -> (context * bool) tzresult Lwt.t + + val remove : context -> key -> (context * int * bool) tzresult Lwt.t + + val remove_existing : context -> key -> (context * int) tzresult Lwt.t + + val get : context -> key -> (context * value) tzresult Lwt.t + + val find : context -> key -> (context * value option) tzresult Lwt.t + + val update : context -> key -> value -> (context * int) tzresult Lwt.t + + val init : context -> key -> value -> (context * int) tzresult Lwt.t + + val add : + context -> key -> value -> (context * int * bool) tzresult Lwt.t + + val add_or_remove : + context -> + key -> + value option -> + (context * int * bool) tzresult Lwt.t + end end) = struct include Data_storage @@ -1592,6 +1695,27 @@ module Sc_rollup = struct let add_or_remove ctxt key value = add_or_remove ctxt key (Option.map Versioned_value.to_versioned value) + + module Local = struct + include Data_storage.Local + + let get c key = + get c key >|=? fun (c, versioned) -> + (c, Versioned_value.of_versioned versioned) + + let find c key = + find c key >|=? fun (c, versioned) -> + (c, Option.map Versioned_value.of_versioned versioned) + + let update c key value = update c key (Versioned_value.to_versioned value) + + let init c key value = init c key (Versioned_value.to_versioned value) + + let add c key value = add c key (Versioned_value.to_versioned value) + + let add_or_remove c key value = + add_or_remove c key (Option.map Versioned_value.to_versioned value) + end end module PVM_kind = diff --git a/src/proto_alpha/lib_protocol/storage.mli b/src/proto_alpha/lib_protocol/storage.mli index c4c00f28d58f8399c3603045adb723dea0d9a467..7d9bc026ff6494311b08128c7fc0bf857bcdced1 100644 --- a/src/proto_alpha/lib_protocol/storage.mli +++ b/src/proto_alpha/lib_protocol/storage.mli @@ -69,6 +69,15 @@ module Contract : sig val list : Raw_context.t -> Contract_repr.t list Lwt.t + type local_context + + val with_local_context : + add_back:bool -> + Raw_context.t -> + Contract_repr.t -> + (local_context -> (local_context * 'a) tzresult Lwt.t) -> + (Raw_context.t * 'a) tzresult Lwt.t + (** The tez possessed by a contract and that can be used. A contract may also possess tez in frozen deposits. Empty balances (of zero tez) are only allowed for originated contracts, not for implicit @@ -78,6 +87,8 @@ module Contract : sig with type key = Contract_repr.t and type value = Tez_repr.t and type t := Raw_context.t + and type local_context = local_context + and type Local.key := unit (** If the value is not set, the delegate didn't miss any endorsing opportunity. If it is set, this value is a record of type @@ -96,6 +107,7 @@ module Contract : sig with type key = Contract_repr.t and type value = missed_endorsements_info and type t := Raw_context.t + and type Local.key := unit (** The manager of a contract *) module Manager : @@ -103,6 +115,8 @@ module Contract : sig with type key = Contract_repr.t and type value = Manager_repr.t and type t := Raw_context.t + and type local_context := local_context + and type Local.key := unit (** The delegate of a contract, if any. *) module Delegate : @@ -110,6 +124,7 @@ module Contract : sig with type key = Contract_repr.t and type value = Signature.Public_key_hash.t and type t := Raw_context.t + and type Local.key := unit (** All contracts (implicit and originated) that are delegated, if any *) module Delegated : @@ -127,6 +142,7 @@ module Contract : sig with type key = Contract_repr.t and type value = deposits and type t := Raw_context.t + and type Local.key := unit (** If there is a value, the frozen balance for the contract won't exceed it (starting in preserved_cycles + 1). *) @@ -135,6 +151,7 @@ module Contract : sig with type key = Contract_repr.t and type value = Tez_repr.t and type t := Raw_context.t + and type Local.key := unit module Inactive_delegate : Data_set_storage with type elt = Contract_repr.t and type t = Raw_context.t @@ -146,12 +163,15 @@ module Contract : sig with type key = Contract_repr.t and type value = Cycle_repr.t and type t := Raw_context.t + and type Local.key := unit module Counter : Indexed_data_storage with type key = Contract_repr.t and type value = Z.t and type t := Raw_context.t + and type local_context := local_context + and type Local.key := unit module Code : Non_iterable_indexed_carbonated_data_storage @@ -172,6 +192,7 @@ module Contract : sig with type key = Contract_repr.t and type value = Z.t and type t := Raw_context.t + and type Local.key := unit (** Maximal space available without needing to burn new fees. *) module Paid_storage_space : @@ -179,6 +200,7 @@ module Contract : sig with type key = Contract_repr.t and type value = Z.t and type t := Raw_context.t + and type Local.key := unit (** Associates a contract and a bond_id with a bond, i.e. an amount of tez that is frozen. *) @@ -201,6 +223,7 @@ module Contract : sig with type key = Contract_repr.t and type value = Tez_repr.t and type t := Raw_context.t + and type Local.key := unit end module Big_map : sig @@ -232,10 +255,11 @@ module Big_map : sig module Contents : sig include - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type key = Script_expr_hash.t and type value = Script_repr.expr and type t := key + and type Local.key = Script_expr_hash.t (** HACK *) val list_values : @@ -293,7 +317,7 @@ module Sapling : sig Single_data_storage with type t := Raw_context.t * id and type value = int module Commitments : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type t := Raw_context.t * id and type key = int64 and type value = Sapling.Hash.t @@ -301,7 +325,7 @@ module Sapling : sig val commitments_init : Raw_context.t -> id -> Raw_context.t Lwt.t module Ciphertexts : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type t := Raw_context.t * id and type key = int64 and type value = Sapling.Ciphertext.t @@ -573,7 +597,7 @@ end [Michelson_v1_primitives.H_constant]. *) module Global_constants : sig module Map : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type t := Raw_context.t and type key = Script_expr_hash.t and type value = Script_repr.expr @@ -589,7 +613,7 @@ end *) module Ticket_balance : sig module Table : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type t := Raw_context.t and type key = Ticket_hash_repr.t and type value = Z.t @@ -726,6 +750,7 @@ module Sc_rollup : sig with type key = Sc_rollup_repr.t and type value = Sc_rollup_inbox_repr.t and type t := Raw_context.t + and type Local.key = unit module Last_cemented_commitment : Non_iterable_indexed_carbonated_data_storage @@ -734,7 +759,7 @@ module Sc_rollup : sig and type t := Raw_context.t module Stakers : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type key = Signature.Public_key_hash.t and type value = Sc_rollup_commitment_repr.Hash.t and type t = Raw_context.t * Sc_rollup_repr.t @@ -788,13 +813,13 @@ module Sc_rollup : sig of steps with respect to the total number of commitments. *) module Commitment_stake_count : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type key = Sc_rollup_commitment_repr.Hash.t and type value = int32 and type t = Raw_context.t * Sc_rollup_repr.t module Commitment_added : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type key = Sc_rollup_commitment_repr.Hash.t and type value = Raw_level_repr.t and type t = Raw_context.t * Sc_rollup_repr.t @@ -815,7 +840,7 @@ module Sc_rollup : sig not duplicated. *) module Game_timeout : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type key = Sc_rollup_game_repr.Index.t and type value = Raw_level_repr.t and type t = Raw_context.t * Sc_rollup_repr.t @@ -826,7 +851,7 @@ module Sc_rollup : sig for searching for current game by staker. *) module Opponent : - Non_iterable_indexed_carbonated_data_storage + Non_iterable_indexed_carbonated_data_storage_with_values with type key = Signature.Public_key_hash.t and type value = Sc_rollup_repr.Staker.t and type t = Raw_context.t * Sc_rollup_repr.t diff --git a/src/proto_alpha/lib_protocol/storage_functors.ml b/src/proto_alpha/lib_protocol/storage_functors.ml index b07dcbe31d9ed40f66ca4e3306a54f8d9c3777e7..fb9bea6b15cdc1419a774065c7dee592726fa760 100644 --- a/src/proto_alpha/lib_protocol/storage_functors.ml +++ b/src/proto_alpha/lib_protocol/storage_functors.ml @@ -68,9 +68,12 @@ let decode_len_value key len = | Some len -> ok len module Make_subcontext (R : REGISTER) (C : Raw_context.T) (N : NAME) : - Raw_context.T with type t = C.t = struct + Raw_context.T with type t = C.t and type local_context = C.local_context = +struct type t = C.t + type local_context = C.local_context + let to_key k = N.name @ k let mem t k = C.mem t (to_key k) @@ -142,6 +145,11 @@ module Make_subcontext (R : REGISTER) (C : Raw_context.T) (N : NAME) : Storage_description.register_named_subcontext description N.name let length = C.length + + let with_local_context ~add_back ctxt k f = + C.with_local_context ~add_back ctxt (to_key k) f + + module Local = C.Local end module Make_single_data_storage @@ -269,12 +277,17 @@ module Make_data_set_storage (C : Raw_context.T) (I : INDEX) : end module Make_indexed_data_storage (C : Raw_context.T) (I : INDEX) (V : VALUE) : - Indexed_data_storage with type t = C.t and type key = I.t and type value = V.t = -struct + Indexed_data_storage + with type t = C.t + and type key = I.t + and type value = V.t + and type Local.key = I.t = struct type t = C.t type context = t + type local_context = C.local_context + type key = I.t type value = V.t @@ -337,6 +350,41 @@ struct let keys s = fold_keys s ~order:`Sorted ~init:[] ~f:(fun p acc -> Lwt.return (p :: acc)) + module Local = struct + type t = local_context + + type context = t + + type nonrec key = I.t + + let mem c i = C.Local.mem c (I.to_path i []) + + let get c i = + C.Local.get c (I.to_path i []) >>=? fun b -> + let key () = C.Local.absolute_key c (I.to_path i []) in + Lwt.return (of_bytes ~key b) + + let find c i = + C.Local.find c (I.to_path i []) >|= function + | None -> Result.return_none + | Some b -> + let key () = C.Local.absolute_key c (I.to_path i []) in + of_bytes ~key b >|? fun v -> Some v + + let update c i v = C.Local.update c (I.to_path i []) (to_bytes v) + + let init c i v = C.Local.init c (I.to_path i []) (to_bytes v) + + let add c i v = C.Local.add c (I.to_path i []) (to_bytes v) + + let add_or_remove c i v = + C.Local.add_or_remove c (I.to_path i []) (Option.map to_bytes v) + + let remove c i = C.Local.remove c (I.to_path i []) + + let remove_existing c i = C.Local.remove_existing c (I.to_path i []) + end + let () = let open Storage_description in let unpack = unpack I.args in @@ -359,12 +407,16 @@ module Make_indexed_carbonated_data_storage_INTERNAL (V : VALUE) : Non_iterable_indexed_carbonated_data_storage_INTERNAL with type t = C.t + and type local_context = C.local_context and type key = I.t - and type value = V.t = struct + and type value = V.t + and type Local.key = I.t = struct type t = C.t type context = t + type local_context = C.local_context + type key = I.t type value = V.t @@ -463,6 +515,126 @@ module Make_indexed_carbonated_data_storage_INTERNAL let add_or_remove s i v = match v with None -> remove s i | Some v -> add s i v + let with_local_context ~add_back s f = + (* The gas cost for using C.with_local_context are: + - find_tree : To access the directory + - add_tree : `write_access` does not charge the path length. Then no need + to reduce the gas *) + (* Remark: To the consumption costs remain the same, the additional gas cost + when add_back is true is set to zero. + *) + let consume_find_tree_gas c = + let path_length = List.length @@ C.absolute_key c [] in + C.consume_gas c (Storage_costs.read_access ~path_length ~read_bytes:0) + in + let consume_add_tree_gas c = + C.consume_gas c (Storage_costs.write_access ~written_bytes:0) + in + consume_find_tree_gas s >>?= fun s -> + C.with_local_context ~add_back s [] f >>=? fun (s, x) -> + (if not add_back then consume_add_tree_gas s else ok s) >>?= fun s -> + return (s, x) + + module Local = struct + type t = local_context + + type context = local_context + + type nonrec key = key + + let consume_mem_gas local key = + C.Local.consume_gas + local + (Storage_costs.read_access ~path_length:(List.length key) ~read_bytes:0) + + let existing_size local i = + C.Local.find local (len_key i) >|= function + | None -> ok (0, false) + | Some len -> decode_len_value (len_key i) len >|? fun len -> (len, true) + + let consume_read_gas get local i = + let len_key = len_key i in + get local len_key >>=? fun len -> + Lwt.return + ( decode_len_value len_key len >>? fun read_bytes -> + let cost = + Storage_costs.read_access + ~path_length:(List.length len_key) + ~read_bytes + in + C.Local.consume_gas local cost ) + + let consume_serialize_write_gas set local i v = + let bytes = to_bytes v in + let len = Bytes.length bytes in + C.Local.consume_gas local (Gas_limit_repr.alloc_mbytes_cost len) + >>?= fun local -> + let cost = Storage_costs.write_access ~written_bytes:len in + C.Local.consume_gas local cost >>?= fun local -> + set local (len_key i) (encode_len_value bytes) >|=? fun local -> + (local, bytes) + + let consume_remove_gas del local i = + C.Local.consume_gas local (Storage_costs.write_access ~written_bytes:0) + >>?= fun local -> del local (len_key i) + + let mem local i = + let key = data_key i in + consume_mem_gas local key >>?= fun local -> + C.Local.mem local key >|= fun exists -> ok (local, exists) + + let get local i = + consume_read_gas C.Local.get local i >>=? fun local -> + C.Local.get local (data_key i) >>=? fun b -> + let key () = C.Local.absolute_key local (data_key i) in + Lwt.return (of_bytes ~key b >|? fun v -> (local, v)) + + let find local i = + let key = data_key i in + consume_mem_gas local key >>?= fun local -> + C.Local.mem local key >>= fun exists -> + if exists then get local i >|=? fun (local, v) -> (local, Some v) + else return (local, None) + + let update local i v = + existing_size local i >>=? fun (prev_size, _) -> + consume_serialize_write_gas C.Local.update local i v + >>=? fun (local, bytes) -> + C.Local.update local (data_key i) bytes >|=? fun local -> + let size_diff = Bytes.length bytes - prev_size in + (local, size_diff) + + let init local i v = + consume_serialize_write_gas C.Local.init local i v + >>=? fun (local, bytes) -> + C.Local.init local (data_key i) bytes >|=? fun local -> + let size = Bytes.length bytes in + (local, size) + + let add local i v = + let add local i v = C.Local.add local i v >|= ok in + existing_size local i >>=? fun (prev_size, existed) -> + consume_serialize_write_gas add local i v >>=? fun (local, bytes) -> + add local (data_key i) bytes >|=? fun local -> + let size_diff = Bytes.length bytes - prev_size in + (local, size_diff, existed) + + let remove local i = + let remove local i = C.Local.remove local i >|= ok in + existing_size local i >>=? fun (prev_size, existed) -> + consume_remove_gas remove local i >>=? fun local -> + remove local (data_key i) >|=? fun local -> (local, prev_size, existed) + + let remove_existing local i = + existing_size local i >>=? fun (prev_size, _) -> + consume_remove_gas C.Local.remove_existing local i >>=? fun local -> + C.Local.remove_existing local (data_key i) >|=? fun local -> + (local, prev_size) + + let add_or_remove local i v = + match v with None -> remove local i | Some v -> add local i v + end + (** Because big map values are not stored under some common key, we have no choice but to fold over all nodes with a path of length [I.path_length] to retrieve actual keys and then paginate. @@ -547,8 +719,10 @@ module Make_indexed_carbonated_data_storage : functor -> Non_iterable_indexed_carbonated_data_storage_with_values with type t = C.t + and type local_context = C.local_context and type key = I.t - and type value = V.t = + and type value = V.t + and type Local.key = I.t = Make_indexed_carbonated_data_storage_INTERNAL module Make_carbonated_data_set_storage (C : Raw_context.T) (I : INDEX) : @@ -654,7 +828,8 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : Indexed_raw_context with type t = C.t and type key = I.t - and type 'a ipath = 'a I.ipath = struct + and type 'a ipath = 'a I.ipath + and type local_context = C.local_context = struct type t = C.t type context = t @@ -663,6 +838,8 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : type 'a ipath = 'a I.ipath + type local_context = C.local_context + let clear t = C.remove t [] >|= fun t -> C.project t let fold_keys t ~order ~init ~f = @@ -698,9 +875,16 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : let pack = Storage_description.pack I.args - module Raw_context : Raw_context.T with type t = C.t I.ipath = struct + module Raw_context : + Raw_context.T + with type t = C.t I.ipath + and type local_context = C.local_context = struct type t = C.t I.ipath + (* Not [C.local_context I.ipath]. For faster local context access, + [local_context] must be the direct pointer to the tree of the index *) + type local_context = C.local_context + let to_key i k = I.to_path i k let mem c k = @@ -824,8 +1008,20 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : let length c = let t, _i = unpack c in C.length t + + let with_local_context ~add_back c k f = + let t, i = unpack c in + C.with_local_context ~add_back t (to_key i k) f >|=? fun (t, res) -> + (pack t i, res) + + module Local = C.Local end + let with_local_context ~add_back s i f = + Raw_context.with_local_context ~add_back (pack s i) [] f >|=? fun (c, x) -> + let s, _ = unpack c in + (s, x) + module Make_set (R : REGISTER) (N : NAME) : Data_set_storage with type t = t and type elt = key = struct type t = C.t @@ -878,8 +1074,12 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : end module Make_map (N : NAME) (V : VALUE) : - Indexed_data_storage with type t = t and type key = key and type value = V.t = - struct + Indexed_data_storage + with type t = t + and type key = key + and type value = V.t + and type local_context = local_context + and type Local.key = unit = struct type t = C.t type context = t @@ -888,6 +1088,8 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : type value = V.t + type nonrec local_context = local_context + include Make_encoder (V) let mem s i = Raw_context.mem (pack s i) N.name @@ -967,13 +1169,51 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : find c k) (register_named_subcontext Raw_context.description N.name) V.encoding + + module Local = struct + type context = Raw_context.Local.t + + type t = context + + type key = unit + + let mem local () = Raw_context.Local.mem local N.name + + let get local () = + Raw_context.Local.get local N.name >|= fun r -> + let key () = Raw_context.Local.absolute_key local N.name in + r >>? of_bytes ~key + + let find local () = + Raw_context.Local.find local N.name >|= function + | None -> Result.return_none + | Some b -> + let key () = Raw_context.Local.absolute_key local N.name in + of_bytes ~key b >|? fun v -> Some v + + let init local () v = Raw_context.Local.init local N.name (to_bytes v) + + let update local () v = Raw_context.Local.update local N.name (to_bytes v) + + let add local () v = Raw_context.Local.add local N.name (to_bytes v) + + let add_or_remove local () vo = + Raw_context.Local.add_or_remove local N.name (Option.map to_bytes vo) + + let remove_existing local () = + Raw_context.Local.remove_existing local N.name + + let remove local () = Raw_context.Local.remove local N.name + end end module Make_carbonated_map (N : NAME) (V : VALUE) : Non_iterable_indexed_carbonated_data_storage with type t = t and type key = key - and type value = V.t = struct + and type value = V.t + and type local_context = local_context + and type Local.key = unit = struct type t = C.t type context = t @@ -982,6 +1222,8 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : type value = V.t + type nonrec local_context = local_context + include Make_encoder (V) let len_name = len_name :: N.name @@ -1094,6 +1336,117 @@ module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : find c k >|=? fun (_, v) -> v) (register_named_subcontext Raw_context.description N.name) V.encoding + + let with_local_context ~add_back s f = + let consume_find_tree_gas c = + let path_length = List.length @@ C.absolute_key c [] in + C.consume_gas c (Storage_costs.read_access ~path_length ~read_bytes:0) + in + let consume_add_tree_gas c = + C.consume_gas c (Storage_costs.write_access ~written_bytes:0) + in + consume_find_tree_gas s >>?= fun s -> + C.with_local_context ~add_back s [] f >>=? fun (s, x) -> + (if not add_back then consume_add_tree_gas s else ok s) >>?= fun s -> + return (s, x) + + module Local = struct + type context = local_context + + type t = context + + type key = unit + + let consume_mem_gas local key = + let path_length = List.length key in + Raw_context.Local.consume_gas + local + (Storage_costs.read_access ~path_length ~read_bytes:0) + + let existing_size local = + Raw_context.Local.find local len_name >|= function + | None -> ok (0, false) + | Some len -> decode_len_value len_name len >|? fun len -> (len, true) + + let consume_read_gas get local = + get local len_name >>=? fun len -> + Lwt.return + ( decode_len_value len_name len >>? fun read_bytes -> + let path_length = List.length len_name in + let cost = Storage_costs.read_access ~path_length ~read_bytes in + C.Local.consume_gas local cost ) + + let consume_serialize_write_gas set local v = + let bytes = to_bytes v in + let len = Bytes.length bytes in + C.Local.consume_gas local (Gas_limit_repr.alloc_mbytes_cost len) + >>?= fun local -> + let cost = Storage_costs.write_access ~written_bytes:len in + C.Local.consume_gas local cost >>?= fun local -> + set local len_name (encode_len_value bytes) >|=? fun local -> + (local, bytes) + + let consume_remove_gas del local = + let cost = Storage_costs.write_access ~written_bytes:0 in + Raw_context.Local.consume_gas local cost >>?= fun local -> + del local len_name + + let mem local () = + consume_mem_gas local data_name >>?= fun local -> + Raw_context.Local.mem local data_name >|= fun exists -> + ok (local, exists) + + let get local () = + consume_read_gas Raw_context.Local.get local >>=? fun local -> + Raw_context.Local.get local data_name >>=? fun b -> + let key () = C.Local.absolute_key local data_name in + Lwt.return (of_bytes ~key b >|? fun v -> (local, v)) + + let find local () = + consume_mem_gas local data_name >>?= fun local -> + Raw_context.Local.mem local data_name >>= fun exists -> + if exists then get local () >|=? fun (local, v) -> (local, Some v) + else return (local, None) + + let update local () v = + existing_size local >>=? fun (prev_size, _) -> + consume_serialize_write_gas Raw_context.Local.update local v + >>=? fun (local, bytes) -> + Raw_context.Local.update local data_name bytes >|=? fun local -> + let size_diff = Bytes.length bytes - prev_size in + (local, size_diff) + + let init local () v = + consume_serialize_write_gas Raw_context.Local.init local v + >>=? fun (local, bytes) -> + Raw_context.Local.init local data_name bytes >|=? fun local -> + let size = Bytes.length bytes in + (local, size) + + let add local () v = + let add local i v = Raw_context.Local.add local i v >|= ok in + existing_size local >>=? fun (prev_size, existed) -> + consume_serialize_write_gas add local v >>=? fun (local, bytes) -> + add local data_name bytes >|=? fun local -> + let size_diff = Bytes.length bytes - prev_size in + (local, size_diff, existed) + + let remove c () = + let remove c k = Raw_context.Local.remove c k >|= ok in + existing_size c >>=? fun (prev_size, existed) -> + consume_remove_gas remove c >>=? fun c -> + remove c data_name >|=? fun c -> (c, prev_size, existed) + + let remove_existing local () = + existing_size local >>=? fun (prev_size, _) -> + consume_remove_gas Raw_context.Local.remove_existing local + >>=? fun local -> + C.Local.remove_existing local data_name >|=? fun local -> + (local, prev_size) + + let add_or_remove local () v = + match v with None -> remove local () | Some v -> add local () v + end end end @@ -1118,6 +1471,8 @@ module Wrap_indexed_data_storage type context = C.t + type local_context = C.local_context + type key = K.t type value = C.value @@ -1156,4 +1511,6 @@ module Wrap_indexed_data_storage let keys s = fold_keys s ~order:`Sorted ~init:[] ~f:(fun p acc -> Lwt.return (p :: acc)) + + module Local = C.Local end diff --git a/src/proto_alpha/lib_protocol/storage_functors.mli b/src/proto_alpha/lib_protocol/storage_functors.mli index e83a1f9da791173b079b1700c6c97939dfbd9ac6..8659c22f0645a6c5a108ee5ceb1eeddc4038bc77 100644 --- a/src/proto_alpha/lib_protocol/storage_functors.mli +++ b/src/proto_alpha/lib_protocol/storage_functors.mli @@ -42,7 +42,7 @@ module Ghost : REGISTER a given subtree. Similar to a {i functional lens}. *) module Make_subcontext (_ : REGISTER) (C : Raw_context.T) (_ : NAME) : - Raw_context.T with type t = C.t + Raw_context.T with type t = C.t and type local_context = C.local_context module Make_single_data_storage (_ : REGISTER) @@ -77,7 +77,11 @@ module Make_carbonated_data_set_storage (C : Raw_context.T) (I : INDEX) : (** This functor creates storage for types with a notion of an index. *) module Make_indexed_data_storage (C : Raw_context.T) (I : INDEX) (V : VALUE) : - Indexed_data_storage with type t = C.t and type key = I.t and type value = V.t + Indexed_data_storage + with type t = C.t + and type key = I.t + and type value = V.t + and type Local.key = I.t (** Like [Make_indexed_data_storage], adding tracking of storage cost. *) module Make_indexed_carbonated_data_storage @@ -86,8 +90,10 @@ module Make_indexed_carbonated_data_storage (V : VALUE) : Non_iterable_indexed_carbonated_data_storage_with_values with type t = C.t + and type local_context = C.local_context and type key = I.t and type value = V.t + and type Local.key = I.t module Make_indexed_data_snapshotable_storage (C : Raw_context.T) @@ -103,6 +109,7 @@ module Make_indexed_data_snapshotable_storage module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : Indexed_raw_context with type t = C.t + and type local_context = C.local_context and type key = I.t and type 'a ipath = 'a I.ipath diff --git a/src/proto_alpha/lib_protocol/storage_sigs.ml b/src/proto_alpha/lib_protocol/storage_sigs.ml index d6c0a2886083bc6ce72bf2782e1d894fbbd7c882..37fce38739696d4cc9dcd9b25a1b5c7b896ceafc 100644 --- a/src/proto_alpha/lib_protocol/storage_sigs.ml +++ b/src/proto_alpha/lib_protocol/storage_sigs.ml @@ -128,6 +128,34 @@ module type Non_iterable_indexed_data_storage = sig (** Removes a storage bucket and its contents ; does nothing if the bucket does not exists. *) val remove : context -> key -> Raw_context.t Lwt.t + + type local_context + + module Local : sig + type t = local_context + + type context = t + + type key + + val mem : context -> key -> bool Lwt.t + + val get : context -> key -> value tzresult Lwt.t + + val find : context -> key -> value option tzresult Lwt.t + + val update : context -> key -> value -> context tzresult Lwt.t + + val init : context -> key -> value -> context tzresult Lwt.t + + val add : context -> key -> value -> context Lwt.t + + val add_or_remove : context -> key -> value option -> context Lwt.t + + val remove_existing : context -> key -> context tzresult Lwt.t + + val remove : context -> key -> context Lwt.t + end end (** Variant of {!Non_iterable_indexed_data_storage} with gas accounting. *) @@ -213,6 +241,41 @@ module type Non_iterable_indexed_carbonated_data_storage = sig (** Returns the list of all storage bucket keys. Not carbonated (i.e. gas is not consumed); use with care. *) val keys_unaccounted : context -> key list Lwt.t + + type local_context + + val with_local_context : + add_back:bool -> + context -> + (local_context -> (local_context * 'a) tzresult Lwt.t) -> + (context * 'a) tzresult Lwt.t + + module Local : sig + type t = local_context + + type context = t + + type key + + val mem : context -> key -> (context * bool) tzresult Lwt.t + + val get : context -> key -> (context * value) tzresult Lwt.t + + val find : context -> key -> (context * value option) tzresult Lwt.t + + val update : context -> key -> value -> (context * int) tzresult Lwt.t + + val init : context -> key -> value -> (context * int) tzresult Lwt.t + + val add : context -> key -> value -> (context * int * bool) tzresult Lwt.t + + val add_or_remove : + context -> key -> value option -> (context * int * bool) tzresult Lwt.t + + val remove_existing : context -> key -> (context * int) tzresult Lwt.t + + val remove : context -> key -> (context * int * bool) tzresult Lwt.t + end end module type Non_iterable_indexed_carbonated_data_storage_with_values = sig @@ -393,6 +456,8 @@ module type Indexed_raw_context = sig type 'a ipath + type local_context + val clear : context -> Raw_context.t Lwt.t val fold_keys : @@ -408,17 +473,32 @@ module type Indexed_raw_context = sig val copy : context -> from:key -> to_:key -> context tzresult Lwt.t + val with_local_context : + add_back:bool -> + context -> + key -> + (local_context -> (local_context * 'a) tzresult Lwt.t) -> + (context * 'a) tzresult Lwt.t + module Make_set (_ : REGISTER) (_ : NAME) : Data_set_storage with type t = t and type elt = key module Make_map (_ : NAME) (V : VALUE) : - Indexed_data_storage with type t = t and type key = key and type value = V.t + Indexed_data_storage + with type t = t + and type key = key + and type value = V.t + and type local_context = local_context + and type Local.key = unit module Make_carbonated_map (_ : NAME) (V : VALUE) : Non_iterable_indexed_carbonated_data_storage with type t = t and type key = key and type value = V.t + and type local_context = local_context + and type Local.key = unit - module Raw_context : Raw_context.T with type t = t ipath + module Raw_context : + Raw_context.T with type t = t ipath and type local_context = local_context end diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_literal.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_literal.out index 48012737a2bacf387081a92a2257fac0deca36e6..ad9b2582fcec19417b879c003a890839831b62b6 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_literal.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_literal.out @@ -1,7 +1,7 @@ tests_alpha/test_contract_onchain_opcodes.py::TestContractBigMapOrigination::test_big_map_origination_literal Node is bootstrapped. -Estimated gas: 1641.662 units (will add 100 for safety) +Estimated gas: 1861.662 units (will add 100 for safety) Estimated storage: 403 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000461 + Fee to the baker: ꜩ0.000483 Expected counter: [EXPECTED_COUNTER] - Gas limit: 1742 + Gas limit: 1962 Storage limit: 423 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000461 - payload fees(the block proposer) ....... +ꜩ0.000461 + [CONTRACT_HASH] ... -ꜩ0.000483 + payload fees(the block proposer) ....... +ꜩ0.000483 Origination: From: [CONTRACT_HASH] Credit: ꜩ1000 @@ -36,7 +36,7 @@ This sequence of operations was run: New map(4) of type (big_map int int) Set map(4)[0] to 0 Paid storage size diff: 146 bytes - Consumed gas: 1641.662 + Consumed gas: 1861.662 Balance updates: [CONTRACT_HASH] ... -ꜩ0.0365 storage fees ........................... +ꜩ0.0365 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out index 781ca61eb5e026bccd189d9827b309c428693d22..50e3b32a73cdcb7830adfeabd96867bea2b34ee5 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestAddApproveTransferRemove::test_add_liquidity Node is bootstrapped. -Estimated gas: 8553.386 units (will add 100 for safety) +Estimated gas: 9433.386 units (will add 100 for safety) Estimated storage: 141 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.001221 + Fee to the baker: ꜩ0.001309 Expected counter: [EXPECTED_COUNTER] - Gas limit: 8654 + Gas limit: 9534 Storage limit: 161 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.001221 - payload fees(the block proposer) ....... +ꜩ0.001221 + [CONTRACT_HASH] ... -ꜩ0.001309 + payload fees(the block proposer) ....... +ꜩ0.001309 Transaction: Amount: ꜩ9001 From: [CONTRACT_HASH] @@ -58,7 +58,7 @@ This sequence of operations was run: Set map(0)[0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600] to 721 Storage size: 2263 bytes Paid storage size diff: 68 bytes - Consumed gas: 3065.552 + Consumed gas: 3505.552 Balance updates: [CONTRACT_HASH] ... -ꜩ0.017 storage fees ........................... +ꜩ0.017 @@ -75,7 +75,7 @@ This sequence of operations was run: Set map(2)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 72007 Storage size: 2048 bytes Paid storage size diff: 70 bytes - Consumed gas: 3213.097 + Consumed gas: 3653.097 Balance updates: [CONTRACT_HASH] ... -ꜩ0.0175 storage fees ........................... +ꜩ0.0175 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approval.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approval.out index f7a5aa87445f75c17beec87d8577416635672d35..4a00d1c367b30fb888aca240801891ffa5b0ff85 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approval.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approval.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestAddApproveTransferRemove::test_approval Node is bootstrapped. -Estimated gas: 1679.709 units (will add 100 for safety) +Estimated gas: 2119.709 units (will add 100 for safety) Estimated storage: 68 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000485 + Fee to the baker: ꜩ0.000529 Expected counter: [EXPECTED_COUNTER] - Gas limit: 1780 + Gas limit: 2220 Storage limit: 88 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000485 - payload fees(the block proposer) ....... +ꜩ0.000485 + [CONTRACT_HASH] ... -ꜩ0.000529 + payload fees(the block proposer) ....... +ꜩ0.000529 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -33,7 +33,7 @@ This sequence of operations was run: 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c)] to 1000 Storage size: 2116 bytes Paid storage size diff: 68 bytes - Consumed gas: 1679.709 + Consumed gas: 2119.709 Balance updates: [CONTRACT_HASH] ... -ꜩ0.017 storage fees ........................... +ꜩ0.017 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approved_transfer.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approved_transfer.out index 9489d1e04057515ef4382cdaddefbc849bda380f..272fd6c78dff55264214c9a6e924db266e8243da 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approved_transfer.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approved_transfer.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestAddApproveTransferRemove::test_approved_transfer Node is bootstrapped. -Estimated gas: 3044.096 units (will add 100 for safety) +Estimated gas: 3484.096 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000672 + Fee to the baker: ꜩ0.000716 Expected counter: [EXPECTED_COUNTER] - Gas limit: 3145 + Gas limit: 3585 Storage limit: 0 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000672 - payload fees(the block proposer) ....... +ꜩ0.000672 + [CONTRACT_HASH] ... -ꜩ0.000716 + payload fees(the block proposer) ....... +ꜩ0.000716 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -36,6 +36,6 @@ This sequence of operations was run: Set map(2)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 71007 Set map(2)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] to 1000 Storage size: 2116 bytes - Consumed gas: 3044.096 + Consumed gas: 3484.096 Injected block at minimal timestamp diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve1.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve1.out index 67447b4075673806e0e9351084bddf7085419973..9bd467dbb36cd8f0994bab53fe4ba1b86437ce65 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve1.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve1.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestAddApproveTransferRemove::test_call_approve1 Node is bootstrapped. -Estimated gas: 1679.785 units (will add 100 for safety) +Estimated gas: 2119.785 units (will add 100 for safety) Estimated storage: 71 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000488 + Fee to the baker: ꜩ0.000532 Expected counter: [EXPECTED_COUNTER] - Gas limit: 1780 + Gas limit: 2220 Storage limit: 91 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000488 - payload fees(the block proposer) ....... +ꜩ0.000488 + [CONTRACT_HASH] ... -ꜩ0.000532 + payload fees(the block proposer) ....... +ꜩ0.000532 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -33,7 +33,7 @@ This sequence of operations was run: 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 Storage size: 2053 bytes Paid storage size diff: 71 bytes - Consumed gas: 1679.785 + Consumed gas: 2119.785 Balance updates: [CONTRACT_HASH] ... -ꜩ0.01775 storage fees ........................... +ꜩ0.01775 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve2.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve2.out index 6867eeba7a81e6c772c52fad93f431597fe397f9..85d96ced728166f2f17b8c8cc29ded46c02bcb57 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve2.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve2.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestAddApproveTransferRemove::test_call_approve2 Node is bootstrapped. -Estimated gas: 1679.785 units (will add 100 for safety) +Estimated gas: 2119.785 units (will add 100 for safety) Estimated storage: 71 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000488 + Fee to the baker: ꜩ0.000532 Expected counter: [EXPECTED_COUNTER] - Gas limit: 1780 + Gas limit: 2220 Storage limit: 91 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000488 - payload fees(the block proposer) ....... +ꜩ0.000488 + [CONTRACT_HASH] ... -ꜩ0.000532 + payload fees(the block proposer) ....... +ꜩ0.000532 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -33,7 +33,7 @@ This sequence of operations was run: 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 Storage size: 2124 bytes Paid storage size diff: 71 bytes - Consumed gas: 1679.785 + Consumed gas: 2119.785 Balance updates: [CONTRACT_HASH] ... -ꜩ0.01775 storage fees ........................... +ꜩ0.01775 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve3.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve3.out index 5b2d8a22ea128ebbb337b5a7f4bdc8c73da02a0b..cf0e7e37af7ff5d65cc91848eaf50216a5acc93b 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve3.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve3.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestAddApproveTransferRemove::test_call_approve3 Node is bootstrapped. -Estimated gas: 1679.785 units (will add 100 for safety) +Estimated gas: 2119.785 units (will add 100 for safety) Estimated storage: 71 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000488 + Fee to the baker: ꜩ0.000532 Expected counter: [EXPECTED_COUNTER] - Gas limit: 1780 + Gas limit: 2220 Storage limit: 91 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000488 - payload fees(the block proposer) ....... +ꜩ0.000488 + [CONTRACT_HASH] ... -ꜩ0.000532 + payload fees(the block proposer) ....... +ꜩ0.000532 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -33,7 +33,7 @@ This sequence of operations was run: 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 Storage size: 2195 bytes Paid storage size diff: 71 bytes - Consumed gas: 1679.785 + Consumed gas: 2119.785 Balance updates: [CONTRACT_HASH] ... -ꜩ0.01775 storage fees ........................... +ꜩ0.01775 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_mint_or_burn.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_mint_or_burn.out index f40670ce15c1ba4e00c0e6227635cfcf8d607e1d..3f32e08d9e6d36b9b593f37ffe47018847547f9a 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_mint_or_burn.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_mint_or_burn.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestAddApproveTransferRemove::test_call_mint_or_burn Node is bootstrapped. -Estimated gas: 3217.054 units (will add 100 for safety) +Estimated gas: 3657.054 units (will add 100 for safety) Estimated storage: 71 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000644 + Fee to the baker: ꜩ0.000688 Expected counter: [EXPECTED_COUNTER] - Gas limit: 3318 + Gas limit: 3758 Storage limit: 91 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000644 - payload fees(the block proposer) ....... +ꜩ0.000644 + [CONTRACT_HASH] ... -ꜩ0.000688 + payload fees(the block proposer) ....... +ꜩ0.000688 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -32,7 +32,7 @@ This sequence of operations was run: Set map(0)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 100000000 Storage size: 1982 bytes Paid storage size diff: 71 bytes - Consumed gas: 3217.527 + Consumed gas: 3657.527 Balance updates: [CONTRACT_HASH] ... -ꜩ0.01775 storage fees ........................... +ꜩ0.01775 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out index 763556d3762bd5042fbe5706b5fb850610681d25..d527dd742d8b8321f2995b69ece9ae6c7e94af63 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestAddApproveTransferRemove::test_remove_liquidity Node is bootstrapped. -Estimated gas: 7517.418 units (will add 100 for safety) +Estimated gas: 8397.418 units (will add 100 for safety) Estimated storage: 67 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.001114 + Fee to the baker: ꜩ0.001202 Expected counter: [EXPECTED_COUNTER] - Gas limit: 7618 + Gas limit: 8498 Storage limit: 87 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.001114 - payload fees(the block proposer) ....... +ꜩ0.001114 + [CONTRACT_HASH] ... -ꜩ0.001202 + payload fees(the block proposer) ....... +ꜩ0.001202 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -47,7 +47,7 @@ This sequence of operations was run: Updated big_maps: Unset map(2)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] Storage size: 2048 bytes - Consumed gas: 1873.230 + Consumed gas: 2313.230 Internal Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -63,7 +63,7 @@ This sequence of operations was run: Set map(0)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] to 10 Storage size: 2330 bytes Paid storage size diff: 67 bytes - Consumed gas: 2367.837 + Consumed gas: 2807.837 Balance updates: [CONTRACT_HASH] ... -ꜩ0.01675 storage fees ........................... +ꜩ0.01675 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out index f2f97a201b2e4ab4a8e6881116aab6c7ac517758..fe4a28b599a2465e490d89271a8e6111d4357b39 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestTrades::test_add_liquidity Node is bootstrapped. -Estimated gas: 8553.386 units (will add 100 for safety) +Estimated gas: 9433.386 units (will add 100 for safety) Estimated storage: 141 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.001221 + Fee to the baker: ꜩ0.001309 Expected counter: [EXPECTED_COUNTER] - Gas limit: 8654 + Gas limit: 9534 Storage limit: 161 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.001221 - payload fees(the block proposer) ....... +ꜩ0.001221 + [CONTRACT_HASH] ... -ꜩ0.001309 + payload fees(the block proposer) ....... +ꜩ0.001309 Transaction: Amount: ꜩ9001 From: [CONTRACT_HASH] @@ -58,7 +58,7 @@ This sequence of operations was run: Set map(0)[0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600] to 721 Storage size: 2263 bytes Paid storage size diff: 68 bytes - Consumed gas: 3065.552 + Consumed gas: 3505.552 Balance updates: [CONTRACT_HASH] ... -ꜩ0.017 storage fees ........................... +ꜩ0.017 @@ -75,7 +75,7 @@ This sequence of operations was run: Set map(2)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 72007 Storage size: 2048 bytes Paid storage size diff: 70 bytes - Consumed gas: 3213.097 + Consumed gas: 3653.097 Balance updates: [CONTRACT_HASH] ... -ꜩ0.0175 storage fees ........................... +ꜩ0.0175 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out index 3a325d5c51f2f8b7ee100454eecf23d1c49cbc22..944ac12de52e9bdba92a51dac0eb1562df47f5ce 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestTrades::test_buy_tok Node is bootstrapped. -Estimated gas: 5113.046 units (will add 100 for safety) +Estimated gas: 5553.046 units (will add 100 for safety) Estimated storage: 326 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000869 + Fee to the baker: ꜩ0.000913 Expected counter: [EXPECTED_COUNTER] - Gas limit: 5214 + Gas limit: 5654 Storage limit: 346 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000869 - payload fees(the block proposer) ....... +ꜩ0.000869 + [CONTRACT_HASH] ... -ꜩ0.000913 + payload fees(the block proposer) ....... +ꜩ0.000913 Transaction: Amount: ꜩ9001 From: [CONTRACT_HASH] @@ -56,7 +56,7 @@ This sequence of operations was run: Set map(0)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] to 360 Storage size: 2331 bytes Paid storage size diff: 68 bytes - Consumed gas: 2367.841 + Consumed gas: 2807.841 Balance updates: [CONTRACT_HASH] ... -ꜩ0.017 storage fees ........................... +ꜩ0.017 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve1.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve1.out index d620099096acf579e2fd082222d7ca594ee71ac9..3a2713894d797f0d515dcc9bc9f6d46a4f0e44ba 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve1.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve1.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestTrades::test_call_approve1 Node is bootstrapped. -Estimated gas: 1679.785 units (will add 100 for safety) +Estimated gas: 2119.785 units (will add 100 for safety) Estimated storage: 71 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000488 + Fee to the baker: ꜩ0.000532 Expected counter: [EXPECTED_COUNTER] - Gas limit: 1780 + Gas limit: 2220 Storage limit: 91 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000488 - payload fees(the block proposer) ....... +ꜩ0.000488 + [CONTRACT_HASH] ... -ꜩ0.000532 + payload fees(the block proposer) ....... +ꜩ0.000532 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -33,7 +33,7 @@ This sequence of operations was run: 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 Storage size: 2053 bytes Paid storage size diff: 71 bytes - Consumed gas: 1679.785 + Consumed gas: 2119.785 Balance updates: [CONTRACT_HASH] ... -ꜩ0.01775 storage fees ........................... +ꜩ0.01775 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve2.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve2.out index 66000869c7e0df95798f056851a4245b600c1eb2..b7dd20d39cf78b789e606c724909bcf61e3a5018 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve2.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve2.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestTrades::test_call_approve2 Node is bootstrapped. -Estimated gas: 1679.785 units (will add 100 for safety) +Estimated gas: 2119.785 units (will add 100 for safety) Estimated storage: 71 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000488 + Fee to the baker: ꜩ0.000532 Expected counter: [EXPECTED_COUNTER] - Gas limit: 1780 + Gas limit: 2220 Storage limit: 91 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000488 - payload fees(the block proposer) ....... +ꜩ0.000488 + [CONTRACT_HASH] ... -ꜩ0.000532 + payload fees(the block proposer) ....... +ꜩ0.000532 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -33,7 +33,7 @@ This sequence of operations was run: 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 Storage size: 2124 bytes Paid storage size diff: 71 bytes - Consumed gas: 1679.785 + Consumed gas: 2119.785 Balance updates: [CONTRACT_HASH] ... -ꜩ0.01775 storage fees ........................... +ꜩ0.01775 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve3.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve3.out index 7350f75c01f5ce93d03b01a533f3bb5314dae6ff..73012de775f8737e5bbd00724f6261db8c964acd 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve3.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve3.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestTrades::test_call_approve3 Node is bootstrapped. -Estimated gas: 1679.785 units (will add 100 for safety) +Estimated gas: 2119.785 units (will add 100 for safety) Estimated storage: 71 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000488 + Fee to the baker: ꜩ0.000532 Expected counter: [EXPECTED_COUNTER] - Gas limit: 1780 + Gas limit: 2220 Storage limit: 91 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000488 - payload fees(the block proposer) ....... +ꜩ0.000488 + [CONTRACT_HASH] ... -ꜩ0.000532 + payload fees(the block proposer) ....... +ꜩ0.000532 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -33,7 +33,7 @@ This sequence of operations was run: 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 Storage size: 2195 bytes Paid storage size diff: 71 bytes - Consumed gas: 1679.785 + Consumed gas: 2119.785 Balance updates: [CONTRACT_HASH] ... -ꜩ0.01775 storage fees ........................... +ꜩ0.01775 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_mint_or_burn.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_mint_or_burn.out index 6ad10428b7b08c73814dc87bdb32502f97a003ed..f9713059d4d05d2582e9f884ca11106521a85ce5 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_mint_or_burn.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_mint_or_burn.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestTrades::test_call_mint_or_burn Node is bootstrapped. -Estimated gas: 3217.054 units (will add 100 for safety) +Estimated gas: 3657.054 units (will add 100 for safety) Estimated storage: 71 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000644 + Fee to the baker: ꜩ0.000688 Expected counter: [EXPECTED_COUNTER] - Gas limit: 3318 + Gas limit: 3758 Storage limit: 91 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000644 - payload fees(the block proposer) ....... +ꜩ0.000644 + [CONTRACT_HASH] ... -ꜩ0.000688 + payload fees(the block proposer) ....... +ꜩ0.000688 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -32,7 +32,7 @@ This sequence of operations was run: Set map(0)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 100000000 Storage size: 1982 bytes Paid storage size diff: 71 bytes - Consumed gas: 3217.527 + Consumed gas: 3657.527 Balance updates: [CONTRACT_HASH] ... -ꜩ0.01775 storage fees ........................... +ꜩ0.01775 diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out index 4659d038264f6ba2b06eb44a12cf49e24534f636..e6826ed04063d93daf6434f55151290ebce60bb5 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestTrades::test_sell_tok Node is bootstrapped. -Estimated gas: 7011.441 units (will add 100 for safety) +Estimated gas: 7451.441 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.001057 + Fee to the baker: ꜩ0.001101 Expected counter: [EXPECTED_COUNTER] - Gas limit: 7112 + Gas limit: 7552 Storage limit: 0 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.001057 - payload fees(the block proposer) ....... +ꜩ0.001057 + [CONTRACT_HASH] ... -ꜩ0.001101 + payload fees(the block proposer) ....... +ꜩ0.001101 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -51,7 +51,7 @@ This sequence of operations was run: Unset map(0)[0x0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd6] Set map(0)[0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600] to 461 Storage size: 2331 bytes - Consumed gas: 3265.588 + Consumed gas: 3705.588 Internal Transaction: Amount: ꜩ3891.966034 From: [CONTRACT_HASH] diff --git a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_transfer.out b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_transfer.out index 9f7c7516026eb5d5f1aebb8403f5db7efe1595d2..295c90ebb4e0e6ef2f8d183212777ad97729681f 100644 --- a/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_transfer.out +++ b/tests_python/tests_alpha/_regtest_outputs/test_liquidity_baking.TestTrades::test_transfer.out @@ -1,7 +1,7 @@ tests_alpha/test_liquidity_baking.py::TestTrades::test_transfer Node is bootstrapped. -Estimated gas: 2376.541 units (will add 100 for safety) +Estimated gas: 2816.541 units (will add 100 for safety) Estimated storage: 68 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[BLOCK_HASH]' @@ -12,13 +12,13 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000605 + Fee to the baker: ꜩ0.000649 Expected counter: [EXPECTED_COUNTER] - Gas limit: 2477 + Gas limit: 2917 Storage limit: 88 bytes Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000605 - payload fees(the block proposer) ....... +ꜩ0.000605 + [CONTRACT_HASH] ... -ꜩ0.000649 + payload fees(the block proposer) ....... +ꜩ0.000649 Transaction: Amount: ꜩ0 From: [CONTRACT_HASH] @@ -35,7 +35,7 @@ This sequence of operations was run: Set map(0)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] to 260 Storage size: 2399 bytes Paid storage size diff: 68 bytes - Consumed gas: 2376.541 + Consumed gas: 2816.541 Balance updates: [CONTRACT_HASH] ... -ꜩ0.017 storage fees ........................... +ꜩ0.017