123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)typeerror+=|Dal_feature_disabled|Dal_slot_index_above_hard_limit|Dal_subscribe_rollup_invalid_slot_indexof{given:Dal_slot_repr.Index.t;maximum:Dal_slot_repr.Index.t;}|Dal_endorsement_unexpected_sizeof{expected:int;got:int}|Dal_publish_slot_header_invalid_indexof{given:Dal_slot_repr.Index.t;maximum:Dal_slot_repr.Index.t;}|Dal_publish_slot_header_candidate_with_low_feesof{proposed_fees:Tez_repr.t;}|Dal_endorsement_size_limit_exceededof{maximum_size:int;got:int}|Dal_publish_slot_header_duplicateof{slot:Dal_slot_repr.t}let()=letopenData_encodinginletdescription="Bad index for slot"inregister_error_kind`Permanent~id:"dal_subscribe_rollup_invalid_slot_index"~title:"DAL slot invalid index for subscribing sc rollup"~description~pp:(funppf(given,maximum)->Format.fprintfppf"%s: Given %a. Maximum %a."descriptionDal_slot_repr.Index.ppgivenDal_slot_repr.Index.ppmaximum)(obj2(req"given"Dal_slot_repr.Index.encoding)(req"got"Dal_slot_repr.Index.encoding))(function|Dal_subscribe_rollup_invalid_slot_index{given;maximum}->Some(given,maximum)|_->None)(fun(given,maximum)->Dal_subscribe_rollup_invalid_slot_index{given;maximum});letdescription="Data-availability layer will be enabled in a future proposal."inregister_error_kind`Permanent~id:"operation.dal_disabled"~title:"DAL is disabled"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.unit(functionDal_feature_disabled->Some()|_->None)(fun()->Dal_feature_disabled);letdescription="The endorsement for data availability has a different size"inregister_error_kind`Permanent~id:"dal_endorsement_unexpected_size"~title:"DAL endorsement unexpected size"~description~pp:(funppf(expected,got)->Format.fprintfppf"%s: Expected %d. Got %d."descriptionexpectedgot)(obj2(req"expected_size"int31)(req"got"int31))(function|Dal_endorsement_unexpected_size{expected;got}->Some(expected,got)|_->None)(fun(expected,got)->Dal_endorsement_unexpected_size{expected;got});letdescription="Slot index above hard limit"inregister_error_kind`Permanent~id:"dal_slot_index_negative_orabove_hard_limit"~title:"DAL slot index negative or above hard limit"~description~pp:(funppf()->Format.fprintfppf"%s: Maximum allowed %a."descriptionDal_slot_repr.Index.ppDal_slot_repr.Index.max_value)Data_encoding.unit(functionDal_slot_index_above_hard_limit->Some()|_->None)(fun()->Dal_slot_index_above_hard_limit);letdescription="Bad index for slot header"inregister_error_kind`Permanent~id:"dal_publish_slot_header_invalid_index"~title:"DAL slot header invalid index"~description~pp:(funppf(given,maximum)->Format.fprintfppf"%s: Given %a. Maximum %a."descriptionDal_slot_repr.Index.ppgivenDal_slot_repr.Index.ppmaximum)(obj2(req"given"Dal_slot_repr.Index.encoding)(req"got"Dal_slot_repr.Index.encoding))(function|Dal_publish_slot_header_invalid_index{given;maximum}->Some(given,maximum)|_->None)(fun(given,maximum)->Dal_publish_slot_header_invalid_index{given;maximum});(* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3114
Better error message *)letdescription="Slot header with too low fees"inregister_error_kind`Permanent~id:"dal_publish_slot_header_with_low_fees"~title:"DAL slot header with low fees"~description~pp:(funppfproposed->Format.fprintfppf"%s: Proposed fees %a."descriptionTez_repr.ppproposed)(obj1(req"proposed"Tez_repr.encoding))(function|Dal_publish_slot_header_candidate_with_low_fees{proposed_fees}->Someproposed_fees|_->None)(funproposed_fees->Dal_publish_slot_header_candidate_with_low_fees{proposed_fees});letdescription="The endorsement for data availability is a too big"inregister_error_kind`Permanent~id:"dal_endorsement_size_limit_exceeded"~title:"DAL endorsement exceeded the limit"~description~pp:(funppf(maximum_size,got)->Format.fprintfppf"%s: Maximum is %d. Got %d."descriptionmaximum_sizegot)(obj2(req"maximum_size"int31)(req"got"int31))(function|Dal_endorsement_size_limit_exceeded{maximum_size;got}->Some(maximum_size,got)|_->None)(fun(maximum_size,got)->Dal_endorsement_size_limit_exceeded{maximum_size;got});(* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3114
Better error message. *)letdescription="A slot header for this slot was already proposed"inregister_error_kind`Permanent~id:"dal_publish_slot_heade_duplicate"~title:"DAL publish slot header duplicate"~description~pp:(funppf_proposed->Format.fprintfppf"%s"description)(obj1(req"proposed"Dal_slot_repr.encoding))(function|Dal_publish_slot_header_duplicate{slot}->Someslot|_->None)(funslot->Dal_publish_slot_header_duplicate{slot})