From 14bd2ae07a4e0f2061dc23e06f1794eeef788050 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Fri, 24 Jun 2022 17:36:13 +0200 Subject: [PATCH 1/2] Proto/Apply_results: remove consumed_gas field for Sc_rollup_dal_slot_subscribe result --- src/proto_alpha/lib_protocol/apply_results.ml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/proto_alpha/lib_protocol/apply_results.ml b/src/proto_alpha/lib_protocol/apply_results.ml index 8589523cd4f6..b7d8af6a6494 100644 --- a/src/proto_alpha/lib_protocol/apply_results.ml +++ b/src/proto_alpha/lib_protocol/apply_results.ml @@ -887,8 +887,7 @@ module Manager_result = struct ~op_case: Operation.Encoding.Manager_operations.sc_rollup_dal_slot_subscribe_case ~encoding: - (obj4 - (req "consumed_gas" Gas.Arith.n_integral_encoding) + (obj3 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (req "slot_index" Dal.Slot_index.encoding) (req "level" Raw_level.encoding)) @@ -900,12 +899,10 @@ module Manager_result = struct ~proj:(function | Sc_rollup_dal_slot_subscribe_result {consumed_gas; slot_index; level} -> - (Gas.Arith.ceil consumed_gas, consumed_gas, slot_index, level)) + (consumed_gas, slot_index, level)) ~kind:Kind.Sc_rollup_dal_slot_subscribe_manager_kind - ~inj:(fun (consumed_gas, consumed_milligas, slot_index, level) -> - assert (Gas.Arith.(equal (ceil consumed_milligas) consumed_gas)) ; - Sc_rollup_dal_slot_subscribe_result - {consumed_gas = consumed_milligas; slot_index; level}) + ~inj:(fun (consumed_gas, slot_index, level) -> + Sc_rollup_dal_slot_subscribe_result {consumed_gas; slot_index; level}) end let successful_manager_operation_result_encoding : -- GitLab From b01727a5c66ba32f0098c6bcf532c833af728018 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Fri, 24 Jun 2022 17:39:17 +0200 Subject: [PATCH 2/2] Proto/Apply_results: remove consumed_gas field from block metadata for consistency Also this field was already expressed in milligas so it was misleading --- src/proto_alpha/lib_protocol/apply_results.ml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/proto_alpha/lib_protocol/apply_results.ml b/src/proto_alpha/lib_protocol/apply_results.ml index b7d8af6a6494..824c7b4bdeef 100644 --- a/src/proto_alpha/lib_protocol/apply_results.ml +++ b/src/proto_alpha/lib_protocol/apply_results.ml @@ -2739,7 +2739,6 @@ let block_metadata_encoding = level_info, voting_period_info, nonce_hash, - consumed_gas, deactivated, balance_updates, liquidity_baking_toggle_ema, @@ -2750,12 +2749,11 @@ let block_metadata_encoding = level_info, voting_period_info, nonce_hash, - consumed_gas, deactivated, balance_updates, liquidity_baking_toggle_ema, implicit_operations_results ), - (_consumed_millgas, dal_slot_availability) ) -> + (consumed_gas, dal_slot_availability) ) -> { proposer; baker; @@ -2770,13 +2768,12 @@ let block_metadata_encoding = dal_slot_availability; }) (merge_objs - (obj10 + (obj9 (req "proposer" Signature.Public_key_hash.encoding) (req "baker" Signature.Public_key_hash.encoding) (req "level_info" Level.encoding) (req "voting_period_info" Voting_period.info_encoding) (req "nonce_hash" (option Nonce_hash.encoding)) - (req "consumed_gas" Gas.Arith.n_fp_encoding) (req "deactivated" (list Signature.Public_key_hash.encoding)) (dft "balance_updates" Receipt.balance_updates_encoding []) (req -- GitLab