From ee1f0c273c818b4d567fbe61c25d227e54dd7d72 Mon Sep 17 00:00:00 2001 From: Diane Gallois-Wong Date: Tue, 14 Jun 2022 18:02:32 +0200 Subject: [PATCH] Proto/apply: do not hash again in record_operation --- src/proto_alpha/lib_protocol/apply.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/proto_alpha/lib_protocol/apply.ml b/src/proto_alpha/lib_protocol/apply.ml index bd65117ab13d..dc8add12474a 100644 --- a/src/proto_alpha/lib_protocol/apply.ml +++ b/src/proto_alpha/lib_protocol/apply.ml @@ -2607,7 +2607,8 @@ let get_predecessor_level = function | Partial_construction {predecessor_level; _} -> predecessor_level -let record_operation (type kind) ctxt (operation : kind operation) : context = +let record_operation (type kind) ctxt hash (operation : kind operation) : + context = match operation.protocol_data.contents with | Single (Preendorsement _) -> ctxt | Single (Endorsement _) -> ctxt @@ -2617,7 +2618,6 @@ let record_operation (type kind) ctxt (operation : kind operation) : context = | Double_endorsement_evidence _ | Double_preendorsement_evidence _ | Double_baking_evidence _ | Activate_account _ | Manager_operation _ ) | Cons (Manager_operation _, _) -> - let hash = Operation.hash operation in record_non_consensus_operation_hash ctxt hash type 'consensus_op_kind expected_consensus_content = { @@ -3195,7 +3195,7 @@ let apply_contents_list (type kind) ctxt chain_id (apply_mode : apply_mode) mode let apply_operation ctxt chain_id (apply_mode : apply_mode) mode ~payload_producer hash operation = let ctxt = Origination_nonce.init ctxt hash in - let ctxt = record_operation ctxt operation in + let ctxt = record_operation ctxt hash operation in apply_contents_list ctxt chain_id -- GitLab