12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *)(* *)(* 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. *)(* *)(*****************************************************************************)openAlpha_contexttypeoperation_conflict=|Operation_conflictof{existing:Operation_hash.t;new_operation:Operation_hash.t;}letoperation_conflict_encoding=letopenData_encodingindef"operation_conflict"~title:"Conflict error"~description:"Conflict between two operations"@@conv(function|Operation_conflict{existing;new_operation}->(existing,new_operation))(fun(existing,new_operation)->Operation_conflict{existing;new_operation})(obj2(req"existing"Operation_hash.encoding)(req"new_operation"Operation_hash.encoding))moduleConsensus=structtypeerror+=Zero_frozen_depositsofSignature.Public_key_hash.tlet()=register_error_kind`Permanent~id:"validate.zero_frozen_deposits"~title:"Zero frozen deposits"~description:"The delegate has zero frozen deposits."~pp:(funppfdelegate->Format.fprintfppf"Delegate %a has zero frozen deposits; it is not allowed to \
bake/preendorse/endorse."Signature.Public_key_hash.ppdelegate)Data_encoding.(obj1(req"delegate"Signature.Public_key_hash.encoding))(functionZero_frozen_depositsdelegate->Somedelegate|_->None)(fundelegate->Zero_frozen_depositsdelegate)(** This type is only used in consensus operation errors to make
them more informative. *)typeconsensus_operation_kind=|Preendorsement|Endorsement|Grandparent_endorsement|Dal_attestationletconsensus_operation_kind_encoding=Data_encoding.string_enum[("Preendorsement",Preendorsement);("Endorsement",Endorsement);("Grandparent_endorsement",Grandparent_endorsement);("Dal_attestation",Dal_attestation);]letconsensus_operation_kind_ppfmt=function|Preendorsement->Format.fprintffmt"Preendorsement"|Endorsement->Format.fprintffmt"Endorsement"|Grandparent_endorsement->Format.fprintffmt"Grandparent endorsement"|Dal_attestation->Format.fprintffmt"Dal_attestation"(** Errors for preendorsements and endorsements. *)typeerror+=|Consensus_operation_for_old_levelof{kind:consensus_operation_kind;expected:Raw_level.t;provided:Raw_level.t;}|Consensus_operation_for_future_levelof{kind:consensus_operation_kind;expected:Raw_level.t;provided:Raw_level.t;}|Consensus_operation_for_old_roundof{kind:consensus_operation_kind;expected:Round.t;provided:Round.t;}|Consensus_operation_for_future_roundof{kind:consensus_operation_kind;expected:Round.t;provided:Round.t;}|Wrong_consensus_operation_branchof{kind:consensus_operation_kind;expected:Block_hash.t;provided:Block_hash.t;}|Wrong_payload_hash_for_consensus_operationof{kind:consensus_operation_kind;expected:Block_payload_hash.t;provided:Block_payload_hash.t;}|Unexpected_preendorsement_in_block|Unexpected_endorsement_in_block|Preendorsement_round_too_highof{block_round:Round.t;provided:Round.t;}|Wrong_slot_used_for_consensus_operationof{kind:consensus_operation_kind;}|Conflicting_consensus_operationof{kind:consensus_operation_kind;conflict:operation_conflict;}|Consensus_operation_not_allowedlet()=register_error_kind`Outdated~id:"validate.consensus_operation_for_old_level"~title:"Consensus operation for old level"~description:"Consensus operation for old level."~pp:(funppf(kind,expected,provided)->Format.fprintfppf"%a for old level (expected: %a, provided: %a)."consensus_operation_kind_ppkindRaw_level.ppexpectedRaw_level.ppprovided)Data_encoding.(obj3(req"kind"consensus_operation_kind_encoding)(req"expected"Raw_level.encoding)(req"provided"Raw_level.encoding))(function|Consensus_operation_for_old_level{kind;expected;provided}->Some(kind,expected,provided)|_->None)(fun(kind,expected,provided)->Consensus_operation_for_old_level{kind;expected;provided});register_error_kind`Temporary~id:"validate.consensus_operation_for_future_level"~title:"Consensus operation for future level"~description:"Consensus operation for future level."~pp:(funppf(kind,expected,provided)->Format.fprintfppf"%a for future level (expected: %a, provided: %a)."consensus_operation_kind_ppkindRaw_level.ppexpectedRaw_level.ppprovided)Data_encoding.(obj3(req"kind"consensus_operation_kind_encoding)(req"expected"Raw_level.encoding)(req"provided"Raw_level.encoding))(function|Consensus_operation_for_future_level{kind;expected;provided}->Some(kind,expected,provided)|_->None)(fun(kind,expected,provided)->Consensus_operation_for_future_level{kind;expected;provided});register_error_kind`Branch~id:"validate.consensus_operation_for_old_round"~title:"Consensus operation for old round"~description:"Consensus operation for old round."~pp:(funppf(kind,expected,provided)->Format.fprintfppf"%a for old round (expected_min: %a, provided: %a)."consensus_operation_kind_ppkindRound.ppexpectedRound.ppprovided)Data_encoding.(obj3(req"kind"consensus_operation_kind_encoding)(req"expected_min"Round.encoding)(req"provided"Round.encoding))(function|Consensus_operation_for_old_round{kind;expected;provided}->Some(kind,expected,provided)|_->None)(fun(kind,expected,provided)->Consensus_operation_for_old_round{kind;expected;provided});register_error_kind`Temporary~id:"validate.consensus_operation_for_future_round"~title:"Consensus operation for future round"~description:"Consensus operation for future round."~pp:(funppf(kind,expected,provided)->Format.fprintfppf"%a for future round (expected: %a, provided: %a)."consensus_operation_kind_ppkindRound.ppexpectedRound.ppprovided)Data_encoding.(obj3(req"kind"consensus_operation_kind_encoding)(req"expected_max"Round.encoding)(req"provided"Round.encoding))(function|Consensus_operation_for_future_round{kind;expected;provided}->Some(kind,expected,provided)|_->None)(fun(kind,expected,provided)->Consensus_operation_for_future_round{kind;expected;provided});register_error_kind`Temporary~id:"validate.wrong_consensus_operation_branch"~title:"Wrong consensus operation branch"~description:"Trying to include an endorsement or preendorsement which points to \
the wrong block. It should be the predecessor for preendorsements and \
the grandfather for endorsements."~pp:(funppf(kind,expected,provided)->Format.fprintfppf"%a with wrong branch (expected: %a, provided: %a)."consensus_operation_kind_ppkindBlock_hash.ppexpectedBlock_hash.ppprovided)Data_encoding.(obj3(req"kind"consensus_operation_kind_encoding)(req"expected"Block_hash.encoding)(req"provided"Block_hash.encoding))(function|Wrong_consensus_operation_branch{kind;expected;provided}->Some(kind,expected,provided)|_->None)(fun(kind,expected,provided)->Wrong_consensus_operation_branch{kind;expected;provided});register_error_kind(* Note: in Mempool mode this used to be
Consensus_operation_on_competing_proposal (which was
[`Branch] so we kept this classification). *)`Branch~id:"validate.wrong_payload_hash_for_consensus_operation"~title:"Wrong payload hash for consensus operation"~description:"Wrong payload hash for consensus operation."~pp:(funppf(kind,expected,provided)->Format.fprintfppf"%a with wrong payload hash (expected: %a, provided: %a)."consensus_operation_kind_ppkindBlock_payload_hash.pp_shortexpectedBlock_payload_hash.pp_shortprovided)Data_encoding.(obj3(req"kind"consensus_operation_kind_encoding)(req"expected"Block_payload_hash.encoding)(req"provided"Block_payload_hash.encoding))(function|Wrong_payload_hash_for_consensus_operation{kind;expected;provided}->Some(kind,expected,provided)|_->None)(fun(kind,expected,provided)->Wrong_payload_hash_for_consensus_operation{kind;expected;provided});register_error_kind`Permanent~id:"validate.unexpected_preendorsement_in_block"~title:"Unexpected preendorsement in block"~description:"Unexpected preendorsement in block."~pp:(funppf()->Format.fprintfppf"Unexpected preendorsement in block.")Data_encoding.empty(functionUnexpected_preendorsement_in_block->Some()|_->None)(fun()->Unexpected_preendorsement_in_block);register_error_kind`Permanent~id:"validate.unexpected_endorsement_in_block"~title:"Unexpected endorsement in block"~description:"Unexpected endorsement in block."~pp:(funppf()->Format.fprintfppf"Unexpected endorsement in block.")Data_encoding.empty(functionUnexpected_endorsement_in_block->Some()|_->None)(fun()->Unexpected_endorsement_in_block);register_error_kind`Permanent~id:"validate.preendorsement_round_too_high"~title:"Preendorsement round too high"~description:"Preendorsement round too high."~pp:(funppf(block_round,provided)->Format.fprintfppf"Preendorsement round too high (block_round: %a, provided: %a)."Round.ppblock_roundRound.ppprovided)Data_encoding.(obj2(req"block_round"Round.encoding)(req"provided"Round.encoding))(function|Preendorsement_round_too_high{block_round;provided}->Some(block_round,provided)|_->None)(fun(block_round,provided)->Preendorsement_round_too_high{block_round;provided});register_error_kind`Permanent~id:"validate.wrong_slot_for_consensus_operation"~title:"Wrong slot for consensus operation"~description:"Wrong slot used for a preendorsement or endorsement."~pp:(funppfkind->Format.fprintfppf"Wrong slot used for a %a."consensus_operation_kind_ppkind)Data_encoding.(obj1(req"kind"consensus_operation_kind_encoding))(function|Wrong_slot_used_for_consensus_operation{kind}->Somekind|_->None)(funkind->Wrong_slot_used_for_consensus_operation{kind});register_error_kind`Branch~id:"validate.double_inclusion_of_consensus_operation"~title:"Double inclusion of consensus operation"~description:"Double inclusion of consensus operation."~pp:(funppf(kind,Operation_conflict{existing;new_operation})->Format.fprintfppf"%a operation %a conflicts with existing %a"consensus_operation_kind_ppkindOperation_hash.ppnew_operationOperation_hash.ppexisting)Data_encoding.(obj2(req"kind"consensus_operation_kind_encoding)(req"conflict"operation_conflict_encoding))(function|Conflicting_consensus_operation{kind;conflict}->Some(kind,conflict)|_->None)(fun(kind,conflict)->Conflicting_consensus_operation{kind;conflict});register_error_kind`Branch~id:"validate.consensus_operation_not_allowed"~title:"Consensus operation not allowed"~description:"Consensus operation not allowed."~pp:(funppf()->Format.fprintfppf"Validation of consensus operation if forbidden ")Data_encoding.empty(functionConsensus_operation_not_allowed->Some()|_->None)(fun()->Consensus_operation_not_allowed)endmoduleVoting=structtypeerror+=|(* Shared voting errors *)Wrong_voting_period_indexof{expected:int32;provided:int32;}|Wrong_voting_period_kindof{current:Voting_period.kind;expected:Voting_period.kindlist;}|Source_not_in_vote_listings|(* Proposals errors *)Empty_proposals|Proposals_contain_duplicateof{proposal:Protocol_hash.t}|Already_proposedof{proposal:Protocol_hash.t}|Too_many_proposalsof{previous_count:int;operation_count:int}|Conflicting_proposalsofoperation_conflict|Testnet_dictator_multiple_proposals|Proposals_from_unregistered_delegateofSignature.Public_key_hash.t|(* Ballot errors *)Ballot_for_wrong_proposalof{current:Protocol_hash.t;submitted:Protocol_hash.t;}|Already_submitted_a_ballot|Ballot_from_unregistered_delegateofSignature.Public_key_hash.t|Conflicting_ballotofoperation_conflictlet()=(* Shared voting errors *)register_error_kind`Temporary~id:"validate.operation.wrong_voting_period_index"~title:"Wrong voting period index"~description:"The voting operation contains a voting period index different from \
the current one."~pp:(funppf(expected,provided)->Format.fprintfppf"The voting operation is meant for voting period %ld, whereas the \
current period is %ld."providedexpected)Data_encoding.(obj2(req"current_index"int32)(req"provided_index"int32))(function|Wrong_voting_period_index{expected;provided}->Some(expected,provided)|_->None)(fun(expected,provided)->Wrong_voting_period_index{expected;provided});register_error_kind`Temporary~id:"validate.operation.wrong_voting_period_kind"~title:"Wrong voting period kind"~description:"The voting operation is incompatible the current voting period kind."~pp:(funppf(current,expected)->Format.fprintfppf"The voting operation is only valid during a %a voting period, but \
we are currently in a %a period."(Format.pp_print_list~pp_sep:(funfmt()->Format.fprintffmt" or ")Voting_period.pp_kind)expectedVoting_period.pp_kindcurrent)Data_encoding.(obj2(req"current"Voting_period.kind_encoding)(req"expected"(listVoting_period.kind_encoding)))(function|Wrong_voting_period_kind{current;expected}->Some(current,expected)|_->None)(fun(current,expected)->Wrong_voting_period_kind{current;expected});letdescription="The delegate is not in the vote listings."inregister_error_kind`Temporary~id:"validate.operation.source_not_in_vote_listings"~title:"Source not in vote listings"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionSource_not_in_vote_listings->Some()|_->None)(fun()->Source_not_in_vote_listings);(* Proposals errors *)letdescription="Proposal list cannot be empty."inregister_error_kind`Permanent~id:"validate.operation.empty_proposals"~title:"Empty proposals"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionEmpty_proposals->Some()|_->None)(fun()->Empty_proposals);register_error_kind`Permanent~id:"validate.operation.proposals_contain_duplicate"~title:"Proposals contain duplicate"~description:"The list of proposals contains a duplicate element."~pp:(funppfproposal->Format.fprintfppf"The list of proposals contains multiple occurrences of the proposal \
%a."Protocol_hash.ppproposal)Data_encoding.(obj1(req"proposal"Protocol_hash.encoding))(function|Proposals_contain_duplicate{proposal}->Someproposal|_->None)(funproposal->Proposals_contain_duplicate{proposal});register_error_kind`Branch~id:"validate.operation.already_proposed"~title:"Already proposed"~description:"The delegate has already submitted one of the operation's proposals."~pp:(funppfproposal->Format.fprintfppf"The delegate has already submitted the proposal %a."Protocol_hash.ppproposal)Data_encoding.(obj1(req"proposal"Protocol_hash.encoding))(functionAlready_proposed{proposal}->Someproposal|_->None)(funproposal->Already_proposed{proposal});register_error_kind`Temporary~id:"validate.operation.conflict_too_many_proposals"~title:"Conflict too many proposals"~description:"The delegate exceeded the maximum number of allowed proposals due to, \
among others, previous Proposals operations in the current \
block/mempool."~pp:(funppf(previous_count,operation_count)->Format.fprintfppf"The delegate cannot submit too many protocol proposals: it \
currently voted for %d and is trying to vote for %d more."previous_countoperation_count)Data_encoding.(obj2(req"previous_count"int8)(req"operation_count"int31))(function|Too_many_proposals{previous_count;operation_count}->Some(previous_count,operation_count)|_->None)(fun(previous_count,operation_count)->Too_many_proposals{previous_count;operation_count});register_error_kind`Temporary~id:"validate.operation.conflicting_proposals"~title:"Conflicting proposals"~description:"The current block/mempool already contains a testnest dictator \
proposals operation, so it cannot have any other voting operation."~pp:(funppf(Operation_conflict{existing;_})->Format.fprintfppf"The current block/mempool already contains a conflicting operation \
%a."Operation_hash.ppexisting)Data_encoding.(obj1(req"conflict"operation_conflict_encoding))(functionConflicting_proposalsconflict->Someconflict|_->None)(funconflict->Conflicting_proposalsconflict);letdescription="A testnet dictator cannot submit more than one proposal at a time."inregister_error_kind`Permanent~id:"validate.operation.testnet_dictator_multiple_proposals"~title:"Testnet dictator multiple proposals"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionTestnet_dictator_multiple_proposals->Some()|_->None)(fun()->Testnet_dictator_multiple_proposals);register_error_kind`Permanent~id:"operation.proposals_from_unregistered_delegate"~title:"Proposals from an unregistered delegate"~description:"Cannot submit proposals with an unregistered delegate."~pp:(funppfc->Format.fprintfppf"Cannot submit proposals with public key hash %a (unregistered \
delegate)."Signature.Public_key_hash.ppc)Data_encoding.(obj1(req"delegate"Signature.Public_key_hash.encoding))(functionProposals_from_unregistered_delegatec->Somec|_->None)(func->Proposals_from_unregistered_delegatec);(* Ballot errors *)register_error_kind`Branch~id:"validate.operation.ballot_for_wrong_proposal"~title:"Ballot for wrong proposal"~description:"Ballot provided for a proposal that is not the current one."~pp:(funppf(current,submitted)->Format.fprintfppf"Ballot provided for proposal %a whereas the current proposal is %a."Protocol_hash.ppsubmittedProtocol_hash.ppcurrent)Data_encoding.(obj2(req"current_proposal"Protocol_hash.encoding)(req"ballot_proposal"Protocol_hash.encoding))(function|Ballot_for_wrong_proposal{current;submitted}->Some(current,submitted)|_->None)(fun(current,submitted)->Ballot_for_wrong_proposal{current;submitted});letdescription="The delegate has already submitted a ballot for the current voting \
period."inregister_error_kind`Branch~id:"validate.operation.already_submitted_a_ballot"~title:"Already submitted a ballot"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionAlready_submitted_a_ballot->Some()|_->None)(fun()->Already_submitted_a_ballot);register_error_kind`Permanent~id:"operation.ballot_from_unregistered_delegate"~title:"Ballot from an unregistered delegate"~description:"Cannot cast a ballot for an unregistered delegate."~pp:(funppfc->Format.fprintfppf"Cannot cast a ballot for public key hash %a (unregistered delegate)."Signature.Public_key_hash.ppc)Data_encoding.(obj1(req"delegate"Signature.Public_key_hash.encoding))(functionBallot_from_unregistered_delegatec->Somec|_->None)(func->Ballot_from_unregistered_delegatec);register_error_kind`Temporary~id:"validate.operation.conflicting_ballot"~title:"Conflicting ballot"~description:"The delegate has already submitted a ballot in a previously validated \
operation of the current block or mempool."~pp:(funppf(Operation_conflict{existing;_})->Format.fprintfppf"The delegate has already submitted a ballot in the previously \
validated operation %a of the current block or mempool."Operation_hash.ppexisting)Data_encoding.(obj1(req"conflict"operation_conflict_encoding))(functionConflicting_ballotconflict->Someconflict|_->None)(funconflict->Conflicting_ballotconflict)endmoduleAnonymous=structtypeerror+=|Invalid_activationof{pkh:Ed25519.Public_key_hash.t}|Conflicting_activationof{edpkh:Ed25519.Public_key_hash.t;conflict:operation_conflict;}let()=register_error_kind`Permanent~id:"validate.operation.invalid_activation"~title:"Invalid activation"~description:"The given key and secret do not correspond to any existing \
preallocated contract."~pp:(funppfpkh->Format.fprintfppf"Invalid activation. The public key %a and accompanying secret do \
not match any commitment."Ed25519.Public_key_hash.pppkh)Data_encoding.(obj1(req"pkh"Ed25519.Public_key_hash.encoding))(functionInvalid_activation{pkh}->Somepkh|_->None)(funpkh->Invalid_activation{pkh});register_error_kind`Branch~id:"validate.operation.conflicting_activation"~title:"Account already activated in current validation_state"~description:"The account has already been activated by a previous operation in the \
current validation state."~pp:(funppf(edpkh,Operation_conflict{existing;_})->Format.fprintfppf"Invalid activation: the account %a has already been activated in \
the current validation state by operation %a."Ed25519.Public_key_hash.ppedpkhOperation_hash.ppexisting)Data_encoding.(obj2(req"edpkh"Ed25519.Public_key_hash.encoding)(req"conflict"operation_conflict_encoding))(function|Conflicting_activation{edpkh;conflict}->Some(edpkh,conflict)|_->None)(fun(edpkh,conflict)->Conflicting_activation{edpkh;conflict})typedenunciation_kind=Preendorsement|Endorsement|Blockletdenunciation_kind_encoding=letopenData_encodinginstring_enum[("preendorsement",Preendorsement);("endorsement",Endorsement);("block",Block);]letpp_denunciation_kindfmt:denunciation_kind->unit=function|Preendorsement->Format.fprintffmt"preendorsement"|Endorsement->Format.fprintffmt"endorsement"|Block->Format.fprintffmt"block"typeerror+=|Invalid_double_baking_evidenceof{hash1:Block_hash.t;level1:Raw_level.t;round1:Round.t;hash2:Block_hash.t;level2:Raw_level.t;round2:Round.t;}|Invalid_denunciationofdenunciation_kind|Inconsistent_denunciationof{kind:denunciation_kind;delegate1:Signature.Public_key_hash.t;delegate2:Signature.Public_key_hash.t;}|Already_denouncedof{kind:denunciation_kind;delegate:Signature.Public_key_hash.t;level:Level.t;}|Conflicting_denunciationof{kind:denunciation_kind;conflict:operation_conflict;}|Too_early_denunciationof{kind:denunciation_kind;level:Raw_level.t;current:Raw_level.t;}|Outdated_denunciationof{kind:denunciation_kind;level:Raw_level.t;last_cycle:Cycle.t;}let()=register_error_kind`Permanent~id:"validate.block.invalid_double_baking_evidence"~title:"Invalid double baking evidence"~description:"A double-baking evidence is inconsistent (two distinct levels)"~pp:(funppf(hash1,level1,round1,hash2,level2,round2)->Format.fprintfppf"Invalid double-baking evidence (hash: %a and %a, levels/rounds: \
(%ld,%ld) and (%ld,%ld))"Block_hash.pphash1Block_hash.pphash2(Raw_level.to_int32level1)(Round.to_int32round1)(Raw_level.to_int32level2)(Round.to_int32round2))Data_encoding.(obj6(req"hash1"Block_hash.encoding)(req"level1"Raw_level.encoding)(req"round1"Round.encoding)(req"hash2"Block_hash.encoding)(req"level2"Raw_level.encoding)(req"round2"Round.encoding))(function|Invalid_double_baking_evidence{hash1;level1;round1;hash2;level2;round2}->Some(hash1,level1,round1,hash2,level2,round2)|_->None)(fun(hash1,level1,round1,hash2,level2,round2)->Invalid_double_baking_evidence{hash1;level1;round1;hash2;level2;round2});register_error_kind`Permanent~id:"validate.operation.block.invalid_denunciation"~title:"Invalid denunciation"~description:"A denunciation is malformed"~pp:(funppfkind->Format.fprintfppf"Malformed double-%a evidence"pp_denunciation_kindkind)Data_encoding.(obj1(req"kind"denunciation_kind_encoding))(functionInvalid_denunciationkind->Somekind|_->None)(funkind->Invalid_denunciationkind);register_error_kind`Permanent~id:"validate.operation.block.inconsistent_denunciation"~title:"Inconsistent denunciation"~description:"A denunciation operation is inconsistent (two distinct delegates)"~pp:(funppf(kind,delegate1,delegate2)->Format.fprintfppf"Inconsistent double-%a evidence (distinct delegate: %a and %a)"pp_denunciation_kindkindSignature.Public_key_hash.pp_shortdelegate1Signature.Public_key_hash.pp_shortdelegate2)Data_encoding.(obj3(req"kind"denunciation_kind_encoding)(req"delegate1"Signature.Public_key_hash.encoding)(req"delegate2"Signature.Public_key_hash.encoding))(function|Inconsistent_denunciation{kind;delegate1;delegate2}->Some(kind,delegate1,delegate2)|_->None)(fun(kind,delegate1,delegate2)->Inconsistent_denunciation{kind;delegate1;delegate2});register_error_kind`Branch~id:"validate.operation.already_denounced"~title:"Already denounced"~description:"The same denunciation has already been validated."~pp:(funppf(kind,delegate,level)->Format.fprintfppf"Delegate %a at level %a has already been denounced for a double %a."pp_denunciation_kindkindSignature.Public_key_hash.ppdelegateLevel.pplevel)Data_encoding.(obj3(req"denunciation_kind"denunciation_kind_encoding)(req"delegate"Signature.Public_key_hash.encoding)(req"level"Level.encoding))(function|Already_denounced{kind;delegate;level}->Some(kind,delegate,level)|_->None)(fun(kind,delegate,level)->Already_denounced{kind;delegate;level});register_error_kind`Branch~id:"validate.operation.conflicting_denunciation"~title:"Conflicting denunciation in current validation state"~description:"The same denunciation has already been validated in the current \
validation state."~pp:(funppf(kind,Operation_conflict{existing;_})->Format.fprintfppf"Double %a evidence already exists in the current validation state \
as operation %a."pp_denunciation_kindkindOperation_hash.ppexisting)Data_encoding.(obj2(req"denunciation_kind"denunciation_kind_encoding)(req"conflict"operation_conflict_encoding))(function|Conflicting_denunciation{kind;conflict}->Some(kind,conflict)|_->None)(fun(kind,conflict)->Conflicting_denunciation{kind;conflict});register_error_kind`Temporary~id:"validate.operation.block.too_early_denunciation"~title:"Too early denunciation"~description:"A denunciation is too far in the future"~pp:(funppf(kind,level,current)->Format.fprintfppf"A double-%a denunciation is too far in the future (current level: \
%a, given level: %a)"pp_denunciation_kindkindRaw_level.ppcurrentRaw_level.pplevel)Data_encoding.(obj3(req"kind"denunciation_kind_encoding)(req"level"Raw_level.encoding)(req"current"Raw_level.encoding))(function|Too_early_denunciation{kind;level;current}->Some(kind,level,current)|_->None)(fun(kind,level,current)->Too_early_denunciation{kind;level;current});register_error_kind`Permanent~id:"validate.operation.block.outdated_denunciation"~title:"Outdated denunciation"~description:"A denunciation is outdated."~pp:(funppf(kind,level,last_cycle)->Format.fprintfppf"A double-%a denunciation is outdated (last acceptable cycle: %a, \
given level: %a)."pp_denunciation_kindkindCycle.pplast_cycleRaw_level.pplevel)Data_encoding.(obj3(req"kind"denunciation_kind_encoding)(req"level"Raw_level.encoding)(req"last"Cycle.encoding))(function|Outdated_denunciation{kind;level;last_cycle}->Some(kind,level,last_cycle)|_->None)(fun(kind,level,last_cycle)->Outdated_denunciation{kind;level;last_cycle})typeerror+=Conflicting_nonce_revelationofoperation_conflictlet()=register_error_kind`Branch~id:"validate.operation.conflicting_nonce_revelation"~title:"Conflicting nonce revelation in the current validation state)."~description:"A revelation for the same nonce has already been validated for the \
current validation state."~pp:(funppf(Operation_conflict{existing;_})->Format.fprintfppf"This nonce revelation is conflicting with an existing revelation %a"Operation_hash.ppexisting)Data_encoding.(obj1(req"conflict"operation_conflict_encoding))(function|Conflicting_nonce_revelationconflict->Someconflict|_->None)(funconflict->Conflicting_nonce_revelationconflict)typeerror+=Conflicting_vdf_revelationofoperation_conflictlet()=register_error_kind`Branch~id:"validate.operation.conflicting_vdf_revelation"~title:"Conflicting vdf revelation in the current validation state)."~description:"A revelation for the same vdf has already been validated for the \
current validation state."~pp:(funppf(Operation_conflict{existing;_})->Format.fprintfppf"This vdf revelation is conflicting with an existing revelation %a"Operation_hash.ppexisting)Data_encoding.(obj1(req"conflict"operation_conflict_encoding))(function|Conflicting_vdf_revelationconflict->Someconflict|_->None)(funconflict->Conflicting_vdf_revelationconflict)typeerror+=|Drain_delegate_on_unregistered_delegateofSignature.Public_key_hash.t|Invalid_drain_delegate_inactive_keyof{delegate:Signature.Public_key_hash.t;consensus_key:Signature.Public_key_hash.t;active_consensus_key:Signature.Public_key_hash.t;}|Invalid_drain_delegate_no_consensus_keyofSignature.Public_key_hash.t|Invalid_drain_delegate_noopofSignature.Public_key_hash.t|Invalid_drain_delegate_insufficient_funds_for_burn_or_feesof{delegate:Signature.Public_key_hash.t;destination:Signature.Public_key_hash.t;min_amount:Tez.t;}|Conflicting_drain_delegateof{delegate:Signature.Public_key_hash.t;conflict:operation_conflict;}let()=register_error_kind`Temporary~id:"operation.drain_delegate_key_on_unregistered_delegate"~title:"Drain delegate key on an unregistered delegate"~description:"Cannot drain an unregistered delegate."~pp:(funppfc->Format.fprintfppf"Cannot drain an unregistered delegate %a."Signature.Public_key_hash.ppc)Data_encoding.(obj1(req"delegate"Signature.Public_key_hash.encoding))(function|Drain_delegate_on_unregistered_delegatec->Somec|_->None)(func->Drain_delegate_on_unregistered_delegatec);register_error_kind`Temporary~id:"operation.invalid_drain.inactive_key"~title:"Drain delegate with an inactive consensus key"~description:"Cannot drain with an inactive consensus key."~pp:(funppf(delegate,consensus_key,active_consensus_key)->Format.fprintfppf"Consensus key %a is not the active consensus key for delegate %a. \
The active consensus key is %a."Signature.Public_key_hash.ppconsensus_keySignature.Public_key_hash.ppdelegateSignature.Public_key_hash.ppactive_consensus_key)Data_encoding.(obj3(req"delegate"Signature.Public_key_hash.encoding)(req"consensus_key"Signature.Public_key_hash.encoding)(req"active_consensus_key"Signature.Public_key_hash.encoding))(function|Invalid_drain_delegate_inactive_key{delegate;consensus_key;active_consensus_key}->Some(delegate,consensus_key,active_consensus_key)|_->None)(fun(delegate,consensus_key,active_consensus_key)->Invalid_drain_delegate_inactive_key{delegate;consensus_key;active_consensus_key});register_error_kind`Temporary~id:"operation.invalid_drain.no_consensus_key"~title:"Drain a delegate without consensus key"~description:"Cannot drain a delegate without consensus key."~pp:(funppfdelegate->Format.fprintfppf"There is no active consensus key for delegate %a."Signature.Public_key_hash.ppdelegate)Data_encoding.(obj1(req"delegate"Signature.Public_key_hash.encoding))(function|Invalid_drain_delegate_no_consensus_keyc->Somec|_->None)(func->Invalid_drain_delegate_no_consensus_keyc);register_error_kind`Temporary~id:"operation.invalid_drain.noop"~title:"Invalid drain delegate: noop"~description:"Cannot drain a delegate to itself."~pp:(funppfdelegate->Format.fprintfppf"The destination of a drain operation cannot be the delegate itself \
(%a)."Signature.Public_key_hash.ppdelegate)Data_encoding.(obj1(req"delegate"Signature.Public_key_hash.encoding))(functionInvalid_drain_delegate_noopc->Somec|_->None)(func->Invalid_drain_delegate_noopc);register_error_kind`Temporary~id:"operation.invalid_drain.insufficient_funds_for_burn_or_fees"~title:"Drain delegate without enough balance for allocation burn or drain \
fees"~description:"Cannot drain without enough allocation burn and drain fees."~pp:(funppf(delegate,destination,min_amount)->Format.fprintfppf"Cannot drain delegate from %a to %a: not enough funds for the drain \
fees in the delegate account (minimum balance required: %a)."Signature.Public_key_hash.ppdelegateSignature.Public_key_hash.ppdestinationTez.ppmin_amount)Data_encoding.(obj3(req"delegate"Signature.Public_key_hash.encoding)(req"destination"Signature.Public_key_hash.encoding)(req"min_amount"Tez.encoding))(function|Invalid_drain_delegate_insufficient_funds_for_burn_or_fees{delegate;destination;min_amount}->Some(delegate,destination,min_amount)|_->None)(fun(delegate,destination,min_amount)->Invalid_drain_delegate_insufficient_funds_for_burn_or_fees{delegate;destination;min_amount});register_error_kind`Branch~id:"validate.operation.conflicting_drain"~title:"Conflicting drain in the current validation state)."~description:"A manager operation or another drain operation is in conflict."~pp:(funppf(delegate,Operation_conflict{existing;_})->Format.fprintfppf"This drain operation conflicts with operation %a for the delegate %a"Operation_hash.ppexistingSignature.Public_key_hash.ppdelegate)Data_encoding.(obj2(req"delegate"Signature.Public_key_hash.encoding)(req"conflict"operation_conflict_encoding))(function|Conflicting_drain_delegate{delegate;conflict}->Some(delegate,conflict)|_->None)(fun(delegate,conflict)->Conflicting_drain_delegate{delegate;conflict})endmoduleManager=structtypeerror+=|Manager_restrictionof{source:Signature.Public_key_hash.t;conflict:operation_conflict;}|Inconsistent_sources|Inconsistent_counters|Incorrect_reveal_position|Insufficient_gas_for_manager|Gas_quota_exceeded_init_deserialize|Tx_rollup_feature_disabled|Sc_rollup_feature_disabled|Sc_rollup_arith_pvm_disabled|Zk_rollup_feature_disabledlet()=register_error_kind`Temporary~id:"validate.operation.manager_restriction"~title:"Manager restriction"~description:"An operation with the same manager has already been validated in the \
current block."~pp:(funppf(source,Operation_conflict{existing;_})->Format.fprintfppf"Manager %a already has the operation %a in the current block."Signature.Public_key_hash.ppsourceOperation_hash.ppexisting)Data_encoding.(obj2(req"source"Signature.Public_key_hash.encoding)(req"conflict"operation_conflict_encoding))(function|Manager_restriction{source;conflict}->Some(source,conflict)|_->None)(fun(source,conflict)->Manager_restriction{source;conflict});letinconsistent_sources_description="The operation batch includes operations from different sources."inregister_error_kind`Permanent~id:"validate.operation.inconsistent_sources"~title:"Inconsistent sources in operation batch"~description:inconsistent_sources_description~pp:(funppf()->Format.fprintfppf"%s"inconsistent_sources_description)Data_encoding.empty(functionInconsistent_sources->Some()|_->None)(fun()->Inconsistent_sources);letinconsistent_counters_description="Inconsistent counters in operation. Counters of an operation must be \
successive."inregister_error_kind`Permanent~id:"validate.operation.inconsistent_counters"~title:"Inconsistent counters in operation"~description:inconsistent_counters_description~pp:(funppf()->Format.fprintfppf"%s"inconsistent_counters_description)Data_encoding.empty(functionInconsistent_counters->Some()|_->None)(fun()->Inconsistent_counters);letincorrect_reveal_description="Incorrect reveal operation position in batch: only allowed in first \
position."inregister_error_kind`Permanent~id:"validate.operation.incorrect_reveal_position"~title:"Incorrect reveal position"~description:incorrect_reveal_description~pp:(funppf()->Format.fprintfppf"%s"incorrect_reveal_description)Data_encoding.empty(functionIncorrect_reveal_position->Some()|_->None)(fun()->Incorrect_reveal_position);register_error_kind`Permanent~id:"validate.operation.insufficient_gas_for_manager"~title:"Not enough gas for initial manager cost"~description:(Format.asprintf"Gas limit is too low to cover the initial cost of manager \
operations: a minimum of %a gas units is required."Gas.pp_cost_as_gasMichelson_v1_gas.Cost_of.manager_operation)Data_encoding.empty(functionInsufficient_gas_for_manager->Some()|_->None)(fun()->Insufficient_gas_for_manager);letgas_deserialize_description="Gas limit was not high enough to deserialize the transaction parameters \
or origination script code or initial storage etc., making the \
operation impossible to parse within the provided gas bounds."inregister_error_kind`Permanent~id:"validate.operation.gas_quota_exceeded_init_deserialize"~title:"Not enough gas for initial deserialization of script expressions"~description:gas_deserialize_description~pp:(funppf()->Format.fprintfppf"%s"gas_deserialize_description)Data_encoding.empty(functionGas_quota_exceeded_init_deserialize->Some()|_->None)(fun()->Gas_quota_exceeded_init_deserialize);register_error_kind`Permanent~id:"validate.operation.tx_rollup_is_disabled"~title:"Tx rollup is disabled"~description:"Cannot originate a tx rollup as it is disabled."~pp:(funppf()->Format.fprintfppf"Cannot apply a tx rollup operation as it is disabled. This feature \
will be enabled in a future proposal")Data_encoding.unit(functionTx_rollup_feature_disabled->Some()|_->None)(fun()->Tx_rollup_feature_disabled);letscoru_disabled_description="Smart rollups are disabled."inregister_error_kind`Permanent~id:"validate.operation.smart_rollup_disabled"~title:"Smart rollups are disabled"~description:scoru_disabled_description~pp:(funppf()->Format.fprintfppf"%s"scoru_disabled_description)Data_encoding.unit(functionSc_rollup_feature_disabled->Some()|_->None)(fun()->Sc_rollup_feature_disabled);letscoru_arith_pvm_disabled_description="Arith PVM is disabled in this network."inregister_error_kind`Permanent~id:"operation.arith_pvm_disabled"~title:"The Arith PVM is disabled"~description:scoru_arith_pvm_disabled_description~pp:(funppf()->Format.fprintfppf"%s"scoru_arith_pvm_disabled_description)Data_encoding.unit(functionSc_rollup_arith_pvm_disabled->Some()|_->None)(fun()->Sc_rollup_arith_pvm_disabled);letzkru_disabled_description="ZK rollups will be enabled in a future proposal."inregister_error_kind`Permanent~id:"validate.operation.zk_rollup_disabled"~title:"ZK rollups are disabled"~description:zkru_disabled_description~pp:(funppf()->Format.fprintfppf"%s"zkru_disabled_description)Data_encoding.unit(functionZk_rollup_feature_disabled->Some()|_->None)(fun()->Zk_rollup_feature_disabled)endtypeerror+=Failing_noop_errorlet()=letdescription="A failing_noop operation can never be validated."inregister_error_kind`Permanent~id:"validate.operation.failing_noop_error"~title:"Failing_noop error"~description~pp:(funppf()->Format.fprintfppf"%s"description)Data_encoding.empty(functionFailing_noop_error->Some()|_->None)(fun()->Failing_noop_error)moduleBlock=structtypeerror+=|Not_enough_endorsementsof{required:int;provided:int}|Inconsistent_validation_passes_in_blockof{expected:int;provided:int;}let()=register_error_kind`Permanent~id:"validate.block.not_enough_endorsements"~title:"Not enough endorsements"~description:"The block being validated does not include the required minimum \
number of endorsements."~pp:(funppf(required,provided)->Format.fprintfppf"Wrong number of endorsements (%i), at least %i are expected"providedrequired)Data_encoding.(obj2(req"required"int31)(req"provided"int31))(function|Not_enough_endorsements{required;provided}->Some(required,provided)|_->None)(fun(required,provided)->Not_enough_endorsements{required;provided});register_error_kind`Permanent~id:"validate.block.inconsistent_validation_passes_in_block"~title:"Inconsistent validation passes in block"~description:"Validation of operation should be ordered by their validation passes \
in a block."~pp:(funppf(expected,provided)->Format.fprintfppf"Validation of operation should be ordered by their validation \
passes in a block. Got an operation with validation pass: %d while \
the last validated operation had the validation pass %d."providedexpected)Data_encoding.(obj2(req"expected"int31)(req"provided"int31))(function|Inconsistent_validation_passes_in_block{expected;provided}->Some(expected,provided)|_->None)(fun(expected,provided)->Inconsistent_validation_passes_in_block{expected;provided})end