Cache SessionInfo on new activated leaf in dispute-distribution (#6993)

* Cache `SessionInfo` on new activated leaf in `dispute-distribution`

* Update node/network/dispute-distribution/src/sender/mod.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* fmt

* Decrease log level

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Tsvetomir Dimitrov
2023-04-03 19:51:31 +03:00
committed by GitHub
parent 88a0b303d5
commit 3ab60efc26
2 changed files with 23 additions and 75 deletions
@@ -366,6 +366,12 @@ async fn get_active_session_indices<Context>(
// Iterate all heads we track as active and fetch the child' session indices.
for head in active_heads {
let session_index = runtime.get_session_index_for_child(ctx.sender(), *head).await?;
// Cache session info
if let Err(err) =
runtime.get_session_info_by_index(ctx.sender(), *head, session_index).await
{
gum::debug!(target: LOG_TARGET, ?err, ?session_index, "Can't cache SessionInfo");
}
indeces.insert(session_index, *head);
}
Ok(indeces)