From 04777dad8e719282759cdb2d86e553346b98eee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cauderlier?= Date: Thu, 8 Feb 2024 12:15:44 +0100 Subject: [PATCH] DAL/Proto: rename publish operation This commit renames the DAL publication operation from "publish_slot_header" to "publish_commitment". --- .../files/alpha__operation.ksy | 10 ++-- .../files/alpha__operation__contents.ksy | 10 ++-- .../files/alpha__operation__contents_list.ksy | 10 ++-- .../files/alpha__operation__protocol_data.ksy | 10 ++-- .../files/alpha__operation__unsigned.ksy | 10 ++-- ...operation_with_legacy_attestation_name.ksy | 10 ++-- ...with_legacy_attestation_name__unsigned.ksy | 10 ++-- docs/alpha/dal_support.rst | 10 ++-- docs/protocols/alpha.rst | 2 +- docs/shell/dal_bakers.rst | 2 +- docs/shell/dal_node.rst | 2 +- src/bin_testnet_scenarios/dal.ml | 2 +- src/lib_octogram/tezos.ml | 2 +- .../lib_benchmarks_proto/dal_benchmarks.ml | 12 ++-- .../lib_client/client_proto_context.ml | 2 +- .../lib_client/client_proto_context.mli | 6 +- src/proto_alpha/lib_client/injection.ml | 6 +- .../lib_client/operation_result.ml | 14 ++--- .../client_proto_context_commands.ml | 2 +- .../lib_dal/dal_plugin_registration.ml | 2 +- .../lib_protocol/alpha_context.mli | 26 ++++----- src/proto_alpha/lib_protocol/apply.ml | 8 +-- src/proto_alpha/lib_protocol/apply_results.ml | 56 +++++++++---------- .../lib_protocol/apply_results.mli | 4 +- src/proto_alpha/lib_protocol/dal_apply.ml | 8 +-- src/proto_alpha/lib_protocol/dal_apply.mli | 12 ++-- .../lib_protocol/dal_costs_generated.ml | 4 +- .../lib_protocol/dal_costs_generated.mli | 2 +- .../lib_protocol/dal_errors_repr.ml | 32 +++++------ .../lib_protocol/dal_operations_repr.ml | 6 +- .../lib_protocol/dal_operations_repr.mli | 2 +- .../lib_protocol/gas_parameters.json | 2 +- .../lib_protocol/operation_repr.ml | 40 ++++++------- .../lib_protocol/operation_repr.mli | 16 +++--- src/proto_alpha/lib_protocol/raw_context.ml | 2 +- .../lib_protocol/test/helpers/block.ml | 4 +- .../lib_protocol/test/helpers/op.ml | 6 +- .../lib_protocol/test/helpers/op.mli | 4 +- .../test/helpers/operation_generator.ml | 12 ++-- .../validate/manager_operation_helpers.ml | 19 +++---- .../test/integration/validate/test_sanity.ml | 4 +- src/proto_alpha/lib_protocol/validate.ml | 4 +- .../lib_sc_rollup_node/daemon_helpers.ml | 4 +- tezt/lib_tezos/dal_common.ml | 4 +- tezt/lib_tezos/dal_common.mli | 2 +- tezt/lib_tezos/operation_core.ml | 12 ++-- tezt/lib_tezos/operation_core.mli | 4 +- tezt/long_tests/dal.ml | 12 ++-- tezt/tests/dal.ml | 22 ++++---- 49 files changed, 231 insertions(+), 236 deletions(-) diff --git a/contrib/kaitai-struct-files/files/alpha__operation.ksy b/contrib/kaitai-struct-files/files/alpha__operation.ksy index 98b02ee05b8f..76e087885f40 100644 --- a/contrib/kaitai-struct-files/files/alpha__operation.ksy +++ b/contrib/kaitai-struct-files/files/alpha__operation.ksy @@ -202,9 +202,9 @@ types: - id: transfer_ticket type: transfer_ticket if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::transfer_ticket) - - id: dal_publish_slot_header - type: dal_publish_slot_header - if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::dal_publish_slot_header) + - id: dal_publish_commitment + type: dal_publish_commitment + if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::dal_publish_commitment) - id: smart_rollup_originate type: smart_rollup_originate if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::smart_rollup_originate) @@ -392,7 +392,7 @@ types: type: u1 - id: page_index type: s2 - dal_publish_slot_header: + dal_publish_commitment: seq: - id: source type: public_key_hash @@ -1913,7 +1913,7 @@ enums: 205: smart_rollup_timeout 206: smart_rollup_execute_outbox_message 207: smart_rollup_recover_bond - 230: dal_publish_slot_header + 230: dal_publish_commitment 250: zk_rollup_origination 251: zk_rollup_publish 252: zk_rollup_update diff --git a/contrib/kaitai-struct-files/files/alpha__operation__contents.ksy b/contrib/kaitai-struct-files/files/alpha__operation__contents.ksy index 4ec29818b5cf..47282d90b321 100644 --- a/contrib/kaitai-struct-files/files/alpha__operation__contents.ksy +++ b/contrib/kaitai-struct-files/files/alpha__operation__contents.ksy @@ -191,9 +191,9 @@ types: - id: transfer_ticket type: transfer_ticket if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::transfer_ticket) - - id: dal_publish_slot_header - type: dal_publish_slot_header - if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::dal_publish_slot_header) + - id: dal_publish_commitment + type: dal_publish_commitment + if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::dal_publish_commitment) - id: smart_rollup_originate type: smart_rollup_originate if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::smart_rollup_originate) @@ -369,7 +369,7 @@ types: type: u1 - id: page_index type: s2 - dal_publish_slot_header: + dal_publish_commitment: seq: - id: source type: public_key_hash @@ -1890,7 +1890,7 @@ enums: 205: smart_rollup_timeout 206: smart_rollup_execute_outbox_message 207: smart_rollup_recover_bond - 230: dal_publish_slot_header + 230: dal_publish_commitment 250: zk_rollup_origination 251: zk_rollup_publish 252: zk_rollup_update diff --git a/contrib/kaitai-struct-files/files/alpha__operation__contents_list.ksy b/contrib/kaitai-struct-files/files/alpha__operation__contents_list.ksy index d9d22fda2921..169a5b96f7ba 100644 --- a/contrib/kaitai-struct-files/files/alpha__operation__contents_list.ksy +++ b/contrib/kaitai-struct-files/files/alpha__operation__contents_list.ksy @@ -191,9 +191,9 @@ types: - id: transfer_ticket type: transfer_ticket if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::transfer_ticket) - - id: dal_publish_slot_header - type: dal_publish_slot_header - if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::dal_publish_slot_header) + - id: dal_publish_commitment + type: dal_publish_commitment + if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::dal_publish_commitment) - id: smart_rollup_originate type: smart_rollup_originate if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::smart_rollup_originate) @@ -373,7 +373,7 @@ types: type: u1 - id: page_index type: s2 - dal_publish_slot_header: + dal_publish_commitment: seq: - id: source type: public_key_hash @@ -1894,7 +1894,7 @@ enums: 205: smart_rollup_timeout 206: smart_rollup_execute_outbox_message 207: smart_rollup_recover_bond - 230: dal_publish_slot_header + 230: dal_publish_commitment 250: zk_rollup_origination 251: zk_rollup_publish 252: zk_rollup_update diff --git a/contrib/kaitai-struct-files/files/alpha__operation__protocol_data.ksy b/contrib/kaitai-struct-files/files/alpha__operation__protocol_data.ksy index 1da822d68536..68c5c7c5ac5f 100644 --- a/contrib/kaitai-struct-files/files/alpha__operation__protocol_data.ksy +++ b/contrib/kaitai-struct-files/files/alpha__operation__protocol_data.ksy @@ -202,9 +202,9 @@ types: - id: transfer_ticket type: transfer_ticket if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::transfer_ticket) - - id: dal_publish_slot_header - type: dal_publish_slot_header - if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::dal_publish_slot_header) + - id: dal_publish_commitment + type: dal_publish_commitment + if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::dal_publish_commitment) - id: smart_rollup_originate type: smart_rollup_originate if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::smart_rollup_originate) @@ -392,7 +392,7 @@ types: type: u1 - id: page_index type: s2 - dal_publish_slot_header: + dal_publish_commitment: seq: - id: source type: public_key_hash @@ -1913,7 +1913,7 @@ enums: 205: smart_rollup_timeout 206: smart_rollup_execute_outbox_message 207: smart_rollup_recover_bond - 230: dal_publish_slot_header + 230: dal_publish_commitment 250: zk_rollup_origination 251: zk_rollup_publish 252: zk_rollup_update diff --git a/contrib/kaitai-struct-files/files/alpha__operation__unsigned.ksy b/contrib/kaitai-struct-files/files/alpha__operation__unsigned.ksy index 81e453cdce6b..d23d8a261500 100644 --- a/contrib/kaitai-struct-files/files/alpha__operation__unsigned.ksy +++ b/contrib/kaitai-struct-files/files/alpha__operation__unsigned.ksy @@ -191,9 +191,9 @@ types: - id: transfer_ticket type: transfer_ticket if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::transfer_ticket) - - id: dal_publish_slot_header - type: dal_publish_slot_header - if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::dal_publish_slot_header) + - id: dal_publish_commitment + type: dal_publish_commitment + if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::dal_publish_commitment) - id: smart_rollup_originate type: smart_rollup_originate if: (alpha__operation__alpha__contents_tag == alpha__operation__alpha__contents_tag::smart_rollup_originate) @@ -380,7 +380,7 @@ types: type: u1 - id: page_index type: s2 - dal_publish_slot_header: + dal_publish_commitment: seq: - id: source type: public_key_hash @@ -1901,7 +1901,7 @@ enums: 205: smart_rollup_timeout 206: smart_rollup_execute_outbox_message 207: smart_rollup_recover_bond - 230: dal_publish_slot_header + 230: dal_publish_commitment 250: zk_rollup_origination 251: zk_rollup_publish 252: zk_rollup_update diff --git a/contrib/kaitai-struct-files/files/alpha__operation_with_legacy_attestation_name.ksy b/contrib/kaitai-struct-files/files/alpha__operation_with_legacy_attestation_name.ksy index a0db9e8288de..8528bdeb3ab6 100644 --- a/contrib/kaitai-struct-files/files/alpha__operation_with_legacy_attestation_name.ksy +++ b/contrib/kaitai-struct-files/files/alpha__operation_with_legacy_attestation_name.ksy @@ -195,9 +195,9 @@ types: - id: transfer_ticket type: transfer_ticket if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::transfer_ticket) - - id: dal_publish_slot_header - type: dal_publish_slot_header - if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::dal_publish_slot_header) + - id: dal_publish_commitment + type: dal_publish_commitment + if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::dal_publish_commitment) - id: smart_rollup_originate type: smart_rollup_originate if: (alpha__operation__alpha__contents_or_signature_prefix_tag == alpha__operation__alpha__contents_or_signature_prefix_tag::smart_rollup_originate) @@ -392,7 +392,7 @@ types: type: u1 - id: page_index type: s2 - dal_publish_slot_header: + dal_publish_commitment: seq: - id: source type: public_key_hash @@ -1913,7 +1913,7 @@ enums: 205: smart_rollup_timeout 206: smart_rollup_execute_outbox_message 207: smart_rollup_recover_bond - 230: dal_publish_slot_header + 230: dal_publish_commitment 250: zk_rollup_origination 251: zk_rollup_publish 252: zk_rollup_update diff --git a/contrib/kaitai-struct-files/files/alpha__operation_with_legacy_attestation_name__unsigned.ksy b/contrib/kaitai-struct-files/files/alpha__operation_with_legacy_attestation_name__unsigned.ksy index b05e2b2b1583..28c464d40921 100644 --- a/contrib/kaitai-struct-files/files/alpha__operation_with_legacy_attestation_name__unsigned.ksy +++ b/contrib/kaitai-struct-files/files/alpha__operation_with_legacy_attestation_name__unsigned.ksy @@ -191,9 +191,9 @@ types: - id: transfer_ticket type: transfer_ticket if: (alpha__operation_with_legacy_attestation_name__alpha__contents_tag == alpha__operation_with_legacy_attestation_name__alpha__contents_tag::transfer_ticket) - - id: dal_publish_slot_header - type: dal_publish_slot_header - if: (alpha__operation_with_legacy_attestation_name__alpha__contents_tag == alpha__operation_with_legacy_attestation_name__alpha__contents_tag::dal_publish_slot_header) + - id: dal_publish_commitment + type: dal_publish_commitment + if: (alpha__operation_with_legacy_attestation_name__alpha__contents_tag == alpha__operation_with_legacy_attestation_name__alpha__contents_tag::dal_publish_commitment) - id: smart_rollup_originate type: smart_rollup_originate if: (alpha__operation_with_legacy_attestation_name__alpha__contents_tag == alpha__operation_with_legacy_attestation_name__alpha__contents_tag::smart_rollup_originate) @@ -358,7 +358,7 @@ types: type: u1 - id: page_index type: s2 - dal_publish_slot_header: + dal_publish_commitment: seq: - id: source type: public_key_hash @@ -1901,7 +1901,7 @@ enums: 205: smart_rollup_timeout 206: smart_rollup_execute_outbox_message 207: smart_rollup_recover_bond - 230: dal_publish_slot_header + 230: dal_publish_commitment 250: zk_rollup_origination 251: zk_rollup_publish 252: zk_rollup_update diff --git a/docs/alpha/dal_support.rst b/docs/alpha/dal_support.rst index abb805f8ad1b..b33869a2f27d 100644 --- a/docs/alpha/dal_support.rst +++ b/docs/alpha/dal_support.rst @@ -4,13 +4,13 @@ DAL support The support for the :doc:`DAL <../shell/dal>` within the economic protocol relies on two operations: -#. ``DAL_publish_slot_header``: Allowing anyone to publish a DAL commitment +#. ``DAL_publish_commitment``: Allowing anyone to publish a DAL commitment #. ``DAL_attestation``: Allowing bakers to attest the data seen onto the DAL P2P network -DAL publish slot header -======================= +DAL publish commitment +====================== -``DAL_publish_slot_header`` is a manager operation that can be issued by a user wishing to publish data onto the DAL. The payload of this operation consists in the following fields: +``DAL_publish_commitment`` is a manager operation that can be issued by a user wishing to publish data onto the DAL. The payload of this operation consists in the following fields: - Slot index: Identifies the specific slot for which the data is being published. It is an integer between ``0`` and ``number_of_slots - 1``. - Commitment: The `KZG commitment `__ over the data. @@ -24,7 +24,7 @@ Users can create and manage these commitments and proofs through the :doc:`DAL n Concurrent operations --------------------- -If a block contains a valid ``DAL_publish_slot_header`` operation, any subsequent operations of the same kind within the same block (and the same slot index) will be recognized as valid but will fail during execution. They still incur transaction fees. More details about this can be found in the :doc:`validator documentation <../active/validation>`. +If a block contains a valid ``DAL_publish_commitment`` operation, any subsequent operations of the same kind within the same block (and the same slot index) will be recognized as valid but will fail during execution. They still incur transaction fees. More details about this can be found in the :doc:`validator documentation <../active/validation>`. Economics --------- diff --git a/docs/protocols/alpha.rst b/docs/protocols/alpha.rst index 931a967c3e8d..65d81f8b42a4 100644 --- a/docs/protocols/alpha.rst +++ b/docs/protocols/alpha.rst @@ -32,7 +32,7 @@ Data Availability Layer (ongoing) - Introduced a ``round`` field in DAL attestations, with a similar meaning as for consensus attestations. (MR :gl:`!11285`) -- Optimize the slot header publication operation by memoizing the +- Optimize the commitment publication operation by memoizing the cryptobox. (MR :gl:`!11594`) - Introduced a new optional field ``dal_content`` to consensus attestation diff --git a/docs/shell/dal_bakers.rst b/docs/shell/dal_bakers.rst index d98ff4b512a6..8017689320f8 100644 --- a/docs/shell/dal_bakers.rst +++ b/docs/shell/dal_bakers.rst @@ -19,7 +19,7 @@ Based on the DAL attestations included in a block , the protocol decides which s It's important for bakers to note the following: - No DAL attestation is injected if there is no slot to attest (i.e. if the bitset is zero). -- If a slot header is included in an L1 block at some level PL (a.k.a ``published_level``), the DAL consensus operations that possibly attest its shards are injected on top of the block(s) at level ``PL + attestation_lag - 1`` and target inclusion at level ``PL + attestation_lag``. +- If a slot commitment is included in an L1 block at some level PL (a.k.a ``published_level``), the DAL consensus operations that possibly attest its shards are injected on top of the block(s) at level ``PL + attestation_lag - 1`` and target inclusion at level ``PL + attestation_lag``. - Theoretically, if a baker is assigned more than ``number_of_shards / redundancy_factor`` shards, it could declare the shards as available if it succeeds in downloading ``number_of_shards / redundancy_factor`` shards at least. The missing shards could be calculated by reconstructing the whole slot (but this is not implemented yet). - It is planned to merge Tenderbake and DAL attestations in the same operation in the future, as they share a few fields. This would avoid an extra signature verification per baker. - As the number of shards is quite small compared to the number of Tenderbake slots, DAL and Tenderbake committees might not always coincide in practice: there might be bakers in the Tenderbake's committee that are not part of the DAL's for some levels. However, any baker in the DAL committee is part of the Tenderbake committee. diff --git a/docs/shell/dal_node.rst b/docs/shell/dal_node.rst index dc5d2aadd9b8..74fca16bdbd6 100644 --- a/docs/shell/dal_node.rst +++ b/docs/shell/dal_node.rst @@ -109,7 +109,7 @@ The life cycle of slots and shards is described by the following steps: This is done via the RPC ``PUT /commitments//shards``. #. The slot producer instructs the DAL node to compute the proof associated with the commitment. This is done via the RPC ``GET /commitments//proof``, which returns the corresponding commitment proof. -#. The slot producer selects a slot index for its slot, and posts the commitment to L1, via the ``publish_slot_header`` operation. +#. The slot producer selects a slot index for its slot, and posts the commitment to L1, via the ``publish_commitment`` operation. This can be done via RPCs for injecting an operation into L1, or using the Octez client, via the following command:: octez-client publish dal commitment from for slot with proof diff --git a/src/bin_testnet_scenarios/dal.ml b/src/bin_testnet_scenarios/dal.ml index 3b1ba4951c67..c04ed1a1a555 100644 --- a/src/bin_testnet_scenarios/dal.ml +++ b/src/bin_testnet_scenarios/dal.ml @@ -70,7 +70,7 @@ let publish_slot dal_node client source ~slot_size ~level ~slot_index = ~force:true [ make ~source - @@ dal_publish_slot_header + @@ dal_publish_commitment ~index:slot_index ~commitment:commitment_hash ~proof; diff --git a/src/lib_octogram/tezos.ml b/src/lib_octogram/tezos.ml index c00b78f2f913..8a9a9ea964a4 100644 --- a/src/lib_octogram/tezos.ml +++ b/src/lib_octogram/tezos.ml @@ -3143,7 +3143,7 @@ let publish_slot_info_encoding = type 'uri publish_dal_slot = { slot_info : publish_slot_info; target_published_level : string option; - (** We target the inclusion of the publish slot header operation at this + (** We target the inclusion of the publish commitment operation at this level, so the operation should be inject at least one level before. *) l1_node_uri : 'uri; (** An URI to a Layer 1 node. If [None], we target the next level. *) diff --git a/src/proto_alpha/lib_benchmarks_proto/dal_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/dal_benchmarks.ml index f7e940088182..aa44f073dd73 100644 --- a/src/proto_alpha/lib_benchmarks_proto/dal_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/dal_benchmarks.ml @@ -28,8 +28,8 @@ let ns = Namespace.make Registration_helpers.ns "dal" let fv s = Free_variable.of_namespace (ns s) -module Publish_slot_header : Benchmark.S = struct - let name = ns "Dal_publish_slot_header" +module Publish_commitment : Benchmark.S = struct + let name = ns "Dal_publish_commitment" let info = "Estimating the cost of publishing a slot header" @@ -55,7 +55,7 @@ module Publish_slot_header : Benchmark.S = struct let model = Model.make ~conv:(fun () -> ()) - (Model.unknown_const1 ~name ~const:(fv "publish_slot_header_const")) + (Model.unknown_const1 ~name ~const:(fv "publish_commitment_const")) let models = [("dal", model)] @@ -70,7 +70,7 @@ module Publish_slot_header : Benchmark.S = struct let* commitment = Crypto.commit cryptobox polynomial in let* commitment_proof = Crypto.prove_commitment cryptobox polynomial in return - @@ Dal.Operations.Publish_slot_header. + @@ Dal.Operations.Publish_commitment. {slot_index; commitment; commitment_proof} let make_bench rng_state (config : config) () : workload Generator.benchmark = @@ -107,7 +107,7 @@ module Publish_slot_header : Benchmark.S = struct in let workload = () in let closure () = - match Dal_apply.apply_publish_slot_header ctxt op with + match Dal_apply.apply_publish_commitment ctxt op with | Error errs -> Format.eprintf "%a@." Environment.Error_monad.pp_trace errs ; Stdlib.failwith @@ -143,4 +143,4 @@ module Publish_slot_header : Benchmark.S = struct List.repeat bench_num (make_bench rng_state config) end -let () = Registration_helpers.register (module Publish_slot_header) +let () = Registration_helpers.register (module Publish_commitment) diff --git a/src/proto_alpha/lib_client/client_proto_context.ml b/src/proto_alpha/lib_client/client_proto_context.ml index a073477d69d4..300cecb8778a 100644 --- a/src/proto_alpha/lib_client/client_proto_context.ml +++ b/src/proto_alpha/lib_client/client_proto_context.ml @@ -1475,7 +1475,7 @@ let dal_publish (cctxt : #full) ~chain ~block ?confirmations ?dry_run ~fee:(Limit.of_option fee) ~gas_limit:(Limit.of_option gas_limit) ~storage_limit:(Limit.of_option storage_limit) - (Dal_publish_slot_header slot_header)) + (Dal_publish_commitment slot_header)) |> Injection.inject_manager_operation cctxt ~chain diff --git a/src/proto_alpha/lib_client/client_proto_context.mli b/src/proto_alpha/lib_client/client_proto_context.mli index 80ed939dfe66..e79d7c30fda8 100644 --- a/src/proto_alpha/lib_client/client_proto_context.mli +++ b/src/proto_alpha/lib_client/client_proto_context.mli @@ -996,13 +996,13 @@ val dal_publish : ?storage_limit:Z.t -> ?counter:Manager_counter.t -> source:public_key_hash -> - slot_header:Alpha_context.Dal.Operations.Publish_slot_header.t -> + slot_header:Alpha_context.Dal.Operations.Publish_commitment.t -> src_pk:public_key -> src_sk:Client_keys.sk_uri -> fee_parameter:Injection.fee_parameter -> unit -> (Operation_hash.t - * Kind.dal_publish_slot_header Kind.manager contents - * Kind.dal_publish_slot_header Kind.manager Apply_results.contents_result) + * Kind.dal_publish_commitment Kind.manager contents + * Kind.dal_publish_commitment Kind.manager Apply_results.contents_result) tzresult Lwt.t diff --git a/src/proto_alpha/lib_client/injection.ml b/src/proto_alpha/lib_client/injection.ml index de3bff19d7a8..2fa804d9bea3 100644 --- a/src/proto_alpha/lib_client/injection.ml +++ b/src/proto_alpha/lib_client/injection.ml @@ -345,7 +345,7 @@ let estimated_gas_single (type kind) | Update_consensus_key_result {consumed_gas; _} | Increase_paid_storage_result {consumed_gas; _} | Transfer_ticket_result {consumed_gas; _} - | Dal_publish_slot_header_result {consumed_gas; _} + | Dal_publish_commitment_result {consumed_gas; _} | Sc_rollup_originate_result {consumed_gas; _} | Sc_rollup_add_messages_result {consumed_gas; _} | Sc_rollup_cement_result {consumed_gas; _} @@ -419,7 +419,7 @@ let estimated_storage_single (type kind) ~origination_size | Zk_rollup_origination_result {storage_size; _} -> Ok storage_size | Transaction_result (Transaction_to_sc_rollup_result _) | Reveal_result _ | Delegation_result _ | Set_deposits_limit_result _ - | Increase_paid_storage_result _ | Dal_publish_slot_header_result _ + | Increase_paid_storage_result _ | Dal_publish_commitment_result _ | Sc_rollup_add_messages_result _ (* The following Sc_rollup operations have zero storage cost because we consider them to be paid in the stake deposit. @@ -502,7 +502,7 @@ let originated_contracts_single (type kind) | Register_global_constant_result _ | Reveal_result _ | Delegation_result _ | Set_deposits_limit_result _ | Update_consensus_key_result _ | Increase_paid_storage_result _ - | Transfer_ticket_result _ | Dal_publish_slot_header_result _ + | Transfer_ticket_result _ | Dal_publish_commitment_result _ | Sc_rollup_originate_result _ | Sc_rollup_add_messages_result _ | Sc_rollup_cement_result _ | Sc_rollup_publish_result _ | Sc_rollup_refute_result _ | Sc_rollup_timeout_result _ diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index b99ac7ca776a..c93787aedcca 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -343,11 +343,11 @@ let pp_manager_operation_content (type kind) source ppf sc_rollup Signature.Public_key_hash.pp staker - | Dal_publish_slot_header operation -> + | Dal_publish_commitment operation -> Format.fprintf ppf "Data availability slot header publishing:@,Slot: %a" - Dal.Operations.Publish_slot_header.pp + Dal.Operations.Publish_commitment.pp operation | Zk_rollup_origination _ -> Format.fprintf ppf "Epoxy origination:@,From: %a" Contract.pp source @@ -694,8 +694,8 @@ let pp_manager_operation_contents_result ppf op_result = pp_consumed_gas ppf consumed_gas ; pp_balance_updates ppf balance_updates in - let pp_dal_publish_slot_header_result - (Dal_publish_slot_header_result {slot_header; consumed_gas}) = + let pp_dal_publish_commitment_result + (Dal_publish_commitment_result {slot_header; consumed_gas}) = pp_slot_header ppf slot_header ; pp_consumed_gas ppf consumed_gas in @@ -828,7 +828,7 @@ let pp_manager_operation_contents_result ppf op_result = | Sc_rollup_execute_outbox_message_result _ -> "smart output message execution" | Sc_rollup_recover_bond_result _ -> "smart rollup bond retrieval" - | Dal_publish_slot_header_result _ -> + | Dal_publish_commitment_result _ -> "data availability slot header publishing" | Zk_rollup_origination_result _ -> "epoxy originate" | Zk_rollup_publish_result _ -> "epoxy publish" @@ -862,8 +862,8 @@ let pp_manager_operation_contents_result ppf op_result = pp_sc_rollup_execute_outbox_message_result op | Sc_rollup_recover_bond_result _ as op -> pp_sc_rollup_recover_bond_result op - | Dal_publish_slot_header_result _ as op -> - pp_dal_publish_slot_header_result op + | Dal_publish_commitment_result _ as op -> + pp_dal_publish_commitment_result op | Zk_rollup_origination_result _ as op -> pp_zk_rollup_origination_result op | Zk_rollup_publish_result _ as op -> pp_zk_rollup_publish_result op | Zk_rollup_update_result _ as op -> pp_zk_rollup_update_result op 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 7f63e4bb6f22..aed69a798ad1 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 @@ -3755,7 +3755,7 @@ let commands_rw () = (number_of_slots - 1) in let slot_header = - Alpha_context.Dal.Operations.Publish_slot_header. + Alpha_context.Dal.Operations.Publish_commitment. {slot_index; commitment; commitment_proof} in let* _res = diff --git a/src/proto_alpha/lib_dal/dal_plugin_registration.ml b/src/proto_alpha/lib_dal/dal_plugin_registration.ml index a8458d1c1104..b9507d5aa619 100644 --- a/src/proto_alpha/lib_dal/dal_plugin_registration.ml +++ b/src/proto_alpha/lib_dal/dal_plugin_registration.ml @@ -88,7 +88,7 @@ module Plugin = struct (result : (kind, _, _) Protocol.Apply_operation_result.operation_result) = match op with - | Dal_publish_slot_header operation -> + | Dal_publish_commitment operation -> (operation.slot_index, operation.commitment, status_of_result result) :: acc | _ -> acc diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 270b6beedec7..55935ea90c70 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2838,7 +2838,7 @@ module Dal : sig end module Operations : sig - module Publish_slot_header : sig + module Publish_commitment : sig type t = { slot_index : Slot_index.t; commitment : Slot.Commitment.t; @@ -2909,14 +2909,14 @@ module Dal_errors : sig type error += | Dal_feature_disabled | Dal_slot_index_above_hard_limit of {given : int; limit : int} - | Dal_publish_slot_header_invalid_index of { + | Dal_publish_commitment_invalid_index of { given : Dal.Slot_index.t; maximum : Dal.Slot_index.t; } - | Dal_publish_slot_header_candidate_with_low_fees of {proposed_fees : Tez.t} + | Dal_publish_commitment_candidate_with_low_fees of {proposed_fees : Tez.t} | Dal_attestation_size_limit_exceeded of {maximum_size : int; got : int} - | Dal_publish_slot_header_duplicate of {slot_header : Dal.Slot.Header.t} - | Dal_publish_slot_header_invalid_proof of { + | Dal_publish_commitment_duplicate of {slot_header : Dal.Slot.Header.t} + | Dal_publish_commitment_invalid_proof of { commitment : Dal.Slot.Commitment.t; commitment_proof : Dal.Slot.Commitment_proof.t; } @@ -4379,7 +4379,7 @@ module Kind : sig type transfer_ticket = Transfer_ticket_kind - type dal_publish_slot_header = Dal_publish_slot_header_kind + type dal_publish_commitment = Dal_publish_commitment_kind type sc_rollup_originate = Sc_rollup_originate_kind @@ -4415,7 +4415,7 @@ module Kind : sig | Increase_paid_storage_manager_kind : increase_paid_storage manager | Update_consensus_key_manager_kind : update_consensus_key manager | Transfer_ticket_manager_kind : transfer_ticket manager - | Dal_publish_slot_header_manager_kind : dal_publish_slot_header manager + | Dal_publish_commitment_manager_kind : dal_publish_commitment manager | Sc_rollup_originate_manager_kind : sc_rollup_originate manager | Sc_rollup_add_messages_manager_kind : sc_rollup_add_messages manager | Sc_rollup_cement_manager_kind : sc_rollup_cement manager @@ -4574,9 +4574,9 @@ and _ manager_operation = entrypoint : Entrypoint.t; } -> Kind.transfer_ticket manager_operation - | Dal_publish_slot_header : - Dal.Operations.Publish_slot_header.t - -> Kind.dal_publish_slot_header manager_operation + | Dal_publish_commitment : + Dal.Operations.Publish_commitment.t + -> Kind.dal_publish_commitment manager_operation | Sc_rollup_originate : { kind : Sc_rollup.Kind.t; boot_sector : string; @@ -4802,8 +4802,8 @@ module Operation : sig val transfer_ticket_case : Kind.transfer_ticket Kind.manager case - val dal_publish_slot_header_case : - Kind.dal_publish_slot_header Kind.manager case + val dal_publish_commitment_case : + Kind.dal_publish_commitment Kind.manager case val register_global_constant_case : Kind.register_global_constant Kind.manager case @@ -4871,7 +4871,7 @@ module Operation : sig val transfer_ticket_case : Kind.transfer_ticket case - val dal_publish_slot_header_case : Kind.dal_publish_slot_header case + val dal_publish_commitment_case : Kind.dal_publish_commitment case val sc_rollup_originate_case : Kind.sc_rollup_originate case diff --git a/src/proto_alpha/lib_protocol/apply.ml b/src/proto_alpha/lib_protocol/apply.ml index ec6269895455..29816a098079 100644 --- a/src/proto_alpha/lib_protocol/apply.ml +++ b/src/proto_alpha/lib_protocol/apply.ml @@ -1459,13 +1459,13 @@ let apply_manager_operation : Update_consensus_key_result {consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt}, [] ) - | Dal_publish_slot_header slot_header -> + | Dal_publish_commitment slot_header -> let*? ctxt, slot_header = - Dal_apply.apply_publish_slot_header ctxt slot_header + Dal_apply.apply_publish_commitment ctxt slot_header in let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in let result = - Dal_publish_slot_header_result {slot_header; consumed_gas} + Dal_publish_commitment_result {slot_header; consumed_gas} in return (ctxt, result, []) | Sc_rollup_originate {kind; boot_sector; parameters_ty; whitelist} -> @@ -1807,7 +1807,7 @@ let burn_manager_storage_fees : ( ctxt, storage_limit, Transfer_ticket_result {payload with balance_updates} ) - | Dal_publish_slot_header_result _ -> return (ctxt, storage_limit, smopr) + | Dal_publish_commitment_result _ -> return (ctxt, storage_limit, smopr) | Sc_rollup_originate_result payload -> let+ ctxt, storage_limit, balance_updates = Fees.burn_sc_rollup_origination_fees diff --git a/src/proto_alpha/lib_protocol/apply_results.ml b/src/proto_alpha/lib_protocol/apply_results.ml index 34e89d9c1a53..9b7ee1634554 100644 --- a/src/proto_alpha/lib_protocol/apply_results.ml +++ b/src/proto_alpha/lib_protocol/apply_results.ml @@ -78,11 +78,11 @@ type _ successful_manager_operation_result = paid_storage_size_diff : Z.t; } -> Kind.transfer_ticket successful_manager_operation_result - | Dal_publish_slot_header_result : { + | Dal_publish_commitment_result : { slot_header : Dal.Slot.Header.t; consumed_gas : Gas.Arith.fp; } - -> Kind.dal_publish_slot_header successful_manager_operation_result + -> Kind.dal_publish_commitment successful_manager_operation_result | Sc_rollup_originate_result : { balance_updates : Receipt.balance_updates; address : Sc_rollup.Address.t; @@ -550,24 +550,23 @@ module Manager_result = struct paid_storage_size_diff; }) - let dal_publish_slot_header_case = + let dal_publish_commitment_case = make - ~op_case: - Operation.Encoding.Manager_operations.dal_publish_slot_header_case + ~op_case:Operation.Encoding.Manager_operations.dal_publish_commitment_case ~encoding: (obj2 (req "slot_header" Dal.Slot.Header.encoding) (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) ~select:(function - | Successful_manager_result (Dal_publish_slot_header_result _ as op) -> + | Successful_manager_result (Dal_publish_commitment_result _ as op) -> Some op | _ -> None) ~proj:(function - | Dal_publish_slot_header_result {slot_header; consumed_gas} -> + | Dal_publish_commitment_result {slot_header; consumed_gas} -> (slot_header, consumed_gas)) - ~kind:Kind.Dal_publish_slot_header_manager_kind + ~kind:Kind.Dal_publish_commitment_manager_kind ~inj:(fun (slot_header, consumed_gas) -> - Dal_publish_slot_header_result {slot_header; consumed_gas}) + Dal_publish_commitment_result {slot_header; consumed_gas}) let zk_rollup_origination_case = make @@ -971,10 +970,10 @@ let equal_manager_kind : | Kind.Transfer_ticket_manager_kind, Kind.Transfer_ticket_manager_kind -> Some Eq | Kind.Transfer_ticket_manager_kind, _ -> None - | ( Kind.Dal_publish_slot_header_manager_kind, - Kind.Dal_publish_slot_header_manager_kind ) -> + | ( Kind.Dal_publish_commitment_manager_kind, + Kind.Dal_publish_commitment_manager_kind ) -> Some Eq - | Kind.Dal_publish_slot_header_manager_kind, _ -> None + | Kind.Dal_publish_commitment_manager_kind, _ -> None | Kind.Sc_rollup_originate_manager_kind, Kind.Sc_rollup_originate_manager_kind -> Some Eq @@ -1633,14 +1632,13 @@ module Encoding = struct Some (op, res) | _ -> None) - let dal_publish_slot_header_case = + let dal_publish_commitment_case = make_manager_case - Operation.Encoding.dal_publish_slot_header_case - Manager_result.dal_publish_slot_header_case + Operation.Encoding.dal_publish_commitment_case + Manager_result.dal_publish_commitment_case (function | Contents_and_result - ( (Manager_operation {operation = Dal_publish_slot_header _; _} as - op), + ( (Manager_operation {operation = Dal_publish_commitment _; _} as op), res ) -> Some (op, res) | _ -> None) @@ -1787,7 +1785,7 @@ let common_cases = increase_paid_storage_case; update_consensus_key_case; transfer_ticket_case; - dal_publish_slot_header_case; + dal_publish_commitment_case; sc_rollup_originate_case; sc_rollup_add_messages_case; sc_rollup_cement_case; @@ -2290,34 +2288,32 @@ let kind_equal : } ) -> Some Eq | Manager_operation {operation = Transfer_ticket _; _}, _ -> None - | ( Manager_operation {operation = Dal_publish_slot_header _; _}, + | ( Manager_operation {operation = Dal_publish_commitment _; _}, Manager_operation_result - {operation_result = Applied (Dal_publish_slot_header_result _); _} ) -> + {operation_result = Applied (Dal_publish_commitment_result _); _} ) -> Some Eq - | ( Manager_operation {operation = Dal_publish_slot_header _; _}, + | ( Manager_operation {operation = Dal_publish_commitment _; _}, Manager_operation_result - { - operation_result = Backtracked (Dal_publish_slot_header_result _, _); - _; - } ) -> + {operation_result = Backtracked (Dal_publish_commitment_result _, _); _} + ) -> Some Eq - | ( Manager_operation {operation = Dal_publish_slot_header _; _}, + | ( Manager_operation {operation = Dal_publish_commitment _; _}, Manager_operation_result { operation_result = - Failed (Alpha_context.Kind.Dal_publish_slot_header_manager_kind, _); + Failed (Alpha_context.Kind.Dal_publish_commitment_manager_kind, _); _; } ) -> Some Eq - | ( Manager_operation {operation = Dal_publish_slot_header _; _}, + | ( Manager_operation {operation = Dal_publish_commitment _; _}, Manager_operation_result { operation_result = - Skipped Alpha_context.Kind.Dal_publish_slot_header_manager_kind; + Skipped Alpha_context.Kind.Dal_publish_commitment_manager_kind; _; } ) -> Some Eq - | Manager_operation {operation = Dal_publish_slot_header _; _}, _ -> None + | Manager_operation {operation = Dal_publish_commitment _; _}, _ -> None | ( Manager_operation {operation = Sc_rollup_originate _; _}, Manager_operation_result {operation_result = Applied (Sc_rollup_originate_result _); _} ) -> diff --git a/src/proto_alpha/lib_protocol/apply_results.mli b/src/proto_alpha/lib_protocol/apply_results.mli index 09b89117532a..89d9f3607e74 100644 --- a/src/proto_alpha/lib_protocol/apply_results.mli +++ b/src/proto_alpha/lib_protocol/apply_results.mli @@ -183,11 +183,11 @@ and _ successful_manager_operation_result = paid_storage_size_diff : Z.t; } -> Kind.transfer_ticket successful_manager_operation_result - | Dal_publish_slot_header_result : { + | Dal_publish_commitment_result : { slot_header : Dal.Slot.Header.t; consumed_gas : Gas.Arith.fp; } - -> Kind.dal_publish_slot_header successful_manager_operation_result + -> Kind.dal_publish_commitment successful_manager_operation_result | Sc_rollup_originate_result : { balance_updates : Receipt.balance_updates; address : Sc_rollup.Address.t; diff --git a/src/proto_alpha/lib_protocol/dal_apply.ml b/src/proto_alpha/lib_protocol/dal_apply.ml index bacc79553074..d15f6e5772a5 100644 --- a/src/proto_alpha/lib_protocol/dal_apply.ml +++ b/src/proto_alpha/lib_protocol/dal_apply.ml @@ -99,17 +99,17 @@ let apply_attestation ctxt consensus_key level attestation = checks that cannot fail unless the source of the operation is malicious (or if there is a bug). In that case, it is better to ensure fees will be taken. *) -let validate_publish_slot_header ctxt _operation = +let validate_publish_commitment ctxt _operation = assert_dal_feature_enabled ctxt -let apply_publish_slot_header ctxt operation = +let apply_publish_commitment ctxt operation = let open Result_syntax in - let* ctxt = Gas.consume ctxt Dal_costs.cost_Dal_publish_slot_header in + let* ctxt = Gas.consume ctxt Dal_costs.cost_Dal_publish_commitment in let number_of_slots = Dal.number_of_slots ctxt in let* ctxt, cryptobox = Dal.make ctxt in let current_level = (Level.current ctxt).level in let* slot_header = - Dal.Operations.Publish_slot_header.slot_header + Dal.Operations.Publish_commitment.slot_header ~cryptobox ~number_of_slots ~current_level diff --git a/src/proto_alpha/lib_protocol/dal_apply.mli b/src/proto_alpha/lib_protocol/dal_apply.mli index 978baf3c8b2e..f67287cc4951 100644 --- a/src/proto_alpha/lib_protocol/dal_apply.mli +++ b/src/proto_alpha/lib_protocol/dal_apply.mli @@ -60,18 +60,18 @@ val validate_mempool_attestation : t -> Dal.Attestation.t -> unit tzresult Lwt.t val apply_attestation : t -> Consensus_key.pk -> Raw_level.t -> Dal.Attestation.t -> t tzresult -(** [validate_publish_slot_header ctxt slot] ensures that [slot_header] is +(** [validate_publish_commitment ctxt slot] ensures that [slot_header] is valid and prevents an operation containing [slot_header] to be refused on top of [ctxt]. If an [Error _] is returned, the [slot_header] is not valid. *) -val validate_publish_slot_header : - t -> Dal.Operations.Publish_slot_header.t -> unit tzresult +val validate_publish_commitment : + t -> Dal.Operations.Publish_commitment.t -> unit tzresult -(** [apply_publish_slot_header ctxt slot_header] applies the publication of +(** [apply_publish_commitment ctxt slot_header] applies the publication of slot header [slot_header] on top of [ctxt]. Fails if the slot contains already a slot header. *) -val apply_publish_slot_header : - t -> Dal.Operations.Publish_slot_header.t -> (t * Dal.Slot.Header.t) tzresult +val apply_publish_commitment : + t -> Dal.Operations.Publish_commitment.t -> (t * Dal.Slot.Header.t) tzresult (** [finalisation ctxt] should be executed at block finalisation time. A set of slots attested at level [ctxt.current_level - lag] diff --git a/src/proto_alpha/lib_protocol/dal_costs_generated.ml b/src/proto_alpha/lib_protocol/dal_costs_generated.ml index c4c7acc07b47..5e4e6d5cb4be 100644 --- a/src/proto_alpha/lib_protocol/dal_costs_generated.ml +++ b/src/proto_alpha/lib_protocol/dal_costs_generated.ml @@ -9,6 +9,6 @@ module S = Saturation_repr open S.Syntax -(* model dal/Dal_publish_slot_header *) +(* model dal/Dal_publish_commitment *) (* max 10 1160000. *) -let cost_Dal_publish_slot_header = S.safe_int 1160000 +let cost_Dal_publish_commitment = S.safe_int 1160000 diff --git a/src/proto_alpha/lib_protocol/dal_costs_generated.mli b/src/proto_alpha/lib_protocol/dal_costs_generated.mli index 32d22fb529af..341e8e8ffd1d 100644 --- a/src/proto_alpha/lib_protocol/dal_costs_generated.mli +++ b/src/proto_alpha/lib_protocol/dal_costs_generated.mli @@ -23,4 +23,4 @@ (* *) (*****************************************************************************) -val cost_Dal_publish_slot_header : Gas_limit_repr.cost +val cost_Dal_publish_commitment : Gas_limit_repr.cost diff --git a/src/proto_alpha/lib_protocol/dal_errors_repr.ml b/src/proto_alpha/lib_protocol/dal_errors_repr.ml index 91b4f8cbb00c..dd62bf25d8e7 100644 --- a/src/proto_alpha/lib_protocol/dal_errors_repr.ml +++ b/src/proto_alpha/lib_protocol/dal_errors_repr.ml @@ -26,16 +26,16 @@ type error += | Dal_feature_disabled | Dal_slot_index_above_hard_limit of {given : int; limit : int} - | Dal_publish_slot_header_invalid_index of { + | Dal_publish_commitment_invalid_index of { given : Dal_slot_index_repr.t; maximum : Dal_slot_index_repr.t; } - | Dal_publish_slot_header_candidate_with_low_fees of { + | Dal_publish_commitment_candidate_with_low_fees of { proposed_fees : Tez_repr.t; } | Dal_attestation_size_limit_exceeded of {maximum_size : int; got : int} - | Dal_publish_slot_header_duplicate of {slot_header : Dal_slot_repr.Header.t} - | Dal_publish_slot_header_invalid_proof of { + | Dal_publish_commitment_duplicate of {slot_header : Dal_slot_repr.Header.t} + | Dal_publish_commitment_invalid_proof of { commitment : Dal.commitment; commitment_proof : Dal.commitment_proof; } @@ -88,7 +88,7 @@ let () = let description = "Bad index for slot header" in register_error_kind `Permanent - ~id:"dal_publish_slot_header_invalid_index" + ~id:"dal_publish_commitment_invalid_index" ~title:"DAL slot header invalid index" ~description ~pp:(fun ppf (given, maximum) -> @@ -104,17 +104,17 @@ let () = (req "given" Dal_slot_index_repr.encoding) (req "got" Dal_slot_index_repr.encoding)) (function - | Dal_publish_slot_header_invalid_index {given; maximum} -> + | Dal_publish_commitment_invalid_index {given; maximum} -> Some (given, maximum) | _ -> None) (fun (given, maximum) -> - Dal_publish_slot_header_invalid_index {given; maximum}) ; + Dal_publish_commitment_invalid_index {given; maximum}) ; (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3114 Better error message *) let description = "Slot header with too low fees" in register_error_kind `Permanent - ~id:"dal_publish_slot_header_with_low_fees" + ~id:"dal_publish_commitment_with_low_fees" ~title:"DAL slot header with low fees" ~description ~pp:(fun ppf proposed -> @@ -126,11 +126,11 @@ let () = proposed) (obj1 (req "proposed" Tez_repr.encoding)) (function - | Dal_publish_slot_header_candidate_with_low_fees {proposed_fees} -> + | Dal_publish_commitment_candidate_with_low_fees {proposed_fees} -> Some proposed_fees | _ -> None) (fun proposed_fees -> - Dal_publish_slot_header_candidate_with_low_fees {proposed_fees}) ; + Dal_publish_commitment_candidate_with_low_fees {proposed_fees}) ; let description = "The attestation for data availability is a too big" in register_error_kind `Permanent @@ -156,19 +156,19 @@ let () = let description = "A slot header for this slot was already proposed" in register_error_kind `Permanent - ~id:"dal_publish_slot_header_duplicate" + ~id:"dal_publish_commitment_duplicate" ~title:"DAL publish slot header duplicate" ~description ~pp:(fun ppf _proposed -> Format.fprintf ppf "%s" description) (obj1 (req "proposed" Dal_slot_repr.Header.encoding)) (function - | Dal_publish_slot_header_duplicate {slot_header} -> Some slot_header + | Dal_publish_commitment_duplicate {slot_header} -> Some slot_header | _ -> None) - (fun slot_header -> Dal_publish_slot_header_duplicate {slot_header}) ; + (fun slot_header -> Dal_publish_commitment_duplicate {slot_header}) ; let description = "The slot header's commitment proof does not check" in register_error_kind `Permanent - ~id:"dal_publish_slot_header_invalid_proof" + ~id:"dal_publish_commitment_invalid_proof" ~title:"DAL publish slot header invalid proof" ~description ~pp:(fun ppf _proposed -> Format.fprintf ppf "%s" description) @@ -176,11 +176,11 @@ let () = (req "commitment" Dal.Commitment.encoding) (req "commitment_proof" Dal.Commitment_proof.encoding)) (function - | Dal_publish_slot_header_invalid_proof {commitment; commitment_proof} -> + | Dal_publish_commitment_invalid_proof {commitment; commitment_proof} -> Some (commitment, commitment_proof) | _ -> None) (fun (commitment, commitment_proof) -> - Dal_publish_slot_header_invalid_proof {commitment; commitment_proof}) ; + Dal_publish_commitment_invalid_proof {commitment; commitment_proof}) ; register_error_kind `Permanent ~id:"Dal_data_availibility_attester_not_in_committee" diff --git a/src/proto_alpha/lib_protocol/dal_operations_repr.ml b/src/proto_alpha/lib_protocol/dal_operations_repr.ml index 9fd52819fd6b..fc9311f83bfc 100644 --- a/src/proto_alpha/lib_protocol/dal_operations_repr.ml +++ b/src/proto_alpha/lib_protocol/dal_operations_repr.ml @@ -23,7 +23,7 @@ (* *) (*****************************************************************************) -module Publish_slot_header = struct +module Publish_commitment = struct type t = { slot_index : Dal_slot_index_repr.t; commitment : Dal_slot_repr.Commitment.t; @@ -63,7 +63,7 @@ module Publish_slot_header = struct Dal_slot_index_repr.compare slot_index max_slot_index <= 0 && Dal_slot_index_repr.compare slot_index Dal_slot_index_repr.zero >= 0) - (Dal_errors_repr.Dal_publish_slot_header_invalid_index + (Dal_errors_repr.Dal_publish_commitment_invalid_index {given = slot_index; maximum = max_slot_index}) in let* proof_ok = @@ -75,7 +75,7 @@ module Publish_slot_header = struct let* () = error_unless proof_ok - (Dal_errors_repr.Dal_publish_slot_header_invalid_proof + (Dal_errors_repr.Dal_publish_commitment_invalid_proof {commitment; commitment_proof}) in return diff --git a/src/proto_alpha/lib_protocol/dal_operations_repr.mli b/src/proto_alpha/lib_protocol/dal_operations_repr.mli index 27183e42e55d..972f5749d9ac 100644 --- a/src/proto_alpha/lib_protocol/dal_operations_repr.mli +++ b/src/proto_alpha/lib_protocol/dal_operations_repr.mli @@ -30,7 +30,7 @@ This module ensures the consistency with the internal data-structures like [Dal_slot_index_repr.t]. *) -module Publish_slot_header : sig +module Publish_commitment : sig (** A "publish slot header" operation contains - a [slot_index] which is the slot index associated with the diff --git a/src/proto_alpha/lib_protocol/gas_parameters.json b/src/proto_alpha/lib_protocol/gas_parameters.json index 73c763b00b33..67efe78dae4d 100644 --- a/src/proto_alpha/lib_protocol/gas_parameters.json +++ b/src/proto_alpha/lib_protocol/gas_parameters.json @@ -10,7 +10,7 @@ "carbonated_map/find/traversal_overhead": 2, "carbonated_map/fold_const": 50, "carbonated_map/fold_cost_per_item": 24, - "dal/publish_slot_header_const": 1160000, + "dal/publish_commitment_const": 1160000, "encoding/B58CHECK_DECODING_CHAIN_ID_const": 1600, "encoding/B58CHECK_DECODING_PUBLIC_KEY_HASH_bls_const": 3600, "encoding/B58CHECK_DECODING_PUBLIC_KEY_HASH_ed25519_const": 3300, diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index 66339e334119..531efa05714a 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -84,7 +84,7 @@ module Kind = struct type transfer_ticket = Transfer_ticket_kind - type dal_publish_slot_header = Dal_publish_slot_header_kind + type dal_publish_commitment = Dal_publish_commitment_kind type sc_rollup_originate = Sc_rollup_originate_kind @@ -120,7 +120,7 @@ module Kind = struct | Increase_paid_storage_manager_kind : increase_paid_storage manager | Update_consensus_key_manager_kind : update_consensus_key manager | Transfer_ticket_manager_kind : transfer_ticket manager - | Dal_publish_slot_header_manager_kind : dal_publish_slot_header manager + | Dal_publish_commitment_manager_kind : dal_publish_commitment manager | Sc_rollup_originate_manager_kind : sc_rollup_originate manager | Sc_rollup_add_messages_manager_kind : sc_rollup_add_messages manager | Sc_rollup_cement_manager_kind : sc_rollup_cement manager @@ -336,9 +336,9 @@ and _ manager_operation = entrypoint : Entrypoint_repr.t; } -> Kind.transfer_ticket manager_operation - | Dal_publish_slot_header : - Dal_operations_repr.Publish_slot_header.t - -> Kind.dal_publish_slot_header manager_operation + | Dal_publish_commitment : + Dal_operations_repr.Publish_commitment.t + -> Kind.dal_publish_commitment manager_operation | Sc_rollup_originate : { kind : Sc_rollups.Kind.t; boot_sector : string; @@ -410,7 +410,7 @@ let manager_kind : type kind. kind manager_operation -> kind Kind.manager = | Increase_paid_storage _ -> Kind.Increase_paid_storage_manager_kind | Update_consensus_key _ -> Kind.Update_consensus_key_manager_kind | Transfer_ticket _ -> Kind.Transfer_ticket_manager_kind - | Dal_publish_slot_header _ -> Kind.Dal_publish_slot_header_manager_kind + | Dal_publish_commitment _ -> Kind.Dal_publish_commitment_manager_kind | Sc_rollup_originate _ -> Kind.Sc_rollup_originate_manager_kind | Sc_rollup_add_messages _ -> Kind.Sc_rollup_add_messages_manager_kind | Sc_rollup_cement _ -> Kind.Sc_rollup_cement_manager_kind @@ -535,7 +535,7 @@ let sc_rollup_operation_recover_bond_tag = sc_rollup_operation_tag_offset + 7 let dal_offset = 230 -let dal_publish_slot_header_tag = dal_offset + 0 +let dal_publish_commitment_tag = dal_offset + 0 let zk_rollup_operation_tag_offset = 250 @@ -844,21 +844,21 @@ module Encoding = struct Sc_rollup_originate {kind; boot_sector; parameters_ty; whitelist}); } - let dal_publish_slot_header_case = + let dal_publish_commitment_case = MCase { - tag = dal_publish_slot_header_tag; - name = "dal_publish_slot_header"; + tag = dal_publish_commitment_tag; + name = "dal_publish_commitment"; encoding = obj1 (req "slot_header" - Dal_operations_repr.Publish_slot_header.encoding); + Dal_operations_repr.Publish_commitment.encoding); select = (function - | Manager (Dal_publish_slot_header _ as op) -> Some op | _ -> None); - proj = (function Dal_publish_slot_header slot_header -> slot_header); - inj = (fun slot_header -> Dal_publish_slot_header slot_header); + | Manager (Dal_publish_commitment _ as op) -> Some op | _ -> None); + proj = (function Dal_publish_commitment slot_header -> slot_header); + inj = (fun slot_header -> Dal_publish_commitment slot_header); } let sc_rollup_add_messages_case = @@ -1584,10 +1584,10 @@ module Encoding = struct transfer_ticket_tag Manager_operations.transfer_ticket_case - let dal_publish_slot_header_case = + let dal_publish_commitment_case = make_manager_case - dal_publish_slot_header_tag - Manager_operations.dal_publish_slot_header_case + dal_publish_commitment_tag + Manager_operations.dal_publish_commitment_case let sc_rollup_originate_case = make_manager_case @@ -1665,7 +1665,7 @@ module Encoding = struct PCase failing_noop_case; PCase register_global_constant_case; PCase transfer_ticket_case; - PCase dal_publish_slot_header_case; + PCase dal_publish_commitment_case; PCase sc_rollup_originate_case; PCase sc_rollup_add_messages_case; PCase sc_rollup_cement_case; @@ -2129,8 +2129,8 @@ let equal_manager_operation_kind : | Update_consensus_key _, _ -> None | Transfer_ticket _, Transfer_ticket _ -> Some Eq | Transfer_ticket _, _ -> None - | Dal_publish_slot_header _, Dal_publish_slot_header _ -> Some Eq - | Dal_publish_slot_header _, _ -> None + | Dal_publish_commitment _, Dal_publish_commitment _ -> Some Eq + | Dal_publish_commitment _, _ -> None | Sc_rollup_originate _, Sc_rollup_originate _ -> Some Eq | Sc_rollup_originate _, _ -> None | Sc_rollup_add_messages _, Sc_rollup_add_messages _ -> Some Eq diff --git a/src/proto_alpha/lib_protocol/operation_repr.mli b/src/proto_alpha/lib_protocol/operation_repr.mli index 40243a2dddf2..b98884088c81 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.mli +++ b/src/proto_alpha/lib_protocol/operation_repr.mli @@ -118,7 +118,7 @@ module Kind : sig type transfer_ticket = Transfer_ticket_kind - type dal_publish_slot_header = Dal_publish_slot_header_kind + type dal_publish_commitment = Dal_publish_commitment_kind type sc_rollup_originate = Sc_rollup_originate_kind @@ -154,7 +154,7 @@ module Kind : sig | Increase_paid_storage_manager_kind : increase_paid_storage manager | Update_consensus_key_manager_kind : update_consensus_key manager | Transfer_ticket_manager_kind : transfer_ticket manager - | Dal_publish_slot_header_manager_kind : dal_publish_slot_header manager + | Dal_publish_commitment_manager_kind : dal_publish_commitment manager | Sc_rollup_originate_manager_kind : sc_rollup_originate manager | Sc_rollup_add_messages_manager_kind : sc_rollup_add_messages manager | Sc_rollup_cement_manager_kind : sc_rollup_cement manager @@ -414,9 +414,9 @@ and _ manager_operation = (** The entrypoint of the smart contract address that should receive the tickets. *) } -> Kind.transfer_ticket manager_operation - | Dal_publish_slot_header : - Dal_operations_repr.Publish_slot_header.t - -> Kind.dal_publish_slot_header manager_operation + | Dal_publish_commitment : + Dal_operations_repr.Publish_commitment.t + -> Kind.dal_publish_commitment manager_operation (** [Sc_rollup_originate] allows an implicit account to originate a new smart contract rollup (initialized with a given boot sector). The [parameters_ty] field allows to provide the expected interface @@ -735,8 +735,8 @@ module Encoding : sig val transfer_ticket_case : Kind.transfer_ticket Kind.manager case - val dal_publish_slot_header_case : - Kind.dal_publish_slot_header Kind.manager case + val dal_publish_commitment_case : + Kind.dal_publish_commitment Kind.manager case val sc_rollup_originate_case : Kind.sc_rollup_originate Kind.manager case @@ -795,7 +795,7 @@ module Encoding : sig val transfer_ticket_case : Kind.transfer_ticket case - val dal_publish_slot_header_case : Kind.dal_publish_slot_header case + val dal_publish_commitment_case : Kind.dal_publish_commitment case val sc_rollup_originate_case : Kind.sc_rollup_originate case diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index eaf38cdb1de1..b7a6ef968f89 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1828,7 +1828,7 @@ module Dal = struct | Some (dal_slot_fee_market, updated) -> if not updated then tzfail - (Dal_errors_repr.Dal_publish_slot_header_duplicate {slot_header}) + (Dal_errors_repr.Dal_publish_commitment_duplicate {slot_header}) else return {ctxt with back = {ctxt.back with dal_slot_fee_market}} let candidates ctxt = diff --git a/src/proto_alpha/lib_protocol/test/helpers/block.ml b/src/proto_alpha/lib_protocol/test/helpers/block.ml index a2313eb61307..7be51053a55a 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/block.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/block.ml @@ -1066,7 +1066,7 @@ let balance_update_of_operation_result : (Transaction_to_sc_rollup_result _) | Reveal_result _ | Update_consensus_key_result _ | Set_deposits_limit_result _ | Transfer_ticket_result _ - | Dal_publish_slot_header_result _ | Sc_rollup_originate_result _ + | Dal_publish_commitment_result _ | Sc_rollup_originate_result _ | Sc_rollup_add_messages_result _ | Sc_rollup_cement_result _ | Sc_rollup_publish_result _ | Sc_rollup_refute_result _ | Sc_rollup_timeout_result _ | Sc_rollup_execute_outbox_message_result _ @@ -1180,7 +1180,7 @@ let bake_n_with_origination_results ?baking_mode ?policy n b = | Successful_manager_result (Set_deposits_limit_result _) | Successful_manager_result (Increase_paid_storage_result _) | Successful_manager_result (Transfer_ticket_result _) - | Successful_manager_result (Dal_publish_slot_header_result _) + | Successful_manager_result (Dal_publish_commitment_result _) | Successful_manager_result (Sc_rollup_originate_result _) | Successful_manager_result (Sc_rollup_add_messages_result _) | Successful_manager_result (Sc_rollup_cement_result _) diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.ml b/src/proto_alpha/lib_protocol/test/helpers/op.ml index 86549fcc1398..b1ee1cdb0441 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/op.ml @@ -961,8 +961,8 @@ let sc_rollup_timeout ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt let+ account = Context.Contract.manager ctxt src in sign account.sk (Context.branch ctxt) to_sign_op -let dal_publish_slot_header ?force_reveal ?counter ?fee ?gas_limit - ?storage_limit ctxt (src : Contract.t) slot_header = +let dal_publish_commitment ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ctxt (src : Contract.t) slot_header = let open Lwt_result_syntax in let* to_sign_op = manager_operation @@ -973,7 +973,7 @@ let dal_publish_slot_header ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ~source:src ctxt - (Dal_publish_slot_header slot_header) + (Dal_publish_commitment slot_header) 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 507e8e9d0755..5f39291b0461 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/op.mli @@ -559,7 +559,7 @@ val sc_rollup_timeout : Sc_rollup.Game.Index.t -> Operation.packed tzresult Lwt.t -val dal_publish_slot_header : +val dal_publish_commitment : ?force_reveal:bool -> ?counter:Manager_counter.t -> ?fee:Tez.t -> @@ -567,7 +567,7 @@ val dal_publish_slot_header : ?storage_limit:Z.t -> Context.t -> Contract.t -> - Dal.Operations.Publish_slot_header.t -> + Dal.Operations.Publish_commitment.t -> (packed_operation, tztrace) result Lwt.t (** [zk_rollup_origination ctxt source ~public_parameters ~circuits_info diff --git a/src/proto_alpha/lib_protocol/test/helpers/operation_generator.ml b/src/proto_alpha/lib_protocol/test/helpers/operation_generator.ml index 98e415c8e9de..587f3f109276 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/operation_generator.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/operation_generator.ml @@ -74,7 +74,7 @@ let manager_kinds = `KIncrease_paid_storage; `KRegister_global_constant; `KTransfer_ticket; - `KDal_publish_slot_header; + `KDal_publish_commitment; `KSc_rollup_originate; `KSc_rollup_add_messages; `KSc_rollup_cement; @@ -514,15 +514,15 @@ let generate_transfer_ticket = let entrypoint = Entrypoint.default in Transfer_ticket {contents; ty; ticketer; amount; destination; entrypoint} -let generate_dal_publish_slot_header = +let generate_dal_publish_commitment = let slot_index = Alpha_context.Dal.Slot_index.zero in let commitment = Alpha_context.Dal.Slot.Commitment.zero in let commitment_proof = Alpha_context.Dal.Slot.Commitment_proof.zero in let slot_header = - Alpha_context.Dal.Operations.Publish_slot_header. + Alpha_context.Dal.Operations.Publish_commitment. {slot_index; commitment; commitment_proof} in - QCheck2.Gen.pure (Dal_publish_slot_header slot_header) + QCheck2.Gen.pure (Dal_publish_commitment slot_header) let generate_sc_rollup_originate = let kind = Sc_rollup.Kind.Example_arith in @@ -608,8 +608,8 @@ let generator_of ?source = function generate_manager_operation ?source generate_register_global_constant | `KTransfer_ticket -> generate_manager_operation ?source generate_transfer_ticket - | `KDal_publish_slot_header -> - generate_manager_operation ?source generate_dal_publish_slot_header + | `KDal_publish_commitment -> + generate_manager_operation ?source generate_dal_publish_commitment | `KSc_rollup_originate -> generate_manager_operation ?source generate_sc_rollup_originate | `KSc_rollup_add_messages -> diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/manager_operation_helpers.ml b/src/proto_alpha/lib_protocol/test/integration/validate/manager_operation_helpers.ml index d9d4f2f9bb3a..c1b7f0d6006a 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/manager_operation_helpers.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/manager_operation_helpers.ml @@ -93,7 +93,7 @@ type manager_operation_kind = | K_Sc_rollup_timeout | K_Sc_rollup_execute_outbox_message | K_Sc_rollup_recover_bond - | K_Dal_publish_slot_header + | K_Dal_publish_commitment | K_Zk_rollup_origination | K_Zk_rollup_publish | K_Zk_rollup_update @@ -184,7 +184,7 @@ let kind_to_string = function | K_Sc_rollup_add_messages -> "Sc_rollup_add_messages" | K_Sc_rollup_execute_outbox_message -> "Sc_rollup_execute_outbox_message" | K_Sc_rollup_recover_bond -> "Sc_rollup_recover_bond" - | K_Dal_publish_slot_header -> "Dal_publish_slot_header" + | K_Dal_publish_commitment -> "Dal_publish_commitment" | K_Zk_rollup_origination -> "Zk_rollup_origination" | K_Zk_rollup_publish -> "Zk_rollup_publish" | K_Zk_rollup_update -> "Zk_rollup_update" @@ -900,15 +900,14 @@ let mk_sc_rollup_return_bond (oinfos : operation_req) (infos : infos) = sc_rollup staker -let mk_dal_publish_slot_header (oinfos : operation_req) (infos : infos) = +let mk_dal_publish_commitment (oinfos : operation_req) (infos : infos) = let slot_index = Alpha_context.Dal.Slot_index.zero in let commitment = Alpha_context.Dal.Slot.Commitment.zero in let commitment_proof = Alpha_context.Dal.Slot.Commitment_proof.zero in let slot = - Dal.Operations.Publish_slot_header. - {slot_index; commitment; commitment_proof} + Dal.Operations.Publish_commitment.{slot_index; commitment; commitment_proof} in - Op.dal_publish_slot_header + Op.dal_publish_commitment ?fee:oinfos.fee ?gas_limit:oinfos.gas_limit ?counter:oinfos.counter @@ -1003,7 +1002,7 @@ let select_op (op_req : operation_req) (infos : infos) = | K_Sc_rollup_timeout -> mk_sc_rollup_timeout | K_Sc_rollup_execute_outbox_message -> mk_sc_rollup_execute_outbox_message | K_Sc_rollup_recover_bond -> mk_sc_rollup_return_bond - | K_Dal_publish_slot_header -> mk_dal_publish_slot_header + | K_Dal_publish_commitment -> mk_dal_publish_commitment | K_Zk_rollup_origination -> mk_zk_rollup_origination | K_Zk_rollup_publish -> mk_zk_rollup_publish | K_Zk_rollup_update -> mk_zk_rollup_update @@ -1369,7 +1368,7 @@ let subjects = K_Sc_rollup_timeout; K_Sc_rollup_execute_outbox_message; K_Sc_rollup_recover_bond; - K_Dal_publish_slot_header; + K_Dal_publish_commitment; K_Zk_rollup_origination; K_Zk_rollup_publish; K_Zk_rollup_update; @@ -1381,7 +1380,7 @@ let is_consumer = function | K_Sc_rollup_add_messages | K_Sc_rollup_origination | K_Sc_rollup_refute | K_Sc_rollup_timeout | K_Sc_rollup_cement | K_Sc_rollup_publish | K_Sc_rollup_execute_outbox_message | K_Sc_rollup_recover_bond - | K_Dal_publish_slot_header | K_Zk_rollup_origination | K_Zk_rollup_publish + | K_Dal_publish_commitment | K_Zk_rollup_origination | K_Zk_rollup_publish | K_Zk_rollup_update -> false | K_Transaction | K_Origination | K_Register_global_constant @@ -1404,6 +1403,6 @@ let is_disabled flags = function | K_Sc_rollup_add_messages | K_Sc_rollup_refute | K_Sc_rollup_timeout | K_Sc_rollup_execute_outbox_message | K_Sc_rollup_recover_bond -> flags.scoru_arith = false - | K_Dal_publish_slot_header -> flags.dal = false + | K_Dal_publish_commitment -> flags.dal = false | K_Zk_rollup_origination | K_Zk_rollup_publish | K_Zk_rollup_update -> flags.zkru = false diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_sanity.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_sanity.ml index 882f29bc3237..574ee8d16770 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_sanity.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_sanity.ml @@ -75,7 +75,7 @@ let ensure_kind infos kind = | Sc_rollup_timeout _, K_Sc_rollup_timeout | Sc_rollup_execute_outbox_message _, K_Sc_rollup_execute_outbox_message | Sc_rollup_recover_bond _, K_Sc_rollup_recover_bond - | Dal_publish_slot_header _, K_Dal_publish_slot_header + | Dal_publish_commitment _, K_Dal_publish_commitment | Zk_rollup_origination _, K_Zk_rollup_origination | Zk_rollup_publish _, K_Zk_rollup_publish | Zk_rollup_update _, K_Zk_rollup_update -> @@ -86,7 +86,7 @@ let ensure_kind infos kind = | Sc_rollup_originate _ | Sc_rollup_publish _ | Sc_rollup_cement _ | Sc_rollup_add_messages _ | Sc_rollup_refute _ | Sc_rollup_timeout _ | Sc_rollup_execute_outbox_message _ | Sc_rollup_recover_bond _ - | Dal_publish_slot_header _ | Zk_rollup_origination _ + | Dal_publish_commitment _ | Zk_rollup_origination _ | Zk_rollup_publish _ | Zk_rollup_update _ ), _ ) -> assert false) diff --git a/src/proto_alpha/lib_protocol/validate.ml b/src/proto_alpha/lib_protocol/validate.ml index bb8052cd310e..afdc22de05dc 100644 --- a/src/proto_alpha/lib_protocol/validate.ml +++ b/src/proto_alpha/lib_protocol/validate.ml @@ -2053,8 +2053,8 @@ module Manager = struct the operations Branch_delayed if they cannot be successfully prechecked? *) return_unit - | Dal_publish_slot_header slot_header -> - Dal_apply.validate_publish_slot_header vi.ctxt slot_header + | Dal_publish_commitment slot_header -> + Dal_apply.validate_publish_commitment vi.ctxt slot_header | Zk_rollup_origination _ | Zk_rollup_publish _ | Zk_rollup_update _ -> assert_zk_rollup_feature_enabled vi diff --git a/src/proto_alpha/lib_sc_rollup_node/daemon_helpers.ml b/src/proto_alpha/lib_sc_rollup_node/daemon_helpers.ml index 005eea524114..50208c2472e8 100644 --- a/src/proto_alpha/lib_sc_rollup_node/daemon_helpers.ml +++ b/src/proto_alpha/lib_sc_rollup_node/daemon_helpers.ml @@ -214,7 +214,7 @@ let process_included_l1_operation (type kind) ~catching_up fail_when (List.exists (Node_context.is_operator node_ctxt) stakers) (Sc_rollup_node_errors.Lost_game Draw)) - | Dal_publish_slot_header _, Dal_publish_slot_header_result {slot_header; _} + | Dal_publish_commitment _, Dal_publish_commitment_result {slot_header; _} when Node_context.dal_supported node_ctxt -> let* () = Node_context.save_slot_header @@ -295,7 +295,7 @@ let process_l1_operation (type kind) ~catching_up node_ctxt | Sc_rollup_recover_bond {sc_rollup = rollup; staker = _} -> Sc_rollup.Address.( rollup = node_ctxt.Node_context.config.sc_rollup_address) - | Dal_publish_slot_header _ -> true + | Dal_publish_commitment _ -> true | Reveal _ | Transaction _ | Origination _ | Delegation _ | Update_consensus_key _ | Register_global_constant _ | Set_deposits_limit _ | Increase_paid_storage _ | Transfer_ticket _ | Sc_rollup_originate _ diff --git a/tezt/lib_tezos/dal_common.ml b/tezt/lib_tezos/dal_common.ml index 3cca957cfd68..49a7bcc64198 100644 --- a/tezt/lib_tezos/dal_common.ml +++ b/tezt/lib_tezos/dal_common.ml @@ -463,7 +463,7 @@ module Helpers = struct | Ok cryptobox -> cryptobox | Error (`Fail msg) -> on_error msg - let publish_slot_header ?counter ?force ?source ?fee ?error ~index ~commitment + let publish_commitment ?counter ?force ?source ?fee ?error ~index ~commitment ~proof client = (* We scale the fees to match the actual gas cost of publishing a slot header. Doing this here allows to keep the diff small as gas cost for @@ -475,7 +475,7 @@ module Helpers = struct ?force [ make ?source ?fee ?counter - @@ dal_publish_slot_header ~index ~commitment ~proof; + @@ dal_publish_commitment ~index ~commitment ~proof; ] client) diff --git a/tezt/lib_tezos/dal_common.mli b/tezt/lib_tezos/dal_common.mli index c8a5dbcec08a..f23a2841dfc5 100644 --- a/tezt/lib_tezos/dal_common.mli +++ b/tezt/lib_tezos/dal_common.mli @@ -64,7 +64,7 @@ module Helpers : sig val make_cryptobox : ?on_error:(string -> Cryptobox.t) -> Cryptobox.parameters -> Cryptobox.t - val publish_slot_header : + val publish_commitment : ?counter:int -> ?force:bool -> ?source:Account.key -> diff --git a/tezt/lib_tezos/operation_core.ml b/tezt/lib_tezos/operation_core.ml index fe752016fd31..4407dd160edd 100644 --- a/tezt/lib_tezos/operation_core.ml +++ b/tezt/lib_tezos/operation_core.ml @@ -605,7 +605,7 @@ module Manager = struct parameters : transfer_parameters option; } | Origination of {code : JSON.u; storage : JSON.u; balance : int} - | Dal_publish_slot_header of { + | Dal_publish_commitment of { index : int; commitment : Tezos_crypto_dal.Cryptobox.commitment; proof : Tezos_crypto_dal.Cryptobox.commitment_proof; @@ -627,8 +627,8 @@ module Manager = struct ?(entrypoint = "default") ?(arg = `O [("prim", `String "Unit")]) () = Transfer {amount; dest; parameters = Some {entrypoint; arg}} - let dal_publish_slot_header ~index ~commitment ~proof = - Dal_publish_slot_header {index; commitment; proof} + let dal_publish_commitment ~index ~commitment ~proof = + Dal_publish_commitment {index; commitment; proof} let origination ?(init_balance = 0) ~code ~init_storage () = Origination {code; storage = init_storage; balance = init_balance} @@ -673,7 +673,7 @@ module Manager = struct ("balance", json_of_tez balance); ("script", script); ] - | Dal_publish_slot_header {index; commitment; proof} -> + | Dal_publish_commitment {index; commitment; proof} -> let slot_header = `O [ @@ -683,7 +683,7 @@ module Manager = struct ] in [ - ("kind", `String "dal_publish_slot_header"); + ("kind", `String "dal_publish_commitment"); ("slot_header", slot_header); ] | Delegation {delegate} -> @@ -744,7 +744,7 @@ module Manager = struct let gas_limit = Option.value gas_limit ~default:1_040 in let storage_limit = Option.value storage_limit ~default:257 in {source; counter; fee; gas_limit; storage_limit; payload} - | Dal_publish_slot_header _ -> + | Dal_publish_commitment _ -> let fee = Option.value fee ~default:2_100 in let gas_limit = Option.value gas_limit ~default:17_000 in let storage_limit = Option.value storage_limit ~default:0 in diff --git a/tezt/lib_tezos/operation_core.mli b/tezt/lib_tezos/operation_core.mli index 0cd535eaf06f..270f8833c89b 100644 --- a/tezt/lib_tezos/operation_core.mli +++ b/tezt/lib_tezos/operation_core.mli @@ -476,10 +476,10 @@ module Manager : sig unit -> payload - (** [dal_publish_slot_header ~level ~index ~header] builds an + (** [dal_publish_commitment ~level ~index ~header] builds an operation for the data-availability layer that publishes a slot. *) - val dal_publish_slot_header : + val dal_publish_commitment : index:int -> commitment:Tezos_crypto_dal.Cryptobox.commitment -> proof:Tezos_crypto_dal.Cryptobox.commitment_proof -> diff --git a/tezt/long_tests/dal.ml b/tezt/long_tests/dal.ml index c6753f92eaaa..249c1e580d9f 100644 --- a/tezt/long_tests/dal.ml +++ b/tezt/long_tests/dal.ml @@ -144,14 +144,14 @@ let store_slot_to_dal_node ~slot_size dal_node = in return (commitment_hash, proof) -let publish_slot_header_to_l1_node ~slot_index ~source ~commitment_hash ~proof +let publish_commitment_to_l1_node ~slot_index ~source ~commitment_hash ~proof client = let* (`OpHash op_hash) = Operation.Manager.( inject [ make ~source - @@ dal_publish_slot_header + @@ dal_publish_commitment ~index:slot_index ~commitment:commitment_hash ~proof; @@ -235,9 +235,9 @@ let test_produce_and_propagate_shards ~executors ~protocol = ~slot_size:dal_parameters.cryptobox.slot_size dal_node2 in - Log.info "Publish slot header from [node2]." ; + Log.info "Publish commitment from [node2]." ; let* op_hash = - publish_slot_header_to_l1_node + publish_commitment_to_l1_node ~slot_index ~source:Constant.bootstrap2 ~commitment_hash @@ -249,7 +249,7 @@ let test_produce_and_propagate_shards ~executors ~protocol = [op_hash] in it's mempool." ; let* () = (* Wait until [node1] gets notified about a new operation - (should be the above publish slot header operation in this case). *) + (should be the above publish commitment operation in this case). *) let* () = Node.wait_for_request ~request:`Notify node1 in let* m = Mempool.get_mempool client1 in Check.( @@ -260,7 +260,7 @@ let test_produce_and_propagate_shards ~executors ~protocol = unit in let dal_node_endpoint = Dal.Helpers.endpoint dal_node2 in - Log.info "Bake two blocks to finalize the slot header." ; + Log.info "Bake two blocks to finalize the commitment publication." ; let* () = Base.repeat 2 (fun () -> Client.bake_for_and_wait client1 ~dal_node_endpoint) diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index e52e39633395..1698b165261e 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -577,7 +577,7 @@ let test_feature_flag _protocol _parameters _cryptobox node client client in let* (`OpHash oph2) = - Helpers.publish_slot_header ~force:true ~index:0 ~commitment ~proof client + Helpers.publish_commitment ~force:true ~index:0 ~commitment ~proof client in let* mempool = Mempool.get_mempool client in let expected_mempool = Mempool.{empty with refused = [oph1; oph2]} in @@ -616,7 +616,7 @@ let test_one_committee_per_level _protocol _parameters _cryptobox node _client let publish_dummy_slot ~source ?error ?fee ~index ~message cryptobox = let commitment, proof = Dal.(Commitment.dummy_commitment cryptobox message) in - Helpers.publish_slot_header ~source ?fee ?error ~index ~commitment ~proof + Helpers.publish_commitment ~source ?fee ?error ~index ~commitment ~proof (* We check that publishing a slot header with a proof for a different slot leads to a proof-checking error. *) @@ -624,7 +624,7 @@ let publish_dummy_slot_with_wrong_proof_for_same_content ~source ?fee ~index cryptobox = let commitment, _proof = Dal.(Commitment.dummy_commitment cryptobox "a") in let _commitment, proof = Dal.(Commitment.dummy_commitment cryptobox "b") in - Helpers.publish_slot_header ~source ?fee ~index ~commitment ~proof + Helpers.publish_commitment ~source ?fee ~index ~commitment ~proof (* We check that publishing a slot header with a proof for the "same" slot contents but represented using a different [slot_size] leads @@ -641,13 +641,13 @@ let publish_dummy_slot_with_wrong_proof_for_different_slot_size ~source ?fee let msg = "a" in let commitment, _proof = Dal.(Commitment.dummy_commitment cryptobox msg) in let _commitment, proof = Dal.(Commitment.dummy_commitment cryptobox' msg) in - Helpers.publish_slot_header ~source ?fee ~index ~commitment ~proof + Helpers.publish_commitment ~source ?fee ~index ~commitment ~proof -let publish_slot_header ?counter ?force ~source ?(fee = 1200) ~index ~commitment +let publish_commitment ?counter ?force ~source ?(fee = 1200) ~index ~commitment ~proof client = let commitment = Dal.Commitment.of_string commitment in let proof = Dal.Commitment.proof_of_string proof in - Helpers.publish_slot_header + Helpers.publish_commitment ?counter ?force ~source @@ -801,10 +801,10 @@ let test_slot_management_logic _protocol parameters cryptobox node client Client.RPC.call client @@ RPC.get_chain_block_operations () in let fees_error = - Failed {error_id = "proto.alpha.dal_publish_slot_header_duplicate"} + Failed {error_id = "proto.alpha.dal_publish_commitment_duplicate"} in let proof_error = - Failed {error_id = "proto.alpha.dal_publish_slot_header_invalid_proof"} + Failed {error_id = "proto.alpha.dal_publish_commitment_invalid_proof"} in (* The baker sorts operations fee wise. Consequently order of application for the operations will be: oph3 > oph2 > oph4 > oph1 @@ -1133,7 +1133,7 @@ let publish_and_store_slot ?with_proof ?counter ?force ?(fee = 1_200) client dal_node source ~index content = let* commitment, proof = Helpers.store_slot dal_node ?with_proof content in let* _ = - publish_slot_header + publish_commitment ?counter ?force ~source @@ -1692,7 +1692,7 @@ let test_dal_node_import_snapshot _protocol parameters _cryptobox node client "content1") in let* _oph = - publish_slot_header + publish_commitment ~source:Constant.bootstrap1 ~index:0 ~commitment @@ -2619,7 +2619,7 @@ let test_attester_with_bake_for _protocol parameters cryptobox node client The publication consists in sending the slot to a DAL node, computing its shards on the DAL node and associating it to a slot index and published - level. On the L1 side, a manager operation publish_slot_header is also sent. + level. On the L1 side, a manager operation publish_commitment is also sent. Having the ability to inject some blocks ahead (thanks to [beforehand_slot_injection]) allows some pipelining, as shards computation -- GitLab