request_response/recipient_source.rs
1use anyhow::Result;
2use async_trait::async_trait;
3use hotshot_types::traits::signature_key::SignatureKey;
4
5use super::request::Request;
6
7/// A trait that allows the [`RequestResponseProtocol`] to get the recipients that a specific message should
8/// expect responses from. In `HotShot` this would go on top of the [`Membership`] trait and determine
9/// which nodes are able (quorum/DA) to respond to which requests
10#[async_trait]
11pub trait RecipientSource<R: Request, K: SignatureKey + 'static>: Send + Sync + 'static {
12 /// Get all the recipients that the specific request should expect responses from
13 async fn get_expected_responders(&self, request: &R) -> Result<Vec<K>>;
14}