Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file dal_errors_repr.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313(*****************************************************************************)(* *)(* 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_attestation_unexpected_sizeof{expected:int;got:int}|Dal_publish_slot_header_future_levelof{provided:Raw_level_repr.t;expected:Raw_level_repr.t;}|Dal_publish_slot_header_past_levelof{provided:Raw_level_repr.t;expected:Raw_level_repr.t;}|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_attestation_size_limit_exceededof{maximum_size:int;got:int}|Dal_publish_slot_header_duplicateof{slot_header:Dal_slot_repr.Header.t}|Dal_publish_slot_header_invalid_proofof{slot_header:Dal_slot_repr.Header.operation;}|Dal_data_availibility_attestor_not_in_committeeof{attestor:Signature.Public_key_hash.t;level:Level_repr.t;}|Dal_operation_for_old_levelof{current:Raw_level_repr.t;given:Raw_level_repr.t;}|Dal_operation_for_future_levelof{current:Raw_level_repr.t;given:Raw_level_repr.t;}let()=letopenData_encodinginletdescription="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 attestation for data availability has a different size"inregister_error_kind`Permanent~id:"dal_attestation_unexpected_size"~title:"DAL attestation 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_attestation_unexpected_size{expected;got}->Some(expected,got)|_->None)(fun(expected,got)->Dal_attestation_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="Unexpected level in the future in slot header"inregister_error_kind`Temporary~id:"dal_publish_slot_header_future_level"~title:"DAL slot header future level"~description~pp:(funppf(provided,expected)->Format.fprintfppf"%s: Provided %a. Expected %a."descriptionRaw_level_repr.ppprovidedRaw_level_repr.ppexpected)(obj2(req"provided"Raw_level_repr.encoding)(req"got"Raw_level_repr.encoding))(function|Dal_publish_slot_header_future_level{provided;expected}->Some(provided,expected)|_->None)(fun(provided,expected)->Dal_publish_slot_header_future_level{provided;expected});letdescription="Unexpected level in the past in slot header"inregister_error_kind`Branch~id:"dal_publish_slot_header_past_level"~title:"DAL slot header past level"~description~pp:(funppf(provided,expected)->Format.fprintfppf"%s: Provided %a. Expected %a."descriptionRaw_level_repr.ppprovidedRaw_level_repr.ppexpected)(obj2(req"provided"Raw_level_repr.encoding)(req"got"Raw_level_repr.encoding))(function|Dal_publish_slot_header_past_level{provided;expected}->Some(provided,expected)|_->None)(fun(provided,expected)->Dal_publish_slot_header_past_level{provided;expected});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 attestation for data availability is a too big"inregister_error_kind`Permanent~id:"dal_attestation_size_limit_exceeded"~title:"DAL attestation 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_attestation_size_limit_exceeded{maximum_size;got}->Some(maximum_size,got)|_->None)(fun(maximum_size,got)->Dal_attestation_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.Header.encoding))(function|Dal_publish_slot_header_duplicate{slot_header}->Someslot_header|_->None)(funslot_header->Dal_publish_slot_header_duplicate{slot_header});letdescription="The slot header's commitment proof does not check"inregister_error_kind`Permanent~id:"dal_publish_slot_header_invalid_proof"~title:"DAL publish slot header invalid proof"~description~pp:(funppf_proposed->Format.fprintfppf"%s"description)Dal_slot_repr.Header.operation_encoding(function|Dal_publish_slot_header_invalid_proof{slot_header}->Someslot_header|_->None)(funslot_header->Dal_publish_slot_header_invalid_proof{slot_header});register_error_kind`Outdated~id:"Dal_operation_for_old_level"~title:"Dal operation for an old level"~description:"The Dal operation targets an old level"~pp:(funppf(current_lvl,given_lvl)->Format.fprintfppf"Dal operation targets an old level %a. Current level is %a."Raw_level_repr.ppgiven_lvlRaw_level_repr.ppcurrent_lvl)Data_encoding.(obj2(req"current_level"Raw_level_repr.encoding)(req"given_level"Raw_level_repr.encoding))(function|Dal_operation_for_old_level{current;given}->Some(current,given)|_->None)(fun(current,given)->Dal_operation_for_old_level{current;given});register_error_kind`Temporary~id:"Dal_operation_for_future_level"~title:"Dal operation for a future level"~description:"The Dal operation target a future level"~pp:(funppf(current_lvl,given_lvl)->Format.fprintfppf"Dal operation targets a future level %a. Current level is %a."Raw_level_repr.ppgiven_lvlRaw_level_repr.ppcurrent_lvl)Data_encoding.(obj2(req"current_level"Raw_level_repr.encoding)(req"given_level"Raw_level_repr.encoding))(function|Dal_operation_for_future_level{current;given}->Some(current,given)|_->None)(fun(current,given)->Dal_operation_for_future_level{current;given});register_error_kind`Permanent~id:"Dal_data_availibility_attestor_not_in_committee"~title:"The attestor is not part of the DAL committee for this level"~description:"The attestor is not part of the DAL committee for this level"~pp:(funppf(attestor,level)->Format.fprintfppf"The attestor %a is not part of the DAL committee for the level %a"Signature.Public_key_hash.ppattestorLevel_repr.pplevel)Data_encoding.(obj2(req"attestor"Signature.Public_key_hash.encoding)(req"level"Level_repr.encoding))(function|Dal_data_availibility_attestor_not_in_committee{attestor;level}->Some(attestor,level)|_->None)(fun(attestor,level)->Dal_data_availibility_attestor_not_in_committee{attestor;level})