diff --git a/substrate/core/finality-grandpa/src/environment.rs b/substrate/core/finality-grandpa/src/environment.rs index 502d201b94..5e3abb3ac7 100644 --- a/substrate/core/finality-grandpa/src/environment.rs +++ b/substrate/core/finality-grandpa/src/environment.rs @@ -587,6 +587,7 @@ where self.inner.import_notification_stream(), self.inner.clone(), incoming, + "round", ).map_err(Into::into)); // schedule network message cleanup when sink drops. diff --git a/substrate/core/finality-grandpa/src/lib.rs b/substrate/core/finality-grandpa/src/lib.rs index 4dc93c381f..e4b71acbec 100644 --- a/substrate/core/finality-grandpa/src/lib.rs +++ b/substrate/core/finality-grandpa/src/lib.rs @@ -427,6 +427,7 @@ fn global_communication, B, E, N, RA>( client.import_notification_stream(), client.clone(), global_in, + "global", ); let global_in = global_in.map_err(CommandOrError::from); diff --git a/substrate/core/finality-grandpa/src/until_imported.rs b/substrate/core/finality-grandpa/src/until_imported.rs index 4232bfacdf..b8568c1f85 100644 --- a/substrate/core/finality-grandpa/src/until_imported.rs +++ b/substrate/core/finality-grandpa/src/until_imported.rs @@ -71,6 +71,7 @@ pub(crate) struct UntilImported, check_pending: Interval, pending: HashMap)>, + identifier: &'static str, } impl UntilImported @@ -81,6 +82,7 @@ impl UntilImported import_notifications: ImportNotifications, status_check: Status, stream: I, + identifier: &'static str, ) -> Self { // how often to check if pending messages that are waiting for blocks to be // imported can be checked. @@ -101,6 +103,7 @@ impl UntilImported ready: VecDeque::new(), check_pending, pending: HashMap::new(), + identifier, } } } @@ -170,8 +173,9 @@ impl Stream for UntilImported if Instant::now() <= next_log { debug!( target: "afg", - "Waiting to import block {} before {} votes can be imported. \ + "Waiting to import block {} before {} {} messages can be imported. \ Possible fork?", + self.identifier, block_hash, v.len(), ); @@ -533,6 +537,7 @@ mod tests { import_notifications, block_status, global_rx.map_err(|_| panic!("should never error")), + "global", ); global_tx.unbounded_send(msg).unwrap(); @@ -558,6 +563,7 @@ mod tests { import_notifications, block_status, global_rx.map_err(|_| panic!("should never error")), + "global", ); global_tx.unbounded_send(msg).unwrap();