reduce concurrency during quorum check tests

This commit is contained in:
Jędrzej Stuczyński
2026-05-27 16:17:09 +01:00
parent 97f79381b9
commit 3853c0f0c9
7 changed files with 27 additions and 18 deletions
Generated
+1 -1
View File
@@ -7768,7 +7768,7 @@ dependencies = [
[[package]]
name = "nym-node-status-api"
version = "4.6.2-rc8"
version = "4.6.2-rc9"
dependencies = [
"ammonia",
"anyhow",
@@ -65,7 +65,7 @@ impl QuorumStateChecker {
let dkg_details = dkg_details_with_client(client_guard.deref()).await?;
drop(client_guard);
let res = check_known_dealers(dkg_details).await?;
let res = check_known_dealers(dkg_details, 4).await?;
info!("there are {} known DKG dealers", res.results.len());
let Some(signing_threshold) = res.threshold else {
@@ -195,9 +195,9 @@ impl ClientUnderTest {
pub(crate) async fn check_client(
dealer_details: DealerDetails,
dkg_epoch: u64,
contract_share: Option<&ContractVKShare>,
contract_share: Option<ContractVKShare>,
) -> TypedSignerResult {
let dealer_information = RawDealerInformation::new(&dealer_details, contract_share);
let dealer_information = RawDealerInformation::new(&dealer_details, contract_share.as_ref());
// 7. attempt to construct client instances out of them
let Ok(parsed_information) = dealer_information.parse() else {
+16 -12
View File
@@ -2,7 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
use crate::client_check::check_client;
use futures::stream::{FuturesUnordered, StreamExt};
use futures::stream;
use futures::stream::StreamExt;
use nym_ecash_signer_check_types::status::{SignerResult, Status};
use nym_network_defaults::NymNetworkDetails;
use nym_validator_client::QueryHttpRpcNyxdClient;
@@ -65,7 +66,7 @@ where
C: DkgQueryClient + Sync,
{
let dkg_details = dkg_details_with_client(client).await?;
check_known_dealers(dkg_details).await
check_known_dealers(dkg_details, None).await
}
pub async fn dkg_details_with_client<C>(client: &C) -> Result<DkgDetails, SignerCheckError>
@@ -109,18 +110,21 @@ where
pub async fn check_known_dealers(
dkg_details: DkgDetails,
concurrency: impl Into<Option<usize>>,
) -> Result<SignersTestResult, SignerCheckError> {
// 6. for each dealer attempt to perform the checks
let results = dkg_details
.network_dealers
.into_iter()
.map(|d| {
let share = dkg_details.submitted_shared.get(&d.assigned_index);
check_client(d, dkg_details.dkg_epoch.epoch_id, share)
})
.collect::<FuturesUnordered<_>>()
.collect::<Vec<_>>()
.await;
let epoch_id = dkg_details.dkg_epoch.epoch_id;
let submitted = dkg_details.submitted_shared;
let dealers = dkg_details.network_dealers.len();
let tasks = dkg_details.network_dealers.into_iter().map(move |d| {
let share = submitted.get(&d.assigned_index).cloned();
check_client(d, epoch_id, share)
});
let limit = concurrency.into().filter(|&n| n > 0).unwrap_or(dealers);
let results = stream::iter(tasks).buffer_unordered(limit).collect().await;
Ok(SignersTestResult {
threshold: dkg_details.threshold,
@@ -3,7 +3,7 @@
[package]
name = "nym-node-status-api"
version = "4.6.2-rc8"
version = "4.6.2-rc9"
authors.workspace = true
edition.workspace = true
license.workspace = true
@@ -4,6 +4,7 @@ use crate::node_scraper::helpers::scrape_and_store_description_by_node_id;
use crate::ticketbook_manager::TicketbookManager;
use crate::ticketbook_manager::state::TicketbookManagerState;
use clap::Parser;
use nym_bin_common::bin_info_owned;
use nym_credential_proxy_lib::quorum_checker::QuorumStateChecker;
use nym_credential_proxy_lib::shared_state::nyxd_client::ChainClient;
use nym_crypto::asymmetric::ed25519::PublicKey;
@@ -11,6 +12,7 @@ use nym_network_defaults::setup_env;
use nym_task::ShutdownManager;
use nym_validator_client::nyxd::NyxdClient;
use std::sync::Arc;
use tracing::info;
mod cli;
mod db;
@@ -27,6 +29,9 @@ mod utils;
async fn main() -> anyhow::Result<()> {
logging::setup_tracing_logger()?;
let bin_info = bin_info_owned!();
info!("using the following version: {bin_info}");
let args = cli::Cli::parse();
if let Some(env_file) = &args.config_env_file {
setup_env(Some(env_file));
@@ -23,7 +23,7 @@ tracing = { workspace = true }
time = { workspace = true }
nym-validator-client = { workspace = true }
nym-validator-client = { workspace = true, features = ["http-client"] }
nym-bin-common = { workspace = true, features = ["output_format", "basic_tracing"] }
nym-network-defaults = { workspace = true }
nym-http-api-client = { workspace = true }