@@ -15,9 +15,8 @@ use lightning_interfaces::signer::{SignerInterface, SubmitTxSocket};
1515use lightning_interfaces:: types:: { Epoch , EpochInfo , UpdateMethod } ;
1616use lightning_interfaces:: {
1717 ApplicationInterface ,
18- BlockNotifierEmitter ,
1918 BroadcastInterface ,
20- EpochNotifierEmitter ,
19+ Emitter ,
2120 IndexSocket ,
2221 NotifierInterface ,
2322 PubSub ,
@@ -55,8 +54,7 @@ pub struct Consensus<C: Collection> {
5554 EpochState <
5655 c ! [ C :: ApplicationInterface :: SyncExecutor ] ,
5756 c ! [ C :: BroadcastInterface :: PubSub <PubSubMsg >] ,
58- c ! [ C :: NotifierInterface :: EpochEmitter ] ,
59- c ! [ C :: NotifierInterface :: BlockEmitter ] ,
57+ c ! [ C :: NotifierInterface :: Emitter ] ,
6058 > ,
6159 > ,
6260 > ,
@@ -74,12 +72,7 @@ pub struct Consensus<C: Collection> {
7472}
7573
7674/// This struct contains mutable state only for the current epoch.
77- struct EpochState <
78- Q : SyncQueryRunnerInterface ,
79- P : PubSub < PubSubMsg > + ' static ,
80- EN : EpochNotifierEmitter ,
81- BN : BlockNotifierEmitter ,
82- > {
75+ struct EpochState < Q : SyncQueryRunnerInterface , P : PubSub < PubSubMsg > + ' static , NE : Emitter > {
8376 /// The node public key of the node.
8477 node_public_key : NodePublicKey ,
8578 /// The consensus public key of the node.
@@ -93,7 +86,7 @@ struct EpochState<
9386 /// Path to the database used by the narwhal implementation
9487 pub store_path : ResolvedPathBuf ,
9588 /// Narwhal execution state.
96- execution_state : Arc < Execution < Q , EN , BN > > ,
89+ execution_state : Arc < Execution < Q , NE > > ,
9790 /// Used to send transactions to consensus
9891 /// We still use this socket on consensus struct because a node is not always on the committee,
9992 /// so its not always sending a transaction to its own mempool. The signer interface
@@ -108,20 +101,16 @@ struct EpochState<
108101}
109102
110103#[ allow( clippy:: too_many_arguments) ]
111- impl <
112- Q : SyncQueryRunnerInterface ,
113- P : PubSub < PubSubMsg > + ' static ,
114- EN : EpochNotifierEmitter ,
115- BN : BlockNotifierEmitter ,
116- > EpochState < Q , P , EN , BN >
104+ impl < Q : SyncQueryRunnerInterface , P : PubSub < PubSubMsg > + ' static , NE : Emitter >
105+ EpochState < Q , P , NE >
117106{
118107 fn new (
119108 node_public_key : NodePublicKey ,
120109 consensus_public_key : ConsensusPublicKey ,
121110 query_runner : Q ,
122111 narwhal_args : NarwhalArgs ,
123112 store_path : ResolvedPathBuf ,
124- execution_state : Arc < Execution < Q , EN , BN > > ,
113+ execution_state : Arc < Execution < Q , NE > > ,
125114 txn_socket : SubmitTxSocket ,
126115 pub_sub : P ,
127116 rx_narwhal_batches : mpsc:: Receiver < ( AuthenticStampedParcel , bool ) > ,
@@ -426,8 +415,7 @@ impl<C: Collection> ConsensusInterface<C> for Consensus<C> {
426415 tx_narwhal_batches,
427416 query_runner. clone ( ) ,
428417 indexer_socket,
429- notifier. new_epoch_emitter ( ) ,
430- notifier. new_block_emitter ( ) ,
418+ notifier. get_emitter ( ) ,
431419 ) ) ;
432420
433421 let shutdown_notify = Arc :: new ( Notify :: new ( ) ) ;
0 commit comments