diff --git a/src/proto_alpha/lib_client/client_proto_utils.ml b/src/proto_alpha/lib_client/client_proto_utils.ml index aac91ab80b72f2c981012b4e966349ddd3d643aa..8971032033664e29fc1e60f856e3d3db4e949cd1 100644 --- a/src/proto_alpha/lib_client/client_proto_utils.ml +++ b/src/proto_alpha/lib_client/client_proto_utils.ml @@ -32,7 +32,7 @@ let to_json_and_bytes branch message = ( Environment.Operation.{branch}, Contents_list (Single (Failing_noop message)) ) in - let encoding = Operation.unsigned_encoding_with_legacy_attestation_name in + let encoding = Operation.unsigned_encoding in ( Data_encoding.Json.construct encoding op, Data_encoding.Binary.to_bytes_exn encoding op ) diff --git a/src/proto_alpha/lib_client/injection.ml b/src/proto_alpha/lib_client/injection.ml index d82472539d744c5b3cd95bd3f2f0c8b00b5b9a0f..4d72ecc0a4b5c3e9b4db94c76ebeeea1a5085bc6 100644 --- a/src/proto_alpha/lib_client/injection.ml +++ b/src/proto_alpha/lib_client/injection.ml @@ -226,7 +226,7 @@ let print_for_verbose_signing ppf ~watermark ~bytes ~branch ~contents = hash_pp [Signature.bytes_of_watermark watermark; bytes]) ; let json = Data_encoding.Json.construct - Operation.unsigned_encoding_with_legacy_attestation_name + Operation.unsigned_encoding ({branch}, Contents_list contents) in item (fun ppf () -> @@ -241,7 +241,7 @@ let preapply (type t) (cctxt : #Protocol_client_context.full) ~chain ~block let* _chain_id, branch = get_branch cctxt ~chain ~block branch in let bytes = Data_encoding.Binary.to_bytes_exn - Operation.unsigned_encoding_with_legacy_attestation_name + Operation.unsigned_encoding ({branch}, Contents_list contents) in let* signature = @@ -270,11 +270,7 @@ let preapply (type t) (cctxt : #Protocol_client_context.full) ~chain ~block let packed_op = {shell = {branch}; protocol_data = Operation_data {contents; signature}} in - let size = - Data_encoding.Binary.length - Operation.encoding_with_legacy_attestation_name - packed_op - in + let size = Data_encoding.Binary.length Operation.encoding packed_op in let*! () = match fee_parameter with | Some fee_parameter -> check_fees cctxt fee_parameter contents size @@ -795,12 +791,12 @@ let may_patch_limits (type kind) (cctxt : #Protocol_client_context.full) @@ Data_encoding.Binary.fixed_length Tezos_base.Operation.shell_header_encoding) + Data_encoding.Binary.length - Operation.contents_encoding_with_legacy_attestation_name + Operation.contents_encoding (Contents op) + signature_size_of_algo signature_algo else Data_encoding.Binary.length - Operation.contents_encoding_with_legacy_attestation_name + Operation.contents_encoding (Contents op) in let minimal_fees_in_nanotez = @@ -1064,9 +1060,7 @@ let inject_operation_internal (type kind) cctxt ~chain ~block ?confirmations if force then return_unit else Lwt.return res in let bytes = - Data_encoding.Binary.to_bytes_exn - Operation.encoding_with_legacy_attestation_name - (Operation.pack op) + Data_encoding.Binary.to_bytes_exn Operation.encoding (Operation.pack op) in if dry_run || simulation then let oph = Operation_hash.hash_bytes [bytes] in 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 f627a058119a828ad1af7013e0726bf6acaff786..09be5852fea942b6cd15eccf5c0c4cdff8d84a0c 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 @@ -817,8 +817,7 @@ let commands_ro () = "%a" Data_encoding.Binary_schema.pp (Data_encoding.Binary.describe - Alpha_context.Operation - .unsigned_encoding_with_legacy_attestation_name) + Alpha_context.Operation.unsigned_encoding) in return_unit); ] diff --git a/src/proto_alpha/lib_client_commands/client_proto_stresstest_commands.ml b/src/proto_alpha/lib_client_commands/client_proto_stresstest_commands.ml index b1e114f7f075bf01a90140868456dbe8d3b31af5..d5e33b91cb58993252b1d29daac2963d84b600ce 100644 --- a/src/proto_alpha/lib_client_commands/client_proto_stresstest_commands.ml +++ b/src/proto_alpha/lib_client_commands/client_proto_stresstest_commands.ml @@ -494,7 +494,7 @@ let rec sample_transfer (cctxt : Protocol_client_context.full) chain block let inject_contents (cctxt : Protocol_client_context.full) branch sk contents = let bytes = Data_encoding.Binary.to_bytes_exn - Operation.unsigned_encoding_with_legacy_attestation_name + Operation.unsigned_encoding ({branch}, Contents_list contents) in let signature = @@ -504,9 +504,7 @@ let inject_contents (cctxt : Protocol_client_context.full) branch sk contents = {shell = {branch}; protocol_data = {contents; signature}} in let bytes = - Data_encoding.Binary.to_bytes_exn - Operation.encoding_with_legacy_attestation_name - (Operation.pack op) + Data_encoding.Binary.to_bytes_exn Operation.encoding (Operation.pack op) in Shell_services.Injection.operation cctxt bytes diff --git a/src/proto_alpha/lib_delegate/baking_actions.ml b/src/proto_alpha/lib_delegate/baking_actions.ml index b85860aed9beadd71915a38213e3fcb3e7f20573..6f9930fa459e64ddef696a5e28cfdf1ddc663f51 100644 --- a/src/proto_alpha/lib_delegate/baking_actions.ml +++ b/src/proto_alpha/lib_delegate/baking_actions.ml @@ -37,8 +37,7 @@ module Operations_source = struct } let operations_encoding = - Data_encoding.( - list (dynamic_size Operation.encoding_with_legacy_attestation_name)) + Data_encoding.(list (dynamic_size Operation.encoding)) let retrieve = let open Lwt_result_syntax in @@ -476,7 +475,7 @@ let inject_preattestations state ~preattestations = in let unsigned_operation_bytes = Data_encoding.Binary.to_bytes_exn - Operation.unsigned_encoding_with_legacy_attestation_name + Operation.unsigned_encoding unsigned_operation in Client_keys.sign cctxt ~watermark sk_uri unsigned_operation_bytes @@ -571,7 +570,7 @@ let sign_attestations state attestations = let unsigned_operation = (shell, Contents_list contents) in let unsigned_operation_bytes = Data_encoding.Binary.to_bytes_exn - Operation.unsigned_encoding_with_legacy_attestation_name + Operation.unsigned_encoding unsigned_operation in Client_keys.sign cctxt ~watermark sk_uri unsigned_operation_bytes @@ -611,7 +610,7 @@ let sign_dal_attestations state attestations = let unsigned_operation = (shell, Contents_list contents) in let unsigned_operation_bytes = Data_encoding.Binary.to_bytes_exn - Operation.unsigned_encoding_with_legacy_attestation_name + Operation.unsigned_encoding unsigned_operation in let*! signature = @@ -666,9 +665,7 @@ let inject_dal_attestations state attestations = List.iter_ep (fun (delegate, signed_operation, (attestation : Dal.Attestation.t)) -> let encoded_op = - Data_encoding.Binary.to_bytes_exn - Operation.encoding_with_legacy_attestation_name - signed_operation + Data_encoding.Binary.to_bytes_exn Operation.encoding signed_operation in let* oph = Shell_services.Injection.operation diff --git a/src/proto_alpha/lib_delegate/baking_state.ml b/src/proto_alpha/lib_delegate/baking_state.ml index 1207ba806458ad1224af9a550f42d8f72ffaea1c..3f46c0dbb1d651c886622609997f8185dcef1457 100644 --- a/src/proto_alpha/lib_delegate/baking_state.ml +++ b/src/proto_alpha/lib_delegate/baking_state.ml @@ -157,9 +157,7 @@ let prequorum_encoding = (req "level" int32) (req "round" Round.encoding) (req "block_payload_hash" Block_payload_hash.encoding) - (req - "preattestations" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name)))) + (req "preattestations" (list (dynamic_size Operation.encoding)))) let block_info_encoding = let open Data_encoding in @@ -212,12 +210,8 @@ let block_info_encoding = (req "payload_round" Round.encoding) (req "round" Round.encoding) (req "prequorum" (option prequorum_encoding)) - (req - "quorum" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name))) - (req - "dal_attestations" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name))) + (req "quorum" (list (dynamic_size Operation.encoding))) + (req "dal_attestations" (list (dynamic_size Operation.encoding))) (req "payload" Operation_pool.payload_encoding)) let round_of_shell_header shell_header = @@ -443,8 +437,7 @@ let event_encoding = (tup3 (constant "Prequorum_reached") Operation_worker.candidate_encoding - (Data_encoding.list - (dynamic_size Operation.encoding_with_legacy_attestation_name))) + (Data_encoding.list (dynamic_size Operation.encoding))) (function | Prequorum_reached (candidate, ops) -> Some ((), candidate, List.map Operation.pack ops) @@ -458,8 +451,7 @@ let event_encoding = (tup3 (constant "Quorum_reached") Operation_worker.candidate_encoding - (Data_encoding.list - (dynamic_size Operation.encoding_with_legacy_attestation_name))) + (Data_encoding.list (dynamic_size Operation.encoding))) (function | Quorum_reached (candidate, ops) -> Some ((), candidate, List.map Operation.pack ops) diff --git a/src/proto_alpha/lib_delegate/block_forge.ml b/src/proto_alpha/lib_delegate/block_forge.ml index 0d232cc2093483df03048d38e56b8a63bffcce7c..19137cf3f57c72020c75fca359ed537e793772da 100644 --- a/src/proto_alpha/lib_delegate/block_forge.ml +++ b/src/proto_alpha/lib_delegate/block_forge.ml @@ -70,8 +70,7 @@ let convert_operation (op : packed_operation) : Tezos_base.Operation.t = shell = op.shell; proto = Data_encoding.Binary.to_bytes_exn - Alpha_context.Operation - .protocol_data_encoding_with_legacy_attestation_name + Alpha_context.Operation.protocol_data_encoding op.protocol_data; } diff --git a/src/proto_alpha/lib_delegate/node_rpc.ml b/src/proto_alpha/lib_delegate/node_rpc.ml index fea1e6f4d6dda675b61ed795081dc9c44159e307..f2a0eb938067f2f2f2722fec242715bed722b93b 100644 --- a/src/proto_alpha/lib_delegate/node_rpc.ml +++ b/src/proto_alpha/lib_delegate/node_rpc.ml @@ -44,9 +44,7 @@ let inject_block cctxt ?(force = false) ~chain signed_block_header operations = let inject_operation cctxt ~chain operation = let encoded_op = - Data_encoding.Binary.to_bytes_exn - Operation.encoding_with_legacy_attestation_name - operation + Data_encoding.Binary.to_bytes_exn Operation.encoding operation in Shell_services.Injection.operation cctxt ~async:true ~chain encoded_op @@ -157,7 +155,7 @@ let compute_block_info cctxt ~in_protocol ?operations ~chain block_hash let parse_op (raw_op : Tezos_base.Operation.t) = let protocol_data = Data_encoding.Binary.of_bytes_exn - Operation.protocol_data_encoding_with_legacy_attestation_name + Operation.protocol_data_encoding raw_op.proto in {shell = raw_op.shell; protocol_data} diff --git a/src/proto_alpha/lib_delegate/operation_pool.ml b/src/proto_alpha/lib_delegate/operation_pool.ml index 7d9ca75987de45da86e69ec8e9f30049660ba412..47dbc1ac8babda23d4d1bc61a7c2698e514a20bc 100644 --- a/src/proto_alpha/lib_delegate/operation_pool.ml +++ b/src/proto_alpha/lib_delegate/operation_pool.ml @@ -97,18 +97,10 @@ let ordered_pool_encoding = (fun (consensus, votes, anonymous, managers) -> {consensus; votes; anonymous; managers}) (obj4 - (req - "ordered_consensus" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name))) - (req - "ordered_votes" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name))) - (req - "ordered_anonymouns" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name))) - (req - "ordered_managers" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name)))) + (req "ordered_consensus" (list (dynamic_size Operation.encoding))) + (req "ordered_votes" (list (dynamic_size Operation.encoding))) + (req "ordered_anonymouns" (list (dynamic_size Operation.encoding))) + (req "ordered_managers" (list (dynamic_size Operation.encoding)))) type payload = { votes_payload : packed_operation list; @@ -127,15 +119,9 @@ let payload_encoding = (fun (votes_payload, anonymous_payload, managers_payload) -> {votes_payload; anonymous_payload; managers_payload}) (obj3 - (req - "votes_payload" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name))) - (req - "anonymous_payload" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name))) - (req - "managers_payload" - (list (dynamic_size Operation.encoding_with_legacy_attestation_name)))) + (req "votes_payload" (list (dynamic_size Operation.encoding))) + (req "anonymous_payload" (list (dynamic_size Operation.encoding))) + (req "managers_payload" (list (dynamic_size Operation.encoding)))) let pp_payload fmt {votes_payload; anonymous_payload; managers_payload} = Format.fprintf diff --git a/src/proto_alpha/lib_delegate/operation_selection.ml b/src/proto_alpha/lib_delegate/operation_selection.ml index 8fb78aac43b37f605244eddfa3fb38634f556102..8df12bcd93d0b71b3f9719a351b370e72296e910 100644 --- a/src/proto_alpha/lib_delegate/operation_selection.ml +++ b/src/proto_alpha/lib_delegate/operation_selection.ml @@ -108,11 +108,7 @@ let prioritize_manager ~max_size ~hard_gas_limit_per_block ~minimal_fees | Ok (Some source, Some counter, fee, gas) -> if Tez.(fee < minimal_fees) then None else - let size = - Data_encoding.Binary.length - Operation.encoding_with_legacy_attestation_name - op - in + let size = Data_encoding.Binary.length Operation.encoding op in let size_f = Q.of_int size in let gas_f = Q.of_bigint (Gas.Arith.integral_to_z gas) in let fee_f = Q.of_int64 (Tez.to_mutez fee) in @@ -211,9 +207,7 @@ let filter_valid_operations_up_to_quota inc (ops, quota) = List.fold_left_s (fun (inc, curr_size, nb_ops, acc) op -> let op_size = - Data_encoding.Binary.length - Alpha_context.Operation.encoding_with_legacy_attestation_name - op + Data_encoding.Binary.length Alpha_context.Operation.encoding op in let new_size = curr_size + op_size in if new_size > max_size then return (inc, curr_size, nb_ops, acc) @@ -308,9 +302,7 @@ let filter_valid_operations_up_to_quota_without_simulation (ops, quota) = List.fold_left (fun (curr_size, nb_ops, acc) op -> let op_size = - Data_encoding.Binary.length - Alpha_context.Operation.encoding_with_legacy_attestation_name - op + Data_encoding.Binary.length Alpha_context.Operation.encoding op in let new_size = curr_size + op_size in if new_size > max_size then (curr_size, nb_ops, acc) diff --git a/src/proto_alpha/lib_plugin/RPC.ml b/src/proto_alpha/lib_plugin/RPC.ml index 5583b0edd38b0dffbea8d2d9cf3e5a3b4d50f839..a0588cd23e2b6613b0d11dd8091a8f580bb66150 100644 --- a/src/proto_alpha/lib_plugin/RPC.ml +++ b/src/proto_alpha/lib_plugin/RPC.ml @@ -2929,7 +2929,7 @@ module Forge = struct (fun () operation -> return (Data_encoding.Binary.to_bytes_exn - Operation.unsigned_encoding_with_legacy_attestation_name + Operation.unsigned_encoding operation)) ; Registration.register0_noctxt ~chunked:true @@ -3166,7 +3166,7 @@ module Parse = struct let open Result_syntax in match Data_encoding.Binary.of_bytes_opt - Operation.protocol_data_encoding_with_legacy_attestation_name + Operation.protocol_data_encoding op.proto with | Some protocol_data -> return {shell = op.shell; protocol_data} diff --git a/src/proto_alpha/lib_plugin/mempool.ml b/src/proto_alpha/lib_plugin/mempool.ml index b672a841d4b7b48b37304052a28f5ea83f2d4e96..6e7674ac814c0da8cd7ec14d22207377a28d5557 100644 --- a/src/proto_alpha/lib_plugin/mempool.ml +++ b/src/proto_alpha/lib_plugin/mempool.ml @@ -246,9 +246,7 @@ let size_of_operation op = (WithExceptions.Option.get ~loc:__LOC__ @@ Data_encoding.Binary.fixed_length Tezos_base.Operation.shell_header_encoding) - + Data_encoding.Binary.length - Operation.protocol_data_encoding_with_legacy_attestation_name - op + + Data_encoding.Binary.length Operation.protocol_data_encoding op (** Returns the weight and resources consumption of an operation. The weight corresponds to the one implemented by the baker, to decide which operations diff --git a/src/proto_alpha/lib_protocol/apply_internal_results.ml b/src/proto_alpha/lib_protocol/apply_internal_results.ml index 3c188af0d33c54e76be66b2f25f906608a19e534..ca82d86267f295a8f09855fec6300c845b52d5d1 100644 --- a/src/proto_alpha/lib_protocol/apply_internal_results.ml +++ b/src/proto_alpha/lib_protocol/apply_internal_results.ml @@ -241,10 +241,7 @@ module Internal_operation = struct (Tag 0) (obj9 (opt "storage" Script.expr_encoding) - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt.balance_updates_encoding []) (dft "ticket_receipt" Ticket_receipt.encoding []) (dft "originated_contracts" (list Contract.originated_encoding) []) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) @@ -571,10 +568,7 @@ module Internal_operation_result = struct ~op_case:Internal_operation.origination_case ~encoding: (obj6 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt.balance_updates_encoding []) (dft "originated_contracts" (list Contract.originated_encoding) []) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (dft "storage_size" z Z.zero) @@ -630,10 +624,7 @@ module Internal_operation_result = struct Data_encoding.( obj2 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - [])) + (dft "balance_updates" Receipt.balance_updates_encoding [])) ~select:(function | Successful_internal_operation_result (IDelegation_result _ as op) -> Some op diff --git a/src/proto_alpha/lib_protocol/apply_results.ml b/src/proto_alpha/lib_protocol/apply_results.ml index e9f997bcbf1e9bea9ae9a64a5311066286f2909a..a813cb593101a4132981fb8c2af1180525b2799b 100644 --- a/src/proto_alpha/lib_protocol/apply_results.ml +++ b/src/proto_alpha/lib_protocol/apply_results.ml @@ -283,10 +283,7 @@ module Manager_result = struct (Tag 0) (obj9 (opt "storage" Script.expr_encoding) - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt.balance_updates_encoding []) (dft "ticket_updates" Ticket_receipt.encoding []) (dft "originated_contracts" (list Contract.originated_encoding) []) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) @@ -370,10 +367,7 @@ module Manager_result = struct ~op_case:Operation.Encoding.Manager_operations.origination_case ~encoding: (obj6 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt.balance_updates_encoding []) (dft "originated_contracts" (list Contract.originated_encoding) []) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (dft "storage_size" z Z.zero) @@ -427,10 +421,7 @@ module Manager_result = struct Operation.Encoding.Manager_operations.register_global_constant_case ~encoding: (obj4 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt.balance_updates_encoding []) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (dft "storage_size" z Z.zero) (req "global_address" Script_expr_hash.encoding)) @@ -455,10 +446,7 @@ module Manager_result = struct Data_encoding.( obj2 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - [])) + (dft "balance_updates" Receipt.balance_updates_encoding [])) ~select:(function | Successful_manager_result (Delegation_result _ as op) -> Some op | _ -> None) @@ -490,10 +478,7 @@ module Manager_result = struct ~encoding: Data_encoding.( obj2 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt.balance_updates_encoding []) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) ~select:(function | Successful_manager_result (Increase_paid_storage_result _ as op) -> @@ -512,9 +497,7 @@ module Manager_result = struct ~encoding: Data_encoding.( obj4 - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name) + (req "balance_updates" Receipt.balance_updates_encoding) (req "ticket_updates" Ticket_receipt.encoding) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (dft "paid_storage_size_diff" z Z.zero)) @@ -572,9 +555,7 @@ module Manager_result = struct ~encoding: Data_encoding.( obj4 - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name) + (req "balance_updates" Receipt.balance_updates_encoding) (req "originated_zk_rollup" Zk_rollup.Address.encoding) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (req "size" z)) @@ -599,9 +580,7 @@ module Manager_result = struct ~encoding: Data_encoding.( obj3 - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name) + (req "balance_updates" Receipt.balance_updates_encoding) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (req "size" z)) ~select:(function @@ -623,9 +602,7 @@ module Manager_result = struct ~encoding: Data_encoding.( obj3 - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name) + (req "balance_updates" Receipt.balance_updates_encoding) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (dft "paid_storage_size_diff" z Z.zero)) ~select:(function @@ -645,9 +622,7 @@ module Manager_result = struct ~op_case:Operation.Encoding.Manager_operations.sc_rollup_originate_case ~encoding: (obj5 - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name) + (req "balance_updates" Receipt.balance_updates_encoding) (req "address" Sc_rollup.Address.encoding) (req "genesis_commitment_hash" Sc_rollup.Commitment.Hash.encoding) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) @@ -727,9 +702,7 @@ module Manager_result = struct (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (req "staked_hash" Sc_rollup.Commitment.Hash.encoding) (req "published_at_level" Raw_level.encoding) - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name)) + (req "balance_updates" Receipt.balance_updates_encoding)) ~select:(function | Successful_manager_result (Sc_rollup_publish_result _ as op) -> Some op @@ -752,9 +725,7 @@ module Manager_result = struct obj3 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (req "game_status" Sc_rollup.Game.status_encoding) - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name)) + (req "balance_updates" Receipt.balance_updates_encoding)) ~select:(function | Successful_manager_result (Sc_rollup_refute_result _ as op) -> Some op | _ -> None) @@ -773,9 +744,7 @@ module Manager_result = struct (obj3 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (req "game_status" Sc_rollup.Game.status_encoding) - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name)) + (req "balance_updates" Receipt.balance_updates_encoding)) ~select:(function | Successful_manager_result (Sc_rollup_timeout_result _ as op) -> Some op @@ -796,9 +765,7 @@ module Manager_result = struct ~encoding: Data_encoding.( obj4 - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name) + (req "balance_updates" Receipt.balance_updates_encoding) (req "ticket_updates" Ticket_receipt.encoding) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) (dft "paid_storage_size_diff" z Z.zero)) @@ -839,9 +806,7 @@ module Manager_result = struct ~encoding: Data_encoding.( obj2 - (req - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name) + (req "balance_updates" Receipt.balance_updates_encoding) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) ~select:(function | Successful_manager_result (Sc_rollup_recover_bond_result _ as op) -> @@ -1021,10 +986,7 @@ module Encoding = struct let consensus_result_encoding power_name = let open Data_encoding in obj4 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt.balance_updates_encoding []) (req "delegate" Signature.Public_key_hash.encoding) (req (Format.asprintf "%s_power" power_name) int31) (req "consensus_key" Signature.Public_key_hash.encoding) @@ -1173,11 +1135,7 @@ module Encoding = struct { op_case = Operation.Encoding.seed_nonce_revelation_case; encoding = - obj1 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []); + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); select = (function | Contents_result (Seed_nonce_revelation_result _ as op) -> Some op @@ -1196,11 +1154,7 @@ module Encoding = struct { op_case = Operation.Encoding.vdf_revelation_case; encoding = - obj1 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []); + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); select = (function | Contents_result (Vdf_revelation_result _ as op) -> Some op @@ -1218,11 +1172,7 @@ module Encoding = struct { op_case = Operation.Encoding.double_endorsement_evidence_case; encoding = - obj1 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []); + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); select = (function | Contents_result (Double_attestation_evidence_result _ as op) -> @@ -1242,11 +1192,7 @@ module Encoding = struct { op_case = Operation.Encoding.double_attestation_evidence_case; encoding = - obj1 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []); + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); select = (function | Contents_result (Double_attestation_evidence_result _ as op) -> @@ -1266,11 +1212,7 @@ module Encoding = struct { op_case = Operation.Encoding.double_preendorsement_evidence_case; encoding = - obj1 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []); + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); select = (function | Contents_result (Double_preattestation_evidence_result _ as op) -> @@ -1291,11 +1233,7 @@ module Encoding = struct { op_case = Operation.Encoding.double_preattestation_evidence_case; encoding = - obj1 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []); + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); select = (function | Contents_result (Double_preattestation_evidence_result _ as op) -> @@ -1316,11 +1254,7 @@ module Encoding = struct { op_case = Operation.Encoding.double_baking_evidence_case; encoding = - obj1 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []); + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); select = (function | Contents_result (Double_baking_evidence_result _ as op) -> Some op @@ -1339,11 +1273,7 @@ module Encoding = struct { op_case = Operation.Encoding.activate_account_case; encoding = - obj1 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []); + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); select = (function | Contents_result (Activate_account_result _ as op) -> Some op @@ -1396,10 +1326,7 @@ module Encoding = struct encoding = Data_encoding.( obj2 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt.balance_updates_encoding []) (dft "allocated_destination_contract" bool false)); select = (function @@ -1429,10 +1356,7 @@ module Encoding = struct op_case = Operation.Encoding.Case op_case; encoding = obj3 - (dft - "balance_updates" - Receipt.balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt.balance_updates_encoding []) (req "operation_result" res_case.t) (dft "internal_operation_results" diff --git a/src/proto_alpha/lib_protocol/mempool_validation.ml b/src/proto_alpha/lib_protocol/mempool_validation.ml index e816542c80860efe12f3038953b07c4fae08ad2b..c8041e9c30e994d2da6dd21214a13ad2c0864315 100644 --- a/src/proto_alpha/lib_protocol/mempool_validation.ml +++ b/src/proto_alpha/lib_protocol/mempool_validation.ml @@ -62,9 +62,7 @@ let encoding : t Data_encoding.t = (req "operations" (Operation_hash.Map.encoding - (dynamic_size - ~kind:`Uint30 - Operation.encoding_with_legacy_attestation_name))) + (dynamic_size ~kind:`Uint30 Operation.encoding))) let init ctxt chain_id ~predecessor_level ~predecessor_round ~predecessor_hash : validation_info * t = diff --git a/src/proto_alpha/lib_protocol/migration_repr.ml b/src/proto_alpha/lib_protocol/migration_repr.ml index c8a5508de79106caac883f82d813eec7269515ca..0008eed3f77873acb03c695efb68d9c5fde5eee7 100644 --- a/src/proto_alpha/lib_protocol/migration_repr.ml +++ b/src/proto_alpha/lib_protocol/migration_repr.ml @@ -56,11 +56,7 @@ let origination_result_list_encoding = paid_storage_size_diff; }) (obj4 - (dft - "balance_updates" - Receipt_repr - .balance_updates_encoding_with_legacy_attestation_name - []) + (dft "balance_updates" Receipt_repr.balance_updates_encoding []) (dft "originated_contracts" (list Contract_repr.originated_encoding) diff --git a/src/proto_alpha/lib_protocol/storage.ml b/src/proto_alpha/lib_protocol/storage.ml index 4ae6863b929f6b28ce4dcd9e226ef50fabdaba41..12993f3997e8f5960622273fdd99983c5dc95ed5 100644 --- a/src/proto_alpha/lib_protocol/storage.ml +++ b/src/proto_alpha/lib_protocol/storage.ml @@ -1630,8 +1630,7 @@ module Pending_migration = struct (struct type t = Receipt_repr.balance_updates - let encoding = - Receipt_repr.balance_updates_encoding_with_legacy_attestation_name + let encoding = Receipt_repr.balance_updates_encoding end) module Operation_results = diff --git a/src/proto_alpha/lib_protocol/test/helpers/block.ml b/src/proto_alpha/lib_protocol/test/helpers/block.ml index 0bc2f962f2528d3393870a7710377ecbc43fdaee..66ce122bc79ab21f1cc5ae5a766335c2c23e9921 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/block.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/block.ml @@ -794,9 +794,7 @@ let apply_with_metadata ?(policy = By_round 0) ?(check_size = true) ~baking_mode (fun vstate op -> (if check_size then let operation_size = - Data_encoding.Binary.length - Operation.encoding_with_legacy_attestation_name - op + Data_encoding.Binary.length Operation.encoding op in if operation_size > Constants_repr.max_operation_data_length then raise diff --git a/src/proto_alpha/lib_protocol/test/helpers/incremental.ml b/src/proto_alpha/lib_protocol/test/helpers/incremental.ml index b1ed8da1b2dbca4ff451b24505550cbdceeee7fd..6d923c8f72c69afe58953aa09768fae434e1b4f2 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/incremental.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/incremental.ml @@ -176,11 +176,7 @@ let detect_script_failure : let check_operation_size ?(check_size = true) op = if check_size then - let operation_size = - Data_encoding.Binary.length - Operation.encoding_with_legacy_attestation_name - op - in + let operation_size = Data_encoding.Binary.length Operation.encoding op in if operation_size > Constants_repr.max_operation_data_length then raise (invalid_arg diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.ml b/src/proto_alpha/lib_protocol/test/helpers/op.ml index 32ab48673e719a18a72819694757867a7bb1175b..125393370a4d70eb219b466187e65c5b33cff1a9 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/op.ml @@ -34,7 +34,7 @@ let pack_operation ctxt signature contents = let sign ?(watermark = Signature.Generic_operation) sk branch contents = let unsigned = Data_encoding.Binary.to_bytes_exn - Operation.unsigned_encoding_with_legacy_attestation_name + Operation.unsigned_encoding ({branch}, Contents_list contents) in let signature = Some (Signature.sign ~watermark sk unsigned) in diff --git a/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml index f2bf85c6de348dc7af3d0a5e39068db83804fa37..4ae7d506ff3af0255597eb7bfacda69d2186b156 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml @@ -105,7 +105,7 @@ module Test_operation_repr = struct let test_split_signatures error assemble = let op_bytes = Data_encoding.Binary.to_bytes_exn - Operation_repr.contents_encoding_with_legacy_attestation_name + Operation_repr.contents_encoding (Contents (Failing_noop "")) in let prefix, suffix = zero_bls in @@ -114,7 +114,7 @@ module Test_operation_repr = struct in match Data_encoding.Binary.of_bytes - Operation_repr.protocol_data_encoding_with_legacy_attestation_name + Operation_repr.protocol_data_encoding protocol_data_bytes with | Ok _ -> failwith "Should have failed with %s" error diff --git a/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml b/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml index 11dc605a49cbc24d647342497f2f6f1645e27e33..55a2a6277e55429cba342b0948a09a3bfe94c940 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml @@ -54,14 +54,10 @@ let test_encodings balance = let r8 = Receipt.(balance, Credited am, Block_application) in let coded = Json.construct - Receipt.balance_updates_encoding_with_legacy_attestation_name + Receipt.balance_updates_encoding [r1; r2; r3; r4; r5; r6; r7; r8] in - let decoded = - Json.destruct - Receipt.balance_updates_encoding_with_legacy_attestation_name - coded - in + let decoded = Json.destruct Receipt.balance_updates_encoding coded in match decoded with | [r1'; r2'; r3'; r4'; r5'; r6'; r7'; r8'] -> assert ( diff --git a/src/proto_alpha/lib_sc_rollup_node/batcher_constants.ml b/src/proto_alpha/lib_sc_rollup_node/batcher_constants.ml index c18ba0722bac0ea1bf201d27a4f927c88b5d0272..edfa3ea32f006f8995fb2ca4999e28d87e98df71 100644 --- a/src/proto_alpha/lib_sc_rollup_node/batcher_constants.ml +++ b/src/proto_alpha/lib_sc_rollup_node/batcher_constants.ml @@ -52,5 +52,5 @@ let protocol_max_batch_size = in Protocol.Constants_repr.max_operation_data_length - Data_encoding.Binary.length - Operation.encoding_with_legacy_attestation_name + Operation.encoding (Operation.pack empty_message_op) diff --git a/src/proto_alpha/lib_sc_rollup_node/sc_rollup_injector.ml b/src/proto_alpha/lib_sc_rollup_node/sc_rollup_injector.ml index af553a74ecdb56be3895ccce2d182603684582c2..67aa70089c7875c5d9989ec88fb581bd057a70c8 100644 --- a/src/proto_alpha/lib_sc_rollup_node/sc_rollup_injector.ml +++ b/src/proto_alpha/lib_sc_rollup_node/sc_rollup_injector.ml @@ -104,9 +104,7 @@ module Proto_client = struct storage_limit = Z.zero; } in - Data_encoding.Binary.length - Operation.contents_encoding_with_legacy_attestation_name - (Contents contents) + Data_encoding.Binary.length Operation.contents_encoding (Contents contents) let operation_size op = manager_operation_size (injector_operation_to_manager op) @@ -137,7 +135,7 @@ module Proto_client = struct in let dummy_size = Data_encoding.Binary.length - Operation.contents_encoding_with_legacy_attestation_name + Operation.contents_encoding (Contents dummy_contents) in dummy_size - manager_operation_size (Manager dummy_operation) @@ -332,9 +330,7 @@ module Proto_client = struct ((shell, Contents_list contents) as unsigned_op) = let open Lwt_result_syntax in let unsigned_bytes = - Data_encoding.Binary.to_bytes_exn - Operation.unsigned_encoding_with_legacy_attestation_name - unsigned_op + Data_encoding.Binary.to_bytes_exn Operation.unsigned_encoding unsigned_op in let cctxt = new Protocol_client_context.wrap_full (cctxt :> Client_context.full) @@ -352,9 +348,7 @@ module Proto_client = struct protocol_data = Operation_data {contents; signature = Some signature}; } in - Data_encoding.Binary.to_bytes_exn - Operation.encoding_with_legacy_attestation_name - op + Data_encoding.Binary.to_bytes_exn Operation.encoding op let time_until_next_block {Injector.minimal_block_delay; delay_increment_per_round; _}