Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file sc_rollup_errors.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *)(* Copyright (c) 2022 TriliTech <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+=|(* `Temporary *)Sc_rollup_disputed|(* `Temporary *)Sc_rollup_does_not_existofSc_rollup_repr.t|(* `Temporary *)Sc_rollup_no_conflict|(* `Temporary *)Sc_rollup_no_stakers|(* `Temporary *)Sc_rollup_not_staked|(* `Temporary *)Sc_rollup_not_staked_on_lcc|(* `Temporary *)Sc_rollup_parent_not_lcc|(* `Temporary *)Sc_rollup_remove_lcc|(* `Temporary *)Sc_rollup_staker_backtracked|(* `Temporary *)Sc_rollup_too_far_ahead|(* `Temporary *)Sc_rollup_too_recent|(* `Temporary *)Sc_rollup_unknown_commitmentofSc_rollup_commitment_repr.Hash.t|(* `Temporary *)Sc_rollup_bad_inbox_level|(* `Temporary *)Sc_rollup_max_number_of_available_messages_reached|(* `Temporary *)Sc_rollup_game_already_started|(* `Temporary *)Sc_rollup_wrong_turn|(* `Temporary *)Sc_rollup_no_game|(* `Temporary *)Sc_rollup_staker_in_gameof[`RefuterofSignature.public_key_hash|`DefenderofSignature.public_key_hash|`BothofSignature.public_key_hash*Signature.public_key_hash]|(* `Temporary *)Sc_rollup_timeout_level_not_reached|(* `Temporary *)Sc_rollup_max_number_of_messages_reached_for_commitment_period|(* `Temporary *)Sc_rollup_invalid_outbox_message_index|(* `Temporary *)Sc_rollup_outbox_level_expired|(* `Temporary *)Sc_rollup_outbox_message_already_applied|(* `Temporary *)Sc_rollup_staker_funds_too_lowof{staker:Signature.public_key_hash;sc_rollup:Sc_rollup_repr.t;staker_balance:Tez_repr.t;min_expected_balance:Tez_repr.t;}|(* DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/3169
Move the errors below to Dal_errors_repr. *)(* `Permanent *)Sc_rollup_dal_slot_already_registeredof(Sc_rollup_repr.t*Dal_slot_repr.Index.t)|(* ` Temporary *)Sc_rollup_requested_dal_slot_subscriptions_of_future_levelof(Raw_level_repr.t*Raw_level_repr.t)let()=register_error_kind`Temporary~id:"Sc_rollup_max_number_of_available_messages_reached"~title:"Maximum number of available messages reached"~description:"Maximum number of available messages reached"Data_encoding.unit(function|Sc_rollup_max_number_of_available_messages_reached->Some()|_->None)(fun()->Sc_rollup_max_number_of_available_messages_reached);register_error_kind`Temporary~id:"Sc_rollup_staker_in_game"~title:"Staker is already playing a game"~description:"Attempted to start a game where one staker is already busy"~pp:(funppfstaker->letbusyppf=function|`Refutersc->Format.fprintfppf"the refuter (%a) is"Signature.Public_key_hash.ppsc|`Defendersc->Format.fprintfppf"the defender (%a) is"Signature.Public_key_hash.ppsc|`Both(refuter,defender)->Format.fprintfppf"both the refuter (%a) and the defender (%a) are"Signature.Public_key_hash.pprefuterSignature.Public_key_hash.ppdefenderinFormat.fprintfppf"Attempted to start a game where %a already busy."busystaker)Data_encoding.(union[case(Tag0)~title:"Refuter"(obj1(req"refuter"Signature.Public_key_hash.encoding))(function`Refutersc->Somesc|_->None)(funsc->`Refutersc);case(Tag1)~title:"Defender"(obj1(req"defender"Signature.Public_key_hash.encoding))(function`Defendersc->Somesc|_->None)(funsc->`Defendersc);case(Tag2)~title:"Both"(obj2(req"refuter"Signature.Public_key_hash.encoding)(req"defender"Signature.Public_key_hash.encoding))(function|`Both(refuter,defender)->Some(refuter,defender)|_->None)(fun(refuter,defender)->`Both(refuter,defender));])(functionSc_rollup_staker_in_gamex->Somex|_->None)(funx->Sc_rollup_staker_in_gamex);register_error_kind`Temporary~id:"Sc_rollup_timeout_level_not_reached"~title:"Attempt to timeout game too early"~description:"Attempt to timeout game too early"Data_encoding.unit(functionSc_rollup_timeout_level_not_reached->Some()|_->None)(fun()->Sc_rollup_timeout_level_not_reached);letdescription="Refutation game already started, must play with is_opening_move = false."inregister_error_kind`Temporary~id:"Sc_rollup_game_already_started"~title:"Refutation game already started"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.unit(functionSc_rollup_game_already_started->Some()|_->None)(fun()->Sc_rollup_game_already_started);letdescription="Refutation game does not exist"inregister_error_kind`Temporary~id:"Sc_rollup_no_game"~title:"Refutation game does not exist"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.unit(functionSc_rollup_no_game->Some()|_->None)(fun()->Sc_rollup_no_game);register_error_kind`Temporary~id:"Sc_rollup_wrong_turn"~title:"Attempt to play move but not staker's turn"~description:"Attempt to play move but not staker's turn"Data_encoding.unit(functionSc_rollup_wrong_turn->Some()|_->None)(fun()->Sc_rollup_wrong_turn);register_error_kind`Temporary~id:"Sc_rollup_max_number_of_messages_reached_for_commitment_period"~title:"Maximum number of messages reached for commitment period"~description:"Maximum number of messages reached for commitment period"Data_encoding.unit(function|Sc_rollup_max_number_of_messages_reached_for_commitment_period->Some()|_->None)(fun()->Sc_rollup_max_number_of_messages_reached_for_commitment_period);letdescription="Attempted to cement a disputed commitment."inregister_error_kind`Temporary~id:"Sc_rollup_disputed"~title:"Commitment disputed"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_disputed->Some()|_->None)(fun()->Sc_rollup_disputed);letdescription="Attempted to use a rollup that has not been originated."inregister_error_kind`Temporary~id:"Sc_rollup_does_not_exist"~title:"Rollup does not exist"~description~pp:(funppfx->Format.fprintfppf"Rollup %a does not exist"Sc_rollup_repr.ppx)Data_encoding.(obj1(req"rollup"Sc_rollup_repr.encoding))(functionSc_rollup_does_not_existx->Somex|_->None)(funx->Sc_rollup_does_not_existx);letdescription="No conflict."inregister_error_kind`Temporary~id:"Sc_rollup_no_conflict"~title:"No conflict"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_no_conflict->Some()|_->None)(fun()->Sc_rollup_no_conflict);letdescription="No stakers."inregister_error_kind`Temporary~id:"Sc_rollup_no_stakers"~title:"No stakers"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_no_stakers->Some()|_->None)(fun()->Sc_rollup_no_stakers);letdescription="Unknown staker."inregister_error_kind`Temporary~id:"Sc_rollup_not_staked"~title:"Unknown staker"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_not_staked->Some()|_->None)(fun()->Sc_rollup_not_staked);letdescription="Attempted to withdraw while not staked on the last cemented commitment."inregister_error_kind`Temporary~id:"Sc_rollup_not_staked_on_lcc"~title:"Rollup not staked on LCC"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_not_staked_on_lcc->Some()|_->None)(fun()->Sc_rollup_not_staked_on_lcc);letdescription="Parent is not cemented."inregister_error_kind`Temporary~id:"Sc_rollup_parent_not_lcc"~title:"Parent not cemented"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_parent_not_lcc->Some()|_->None)(fun()->Sc_rollup_parent_not_lcc);letdescription="Can not remove a cemented commitment."inregister_error_kind`Temporary~id:"Sc_rollup_remove_lcc"~title:"Can not remove cemented"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_remove_lcc->Some()|_->None)(fun()->Sc_rollup_remove_lcc);letdescription="Staker backtracked."inregister_error_kind`Temporary~id:"Sc_rollup_staker_backtracked"~title:"Staker backtracked"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_staker_backtracked->Some()|_->None)(fun()->Sc_rollup_staker_backtracked);letdescription="Commitment is too far ahead of the last cemented commitment."inregister_error_kind`Temporary~id:"Sc_rollup_too_far_ahead"~title:"Commitment too far ahead"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_too_far_ahead->Some()|_->None)(fun()->Sc_rollup_too_far_ahead);letdescription="Attempted to cement a commitment before its refutation deadline."inregister_error_kind`Temporary~id:"Sc_rollup_too_recent"~title:"Commitment too recent"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_too_recent->Some()|_->None)(fun()->Sc_rollup_too_recent);letdescription="Unknown commitment."inregister_error_kind`Temporary~id:"Sc_rollup_unknown_commitment"~title:"Unknown commitment"~description~pp:(funppfx->Format.fprintfppf"Commitment %a does not exist"Sc_rollup_commitment_repr.Hash.ppx)Data_encoding.(obj1(req"commitment"Sc_rollup_commitment_repr.Hash.encoding))(functionSc_rollup_unknown_commitmentx->Somex|_->None)(funx->Sc_rollup_unknown_commitmentx);letdescription="Attempted to commit to a bad inbox level."inregister_error_kind`Temporary~id:"Sc_rollup_bad_inbox_level"~title:"Committing to a bad inbox level"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_bad_inbox_level->Some()|_->None)(fun()->Sc_rollup_bad_inbox_level);letdescription="Invalid rollup outbox message index"inregister_error_kind`Temporary~id:"Sc_rollup_invalid_outbox_message_index"~title:"Invalid rollup outbox message index"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_invalid_outbox_message_index->Some()|_->None)(fun()->Sc_rollup_invalid_outbox_message_index);letdescription="Outbox level expired"inregister_error_kind`Temporary~id:"Sc_rollup_outbox_level_expired"~title:description~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_outbox_level_expired->Some()|_->None)(fun()->Sc_rollup_outbox_level_expired);letdescription="Outbox message already applied"inregister_error_kind`Temporary~id:"Sc_rollup_outbox_message_already_applied"~title:description~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSc_rollup_outbox_message_already_applied->Some()|_->None)(fun()->Sc_rollup_outbox_message_already_applied);register_error_kind`Temporary~id:"Sc_rollup_staker_funds_too_low"~title:"Staker does not have enough funds to make a deposit"~description:"Staker doesn't have enough funds to make a smart contract rollup \
deposit."~pp:(funppf(staker,sc_rollup,staker_balance,min_expected_balance)->Format.fprintfppf"Staker (%a) doesn't have enough funds to make the deposit for smart \
contract rollup (%a). Staker's balance is %a while a balance of at \
least %a is required."Signature.Public_key_hash.ppstakerSc_rollup_repr.ppsc_rollupTez_repr.ppstaker_balanceTez_repr.ppmin_expected_balance)Data_encoding.(obj4(req"staker"Signature.Public_key_hash.encoding)(req"sc_rollup"Sc_rollup_repr.encoding)(req"staker_balance"Tez_repr.encoding)(req"min_expected_balance"Tez_repr.encoding))(function|Sc_rollup_staker_funds_too_low{staker;sc_rollup;staker_balance;min_expected_balance}->Some(staker,sc_rollup,staker_balance,min_expected_balance)|_->None)(fun(staker,sc_rollup,staker_balance,min_expected_balance)->Sc_rollup_staker_funds_too_low{staker;sc_rollup;staker_balance;min_expected_balance});register_error_kind`Permanent~id:"Sc_rollup_dal_slot_already_registered"~title:"DAL slot already registered for rollup"~description~pp:(funppf(rollup,slot_index)->Format.fprintfppf"Rollup %a is already subscribed to data availability slot %a"Sc_rollup_repr.pprollupDal_slot_repr.Index.ppslot_index)Data_encoding.(obj2(req"rollup"Sc_rollup_repr.encoding)(req"slot_index"Dal_slot_repr.Index.encoding))(function|Sc_rollup_dal_slot_already_registered(rollup,slot_index)->Some(rollup,slot_index)|_->None)(fun(rollup,slot_index)->Sc_rollup_dal_slot_already_registered(rollup,slot_index));register_error_kind`Temporary~id:"Sc_rollup_requested_dal_slot_subscriptions_at_future_level"~title:"Requested list of subscribed dal slots at a future level"~description~pp:(funppf(current_level,future_level)->Format.fprintfppf"The list of subscribed dal slot indices has been requested for level \
%a, but the current level is %a"Raw_level_repr.ppfuture_levelRaw_level_repr.ppcurrent_level)Data_encoding.(obj2(req"current_level"Raw_level_repr.encoding)(req"future_level"Raw_level_repr.encoding))(function|Sc_rollup_requested_dal_slot_subscriptions_of_future_level(current_level,future_level)->Some(current_level,future_level)|_->None)(fun(current_level,future_level)->Sc_rollup_requested_dal_slot_subscriptions_of_future_level(current_level,future_level));()