1use std::fmt::Display;
8
9use async_broadcast::Sender;
10use either::Either;
11use hotshot_task::task::TaskEvent;
12use hotshot_types::{
13 data::{
14 DaProposal2, Leaf2, PackedBundle, QuorumProposal2, QuorumProposalWrapper, UpgradeProposal,
15 VidCommitment, VidDisperse, VidDisperseShare,
16 },
17 message::Proposal,
18 request_response::ProposalRequestPayload,
19 simple_certificate::{
20 DaCertificate2, EpochRootQuorumCertificate, NextEpochQuorumCertificate2, QuorumCertificate,
21 QuorumCertificate2, TimeoutCertificate, TimeoutCertificate2, UpgradeCertificate,
22 ViewSyncCommitCertificate2, ViewSyncFinalizeCertificate2, ViewSyncPreCommitCertificate2,
23 },
24 simple_vote::{
25 DaVote2, EpochRootQuorumVote, QuorumVote2, TimeoutVote2, UpgradeVote, ViewSyncCommitVote2,
26 ViewSyncFinalizeVote2, ViewSyncPreCommitVote2,
27 },
28 traits::{
29 block_contents::BuilderFee, network::DataRequest, node_implementation::NodeType,
30 signature_key::SignatureKey, BlockPayload,
31 },
32 utils::BuilderCommitment,
33 vote::HasViewNumber,
34};
35use vec1::Vec1;
36
37use crate::view_sync::ViewSyncPhase;
38
39impl<TYPES: NodeType> TaskEvent for HotShotEvent<TYPES> {
40 fn shutdown_event() -> Self {
41 HotShotEvent::Shutdown
42 }
43}
44
45#[derive(Debug, Clone)]
48pub struct ProposalMissing<TYPES: NodeType> {
49 pub view: TYPES::View,
51 pub response_chan: Sender<Option<Proposal<TYPES, QuorumProposal2<TYPES>>>>,
53}
54
55impl<TYPES: NodeType> PartialEq for ProposalMissing<TYPES> {
56 fn eq(&self, other: &Self) -> bool {
57 self.view == other.view
58 }
59}
60
61impl<TYPES: NodeType> Eq for ProposalMissing<TYPES> {}
62
63#[derive(Eq, PartialEq, Debug, Clone)]
65pub struct HotShotTaskCompleted;
66
67#[derive(Eq, PartialEq, Debug, Clone)]
69#[allow(clippy::large_enum_variant)]
70pub enum HotShotEvent<TYPES: NodeType> {
71 Shutdown,
73 QuorumProposalRecv(
75 Proposal<TYPES, QuorumProposalWrapper<TYPES>>,
76 TYPES::SignatureKey,
77 ),
78 QuorumVoteRecv(QuorumVote2<TYPES>),
80 EpochRootQuorumVoteRecv(EpochRootQuorumVote<TYPES>),
83 TimeoutVoteRecv(TimeoutVote2<TYPES>),
85 TimeoutVoteSend(TimeoutVote2<TYPES>),
87 DaProposalRecv(Proposal<TYPES, DaProposal2<TYPES>>, TYPES::SignatureKey),
89 DaProposalValidated(Proposal<TYPES, DaProposal2<TYPES>>, TYPES::SignatureKey),
91 DaVoteRecv(DaVote2<TYPES>),
93 DaCertificateRecv(DaCertificate2<TYPES>),
95 DaCertificateValidated(DaCertificate2<TYPES>),
97 QuorumProposalSend(
99 Proposal<TYPES, QuorumProposalWrapper<TYPES>>,
100 TYPES::SignatureKey,
101 ),
102 QuorumVoteSend(QuorumVote2<TYPES>),
104 ExtendedQuorumVoteSend(QuorumVote2<TYPES>),
106 EpochRootQuorumVoteSend(EpochRootQuorumVote<TYPES>),
108 QuorumProposalValidated(Proposal<TYPES, QuorumProposalWrapper<TYPES>>, Leaf2<TYPES>),
115 QuorumProposalRequestSend(
117 ProposalRequestPayload<TYPES>,
118 <TYPES::SignatureKey as SignatureKey>::PureAssembledSignatureType,
119 ),
120 QuorumProposalRequestRecv(
122 ProposalRequestPayload<TYPES>,
123 <TYPES::SignatureKey as SignatureKey>::PureAssembledSignatureType,
124 ),
125 QuorumProposalResponseSend(
127 TYPES::SignatureKey,
128 Proposal<TYPES, QuorumProposalWrapper<TYPES>>,
129 ),
130 QuorumProposalResponseRecv(Proposal<TYPES, QuorumProposalWrapper<TYPES>>),
132 DaProposalSend(Proposal<TYPES, DaProposal2<TYPES>>, TYPES::SignatureKey),
134 DaVoteSend(DaVote2<TYPES>),
136 QcFormed(Either<QuorumCertificate<TYPES>, TimeoutCertificate<TYPES>>),
138 Qc2Formed(Either<QuorumCertificate2<TYPES>, TimeoutCertificate2<TYPES>>),
140 EpochRootQcFormed(EpochRootQuorumCertificate<TYPES>),
142 NextEpochQc2Formed(Either<NextEpochQuorumCertificate2<TYPES>, TimeoutCertificate<TYPES>>),
144 ExtendedQc2Formed(QuorumCertificate2<TYPES>),
146 DacSend(DaCertificate2<TYPES>, TYPES::SignatureKey),
148 ViewChange(TYPES::View, Option<TYPES::Epoch>),
150 SetFirstEpoch(TYPES::View, TYPES::Epoch),
152 ViewSyncTimeout(TYPES::View, u64, ViewSyncPhase),
154
155 ViewSyncPreCommitVoteRecv(ViewSyncPreCommitVote2<TYPES>),
157 ViewSyncCommitVoteRecv(ViewSyncCommitVote2<TYPES>),
159 ViewSyncFinalizeVoteRecv(ViewSyncFinalizeVote2<TYPES>),
161
162 ViewSyncPreCommitVoteSend(ViewSyncPreCommitVote2<TYPES>),
164 ViewSyncCommitVoteSend(ViewSyncCommitVote2<TYPES>),
166 ViewSyncFinalizeVoteSend(ViewSyncFinalizeVote2<TYPES>),
168
169 ViewSyncPreCommitCertificateRecv(ViewSyncPreCommitCertificate2<TYPES>),
171 ViewSyncCommitCertificateRecv(ViewSyncCommitCertificate2<TYPES>),
173 ViewSyncFinalizeCertificateRecv(ViewSyncFinalizeCertificate2<TYPES>),
175
176 ViewSyncPreCommitCertificateSend(ViewSyncPreCommitCertificate2<TYPES>, TYPES::SignatureKey),
178 ViewSyncCommitCertificateSend(ViewSyncCommitCertificate2<TYPES>, TYPES::SignatureKey),
180 ViewSyncFinalizeCertificateSend(ViewSyncFinalizeCertificate2<TYPES>, TYPES::SignatureKey),
182
183 ViewSyncTrigger(TYPES::View),
185 Timeout(TYPES::View, Option<TYPES::Epoch>),
187 TransactionsRecv(Vec<TYPES::Transaction>),
189 TransactionSend(TYPES::Transaction, TYPES::SignatureKey),
191 SendPayloadCommitmentAndMetadata(
193 VidCommitment,
194 BuilderCommitment,
195 <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata,
196 TYPES::View,
197 Vec1<BuilderFee<TYPES>>,
198 ),
199 BlockRecv(PackedBundle<TYPES>),
201 VidDisperseSend(Proposal<TYPES, VidDisperse<TYPES>>, TYPES::SignatureKey),
205 VidShareRecv(
209 TYPES::SignatureKey,
210 Proposal<TYPES, VidDisperseShare<TYPES>>,
211 ),
212 VidShareValidated(Proposal<TYPES, VidDisperseShare<TYPES>>),
214 UpgradeProposalRecv(Proposal<TYPES, UpgradeProposal<TYPES>>, TYPES::SignatureKey),
216 UpgradeProposalSend(Proposal<TYPES, UpgradeProposal<TYPES>>, TYPES::SignatureKey),
218 UpgradeVoteRecv(UpgradeVote<TYPES>),
220 UpgradeVoteSend(UpgradeVote<TYPES>),
222 UpgradeCertificateFormed(UpgradeCertificate<TYPES>),
224 QuorumProposalPreliminarilyValidated(Proposal<TYPES, QuorumProposalWrapper<TYPES>>),
230
231 VidRequestSend(
234 DataRequest<TYPES>,
235 TYPES::SignatureKey,
237 TYPES::SignatureKey,
239 ),
240
241 VidRequestRecv(DataRequest<TYPES>, TYPES::SignatureKey),
244
245 VidResponseSend(
248 TYPES::SignatureKey,
250 TYPES::SignatureKey,
252 Proposal<TYPES, VidDisperseShare<TYPES>>,
253 ),
254
255 VidResponseRecv(
257 TYPES::SignatureKey,
258 Proposal<TYPES, VidDisperseShare<TYPES>>,
259 ),
260
261 HighQcRecv(
263 QuorumCertificate2<TYPES>,
264 Option<NextEpochQuorumCertificate2<TYPES>>,
265 TYPES::SignatureKey,
266 ),
267
268 HighQcSend(
270 QuorumCertificate2<TYPES>,
271 Option<NextEpochQuorumCertificate2<TYPES>>,
272 TYPES::SignatureKey,
273 TYPES::SignatureKey,
274 ),
275
276 ExtendedQcRecv(
278 QuorumCertificate2<TYPES>,
279 NextEpochQuorumCertificate2<TYPES>,
280 TYPES::SignatureKey,
281 ),
282
283 ExtendedQcSend(
285 QuorumCertificate2<TYPES>,
286 NextEpochQuorumCertificate2<TYPES>,
287 TYPES::SignatureKey,
288 ),
289
290 EpochRootQcSend(
292 EpochRootQuorumCertificate<TYPES>,
293 TYPES::SignatureKey,
294 TYPES::SignatureKey,
295 ),
296 EpochRootQcRecv(EpochRootQuorumCertificate<TYPES>, TYPES::SignatureKey),
298 LeavesDecided(Vec<Leaf2<TYPES>>),
300}
301
302impl<TYPES: NodeType> HotShotEvent<TYPES> {
303 #[allow(clippy::too_many_lines)]
304 pub fn view_number(&self) -> Option<TYPES::View> {
306 match self {
307 HotShotEvent::QuorumVoteSend(v)
308 | HotShotEvent::QuorumVoteRecv(v)
309 | HotShotEvent::ExtendedQuorumVoteSend(v) => Some(v.view_number()),
310 HotShotEvent::EpochRootQuorumVoteRecv(v) | HotShotEvent::EpochRootQuorumVoteSend(v) => {
311 Some(v.view_number())
312 },
313 HotShotEvent::TimeoutVoteRecv(v) | HotShotEvent::TimeoutVoteSend(v) => {
314 Some(v.view_number())
315 },
316 HotShotEvent::QuorumProposalRecv(proposal, _)
317 | HotShotEvent::QuorumProposalSend(proposal, _)
318 | HotShotEvent::QuorumProposalValidated(proposal, _)
319 | HotShotEvent::QuorumProposalResponseRecv(proposal)
320 | HotShotEvent::QuorumProposalResponseSend(_, proposal)
321 | HotShotEvent::QuorumProposalPreliminarilyValidated(proposal) => {
322 Some(proposal.data.view_number())
323 },
324 HotShotEvent::DaProposalRecv(proposal, _)
325 | HotShotEvent::DaProposalValidated(proposal, _)
326 | HotShotEvent::DaProposalSend(proposal, _) => Some(proposal.data.view_number()),
327 HotShotEvent::DaVoteRecv(vote) | HotShotEvent::DaVoteSend(vote) => {
328 Some(vote.view_number())
329 },
330 HotShotEvent::QcFormed(cert) => match cert {
331 either::Left(qc) => Some(qc.view_number()),
332 either::Right(tc) => Some(tc.view_number()),
333 },
334 HotShotEvent::Qc2Formed(cert) => match cert {
335 either::Left(qc) => Some(qc.view_number()),
336 either::Right(tc) => Some(tc.view_number()),
337 },
338 HotShotEvent::NextEpochQc2Formed(cert) => match cert {
339 either::Left(qc) => Some(qc.view_number()),
340 either::Right(tc) => Some(tc.view_number()),
341 },
342 HotShotEvent::EpochRootQcFormed(root_qc) => Some(root_qc.view_number()),
343 HotShotEvent::ExtendedQc2Formed(cert) => Some(cert.view_number()),
344 HotShotEvent::ViewSyncCommitVoteSend(vote)
345 | HotShotEvent::ViewSyncCommitVoteRecv(vote) => Some(vote.view_number()),
346 HotShotEvent::ViewSyncPreCommitVoteRecv(vote)
347 | HotShotEvent::ViewSyncPreCommitVoteSend(vote) => Some(vote.view_number()),
348 HotShotEvent::ViewSyncFinalizeVoteRecv(vote)
349 | HotShotEvent::ViewSyncFinalizeVoteSend(vote) => Some(vote.view_number()),
350 HotShotEvent::ViewSyncPreCommitCertificateRecv(cert)
351 | HotShotEvent::ViewSyncPreCommitCertificateSend(cert, _) => Some(cert.view_number()),
352 HotShotEvent::ViewSyncCommitCertificateRecv(cert)
353 | HotShotEvent::ViewSyncCommitCertificateSend(cert, _) => Some(cert.view_number()),
354 HotShotEvent::ViewSyncFinalizeCertificateRecv(cert)
355 | HotShotEvent::ViewSyncFinalizeCertificateSend(cert, _) => Some(cert.view_number()),
356 HotShotEvent::SendPayloadCommitmentAndMetadata(_, _, _, view_number, ..) => {
357 Some(*view_number)
358 },
359 HotShotEvent::BlockRecv(packed_bundle) => Some(packed_bundle.view_number),
360 HotShotEvent::Shutdown
361 | HotShotEvent::TransactionSend(..)
362 | HotShotEvent::TransactionsRecv(_) => None,
363 HotShotEvent::VidDisperseSend(proposal, _) => Some(proposal.data.view_number()),
364 HotShotEvent::VidShareRecv(_, proposal) | HotShotEvent::VidShareValidated(proposal) => {
365 Some(proposal.data.view_number())
366 },
367 HotShotEvent::UpgradeProposalRecv(proposal, _)
368 | HotShotEvent::UpgradeProposalSend(proposal, _) => Some(proposal.data.view_number()),
369 HotShotEvent::UpgradeVoteRecv(vote) | HotShotEvent::UpgradeVoteSend(vote) => {
370 Some(vote.view_number())
371 },
372 HotShotEvent::QuorumProposalRequestSend(req, _)
373 | HotShotEvent::QuorumProposalRequestRecv(req, _) => Some(req.view_number),
374 HotShotEvent::ViewChange(view_number, _)
375 | HotShotEvent::ViewSyncTimeout(view_number, ..)
376 | HotShotEvent::ViewSyncTrigger(view_number)
377 | HotShotEvent::Timeout(view_number, ..) => Some(*view_number),
378 HotShotEvent::DaCertificateRecv(cert) | HotShotEvent::DacSend(cert, _) => {
379 Some(cert.view_number())
380 },
381 HotShotEvent::DaCertificateValidated(cert) => Some(cert.view_number),
382 HotShotEvent::UpgradeCertificateFormed(cert) => Some(cert.view_number()),
383 HotShotEvent::VidRequestSend(request, ..)
384 | HotShotEvent::VidRequestRecv(request, _) => Some(request.view),
385 HotShotEvent::VidResponseSend(_, _, proposal)
386 | HotShotEvent::VidResponseRecv(_, proposal) => Some(proposal.data.view_number()),
387 HotShotEvent::HighQcRecv(qc, ..)
388 | HotShotEvent::HighQcSend(qc, ..)
389 | HotShotEvent::ExtendedQcRecv(qc, ..)
390 | HotShotEvent::ExtendedQcSend(qc, ..) => Some(qc.view_number()),
391 HotShotEvent::EpochRootQcSend(cert, ..) | HotShotEvent::EpochRootQcRecv(cert, _) => {
392 Some(cert.view_number())
393 },
394 HotShotEvent::SetFirstEpoch(..) => None,
395 HotShotEvent::LeavesDecided(..) => None,
396 }
397 }
398}
399
400impl<TYPES: NodeType> Display for HotShotEvent<TYPES> {
401 #[allow(clippy::too_many_lines)]
402 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
403 match self {
404 HotShotEvent::Shutdown => write!(f, "Shutdown"),
405 HotShotEvent::QuorumProposalRecv(proposal, _) => write!(
406 f,
407 "QuorumProposalRecv(view_number={:?})",
408 proposal.data.view_number()
409 ),
410 HotShotEvent::QuorumVoteRecv(v) => {
411 write!(f, "QuorumVoteRecv(view_number={:?})", v.view_number())
412 },
413 HotShotEvent::EpochRootQuorumVoteRecv(v) => {
414 write!(
415 f,
416 "EpochRootQuorumVoteRecv(view_number={:?})",
417 v.view_number()
418 )
419 },
420 HotShotEvent::EpochRootQuorumVoteSend(v) => {
421 write!(
422 f,
423 "EpochRootQuorumVoteSend(view_number={:?})",
424 v.view_number()
425 )
426 },
427 HotShotEvent::ExtendedQuorumVoteSend(v) => {
428 write!(
429 f,
430 "ExtendedQuorumVoteSend(view_number={:?})",
431 v.view_number()
432 )
433 },
434 HotShotEvent::TimeoutVoteRecv(v) => {
435 write!(f, "TimeoutVoteRecv(view_number={:?})", v.view_number())
436 },
437 HotShotEvent::TimeoutVoteSend(v) => {
438 write!(f, "TimeoutVoteSend(view_number={:?})", v.view_number())
439 },
440 HotShotEvent::DaProposalRecv(proposal, _) => write!(
441 f,
442 "DaProposalRecv(view_number={:?})",
443 proposal.data.view_number()
444 ),
445 HotShotEvent::DaProposalValidated(proposal, _) => write!(
446 f,
447 "DaProposalValidated(view_number={:?})",
448 proposal.data.view_number()
449 ),
450 HotShotEvent::DaVoteRecv(vote) => {
451 write!(f, "DaVoteRecv(view_number={:?})", vote.view_number())
452 },
453 HotShotEvent::DaCertificateRecv(cert) => {
454 write!(f, "DaCertificateRecv(view_number={:?})", cert.view_number())
455 },
456 HotShotEvent::DaCertificateValidated(cert) => write!(
457 f,
458 "DaCertificateValidated(view_number={:?})",
459 cert.view_number()
460 ),
461 HotShotEvent::QuorumProposalSend(proposal, _) => write!(
462 f,
463 "QuorumProposalSend(view_number={:?})",
464 proposal.data.view_number()
465 ),
466 HotShotEvent::QuorumVoteSend(vote) => {
467 write!(f, "QuorumVoteSend(view_number={:?})", vote.view_number())
468 },
469 HotShotEvent::QuorumProposalValidated(proposal, _) => write!(
470 f,
471 "QuorumProposalValidated(view_number={:?})",
472 proposal.data.view_number()
473 ),
474 HotShotEvent::DaProposalSend(proposal, _) => write!(
475 f,
476 "DaProposalSend(view_number={:?})",
477 proposal.data.view_number()
478 ),
479 HotShotEvent::DaVoteSend(vote) => {
480 write!(f, "DaVoteSend(view_number={:?})", vote.view_number())
481 },
482 HotShotEvent::QcFormed(cert) => match cert {
483 either::Left(qc) => write!(f, "QcFormed(view_number={:?})", qc.view_number()),
484 either::Right(tc) => write!(f, "QcFormed(view_number={:?})", tc.view_number()),
485 },
486 HotShotEvent::Qc2Formed(cert) => match cert {
487 either::Left(qc) => write!(f, "QcFormed2(view_number={:?})", qc.view_number()),
488 either::Right(tc) => write!(f, "QcFormed2(view_number={:?})", tc.view_number()),
489 },
490 HotShotEvent::EpochRootQcFormed(root_qc) => {
491 write!(
492 f,
493 "EpochRootQcFormed(view_number={:?})",
494 root_qc.view_number()
495 )
496 },
497 HotShotEvent::NextEpochQc2Formed(cert) => match cert {
498 either::Left(qc) => {
499 write!(f, "NextEpochQc2Formed(view_number={:?})", qc.view_number())
500 },
501 either::Right(tc) => {
502 write!(f, "NextEpochQc2Formed(view_number={:?})", tc.view_number())
503 },
504 },
505 HotShotEvent::ExtendedQc2Formed(cert) => {
506 write!(f, "ExtendedQc2Formed(view_number={:?})", cert.view_number())
507 },
508 HotShotEvent::DacSend(cert, _) => {
509 write!(f, "DacSend(view_number={:?})", cert.view_number())
510 },
511 HotShotEvent::ViewChange(view_number, epoch_number) => {
512 write!(
513 f,
514 "ViewChange(view_number={view_number:?}, epoch_number={epoch_number:?})"
515 )
516 },
517 HotShotEvent::ViewSyncTimeout(view_number, ..) => {
518 write!(f, "ViewSyncTimeout(view_number={view_number:?})")
519 },
520 HotShotEvent::ViewSyncPreCommitVoteRecv(vote) => write!(
521 f,
522 "ViewSyncPreCommitVoteRecv(view_number={:?})",
523 vote.view_number()
524 ),
525 HotShotEvent::ViewSyncCommitVoteRecv(vote) => write!(
526 f,
527 "ViewSyncCommitVoteRecv(view_number={:?})",
528 vote.view_number()
529 ),
530 HotShotEvent::ViewSyncFinalizeVoteRecv(vote) => write!(
531 f,
532 "ViewSyncFinalizeVoteRecv(view_number={:?})",
533 vote.view_number()
534 ),
535 HotShotEvent::ViewSyncPreCommitVoteSend(vote) => write!(
536 f,
537 "ViewSyncPreCommitVoteSend(view_number={:?})",
538 vote.view_number()
539 ),
540 HotShotEvent::ViewSyncCommitVoteSend(vote) => write!(
541 f,
542 "ViewSyncCommitVoteSend(view_number={:?})",
543 vote.view_number()
544 ),
545 HotShotEvent::ViewSyncFinalizeVoteSend(vote) => write!(
546 f,
547 "ViewSyncFinalizeVoteSend(view_number={:?})",
548 vote.view_number()
549 ),
550 HotShotEvent::ViewSyncPreCommitCertificateRecv(cert) => {
551 write!(
552 f,
553 "ViewSyncPreCommitCertificateRecv(view_number={:?})",
554 cert.view_number()
555 )
556 },
557 HotShotEvent::ViewSyncCommitCertificateRecv(cert) => {
558 write!(
559 f,
560 "ViewSyncCommitCertificateRecv(view_number={:?})",
561 cert.view_number()
562 )
563 },
564 HotShotEvent::ViewSyncFinalizeCertificateRecv(cert) => {
565 write!(
566 f,
567 "ViewSyncFinalizeCertificateRecv(view_number={:?})",
568 cert.view_number()
569 )
570 },
571 HotShotEvent::ViewSyncPreCommitCertificateSend(cert, _) => {
572 write!(
573 f,
574 "ViewSyncPreCommitCertificateSend(view_number={:?})",
575 cert.view_number()
576 )
577 },
578 HotShotEvent::ViewSyncCommitCertificateSend(cert, _) => {
579 write!(
580 f,
581 "ViewSyncCommitCertificateSend(view_number={:?})",
582 cert.view_number()
583 )
584 },
585 HotShotEvent::ViewSyncFinalizeCertificateSend(cert, _) => {
586 write!(
587 f,
588 "ViewSyncFinalizeCertificateSend(view_number={:?})",
589 cert.view_number()
590 )
591 },
592 HotShotEvent::ViewSyncTrigger(view_number) => {
593 write!(f, "ViewSyncTrigger(view_number={view_number:?})")
594 },
595 HotShotEvent::Timeout(view_number, epoch) => {
596 write!(f, "Timeout(view_number={view_number:?}, epoch={epoch:?})")
597 },
598 HotShotEvent::TransactionsRecv(_) => write!(f, "TransactionsRecv"),
599 HotShotEvent::TransactionSend(..) => write!(f, "TransactionSend"),
600 HotShotEvent::SendPayloadCommitmentAndMetadata(_, _, _, view_number, ..) => {
601 write!(
602 f,
603 "SendPayloadCommitmentAndMetadata(view_number={view_number:?})"
604 )
605 },
606 HotShotEvent::BlockRecv(packed_bundle) => {
607 write!(f, "BlockRecv(view_number={:?})", packed_bundle.view_number)
608 },
609 HotShotEvent::VidDisperseSend(proposal, _) => write!(
610 f,
611 "VidDisperseSend(view_number={:?})",
612 proposal.data.view_number()
613 ),
614 HotShotEvent::VidShareRecv(_, proposal) => write!(
615 f,
616 "VIDShareRecv(view_number={:?})",
617 proposal.data.view_number()
618 ),
619 HotShotEvent::VidShareValidated(proposal) => write!(
620 f,
621 "VIDShareValidated(view_number={:?})",
622 proposal.data.view_number()
623 ),
624 HotShotEvent::UpgradeProposalRecv(proposal, _) => write!(
625 f,
626 "UpgradeProposalRecv(view_number={:?})",
627 proposal.data.view_number()
628 ),
629 HotShotEvent::UpgradeProposalSend(proposal, _) => write!(
630 f,
631 "UpgradeProposalSend(view_number={:?})",
632 proposal.data.view_number()
633 ),
634 HotShotEvent::UpgradeVoteRecv(vote) => {
635 write!(f, "UpgradeVoteRecv(view_number={:?})", vote.view_number())
636 },
637 HotShotEvent::UpgradeVoteSend(vote) => {
638 write!(f, "UpgradeVoteSend(view_number={:?})", vote.view_number())
639 },
640 HotShotEvent::UpgradeCertificateFormed(cert) => write!(
641 f,
642 "UpgradeCertificateFormed(view_number={:?})",
643 cert.view_number()
644 ),
645 HotShotEvent::QuorumProposalRequestSend(view_number, _) => {
646 write!(f, "QuorumProposalRequestSend(view_number={view_number:?})")
647 },
648 HotShotEvent::QuorumProposalRequestRecv(view_number, _) => {
649 write!(f, "QuorumProposalRequestRecv(view_number={view_number:?})")
650 },
651 HotShotEvent::QuorumProposalResponseSend(_, proposal) => {
652 write!(
653 f,
654 "QuorumProposalResponseSend(view_number={:?})",
655 proposal.data.view_number()
656 )
657 },
658 HotShotEvent::QuorumProposalResponseRecv(proposal) => {
659 write!(
660 f,
661 "QuorumProposalResponseRecv(view_number={:?})",
662 proposal.data.view_number()
663 )
664 },
665 HotShotEvent::QuorumProposalPreliminarilyValidated(proposal) => {
666 write!(
667 f,
668 "QuorumProposalPreliminarilyValidated(view_number={:?}",
669 proposal.data.view_number()
670 )
671 },
672 HotShotEvent::VidRequestSend(request, ..) => {
673 write!(f, "VidRequestSend(view_number={:?}", request.view)
674 },
675 HotShotEvent::VidRequestRecv(request, _) => {
676 write!(f, "VidRequestRecv(view_number={:?}", request.view)
677 },
678 HotShotEvent::VidResponseSend(_, _, proposal) => {
679 write!(
680 f,
681 "VidResponseSend(view_number={:?}",
682 proposal.data.view_number()
683 )
684 },
685 HotShotEvent::VidResponseRecv(_, proposal) => {
686 write!(
687 f,
688 "VidResponseRecv(view_number={:?}",
689 proposal.data.view_number()
690 )
691 },
692 HotShotEvent::HighQcRecv(qc, ..) => {
693 write!(f, "HighQcRecv(view_number={:?}", qc.view_number())
694 },
695 HotShotEvent::HighQcSend(qc, ..) => {
696 write!(f, "HighQcSend(view_number={:?}", qc.view_number())
697 },
698 HotShotEvent::ExtendedQcRecv(qc, ..) => {
699 write!(f, "ExtendedQcRecv(view_number={:?}", qc.view_number())
700 },
701 HotShotEvent::ExtendedQcSend(qc, ..) => {
702 write!(f, "ExtendedQcSend(view_number={:?}", qc.view_number())
703 },
704 HotShotEvent::EpochRootQcSend(cert, ..) => {
705 write!(f, "EpochRootQcSend(view_number={:?}", cert.view_number())
706 },
707 HotShotEvent::EpochRootQcRecv(cert, ..) => {
708 write!(f, "EpochRootQcRecv(view_number={:?}", cert.view_number())
709 },
710 HotShotEvent::SetFirstEpoch(view, epoch) => {
711 write!(f, "SetFirstEpoch(view_number={view:?}, epoch={epoch:?})")
712 },
713 HotShotEvent::LeavesDecided(leaf) => {
714 write!(f, "LeavesDecided(leaf={leaf:?})")
715 },
716 }
717 }
718}