From a69558c972af1e6695a64fece1882233c8b59da9 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Wed, 20 Nov 2024 17:06:22 +0100 Subject: [PATCH 1/8] proto/alpha: add proof in update_consensus_key operation --- .../lib_client/client_proto_context.ml | 4 +- .../lib_client/operation_result.ml | 10 ++- .../lib_protocol/alpha_context.mli | 6 +- src/proto_alpha/lib_protocol/apply.ml | 39 ++++++++- .../lib_protocol/operation_costs.mli | 2 + .../lib_protocol/operation_repr.ml | 19 +++-- .../lib_protocol/operation_repr.mli | 28 +++--- .../lib_protocol/test/helpers/op.ml | 4 +- src/proto_alpha/lib_protocol/validate.ml | 53 +++++++++++- .../lib_protocol/validate_errors.ml | 85 +++++++++++++++++++ .../lib_protocol/validate_errors.mli | 12 +++ 11 files changed, 232 insertions(+), 30 deletions(-) diff --git a/src/proto_alpha/lib_client/client_proto_context.ml b/src/proto_alpha/lib_client/client_proto_context.ml index 1d3f63ee6480..c81bac1296cf 100644 --- a/src/proto_alpha/lib_client/client_proto_context.ml +++ b/src/proto_alpha/lib_client/client_proto_context.ml @@ -336,8 +336,8 @@ let set_delegate cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ~fee_parameter opt_delegate -let build_update_consensus_key ?fee ?gas_limit ?storage_limit consensus_pk = - let operation = Update_consensus_key consensus_pk in +let build_update_consensus_key ?fee ?gas_limit ?storage_limit public_key = + let operation = Update_consensus_key {public_key; proof = None} in Injection.prepare_manager_operation ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index d918565a9af6..833a9ceaea6d 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -234,12 +234,18 @@ let pp_manager_operation_content (type kind) source ppf source Contract_hash.pp destination - | Update_consensus_key pk -> + | Update_consensus_key {public_key = pk; proof} -> Format.fprintf ppf - "Update_consensus_key:@,Public key hash: %a" + "Update_consensus_key:@,Public key hash: %a%a" Signature.Public_key_hash.pp (Signature.Public_key.hash pk) + (fun ppf proof -> + match proof with + | None -> () + | Some proof -> + Format.fprintf ppf "@,Proof of possession: %a" Signature.pp proof) + proof | Transfer_ticket {contents; ty; ticketer; amount; destination; entrypoint} -> Format.fprintf ppf diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 5cec78e991eb..d4ea21240cd5 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -4735,8 +4735,10 @@ and _ manager_operation = destination : Contract_hash.t; } -> Kind.increase_paid_storage manager_operation - | Update_consensus_key : - Signature.Public_key.t + | Update_consensus_key : { + public_key : Signature.Public_key.t; + proof : Signature.signature option; + } -> Kind.update_consensus_key manager_operation | Transfer_ticket : { contents : Script.lazy_expr; diff --git a/src/proto_alpha/lib_protocol/apply.ml b/src/proto_alpha/lib_protocol/apply.ml index 094b8b2ece5a..50db57b7c115 100644 --- a/src/proto_alpha/lib_protocol/apply.ml +++ b/src/proto_alpha/lib_protocol/apply.ml @@ -1425,14 +1425,49 @@ let apply_manager_operation : } in (ctxt, result, []) - | Update_consensus_key pk -> + | Update_consensus_key {public_key; proof} -> let*! is_registered = Delegate.registered ctxt source in let*? () = error_unless is_registered (Update_consensus_key_on_unregistered_delegate source) in - let* ctxt = Delegate.Consensus_key.register_update ctxt source pk in + let* ctxt = + match (public_key, proof) with + | Bls bls_public_key, Some (Bls _ as proof) -> + let*? ctxt = + let gas_cost_for_sig_check = + let open Saturation_repr.Syntax in + let size = Bls.Public_key.size bls_public_key in + Operation_costs.serialization_cost size + + Michelson_v1_gas.Cost_of.Interpreter.check_signature_on_algo + Bls + size + in + Gas.consume ctxt gas_cost_for_sig_check + in + let bytes = + match + Data_encoding.Binary.to_bytes_opt + Signature.Public_key.encoding + public_key + with + | None -> Bytes.empty (* Should never happen *) + | Some bytes -> bytes + in + let* () = + fail_unless + (Signature.check public_key proof bytes) + (Validate_errors.Manager + .Update_consensus_key_with_incorrect_proof + {public_key; proof}) + in + return ctxt + | _, _ -> return ctxt + in + let* ctxt = + Delegate.Consensus_key.register_update ctxt source public_key + in return ( ctxt, Update_consensus_key_result diff --git a/src/proto_alpha/lib_protocol/operation_costs.mli b/src/proto_alpha/lib_protocol/operation_costs.mli index f6005929711d..e90212326371 100644 --- a/src/proto_alpha/lib_protocol/operation_costs.mli +++ b/src/proto_alpha/lib_protocol/operation_costs.mli @@ -25,5 +25,7 @@ open Alpha_context +val serialization_cost : int -> Gas.cost + val check_signature_cost : Michelson_v1_gas.Cost_of.Interpreter.algo -> _ operation -> Gas.cost diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index e56a47747c24..d83ce5d1d99f 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -333,8 +333,10 @@ and _ manager_operation = destination : Contract_hash.t; } -> Kind.increase_paid_storage manager_operation - | Update_consensus_key : - Signature.Public_key.t + | Update_consensus_key : { + public_key : Signature.Public_key.t; + proof : Signature.signature option; + } -> Kind.update_consensus_key manager_operation | Transfer_ticket : { contents : Script_repr.lazy_expr; @@ -725,12 +727,19 @@ module Encoding = struct { tag = update_consensus_key_tag; name = "update_consensus_key"; - encoding = obj1 (req "pk" Signature.Public_key.encoding); + encoding = + obj2 + (req "pk" Signature.Public_key.encoding) + (opt "proof" (dynamic_size Signature.encoding)); select = (function | Manager (Update_consensus_key _ as op) -> Some op | _ -> None); - proj = (function Update_consensus_key consensus_pk -> consensus_pk); - inj = (fun consensus_pk -> Update_consensus_key consensus_pk); + proj = + (fun (Update_consensus_key {public_key; proof}) -> + (public_key, proof)); + inj = + (fun (public_key, proof) -> + Update_consensus_key {public_key; proof}); } let transfer_ticket_case = diff --git a/src/proto_alpha/lib_protocol/operation_repr.mli b/src/proto_alpha/lib_protocol/operation_repr.mli index dd74dc626a55..1f95e8091715 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.mli +++ b/src/proto_alpha/lib_protocol/operation_repr.mli @@ -399,19 +399,23 @@ and _ manager_operation = destination : Contract_hash.t; } -> Kind.increase_paid_storage manager_operation - (* [Update_consensus_key pk] updates the consensus key of - the signing delegate to [pk]. *) - | Update_consensus_key : - Signature.Public_key.t + (* [Update_consensus_key {public_key; proof}] updates the consensus key of the + signing delegate to [public_key]. To prevent rogue key attacks, a proof of + possession must be provided if and only if the new key is a BLS key. The + [proof] is a signature over the public key itself. *) + | Update_consensus_key : { + public_key : Signature.Public_key.t; + proof : Signature.signature option; + } -> Kind.update_consensus_key manager_operation - (** [Transfer_ticket] allows an implicit account (the "claimer") to - receive [amount] tickets, pulled out of [tx_rollup], to the - [entrypoint] of the smart contract [destination]. - - The ticket must have been addressed to the - claimer, who must be the source of this operation. It must have been - pulled out at [level] and from the message at [message_index]. The ticket - is composed of [ticketer; ty; contents]. *) + (** [Transfer_ticket] allows an implicit account (the "claimer") to receive + [amount] tickets, pulled out of [tx_rollup], to the [entrypoint] of the + smart contract [destination]. + + The ticket must have been addressed to the claimer, who must be the source + of this operation. It must have been pulled out at [level] and from the + message at [message_index]. The ticket is composed of [ticketer; ty; + contents]. *) | Transfer_ticket : { contents : Script_repr.lazy_expr; (** Contents of the withdrawn ticket *) ty : Script_repr.lazy_expr; diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.ml b/src/proto_alpha/lib_protocol/test/helpers/op.ml index cdfc072f0103..74fe4da7f491 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/op.ml @@ -1036,7 +1036,7 @@ let zk_rollup_origination ?force_reveal ?counter ?fee ?gas_limit ?storage_limit originated_zk_rollup op |> fun addr -> (op, addr) let update_consensus_key ?force_reveal ?counter ?fee ?gas_limit ?storage_limit - ctxt (src : Contract.t) pkh = + ctxt (src : Contract.t) public_key = let open Lwt_result_syntax in let* to_sign_op = manager_operation @@ -1047,7 +1047,7 @@ let update_consensus_key ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ?storage_limit ~source:src ctxt - (Update_consensus_key pkh) + (Update_consensus_key {public_key; proof = None}) in let+ account = Context.Contract.manager ctxt src in sign account.sk (Context.branch ctxt) to_sign_op diff --git a/src/proto_alpha/lib_protocol/validate.ml b/src/proto_alpha/lib_protocol/validate.ml index a29c0bf44a58..e860329487e6 100644 --- a/src/proto_alpha/lib_protocol/validate.ml +++ b/src/proto_alpha/lib_protocol/validate.ml @@ -2283,6 +2283,54 @@ module Manager = struct trace to this effect. *) record_trace Gas.Gas_limit_too_high + let check_update_consensus_key vi remaining_gas source + (public_key : Signature.Public_key.t) proof = + let open Result_syntax in + if Constants.allow_tz4_delegate_enable vi.ctxt then + match (public_key, proof) with + | Bls _bls_public_key, None -> + result_error + (Validate_errors.Manager.Update_consensus_key_with_tz4_without_proof + {source; public_key}) + | ( Bls _bls_public_key, + Some + ((Signature.Ed25519 _ | Signature.Secp256k1 _ | Signature.P256 _) as + proof) ) -> + result_error + (Validate_errors.Manager.Update_consensus_key_with_incorrect_proof + {public_key; proof}) + | Bls bls_public_key, Some (Signature.Bls _ | Signature.Unknown _) -> + (* Compute the gas cost to encode the consensus public key and + check the proof. *) + let gas_cost_for_sig_check = + let open Saturation_repr.Syntax in + let size = Bls.Public_key.size bls_public_key in + Operation_costs.serialization_cost size + + Michelson_v1_gas.Cost_of.Interpreter.check_signature_on_algo + Bls + size + in + let* (_ : Gas.Arith.fp) = + record_trace + Insufficient_gas_for_manager + (Gas.consume_from + (Gas.Arith.fp remaining_gas) + gas_cost_for_sig_check) + in + return_unit + | (Ed25519 _ | Secp256k1 _ | P256 _), Some _proof -> + result_error + (Validate_errors.Manager.Update_consensus_key_with_unused_proof + {source; public_key}) + | (Ed25519 _ | Secp256k1 _ | P256 _), None -> return_unit + else + let* () = Delegate.Consensus_key.check_not_tz4 public_key in + if Option.is_some proof then + result_error + (Validate_errors.Manager.Update_consensus_key_with_unused_proof + {source; public_key}) + else return_unit + let check_kind_specific_content (type kind) (contents : kind Kind.manager contents) remaining_gas vi = let open Result_syntax in @@ -2316,9 +2364,8 @@ module Manager = struct | Delegation (Some pkh) -> if Constants.allow_tz4_delegate_enable vi.ctxt then return_unit else Delegate.check_not_tz4 pkh - | Update_consensus_key pk -> - if Constants.allow_tz4_delegate_enable vi.ctxt then return_unit - else Delegate.Consensus_key.check_not_tz4 pk + | Update_consensus_key {public_key; proof} -> + check_update_consensus_key vi remaining_gas source public_key proof | Delegation None | Set_deposits_limit _ | Increase_paid_storage _ -> return_unit | Transfer_ticket {contents; ty; _} -> diff --git a/src/proto_alpha/lib_protocol/validate_errors.ml b/src/proto_alpha/lib_protocol/validate_errors.ml index 419644be0e64..851279eac98e 100644 --- a/src/proto_alpha/lib_protocol/validate_errors.ml +++ b/src/proto_alpha/lib_protocol/validate_errors.ml @@ -1213,6 +1213,18 @@ module Manager = struct counter : Manager_counter.t; } | Incorrect_reveal_position + | Update_consensus_key_with_tz4_without_proof of { + source : public_key_hash; + public_key : public_key; + } + | Update_consensus_key_with_incorrect_proof of { + public_key : public_key; + proof : signature; + } + | Update_consensus_key_with_unused_proof of { + source : public_key_hash; + public_key : public_key; + } | Insufficient_gas_for_manager | Gas_quota_exceeded_init_deserialize | Sc_rollup_arith_pvm_disabled @@ -1301,6 +1313,79 @@ module Manager = struct Data_encoding.empty (function Incorrect_reveal_position -> Some () | _ -> None) (fun () -> Incorrect_reveal_position) ; + register_error_kind + `Permanent + ~id:"validate.operation.update_consensus_key_with_tz4_without_proof" + ~title:"update consensus key with tz4 without proof" + ~description:"Update to a tz4 consensus key without proof of possession" + ~pp:(fun ppf (pk, source) -> + Format.fprintf + ppf + "Update to a BLS consensus key %a from %a should contain a proof of \ + possession." + Signature.Public_key_hash.pp + pk + Signature.Public_key.pp + source) + Data_encoding.( + obj2 + (req "source" Signature.Public_key_hash.encoding) + (req "public_key" Signature.Public_key.encoding)) + (function + | Update_consensus_key_with_tz4_without_proof {source; public_key} -> + Some (source, public_key) + | _ -> None) + (fun (source, public_key) -> + Update_consensus_key_with_tz4_without_proof {source; public_key}) ; + register_error_kind + `Permanent + ~id:"validate.operation.update_consensus_key_with_with_incorrect_proof" + ~title:"update consensus key with tz4 with incorrect proof" + ~description: + "Update to a tz4 consensus key with an incorrect proof of possession" + ~pp:(fun ppf (pk, proof) -> + Format.fprintf + ppf + "Update to a BLS consensus key %a contains an incorrect proof of \ + possession %a." + Signature.Public_key.pp + pk + Signature.pp + proof) + Data_encoding.( + obj2 + (req "public_key" Signature.Public_key.encoding) + (req "proof" Signature.encoding)) + (function + | Update_consensus_key_with_incorrect_proof {public_key; proof} -> + Some (public_key, proof) + | _ -> None) + (fun (public_key, proof) -> + Update_consensus_key_with_incorrect_proof {public_key; proof}) ; + register_error_kind + `Permanent + ~id:"validate.operation.update_consensus_key_with_unused_proof" + ~title:"update consensus key with unused proof" + ~description:"Update consensus key with unused proof of possession" + ~pp:(fun ppf (pk, source) -> + Format.fprintf + ppf + "Consensus key update to %a from %a contains an unused proof of \ + possession." + Signature.Public_key_hash.pp + pk + Signature.Public_key.pp + source) + Data_encoding.( + obj2 + (req "source" Signature.Public_key_hash.encoding) + (req "public_key" Signature.Public_key.encoding)) + (function + | Update_consensus_key_with_unused_proof {source; public_key} -> + Some (source, public_key) + | _ -> None) + (fun (source, public_key) -> + Update_consensus_key_with_unused_proof {source; public_key}) ; register_error_kind `Permanent ~id:"validate.operation.insufficient_gas_for_manager" diff --git a/src/proto_alpha/lib_protocol/validate_errors.mli b/src/proto_alpha/lib_protocol/validate_errors.mli index bded453f4dd3..e02ea172de03 100644 --- a/src/proto_alpha/lib_protocol/validate_errors.mli +++ b/src/proto_alpha/lib_protocol/validate_errors.mli @@ -201,6 +201,18 @@ module Manager : sig counter : Manager_counter.t; } | Incorrect_reveal_position + | Update_consensus_key_with_tz4_without_proof of { + source : public_key_hash; + public_key : public_key; + } + | Update_consensus_key_with_incorrect_proof of { + public_key : public_key; + proof : signature; + } + | Update_consensus_key_with_unused_proof of { + source : public_key_hash; + public_key : public_key; + } | Insufficient_gas_for_manager | Gas_quota_exceeded_init_deserialize | Sc_rollup_arith_pvm_disabled -- GitLab From 94d399cb10885a137da3e0b83ae3d874301cd7ec Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Wed, 20 Nov 2024 17:06:54 +0100 Subject: [PATCH 2/8] client/alpha: adapt update consensus key operation with proof --- .../lib_client/client_proto_context.ml | 51 +++++++++++++------ .../lib_client/client_proto_context.mli | 5 +- .../client_proto_context_commands.ml | 40 +++++++++++---- 3 files changed, 68 insertions(+), 28 deletions(-) diff --git a/src/proto_alpha/lib_client/client_proto_context.ml b/src/proto_alpha/lib_client/client_proto_context.ml index c81bac1296cf..0d89a4117bc4 100644 --- a/src/proto_alpha/lib_client/client_proto_context.ml +++ b/src/proto_alpha/lib_client/client_proto_context.ml @@ -336,20 +336,35 @@ let set_delegate cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ~fee_parameter opt_delegate -let build_update_consensus_key ?fee ?gas_limit ?storage_limit public_key = - let operation = Update_consensus_key {public_key; proof = None} in - Injection.prepare_manager_operation - ~fee:(Limit.of_option fee) - ~gas_limit:(Limit.of_option gas_limit) - ~storage_limit:(Limit.of_option storage_limit) - operation +let build_update_consensus_key cctxt ?fee ?gas_limit ?storage_limit + ?secret_key_uri public_key = + let open Lwt_result_syntax in + let* proof = + match ((public_key : Signature.public_key), secret_key_uri) with + | Bls _, Some secret_key_uri -> + let bytes = + Data_encoding.Binary.to_bytes_exn + Signature.Public_key.encoding + public_key + in + let* proof = Client_keys.sign cctxt secret_key_uri bytes in + return_some proof + | _ -> return_none + in + let operation = Update_consensus_key {public_key; proof} in + return + @@ Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + operation let register_as_delegate cctxt ~chain ~block ?confirmations ?dry_run - ?verbose_signing ?fee ~manager_sk ~fee_parameter ?consensus_pk src_pk = + ?verbose_signing ?fee ~manager_sk ~fee_parameter ?consensus_keys src_pk = let open Lwt_result_syntax in let source = Signature.Public_key.hash src_pk in let delegate_op = build_delegate_operation ?fee (Some source) in - match consensus_pk with + match consensus_keys with | None -> ( let operation = Annotated_manager_operation.Single_manager delegate_op in let* oph, _, op, result = @@ -372,12 +387,14 @@ let register_as_delegate cctxt ~chain ~block ?confirmations ?dry_run match Apply_results.pack_contents_list op result with | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> return ((oph, op, result), None)) - | Some consensus_pk -> ( - let operation = + | Some (public_key, secret_key_uri) -> ( + let* operation = + let+ operation_content = + build_update_consensus_key cctxt ?fee ?secret_key_uri public_key + in Annotated_manager_operation.Cons_manager ( delegate_op, - Annotated_manager_operation.Single_manager - (build_update_consensus_key ?fee consensus_pk) ) + Annotated_manager_operation.Single_manager operation_content ) in let* oph, _, op, result = Injection.inject_manager_operation @@ -408,11 +425,13 @@ let register_as_delegate cctxt ~chain ~block ?confirmations ?dry_run return ((oph, op1, res1), Some (op2, res2))) let update_consensus_key cctxt ~chain ~block ?confirmations ?dry_run - ?verbose_signing ?simulation ?fee ~consensus_pk ~manager_sk ~fee_parameter - src_pk = + ?verbose_signing ?simulation ?fee ?secret_key_uri ~public_key ~manager_sk + ~fee_parameter src_pk = let open Lwt_result_syntax in let source = Signature.Public_key.hash src_pk in - let operation = build_update_consensus_key ?fee consensus_pk in + let* operation = + build_update_consensus_key cctxt ?fee ?secret_key_uri public_key + in let operation = Annotated_manager_operation.Single_manager operation in let* oph, _, op, result = Injection.inject_manager_operation diff --git a/src/proto_alpha/lib_client/client_proto_context.mli b/src/proto_alpha/lib_client/client_proto_context.mli index cf4b7046e68f..c33a513fe4fd 100644 --- a/src/proto_alpha/lib_client/client_proto_context.mli +++ b/src/proto_alpha/lib_client/client_proto_context.mli @@ -209,7 +209,8 @@ val update_consensus_key : ?verbose_signing:bool -> ?simulation:bool -> ?fee:Tez.t -> - consensus_pk:Signature.public_key -> + ?secret_key_uri:Client_keys.sk_uri -> + public_key:Signature.public_key -> manager_sk:Client_keys.sk_uri -> fee_parameter:Injection.fee_parameter -> Signature.public_key -> @@ -283,7 +284,7 @@ val register_as_delegate : ?fee:Tez.t -> manager_sk:Client_keys.sk_uri -> fee_parameter:Injection.fee_parameter -> - ?consensus_pk:public_key -> + ?consensus_keys:public_key * Client_keys.sk_uri option -> public_key -> (Kind.delegation Kind.manager Injection.result * (Kind.update_consensus_key Kind.manager contents diff --git a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml index e71ea075a93a..e58f81f0b19c 100644 --- a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml +++ b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml @@ -2333,14 +2333,25 @@ let commands_rw () = @@ stop) (fun (fee, dry_run, verbose_signing, fee_parameter) src_pkh - (name_pk, consensus_pk) + (name_pk, public_key) cctxt -> let open Lwt_result_syntax in let* _, src_pk, src_sk = Client_keys.get_key cctxt src_pkh in - let* consensus_pk = - match consensus_pk with - | Some pk -> return pk - | None -> Client_keys.public_key name_pk + let* consensus_keys = + let* public_key = + match public_key with + | Some pk -> return pk + | None -> Client_keys.public_key name_pk + in + let* secret_key_uri = + match public_key with + | Bls _ -> + let pkh = Signature.Public_key.hash public_key in + let* _, _, secret_key_uri = Client_keys.get_key cctxt pkh in + return_some secret_key_uri + | _ -> return_none + in + return (public_key, secret_key_uri) in let*! r = register_as_delegate @@ -2353,7 +2364,7 @@ let commands_rw () = ~verbose_signing ?fee ~manager_sk:src_sk - ~consensus_pk + ~consensus_keys src_pk in match r with @@ -2377,17 +2388,25 @@ let commands_rw () = @@ stop) (fun (fee, dry_run, verbose_signing, fee_parameter) delegate_pkh - (name_pk, consensus_pk) + (name_pk, public_key) cctxt -> let open Lwt_result_syntax in let* _, delegate_pk, delegate_sk = Client_keys.get_key cctxt delegate_pkh in - let* consensus_pk = - match consensus_pk with + let* public_key = + match public_key with | Some pk -> return pk | None -> Client_keys.public_key name_pk in + let* secret_key_uri = + match public_key with + | Bls _ -> + let pkh = Signature.Public_key.hash public_key in + let* _, _, secret_key_uri = Client_keys.get_key cctxt pkh in + return_some secret_key_uri + | _ -> return_none + in let*! r = update_consensus_key cctxt @@ -2398,7 +2417,8 @@ let commands_rw () = ~fee_parameter ~verbose_signing ?fee - ~consensus_pk + ?secret_key_uri + ~public_key ~manager_sk:delegate_sk delegate_pk in -- GitLab From b4e880e2470336ec576d46b78645e6b08e1d5d78 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Wed, 20 Nov 2024 17:07:29 +0100 Subject: [PATCH 3/8] alpha/test: adapt update consensus key operation helper with proof --- src/proto_alpha/lib_protocol/test/helpers/op.ml | 16 ++++++++++++++-- src/proto_alpha/lib_protocol/test/helpers/op.mli | 6 ++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.ml b/src/proto_alpha/lib_protocol/test/helpers/op.ml index 74fe4da7f491..8533a584da89 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/op.ml @@ -1036,8 +1036,20 @@ let zk_rollup_origination ?force_reveal ?counter ?fee ?gas_limit ?storage_limit originated_zk_rollup op |> fun addr -> (op, addr) let update_consensus_key ?force_reveal ?counter ?fee ?gas_limit ?storage_limit - ctxt (src : Contract.t) public_key = + ?proof_signer ctxt (src : Contract.t) public_key = let open Lwt_result_syntax in + let* proof = + match proof_signer with + | None -> return_none + | Some account -> + let* account = Context.Contract.manager ctxt account in + let bytes = + Data_encoding.Binary.to_bytes_exn + Signature.Public_key.encoding + public_key + in + return_some (Signature.sign account.sk bytes) + in let* to_sign_op = manager_operation ?force_reveal @@ -1047,7 +1059,7 @@ let update_consensus_key ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ?storage_limit ~source:src ctxt - (Update_consensus_key {public_key; proof = None}) + (Update_consensus_key {public_key; proof}) in let+ account = Context.Contract.manager ctxt src in sign account.sk (Context.branch ctxt) to_sign_op diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.mli b/src/proto_alpha/lib_protocol/test/helpers/op.mli index 28c88c707459..cdbbd151e819 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/op.mli @@ -624,12 +624,18 @@ val zk_rollup_origination : nb_ops:int -> (Operation.packed * Zk_rollup.t) tzresult Lwt.t +(* [update_consensus_key ?proof_signer ctxt source public_key] tries to update + the consensus key of [source] to [public_key]. If a [proof_signer] is given, + we create a signature of the [public_key] using the [proof_signer] secret + key. This signature is then given as a [proof] in the update_consensus_key + operation. *) val update_consensus_key : ?force_reveal:bool -> ?counter:Manager_counter.t -> ?fee:Tez.t -> ?gas_limit:gas_limit -> ?storage_limit:Z.t -> + ?proof_signer:Contract.t -> Context.t -> Contract.t -> public_key -> -- GitLab From 2a8eb505c6167e86899dba9d5993366245307215 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Wed, 20 Nov 2024 17:31:03 +0100 Subject: [PATCH 4/8] alpha/test: add test for missing/incorrect/correct proof in update consensus key operation --- .../consensus/test_consensus_key.ml | 109 +++++++++++++++++- 1 file changed, 106 insertions(+), 3 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml index 8e96e3575cbd..8b2a6e156856 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml @@ -210,10 +210,10 @@ let test_drain_empty_delegate ~exclude_ck () = let test_tz4_consensus_key ~allow_tz4_delegate_enable () = let open Lwt_result_syntax in - let* genesis, contracts = + let* genesis, contract = Context.init_with_constants1 {constants with allow_tz4_delegate_enable} in - let account1_pkh = Context.Contract.pkh contracts in + let account1_pkh = Context.Contract.pkh contract in let consensus_account = Account.new_account ~algo:Bls () in let delegate = account1_pkh in let consensus_pk = consensus_account.pk in @@ -227,7 +227,67 @@ let test_tz4_consensus_key ~allow_tz4_delegate_enable () = let tz4_pk = match consensus_pk with Bls pk -> pk | _ -> assert false in let* inc = Incremental.begin_construction blk' in if allow_tz4_delegate_enable then - let* (_i : Incremental.t) = Incremental.validate_operation inc operation in + let expect_failure = function + | [ + Environment.Ecoproto_error + (Validate_errors.Manager.Update_consensus_key_with_tz4_without_proof + {source; public_key}); + ] + when Signature.Public_key.(public_key = consensus_pk) + && source = delegate -> + return_unit + | err -> + failwith + "Error trace:@,\ + \ %a does not match the \ + [Validate_errors.Manager.Update_consensus_key_with_tz4_without_proof] \ + error" + Error_monad.pp_print_trace + err + in + let* (_i : Incremental.t) = + Incremental.validate_operation ~expect_failure inc operation + in + let* operation_with_incorrect_proof = + Op.update_consensus_key + ~proof_signer:contract + (B blk') + (Contract.Implicit delegate) + consensus_pk + in + let expect_failure = function + | [ + Environment.Ecoproto_error + (Validate_errors.Manager.Update_consensus_key_with_incorrect_proof + {public_key; proof = _}); + ] + when Signature.Public_key.(public_key = consensus_pk) -> + return_unit + | err -> + failwith + "Error trace:@,\ + \ %a does not match the \ + [Validate_errors.Manager.Update_consensus_key_with_incorrect_proof] \ + error" + Error_monad.pp_print_trace + err + in + let* (_i : Incremental.t) = + Incremental.validate_operation + ~expect_failure + inc + operation_with_incorrect_proof + in + let* operation_with_correct_proof = + Op.update_consensus_key + ~proof_signer:(Contract.Implicit consensus_account.pkh) + (B blk') + (Contract.Implicit delegate) + consensus_pk + in + let* (_i : Incremental.t) = + Incremental.add_operation inc operation_with_correct_proof + in return_unit else let expect_failure = function @@ -251,6 +311,45 @@ let test_tz4_consensus_key ~allow_tz4_delegate_enable () = in return_unit +let test_consensus_key_with_unused_proof () = + let open Lwt_result_syntax in + let* genesis, contract = Context.init_with_constants1 constants in + let account1_pkh = Context.Contract.pkh contract in + let consensus_account = Account.new_account () in + let delegate = account1_pkh in + let consensus_pk = consensus_account.pk in + let consensus_pkh = consensus_account.pkh in + let* blk' = + transfer_tokens genesis account1_pkh consensus_pkh Tez.one_mutez + in + let* operation = + Op.update_consensus_key + ~proof_signer:(Contract.Implicit consensus_account.pkh) + (B blk') + (Contract.Implicit delegate) + consensus_pk + in + let* inc = Incremental.begin_construction blk' in + let expect_failure = function + | [ + Environment.Ecoproto_error + (Validate_errors.Manager.Update_consensus_key_with_unused_proof _); + ] -> + return_unit + | err -> + failwith + "Error trace:@,\ + \ %a does not match the \ + [Validate_errors.Manager.Update_consensus_key_with_unused_proof] \ + error" + Error_monad.pp_print_trace + err + in + let* (_i : Incremental.t) = + Incremental.validate_operation ~expect_failure inc operation + in + return_unit + let test_attestation_with_consensus_key () = let open Lwt_result_syntax in let* genesis, contracts = Context.init_with_constants1 constants in @@ -351,6 +450,10 @@ let tests = "tz4 consensus key (allow_tz4_delegate_enable:true)" `Quick (test_tz4_consensus_key ~allow_tz4_delegate_enable:true); + tztest + "consensus key update with unused proof" + `Quick + test_consensus_key_with_unused_proof; tztest "attestation with ck" `Quick test_attestation_with_consensus_key; ] -- GitLab From 2ecd7c53d738b4b9913ffd76435e3f55ded38217 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Thu, 21 Nov 2024 09:24:52 +0100 Subject: [PATCH 5/8] katai: update struct --- .../files/alpha__operation.ksy | 21 ++++++++++++++++++- .../files/alpha__operation__contents.ksy | 21 ++++++++++++++++++- .../files/alpha__operation__contents_list.ksy | 21 ++++++++++++++++++- .../files/alpha__operation__protocol_data.ksy | 21 ++++++++++++++++++- .../files/alpha__operation__unsigned.ksy | 21 ++++++++++++++++++- 5 files changed, 100 insertions(+), 5 deletions(-) diff --git a/client-libs/kaitai-struct-files/files/alpha__operation.ksy b/client-libs/kaitai-struct-files/files/alpha__operation.ksy index 2c8c5dc05a2f..8c818a43d5b1 100644 --- a/client-libs/kaitai-struct-files/files/alpha__operation.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__operation.ksy @@ -916,6 +916,19 @@ types: - id: private_pis_elt_field1 type: private_pis_elt_field1 proof: + seq: + - id: signature__v1 + size-eos: true + proof_0: + seq: + - id: len_proof + type: u4be + valid: + max: 1073741823 + - id: proof + type: proof + size: len_proof + proof_1: seq: - id: pvm_step type: bytes_dyn_uint30 @@ -1290,7 +1303,7 @@ types: type: dissection_0 if: (step_tag == step_tag::dissection) - id: proof - type: proof + type: proof_1 if: (step_tag == step_tag::proof) transaction: seq: @@ -1375,6 +1388,12 @@ types: - id: pk type: public_key doc: A Ed25519, Secp256k1, or P256 public key + - id: proof_tag + type: u1 + enum: bool + - id: proof + type: proof_0 + if: (proof_tag == bool::true) whitelist: seq: - id: whitelist_entries diff --git a/client-libs/kaitai-struct-files/files/alpha__operation__contents.ksy b/client-libs/kaitai-struct-files/files/alpha__operation__contents.ksy index 9af256a21069..0b46a2d475f5 100644 --- a/client-libs/kaitai-struct-files/files/alpha__operation__contents.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__operation__contents.ksy @@ -893,6 +893,19 @@ types: - id: private_pis_elt_field1 type: private_pis_elt_field1 proof: + seq: + - id: signature__v1 + size-eos: true + proof_0: + seq: + - id: len_proof + type: u4be + valid: + max: 1073741823 + - id: proof + type: proof + size: len_proof + proof_1: seq: - id: pvm_step type: bytes_dyn_uint30 @@ -1267,7 +1280,7 @@ types: type: dissection_0 if: (step_tag == step_tag::dissection) - id: proof - type: proof + type: proof_1 if: (step_tag == step_tag::proof) transaction: seq: @@ -1352,6 +1365,12 @@ types: - id: pk type: public_key doc: A Ed25519, Secp256k1, or P256 public key + - id: proof_tag + type: u1 + enum: bool + - id: proof + type: proof_0 + if: (proof_tag == bool::true) whitelist: seq: - id: whitelist_entries diff --git a/client-libs/kaitai-struct-files/files/alpha__operation__contents_list.ksy b/client-libs/kaitai-struct-files/files/alpha__operation__contents_list.ksy index 6c10ba5fa716..e297bc8de3ac 100644 --- a/client-libs/kaitai-struct-files/files/alpha__operation__contents_list.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__operation__contents_list.ksy @@ -897,6 +897,19 @@ types: - id: private_pis_elt_field1 type: private_pis_elt_field1 proof: + seq: + - id: signature__v1 + size-eos: true + proof_0: + seq: + - id: len_proof + type: u4be + valid: + max: 1073741823 + - id: proof + type: proof + size: len_proof + proof_1: seq: - id: pvm_step type: bytes_dyn_uint30 @@ -1271,7 +1284,7 @@ types: type: dissection_0 if: (step_tag == step_tag::dissection) - id: proof - type: proof + type: proof_1 if: (step_tag == step_tag::proof) transaction: seq: @@ -1356,6 +1369,12 @@ types: - id: pk type: public_key doc: A Ed25519, Secp256k1, or P256 public key + - id: proof_tag + type: u1 + enum: bool + - id: proof + type: proof_0 + if: (proof_tag == bool::true) whitelist: seq: - id: whitelist_entries diff --git a/client-libs/kaitai-struct-files/files/alpha__operation__protocol_data.ksy b/client-libs/kaitai-struct-files/files/alpha__operation__protocol_data.ksy index 6029ec16621e..b3a66606d2db 100644 --- a/client-libs/kaitai-struct-files/files/alpha__operation__protocol_data.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__operation__protocol_data.ksy @@ -916,6 +916,19 @@ types: - id: private_pis_elt_field1 type: private_pis_elt_field1 proof: + seq: + - id: signature__v1 + size-eos: true + proof_0: + seq: + - id: len_proof + type: u4be + valid: + max: 1073741823 + - id: proof + type: proof + size: len_proof + proof_1: seq: - id: pvm_step type: bytes_dyn_uint30 @@ -1290,7 +1303,7 @@ types: type: dissection_0 if: (step_tag == step_tag::dissection) - id: proof - type: proof + type: proof_1 if: (step_tag == step_tag::proof) transaction: seq: @@ -1375,6 +1388,12 @@ types: - id: pk type: public_key doc: A Ed25519, Secp256k1, or P256 public key + - id: proof_tag + type: u1 + enum: bool + - id: proof + type: proof_0 + if: (proof_tag == bool::true) whitelist: seq: - id: whitelist_entries diff --git a/client-libs/kaitai-struct-files/files/alpha__operation__unsigned.ksy b/client-libs/kaitai-struct-files/files/alpha__operation__unsigned.ksy index 55743ab0d306..cd5290993032 100644 --- a/client-libs/kaitai-struct-files/files/alpha__operation__unsigned.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__operation__unsigned.ksy @@ -904,6 +904,19 @@ types: - id: private_pis_elt_field1 type: private_pis_elt_field1 proof: + seq: + - id: signature__v1 + size-eos: true + proof_0: + seq: + - id: len_proof + type: u4be + valid: + max: 1073741823 + - id: proof + type: proof + size: len_proof + proof_1: seq: - id: pvm_step type: bytes_dyn_uint30 @@ -1278,7 +1291,7 @@ types: type: dissection_0 if: (step_tag == step_tag::dissection) - id: proof - type: proof + type: proof_1 if: (step_tag == step_tag::proof) transaction: seq: @@ -1363,6 +1376,12 @@ types: - id: pk type: public_key doc: A Ed25519, Secp256k1, or P256 public key + - id: proof_tag + type: u1 + enum: bool + - id: proof + type: proof_0 + if: (proof_tag == bool::true) whitelist: seq: - id: whitelist_entries -- GitLab From c5aeb46e52e59d5ea9f2435ef2dba293353fc4b1 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Thu, 21 Nov 2024 10:55:56 +0100 Subject: [PATCH 6/8] tezt/lib_tezos: obfuscate signature in regression hooks --- tezt/lib_tezos/tezos_regression.ml | 54 ++++++++++++++--------------- tezt/lib_tezos/tezos_regression.mli | 5 ++- tezt/tests/consensus_key.ml | 9 ++++- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/tezt/lib_tezos/tezos_regression.ml b/tezt/lib_tezos/tezos_regression.ml index 97daf11dcb5f..6e147c5a0c05 100644 --- a/tezt/lib_tezos/tezos_regression.ml +++ b/tezt/lib_tezos/tezos_regression.ml @@ -23,36 +23,36 @@ (* *) (*****************************************************************************) +let replacements = + [ + ("sh\\w{72}\\b", "[DAL_SLOT_HEADER]"); + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3752 + Remove this regexp as soon as the WASM PVM stabilizes. *) + ("srs\\w{51}\\b", "[SC_ROLLUP_PVM_STATE_HASH]"); + ("\\bB\\w{50}\\b", "[BLOCK_HASH]"); + ("SRCo\\w{50}\\b", "[SC_ROLLUP_CONTEXT_HASH]"); + ("Co\\w{50}\\b", "[CONTEXT_HASH]"); + ("src1\\w{50}\\b", "[SC_ROLLUP_COMMITMENT_HASH]"); + ("srib1\\w{50}\\b", "[SC_ROLLUP_INBOX_HASH]"); + ("srib2\\w{50}\\b", "[SC_ROLLUP_INBOX_MERKELIZED_PAYLOAD_HASHES_HASH]"); + ("srib3\\w{50}\\b", "[SC_ROLLUP_INBOX_MESSAGE_HASH]"); + ("edpk\\w{50}\\b", "[PUBLIC_KEY]"); + ("\\bo\\w{50}\\b", "[OPERATION_HASH]"); + ("tz[1234]\\w{33}\\b", "[PUBLIC_KEY_HASH]"); + ("sr1\\w{33}\\b", "[SMART_ROLLUP_HASH]"); + ("KT1\\w{33}\\b", "[CONTRACT_HASH]"); + ("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z", "[TIMESTAMP]"); + (* Ports are non-deterministic when using -j. *) + ("/localhost:\\d{4,5}/", "/[HOST]:[PORT]/"); + ("/127.0.0.1:\\d{4,5}/", "/[HOST]:[PORT]/"); + ("/\\[::1\\]:\\d{4,5}/", "/[HOST]:[PORT]/"); + ] + (* Replace variables that may change between different runs by constants. Order them by length. *) -let replace_variables string = - let replacements = - [ - ("sh\\w{72}\\b", "[DAL_SLOT_HEADER]"); - (* TODO: https://gitlab.com/tezos/tezos/-/issues/3752 - Remove this regexp as soon as the WASM PVM stabilizes. *) - ("srs\\w{51}\\b", "[SC_ROLLUP_PVM_STATE_HASH]"); - ("\\bB\\w{50}\\b", "[BLOCK_HASH]"); - ("SRCo\\w{50}\\b", "[SC_ROLLUP_CONTEXT_HASH]"); - ("Co\\w{50}\\b", "[CONTEXT_HASH]"); - ("src1\\w{50}\\b", "[SC_ROLLUP_COMMITMENT_HASH]"); - ("srib1\\w{50}\\b", "[SC_ROLLUP_INBOX_HASH]"); - ("srib2\\w{50}\\b", "[SC_ROLLUP_INBOX_MERKELIZED_PAYLOAD_HASHES_HASH]"); - ("srib3\\w{50}\\b", "[SC_ROLLUP_INBOX_MESSAGE_HASH]"); - ("edpk\\w{50}\\b", "[PUBLIC_KEY]"); - ("\\bo\\w{50}\\b", "[OPERATION_HASH]"); - ("tz[1234]\\w{33}\\b", "[PUBLIC_KEY_HASH]"); - ("sr1\\w{33}\\b", "[SMART_ROLLUP_HASH]"); - ("KT1\\w{33}\\b", "[CONTRACT_HASH]"); - ("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z", "[TIMESTAMP]"); - (* Ports are non-deterministic when using -j. *) - ("/localhost:\\d{4,5}/", "/[HOST]:[PORT]/"); - ("/127.0.0.1:\\d{4,5}/", "/[HOST]:[PORT]/"); - ("/\\[::1\\]:\\d{4,5}/", "/[HOST]:[PORT]/"); - ] - in +let replace_variables ?(replacements = replacements) string = List.fold_left (fun string (replace, by) -> replace_string ~all:true (rex replace) ~by string) @@ -63,7 +63,7 @@ let scrubbed_global_options = ["--base-dir"; "-d"; "--endpoint"; "-E"; "--sources"] let hooks_custom ?(scrubbed_global_options = scrubbed_global_options) - ?(replace_variables = replace_variables) () = + ?(replace_variables = replace_variables ~replacements) () = let on_spawn command arguments = (* Remove arguments that shouldn't be captured in regression output. *) let arguments, _ = diff --git a/tezt/lib_tezos/tezos_regression.mli b/tezt/lib_tezos/tezos_regression.mli index 1728a7dfe188..0d9e1ed268f8 100644 --- a/tezt/lib_tezos/tezos_regression.mli +++ b/tezt/lib_tezos/tezos_regression.mli @@ -25,10 +25,13 @@ (** Tezos-specific extension for the [Regression] module. *) +(** List of default replacement *) +val replacements : (string * string) list + (** [replace_variables log] returns [log] with all occurrences of variables such as contract addresses, hashes etc. that may change between different runs replaced by constants. *) -val replace_variables : string -> string +val replace_variables : ?replacements:(string * string) list -> string -> string (** Custom Tezos-specific regression hooks that replaces Tezos-specific values with constants. diff --git a/tezt/tests/consensus_key.ml b/tezt/tests/consensus_key.ml index f2643421b928..eeb3140fb8c2 100644 --- a/tezt/tests/consensus_key.ml +++ b/tezt/tests/consensus_key.ml @@ -34,7 +34,14 @@ let team = Tag.layer1 -let hooks = Tezos_regression.hooks +let hooks = + let replacements = + ("edsig\\w{94}", "[SIGNATURE]") :: Tezos_regression.replacements + in + Tezos_regression.hooks_custom + ~replace_variables:(fun s -> + Tezos_regression.replace_variables ~replacements s) + () let blocks_per_cycle = 4 -- GitLab From 5d2d2c52759e010bc55f16451d62819decb405ba Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Thu, 21 Nov 2024 09:33:34 +0100 Subject: [PATCH 7/8] tezt/tests: update consensus key regression file --- tezt/tests/consensus_key.ml | 13 +- ... - delegate - consensus - destination).out | 10 +- ...- delegate - consensus -- destination).out | 10 +- ...-- delegate - consensus - destination).out | 56 +++--- ...- delegate - consensus -- destination).out | 54 +++--- ...lpha- Test register with consensus key.out | 32 ++-- ... set consensus key - baker is delegate.out | 10 +- ... consensus key - baker is not delegate.out | 34 ++-- .../Alpha- update consensus key.out | 171 ++++++++++++++++++ .../Parisc- update consensus key.out | 144 +++++++++++++++ .../Quebec- update consensus key.out | 144 +++++++++++++++ 11 files changed, 573 insertions(+), 105 deletions(-) create mode 100644 tezt/tests/expected/consensus_key.ml/Alpha- update consensus key.out create mode 100644 tezt/tests/expected/consensus_key.ml/Parisc- update consensus key.out create mode 100644 tezt/tests/expected/consensus_key.ml/Quebec- update consensus key.out diff --git a/tezt/tests/consensus_key.ml b/tezt/tests/consensus_key.ml index eeb3140fb8c2..1be802860f1f 100644 --- a/tezt/tests/consensus_key.ml +++ b/tezt/tests/consensus_key.ml @@ -36,7 +36,9 @@ let team = Tag.layer1 let hooks = let replacements = - ("edsig\\w{94}", "[SIGNATURE]") :: Tezos_regression.replacements + ("edsig\\w{94}", "[SIGNATURE]") + :: ("BLsig\\w{137}", "[BLS_SIGNATURE]") + :: Tezos_regression.replacements in Tezos_regression.hooks_custom ~replace_variables:(fun s -> @@ -91,7 +93,7 @@ open Helpers tests succeeding for wrong reasons. *) let test_update_consensus_key = - Protocol.register_test + Protocol.register_regression_test ~__FILE__ ~title:"update consensus key" ~tags:[team; "consensus_key"] @@ -180,6 +182,7 @@ let test_update_consensus_key = if Protocol.(number protocol > number Quebec) then ( Log.info "Valid update: changing the consensus key to a BLS key." ; Client.update_consensus_key + ~hooks ~expect_failure:false ~src:Constant.bootstrap5.alias ~pk:key_bls.alias @@ -196,6 +199,7 @@ let test_update_consensus_key = Log.info "Trying a valid consensus key update." ; let* () = Client.update_consensus_key + ~hooks ~src:Constant.bootstrap1.alias ~pk:key_a.alias client @@ -264,6 +268,7 @@ let test_update_consensus_key = Log.info "Switch back to the initial consensus key." ; let* () = Client.update_consensus_key + ~hooks ~src:Constant.bootstrap1.alias ~pk:Constant.bootstrap1.alias client @@ -290,12 +295,14 @@ let test_update_consensus_key = `key_c`, respectively..." ; let* () = Client.update_consensus_key + ~hooks ~src:Constant.bootstrap3.alias ~pk:key_a.alias client in let* () = Client.update_consensus_key + ~hooks ~src:Constant.bootstrap4.alias ~pk:key_c.alias client @@ -373,6 +380,7 @@ let test_update_consensus_key = Log.info "Inject a valid drain..." ; let* () = Client.drain_delegate + ~hooks ~delegate:Constant.bootstrap4.alias ~consensus_key:key_c.alias ~destination:destination.alias @@ -417,6 +425,7 @@ let test_update_consensus_key = in let* () = Client.drain_delegate + ~hooks ~delegate:Constant.bootstrap3.alias ~consensus_key:key_a.alias ~destination:destination.alias diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out index 44cc93ce58fa..575f7a5b9e20 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out @@ -1,7 +1,7 @@ ./octez-client --wait none set consensus key for bootstrap1 to dummy_account_0 Node is bootstrapped. -Estimated gas: 168.946 units (will add 100 for safety) +Estimated gas: 168.980 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -12,17 +12,17 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000284 + Fee to the baker: ꜩ0.000285 Expected counter: 1 Gas limit: 269 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000284 - payload fees(the block proposer) ....... +ꜩ0.000284 + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 Update_consensus_key: Public key hash: [PUBLIC_KEY_HASH] This consensus key update was successfully applied - Consumed gas: 168.880 + Consumed gas: 168.913 ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out index 66a3dfb62971..33dbb8cc326a 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out @@ -1,7 +1,7 @@ ./octez-client --wait none set consensus key for bootstrap1 to dummy_account_0 Node is bootstrapped. -Estimated gas: 168.946 units (will add 100 for safety) +Estimated gas: 168.980 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -12,17 +12,17 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000284 + Fee to the baker: ꜩ0.000285 Expected counter: 1 Gas limit: 269 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000284 - payload fees(the block proposer) ....... +ꜩ0.000284 + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 Update_consensus_key: Public key hash: [PUBLIC_KEY_HASH] This consensus key update was successfully applied - Consumed gas: 168.880 + Consumed gas: 168.913 ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out index 5b099b7f2d6a..01bd27d4d0cd 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out @@ -1,7 +1,7 @@ ./octez-client --wait none set consensus key for bootstrap1 to dummy_account_0 Node is bootstrapped. -Estimated gas: 168.946 units (will add 100 for safety) +Estimated gas: 168.980 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -12,17 +12,17 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000284 + Fee to the baker: ꜩ0.000285 Expected counter: 1 Gas limit: 269 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000284 - payload fees(the block proposer) ....... +ꜩ0.000284 + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 Update_consensus_key: Public key hash: [PUBLIC_KEY_HASH] This consensus key update was successfully applied - Consumed gas: 168.880 + Consumed gas: 168.913 ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' @@ -70,19 +70,19 @@ This sequence of operations was run: "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, - "pending_staking_parameters": [], "baking_power": "1466666666572", - "total_staked": "200000000000", "total_delegated": "3799999999716", + "pending_staking_parameters": [], "baking_power": "1466666666571", + "total_staked": "200000000000", "total_delegated": "3799999999715", "min_delegated_in_current_cycle": - { "amount": "3799999999716", + { "amount": "3799999999715", "level": { "level": 2, "level_position": 1, "cycle": 0, "cycle_position": 1, "expected_commitment": false } }, - "own_full_balance": "3999999999716", "own_staked": "200000000000", - "own_delegated": "3799999999716", "external_staked": "0", + "own_full_balance": "3999999999715", "own_staked": "200000000000", + "own_delegated": "3799999999715", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "3999999999716", + "staking_denominator": "0", "current_voting_power": "3999999999715", "voting_power": "4000000000000", "voting_info": { "voting_power": "4000000000000", "remaining_proposals": 20 }, @@ -108,20 +108,20 @@ This sequence of operations was run: "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, - "pending_staking_parameters": [], "baking_power": "1466667371027", - "total_staked": "200000148243", "total_delegated": "3800002816253", + "pending_staking_parameters": [], "baking_power": "1466667371026", + "total_staked": "200000148243", "total_delegated": "3800002816252", "min_delegated_in_current_cycle": - { "amount": "3800001668352", + { "amount": "3800001668351", "level": { "level": 5, "level_position": 4, "cycle": 1, "cycle_position": 0, "expected_commitment": false } }, - "own_full_balance": "4000002964496", "own_staked": "200000148243", - "own_delegated": "3800002816253", "external_staked": "0", + "own_full_balance": "4000002964495", "own_staked": "200000148243", + "own_delegated": "3800002816252", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" }, { "cycle": 1, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "4000002964496", + "staking_denominator": "0", "current_voting_power": "4000002964495", "voting_power": "4000000000000", "voting_info": { "voting_power": "4000000000000", "remaining_proposals": 20 }, @@ -144,20 +144,20 @@ This sequence of operations was run: "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, - "pending_staking_parameters": [], "baking_power": "1466667371027", - "total_staked": "200000148243", "total_delegated": "3800002816253", + "pending_staking_parameters": [], "baking_power": "1466667371026", + "total_staked": "200000148243", "total_delegated": "3800002816252", "min_delegated_in_current_cycle": - { "amount": "3800001668352", + { "amount": "3800001668351", "level": { "level": 5, "level_position": 4, "cycle": 1, "cycle_position": 0, "expected_commitment": false } }, - "own_full_balance": "4000002964496", "own_staked": "200000148243", - "own_delegated": "3800002816253", "external_staked": "0", + "own_full_balance": "4000002964495", "own_staked": "200000148243", + "own_delegated": "3800002816252", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" }, { "cycle": 1, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "4000002964496", + "staking_denominator": "0", "current_voting_power": "4000002964495", "voting_power": "4000000000000", "voting_info": { "voting_power": "4000000000000", "remaining_proposals": 20 }, @@ -171,7 +171,7 @@ This sequence of operations was run: "delegators": [ "[PUBLIC_KEY_HASH]" ] } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' -"3800002816253" +"3800002816252" ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' "0" @@ -195,8 +195,8 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.06425 storage fees ........................... +ꜩ0.06425 - [PUBLIC_KEY_HASH] ... -ꜩ3762002.724483 - [PUBLIC_KEY_HASH] ... +ꜩ3762002.724483 + [PUBLIC_KEY_HASH] ... -ꜩ3762002.724482 + [PUBLIC_KEY_HASH] ... +ꜩ3762002.724482 [PUBLIC_KEY_HASH] ... -ꜩ38000.02752 [PUBLIC_KEY_HASH] ... +ꜩ38000.02752 @@ -241,7 +241,7 @@ This sequence of operations was run: "38000035050" ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' -"3762002724483" +"3762002724482" ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' -"3762002724483" +"3762002724482" diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out index 914e5ab747e2..583130e444db 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out @@ -1,7 +1,7 @@ ./octez-client --wait none set consensus key for bootstrap1 to dummy_account_0 Node is bootstrapped. -Estimated gas: 168.946 units (will add 100 for safety) +Estimated gas: 168.980 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -12,17 +12,17 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000284 + Fee to the baker: ꜩ0.000285 Expected counter: 1 Gas limit: 269 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000284 - payload fees(the block proposer) ....... +ꜩ0.000284 + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 Update_consensus_key: Public key hash: [PUBLIC_KEY_HASH] This consensus key update was successfully applied - Consumed gas: 168.880 + Consumed gas: 168.913 ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' @@ -70,19 +70,19 @@ This sequence of operations was run: "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, - "pending_staking_parameters": [], "baking_power": "1466666666572", - "total_staked": "200000000000", "total_delegated": "3799999999716", + "pending_staking_parameters": [], "baking_power": "1466666666571", + "total_staked": "200000000000", "total_delegated": "3799999999715", "min_delegated_in_current_cycle": - { "amount": "3799999999716", + { "amount": "3799999999715", "level": { "level": 2, "level_position": 1, "cycle": 0, "cycle_position": 1, "expected_commitment": false } }, - "own_full_balance": "3999999999716", "own_staked": "200000000000", - "own_delegated": "3799999999716", "external_staked": "0", + "own_full_balance": "3999999999715", "own_staked": "200000000000", + "own_delegated": "3799999999715", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "3999999999716", + "staking_denominator": "0", "current_voting_power": "3999999999715", "voting_power": "4000000000000", "voting_info": { "voting_power": "4000000000000", "remaining_proposals": 20 }, @@ -108,20 +108,20 @@ This sequence of operations was run: "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, - "pending_staking_parameters": [], "baking_power": "1466667371027", - "total_staked": "200000148243", "total_delegated": "3800002816253", + "pending_staking_parameters": [], "baking_power": "1466667371026", + "total_staked": "200000148243", "total_delegated": "3800002816252", "min_delegated_in_current_cycle": - { "amount": "3800001668352", + { "amount": "3800001668351", "level": { "level": 5, "level_position": 4, "cycle": 1, "cycle_position": 0, "expected_commitment": false } }, - "own_full_balance": "4000002964496", "own_staked": "200000148243", - "own_delegated": "3800002816253", "external_staked": "0", + "own_full_balance": "4000002964495", "own_staked": "200000148243", + "own_delegated": "3800002816252", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" }, { "cycle": 1, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "4000002964496", + "staking_denominator": "0", "current_voting_power": "4000002964495", "voting_power": "4000000000000", "voting_info": { "voting_power": "4000000000000", "remaining_proposals": 20 }, @@ -144,20 +144,20 @@ This sequence of operations was run: "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, - "pending_staking_parameters": [], "baking_power": "1466667371027", - "total_staked": "200000148243", "total_delegated": "3800002816253", + "pending_staking_parameters": [], "baking_power": "1466667371026", + "total_staked": "200000148243", "total_delegated": "3800002816252", "min_delegated_in_current_cycle": - { "amount": "3800001668352", + { "amount": "3800001668351", "level": { "level": 5, "level_position": 4, "cycle": 1, "cycle_position": 0, "expected_commitment": false } }, - "own_full_balance": "4000002964496", "own_staked": "200000148243", - "own_delegated": "3800002816253", "external_staked": "0", + "own_full_balance": "4000002964495", "own_staked": "200000148243", + "own_delegated": "3800002816252", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" }, { "cycle": 1, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "4000002964496", + "staking_denominator": "0", "current_voting_power": "4000002964495", "voting_power": "4000000000000", "voting_info": { "voting_power": "4000000000000", "remaining_proposals": 20 }, @@ -171,7 +171,7 @@ This sequence of operations was run: "delegators": [ "[PUBLIC_KEY_HASH]" ] } ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' -"3800002816253" +"3800002816252" ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' "0" @@ -195,8 +195,8 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.06425 storage fees ........................... +ꜩ0.06425 - [PUBLIC_KEY_HASH] ... -ꜩ3762002.724483 - [PUBLIC_KEY_HASH] ... +ꜩ3762002.724483 + [PUBLIC_KEY_HASH] ... -ꜩ3762002.724482 + [PUBLIC_KEY_HASH] ... +ꜩ3762002.724482 [PUBLIC_KEY_HASH] ... -ꜩ38000.02752 [PUBLIC_KEY_HASH] ... +ꜩ38000.02752 @@ -244,4 +244,4 @@ This sequence of operations was run: "0" ./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' -"3762002724483" +"3762002724482" diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out index eb85be67c3ac..04886b28da7c 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out @@ -4,7 +4,7 @@ ./octez-client --wait none register key dummy_account_0 as delegate with consensus key dummy_account_1 Node is bootstrapped. -Estimated gas: 172.756 units (will add 0 for safety) +Estimated gas: 172.789 units (will add 0 for safety) Estimated storage: no bytes added Estimated gas: 100 units (will add 0 for safety) Estimated storage: no bytes added @@ -30,7 +30,7 @@ This sequence of operations was run: Contract: [PUBLIC_KEY_HASH] Key: [PUBLIC_KEY] This revelation was successfully applied - Consumed gas: 172.524 + Consumed gas: 172.557 Manager signed operations: From: [PUBLIC_KEY_HASH] Fee to the baker: ꜩ0.000159 @@ -47,13 +47,13 @@ This sequence of operations was run: Consumed gas: 100 Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000181 + Fee to the baker: ꜩ0.000182 Expected counter: 4 Gas limit: 200 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000181 - payload fees(the block proposer) ....... +ꜩ0.000181 + [PUBLIC_KEY_HASH] ... -ꜩ0.000182 + payload fees(the block proposer) ....... +ꜩ0.000182 Update_consensus_key: Public key hash: [PUBLIC_KEY_HASH] This consensus key update was successfully applied @@ -71,18 +71,18 @@ This sequence of operations was run: { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, "pending_staking_parameters": [], "baking_power": "0", "total_staked": "0", - "total_delegated": "999999999385", + "total_delegated": "999999999384", "min_delegated_in_current_cycle": - { "amount": "999999999385", + { "amount": "999999999384", "level": { "level": 3, "level_position": 2, "cycle": 0, "cycle_position": 2, "expected_commitment": false } }, - "own_full_balance": "999999999385", "own_staked": "0", - "own_delegated": "999999999385", "external_staked": "0", + "own_full_balance": "999999999384", "own_staked": "0", + "own_delegated": "999999999384", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "999999999385", + "staking_denominator": "0", "current_voting_power": "999999999384", "voting_power": "0", "voting_info": {}, "consensus_key": { "active": @@ -106,20 +106,20 @@ This sequence of operations was run: "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, - "pending_staking_parameters": [], "baking_power": "666666666254", - "total_staked": "500000000000", "total_delegated": "499999998762", + "pending_staking_parameters": [], "baking_power": "666666666253", + "total_staked": "500000000000", "total_delegated": "499999998761", "min_delegated_in_current_cycle": - { "amount": "499999998762", + { "amount": "499999998761", "level": { "level": 5, "level_position": 4, "cycle": 1, "cycle_position": 0, "expected_commitment": false } }, - "own_full_balance": "999999998762", "own_staked": "500000000000", - "own_delegated": "499999998762", "external_staked": "0", + "own_full_balance": "999999998761", "own_staked": "500000000000", + "own_delegated": "499999998761", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" }, { "cycle": 1, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "999999998762", + "staking_denominator": "0", "current_voting_power": "999999998761", "voting_power": "0", "voting_info": {}, "consensus_key": { "active": diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out index 1cf22cf676e0..af08bec6a4b7 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out @@ -1,7 +1,7 @@ ./octez-client --wait none set consensus key for bootstrap1 to dummy_account_0 Node is bootstrapped. -Estimated gas: 168.946 units (will add 100 for safety) +Estimated gas: 168.980 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -12,17 +12,17 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000284 + Fee to the baker: ꜩ0.000285 Expected counter: 1 Gas limit: 269 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000284 - payload fees(the block proposer) ....... +ꜩ0.000284 + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 Update_consensus_key: Public key hash: [PUBLIC_KEY_HASH] This consensus key update was successfully applied - Consumed gas: 168.880 + Consumed gas: 168.913 ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out index 15496e52bd0a..cdcab253c12c 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out @@ -1,7 +1,7 @@ ./octez-client --wait none set consensus key for bootstrap1 to dummy_account_0 Node is bootstrapped. -Estimated gas: 168.946 units (will add 100 for safety) +Estimated gas: 168.980 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -12,17 +12,17 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000284 + Fee to the baker: ꜩ0.000285 Expected counter: 1 Gas limit: 269 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000284 - payload fees(the block proposer) ....... +ꜩ0.000284 + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 Update_consensus_key: Public key hash: [PUBLIC_KEY_HASH] This consensus key update was successfully applied - Consumed gas: 168.880 + Consumed gas: 168.913 ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' @@ -70,19 +70,19 @@ This sequence of operations was run: "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, - "pending_staking_parameters": [], "baking_power": "1466666666572", - "total_staked": "200000000000", "total_delegated": "3799999999716", + "pending_staking_parameters": [], "baking_power": "1466666666571", + "total_staked": "200000000000", "total_delegated": "3799999999715", "min_delegated_in_current_cycle": - { "amount": "3799999999716", + { "amount": "3799999999715", "level": { "level": 2, "level_position": 1, "cycle": 0, "cycle_position": 1, "expected_commitment": false } }, - "own_full_balance": "3999999999716", "own_staked": "200000000000", - "own_delegated": "3799999999716", "external_staked": "0", + "own_full_balance": "3999999999715", "own_staked": "200000000000", + "own_delegated": "3799999999715", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "3999999999716", + "staking_denominator": "0", "current_voting_power": "3999999999715", "voting_power": "4000000000000", "voting_info": { "voting_power": "4000000000000", "remaining_proposals": 20 }, @@ -108,20 +108,20 @@ This sequence of operations was run: "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, - "pending_staking_parameters": [], "baking_power": "1466667371027", - "total_staked": "200000148243", "total_delegated": "3800002816253", + "pending_staking_parameters": [], "baking_power": "1466667371026", + "total_staked": "200000148243", "total_delegated": "3800002816252", "min_delegated_in_current_cycle": - { "amount": "3800001668352", + { "amount": "3800001668351", "level": { "level": 5, "level_position": 4, "cycle": 1, "cycle_position": 0, "expected_commitment": false } }, - "own_full_balance": "4000002964496", "own_staked": "200000148243", - "own_delegated": "3800002816253", "external_staked": "0", + "own_full_balance": "4000002964495", "own_staked": "200000148243", + "own_delegated": "3800002816252", "external_staked": "0", "external_delegated": "0", "total_unstaked_per_cycle": [ { "cycle": 0, "deposit": "0" }, { "cycle": 1, "deposit": "0" } ], "denunciations": [], "estimated_shared_pending_slashed_amount": "0", - "staking_denominator": "0", "current_voting_power": "4000002964496", + "staking_denominator": "0", "current_voting_power": "4000002964495", "voting_power": "4000000000000", "voting_info": { "voting_power": "4000000000000", "remaining_proposals": 20 }, diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- update consensus key.out b/tezt/tests/expected/consensus_key.ml/Alpha- update consensus key.out new file mode 100644 index 000000000000..9871b8ed4091 --- /dev/null +++ b/tezt/tests/expected/consensus_key.ml/Alpha- update consensus key.out @@ -0,0 +1,171 @@ + +./octez-client --wait none set consensus key for bootstrap5 to tezt_4 +Node is bootstrapped. +Estimated gas: 1744.502 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000559 + Expected counter: 1 + Gas limit: 1845 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000559 + payload fees(the block proposer) ....... +ꜩ0.000559 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + Proof of possession: [BLS_SIGNATURE] + This consensus key update was successfully applied + Consumed gas: 1744.436 + + +./octez-client --wait none set consensus key for bootstrap1 to tezt_1 +Node is bootstrapped. +Estimated gas: 168.980 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000285 + Expected counter: 2 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.913 + + +./octez-client --wait none set consensus key for bootstrap1 to bootstrap1 +Node is bootstrapped. +Estimated gas: 168.980 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000285 + Expected counter: 3 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.913 + + +./octez-client --wait none set consensus key for bootstrap3 to tezt_1 +Node is bootstrapped. +Estimated gas: 168.980 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000285 + Expected counter: 1 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.913 + + +./octez-client --wait none set consensus key for bootstrap4 to tezt_3 +Node is bootstrapped. +Estimated gas: 168.980 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000285 + Expected counter: 2 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000285 + payload fees(the block proposer) ....... +ꜩ0.000285 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.913 + + +./octez-client --wait none drain delegate bootstrap4 to tezt_5 with tezt_3 +Node is bootstrapped. +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Drain delegate: + Consensus key hash: [PUBLIC_KEY_HASH] + Delegate: [PUBLIC_KEY_HASH] + Destination: [PUBLIC_KEY_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ3761998.945648 + [PUBLIC_KEY_HASH] ... +ꜩ3761998.945648 + [PUBLIC_KEY_HASH] ... -ꜩ37999.989349 + [PUBLIC_KEY_HASH] ... +ꜩ37999.989349 + + +./octez-client --wait none drain delegate bootstrap3 to tezt_5 with tezt_1 +Node is bootstrapped. +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Drain delegate: + Consensus key hash: [PUBLIC_KEY_HASH] + Delegate: [PUBLIC_KEY_HASH] + Destination: [PUBLIC_KEY_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ3761999.999718 + [PUBLIC_KEY_HASH] ... +ꜩ3761999.999718 + [PUBLIC_KEY_HASH] ... -ꜩ37999.999997 + [PUBLIC_KEY_HASH] ... +ꜩ37999.999997 + diff --git a/tezt/tests/expected/consensus_key.ml/Parisc- update consensus key.out b/tezt/tests/expected/consensus_key.ml/Parisc- update consensus key.out new file mode 100644 index 000000000000..02c78901629b --- /dev/null +++ b/tezt/tests/expected/consensus_key.ml/Parisc- update consensus key.out @@ -0,0 +1,144 @@ + +./octez-client --wait none set consensus key for bootstrap1 to tezt_1 +Node is bootstrapped. +Estimated gas: 168.946 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000284 + Expected counter: 2 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000284 + payload fees(the block proposer) ....... +ꜩ0.000284 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.880 + + +./octez-client --wait none set consensus key for bootstrap1 to bootstrap1 +Node is bootstrapped. +Estimated gas: 168.946 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000284 + Expected counter: 3 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000284 + payload fees(the block proposer) ....... +ꜩ0.000284 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.880 + + +./octez-client --wait none set consensus key for bootstrap3 to tezt_1 +Node is bootstrapped. +Estimated gas: 168.946 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000284 + Expected counter: 1 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000284 + payload fees(the block proposer) ....... +ꜩ0.000284 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.880 + + +./octez-client --wait none set consensus key for bootstrap4 to tezt_3 +Node is bootstrapped. +Estimated gas: 168.946 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000284 + Expected counter: 2 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000284 + payload fees(the block proposer) ....... +ꜩ0.000284 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.880 + + +./octez-client --wait none drain delegate bootstrap4 to tezt_5 with tezt_3 +Node is bootstrapped. +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Drain delegate: + Consensus key hash: [PUBLIC_KEY_HASH] + Delegate: [PUBLIC_KEY_HASH] + Destination: [PUBLIC_KEY_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ3761998.945847 + [PUBLIC_KEY_HASH] ... +ꜩ3761998.945847 + [PUBLIC_KEY_HASH] ... -ꜩ37999.989351 + [PUBLIC_KEY_HASH] ... +ꜩ37999.989351 + + +./octez-client --wait none drain delegate bootstrap3 to tezt_5 with tezt_1 +Node is bootstrapped. +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Drain delegate: + Consensus key hash: [PUBLIC_KEY_HASH] + Delegate: [PUBLIC_KEY_HASH] + Destination: [PUBLIC_KEY_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ3761999.999719 + [PUBLIC_KEY_HASH] ... +ꜩ3761999.999719 + [PUBLIC_KEY_HASH] ... -ꜩ37999.999997 + [PUBLIC_KEY_HASH] ... +ꜩ37999.999997 + diff --git a/tezt/tests/expected/consensus_key.ml/Quebec- update consensus key.out b/tezt/tests/expected/consensus_key.ml/Quebec- update consensus key.out new file mode 100644 index 000000000000..02c78901629b --- /dev/null +++ b/tezt/tests/expected/consensus_key.ml/Quebec- update consensus key.out @@ -0,0 +1,144 @@ + +./octez-client --wait none set consensus key for bootstrap1 to tezt_1 +Node is bootstrapped. +Estimated gas: 168.946 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000284 + Expected counter: 2 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000284 + payload fees(the block proposer) ....... +ꜩ0.000284 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.880 + + +./octez-client --wait none set consensus key for bootstrap1 to bootstrap1 +Node is bootstrapped. +Estimated gas: 168.946 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000284 + Expected counter: 3 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000284 + payload fees(the block proposer) ....... +ꜩ0.000284 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.880 + + +./octez-client --wait none set consensus key for bootstrap3 to tezt_1 +Node is bootstrapped. +Estimated gas: 168.946 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000284 + Expected counter: 1 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000284 + payload fees(the block proposer) ....... +ꜩ0.000284 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.880 + + +./octez-client --wait none set consensus key for bootstrap4 to tezt_3 +Node is bootstrapped. +Estimated gas: 168.946 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000284 + Expected counter: 2 + Gas limit: 269 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000284 + payload fees(the block proposer) ....... +ꜩ0.000284 + Update_consensus_key: + Public key hash: [PUBLIC_KEY_HASH] + This consensus key update was successfully applied + Consumed gas: 168.880 + + +./octez-client --wait none drain delegate bootstrap4 to tezt_5 with tezt_3 +Node is bootstrapped. +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Drain delegate: + Consensus key hash: [PUBLIC_KEY_HASH] + Delegate: [PUBLIC_KEY_HASH] + Destination: [PUBLIC_KEY_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ3761998.945847 + [PUBLIC_KEY_HASH] ... +ꜩ3761998.945847 + [PUBLIC_KEY_HASH] ... -ꜩ37999.989351 + [PUBLIC_KEY_HASH] ... +ꜩ37999.989351 + + +./octez-client --wait none drain delegate bootstrap3 to tezt_5 with tezt_1 +Node is bootstrapped. +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Drain delegate: + Consensus key hash: [PUBLIC_KEY_HASH] + Delegate: [PUBLIC_KEY_HASH] + Destination: [PUBLIC_KEY_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ3761999.999719 + [PUBLIC_KEY_HASH] ... +ꜩ3761999.999719 + [PUBLIC_KEY_HASH] ... -ꜩ37999.999997 + [PUBLIC_KEY_HASH] ... +ꜩ37999.999997 + -- GitLab From d57af36ed1506a5ace31d5336dcefa8389d36fe8 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Thu, 21 Nov 2024 09:40:08 +0100 Subject: [PATCH 8/8] changelog/alpha: add an entry for the new proof parameter in the update consensus key operation. --- docs/protocols/alpha.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/protocols/alpha.rst b/docs/protocols/alpha.rst index ede9b1dfbd9f..347db46f505e 100644 --- a/docs/protocols/alpha.rst +++ b/docs/protocols/alpha.rst @@ -36,6 +36,10 @@ Gas improvements Breaking Changes ---------------- +- ``Update_consensus_key`` operation now has an optional ``proof`` parameter. + This parameter is needed to update to a tz4 (BLS) consensus key. (MR + :gl:`!15670`) + RPC Changes ----------- -- GitLab