@@ -34,8 +34,8 @@ const DEFAULT_PROTOCOL_PARAMETERS_SUBSCRIBE_TOPIC: (&str, &str) = (
3434 "protocol-parameters-subscribe-topic" ,
3535 "cardano.protocol.parameters" ,
3636) ;
37- const DEFAULT_EPOCH_ACTIVITY_SUBSCRIBE_TOPIC : ( & str , & str ) =
38- ( "epoch-activity -subscribe-topic" , "cardano.epoch.activity " ) ;
37+ const DEFAULT_EPOCH_NONCE_SUBSCRIBE_TOPIC : ( & str , & str ) =
38+ ( "epoch-nonce -subscribe-topic" , "cardano.epoch.nonce " ) ;
3939const DEFAULT_SPO_STATE_SUBSCRIBE_TOPIC : ( & str , & str ) =
4040 ( "spo-state-subscribe-topic" , "cardano.spo.state" ) ;
4141const DEFAULT_SPDD_SUBSCRIBE_TOPIC : ( & str , & str ) =
@@ -58,7 +58,7 @@ impl BlockVrfValidator {
5858 mut bootstrapped_subscription : Box < dyn Subscription < Message > > ,
5959 mut block_subscription : Box < dyn Subscription < Message > > ,
6060 mut protocol_parameters_subscription : Box < dyn Subscription < Message > > ,
61- mut epoch_activity_subscription : Box < dyn Subscription < Message > > ,
61+ mut epoch_nonce_subscription : Box < dyn Subscription < Message > > ,
6262 mut spo_state_subscription : Box < dyn Subscription < Message > > ,
6363 mut spdd_subscription : Box < dyn Subscription < Message > > ,
6464 ) -> Result < ( ) > {
@@ -90,8 +90,10 @@ impl BlockVrfValidator {
9090
9191 if is_new_epoch {
9292 // read epoch boundary messages
93- let ( _, protocol_parameters_msg) =
94- protocol_parameters_subscription. read_ignoring_rollbacks ( ) . await ?;
93+ let protocol_parameters_message_f = protocol_parameters_subscription. read ( ) ;
94+ let epoch_nonce_message_f = epoch_nonce_subscription. read ( ) ;
95+
96+ let ( _, protocol_parameters_msg) = protocol_parameters_message_f. await ?;
9597 let span = info_span ! (
9698 "block_vrf_validator.handle_protocol_parameters" ,
9799 epoch = block_info. epoch
@@ -104,18 +106,20 @@ impl BlockVrfValidator {
104106 _ => error ! ( "Unexpected message type: {protocol_parameters_msg:?}" ) ,
105107 } ) ;
106108
107- let ( _, epoch_activity_msg) =
108- epoch_activity_subscription. read_ignoring_rollbacks ( ) . await ?;
109+ let ( _, epoch_nonce_msg) = epoch_nonce_message_f. await ?;
109110 let span = info_span ! (
110- "block_vrf_validator.handle_epoch_activity " ,
111+ "block_vrf_validator.handle_epoch_nonce " ,
111112 epoch = block_info. epoch
112113 ) ;
113- span. in_scope ( || match epoch_activity_msg. as_ref ( ) {
114- Message :: Cardano ( ( block_info, CardanoMessage :: EpochActivity ( msg) ) ) => {
114+ span. in_scope ( || match epoch_nonce_msg. as_ref ( ) {
115+ Message :: Cardano ( (
116+ block_info,
117+ CardanoMessage :: EpochNonce ( active_nonce) ,
118+ ) ) => {
115119 Self :: check_sync ( & current_block, block_info) ;
116- state. handle_epoch_activity ( msg ) ;
120+ state. handle_epoch_nonce ( active_nonce ) ;
117121 }
118- _ => error ! ( "Unexpected message type: {epoch_activity_msg :?}" ) ,
122+ _ => error ! ( "Unexpected message type: {epoch_nonce_msg :?}" ) ,
119123 } ) ;
120124
121125 let ( _, spo_state_msg) =
@@ -194,10 +198,10 @@ impl BlockVrfValidator {
194198 . unwrap_or ( DEFAULT_BLOCK_SUBSCRIBE_TOPIC . 1 . to_string ( ) ) ;
195199 info ! ( "Creating block subscription on '{block_subscribe_topic}'" ) ;
196200
197- let epoch_activity_subscribe_topic = config
198- . get_string ( DEFAULT_EPOCH_ACTIVITY_SUBSCRIBE_TOPIC . 0 )
199- . unwrap_or ( DEFAULT_EPOCH_ACTIVITY_SUBSCRIBE_TOPIC . 1 . to_string ( ) ) ;
200- info ! ( "Creating epoch activity subscription on '{epoch_activity_subscribe_topic }'" ) ;
201+ let epoch_nonce_subscribe_topic = config
202+ . get_string ( DEFAULT_EPOCH_NONCE_SUBSCRIBE_TOPIC . 0 )
203+ . unwrap_or ( DEFAULT_EPOCH_NONCE_SUBSCRIBE_TOPIC . 1 . to_string ( ) ) ;
204+ info ! ( "Creating epoch nonce subscription on '{epoch_nonce_subscribe_topic }'" ) ;
201205
202206 let spo_state_subscribe_topic = config
203207 . get_string ( DEFAULT_SPO_STATE_SUBSCRIBE_TOPIC . 0 )
@@ -218,8 +222,7 @@ impl BlockVrfValidator {
218222 let protocol_parameters_subscription =
219223 context. subscribe ( & protocol_parameters_subscribe_topic) . await ?;
220224 let block_subscription = context. subscribe ( & block_subscribe_topic) . await ?;
221- let epoch_activity_subscription =
222- context. subscribe ( & epoch_activity_subscribe_topic) . await ?;
225+ let epoch_nonce_subscription = context. subscribe ( & epoch_nonce_subscribe_topic) . await ?;
223226 let spo_state_subscription = context. subscribe ( & spo_state_subscribe_topic) . await ?;
224227 let spdd_subscription = context. subscribe ( & spdd_subscribe_topic) . await ?;
225228
@@ -237,7 +240,7 @@ impl BlockVrfValidator {
237240 bootstrapped_subscription,
238241 block_subscription,
239242 protocol_parameters_subscription,
240- epoch_activity_subscription ,
243+ epoch_nonce_subscription ,
241244 spo_state_subscription,
242245 spdd_subscription,
243246 )
0 commit comments