async fn wait_for_main_node_block(
    ctx: &ctx::Ctx,
    sync_state: &SyncState,
    pred: impl Fn(validator::BlockNumber) -> bool,
) -> ctx::OrCanceled<validator::BlockNumber> {
    sync::wait_for_some(ctx, &mut sync_state.subscribe(), |inner| {
        inner
            .main_node_block()
            .map(|n| validator::BlockNumber(n.0.into()))
            .filter(|n| pred(*n))
    })
    .await
}
Waits until the main node block is greater or equal to the given block number.
Returns the current main node block number.
core/node/consensus/src/en.rs