Let's say I have a consensus engine called X
. I know that most consensus engines import blocks through something with the trait ImportQueue
, and BasicQueue
is a popular choice for that. Consensus engines that rely on BasicQueue
must also implement a Verifier
trait to check the blocks for correct inherents and signatures and so forth.
My question is, what happens if I don't use BasicQueue
but my consensus engine provides its own implementation of ImportQueue
?
Can I then build the verification and importing functionality in one go through an impl of ImportQueue
? If yes, how, i.e. which functions of the trait are we supposed to build the verification functionality in?
pub trait ImportQueue<B: BlockT>: Send {
fn service(&self) -> Box<dyn ImportQueueService<B>>;
fn service_ref(&mut self) -> &mut dyn ImportQueueService<B>;
fn poll_actions(&mut self, cx: &mut Context<'_>, link: &mut dyn Link<B>);
fn run<'async_trait>(
self,
link: Box<dyn Link<B>>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
Self: 'async_trait;
}
Bonus Question: Is there a real world implemenation of a consensus engine not using BasicQueue
for ImportQueue
?