polkadot_statement_distribution/
error.rs1use polkadot_node_network_protocol::PeerId;
21use polkadot_node_subsystem::{RuntimeApiError, SubsystemError};
22use polkadot_node_subsystem_util::{
23 backing_implicit_view::FetchError as ImplicitViewFetchError, runtime,
24};
25use polkadot_primitives::{CandidateHash, Hash, Id as ParaId};
26
27use futures::channel::oneshot;
28
29pub type Result<T> = std::result::Result<T, Error>;
31pub type JfyiErrorResult<T> = std::result::Result<T, JfyiError>;
33pub type FatalResult<T> = std::result::Result<T, FatalError>;
35
36#[allow(missing_docs)]
37#[fatality::fatality(splitable)]
38pub enum Error {
39 #[fatal]
40 #[error("Requester receiver stream finished")]
41 RequesterReceiverFinished,
42
43 #[fatal]
44 #[error("Responder receiver stream finished")]
45 ResponderReceiverFinished,
46
47 #[fatal]
48 #[error("Spawning subsystem task failed")]
49 SpawnTask(#[source] SubsystemError),
50
51 #[fatal]
52 #[error("Receiving message from overseer failed")]
53 SubsystemReceive(#[source] SubsystemError),
54
55 #[fatal(forward)]
56 #[error("Error while accessing runtime information")]
57 Runtime(#[from] runtime::Error),
58
59 #[error("RuntimeAPISubsystem channel closed before receipt")]
60 RuntimeApiUnavailable(#[source] oneshot::Canceled),
61
62 #[error("Fetching persisted validation data for para {0:?}, {1:?}")]
63 FetchPersistedValidationData(ParaId, RuntimeApiError),
64
65 #[error("Fetching session index failed {0:?}")]
66 FetchSessionIndex(RuntimeApiError),
67
68 #[error("Fetching session info failed {0:?}")]
69 FetchSessionInfo(RuntimeApiError),
70
71 #[error("Fetching disabled validators failed {0:?}")]
72 FetchDisabledValidators(RuntimeApiError),
73
74 #[error("Fetching validator groups failed {0:?}")]
75 FetchValidatorGroups(RuntimeApiError),
76
77 #[error("Fetching claim queue failed {0:?}")]
78 FetchClaimQueue(RuntimeApiError),
79
80 #[error("Fetching minimum backing votes failed {0:?}")]
81 FetchMinimumBackingVotes(RuntimeApiError),
82
83 #[error("Fetching node features failed {0:?}")]
84 FetchNodeFeatures(RuntimeApiError),
85
86 #[error("Attempted to share statement when not a validator or not assigned")]
87 InvalidShare,
88
89 #[error("Relay parent could not be found in active heads")]
90 NoSuchHead(Hash),
91
92 #[error("Message from not connected peer")]
93 NoSuchPeer(PeerId),
94
95 #[error("Peer requested data for candidate it never received a notification for (malicious?)")]
96 RequestedUnannouncedCandidate(PeerId, CandidateHash),
97
98 #[error("Statement status does not exist")]
100 NoSuchLargeStatementStatus(Hash, CandidateHash),
101
102 #[error("Fetched large statement does not exist")]
104 NoSuchFetchedLargeStatement(Hash, CandidateHash),
105
106 #[error("Oneshot `GetData` channel closed")]
108 ResponderGetDataCanceled,
109
110 #[error("Implicit view failure while activating leaf")]
112 ActivateLeafFailure(ImplicitViewFetchError),
113}