Skip to content

Commit 4713776

Browse files
authored
[testnet] Downgrade log levels; make --min-votes named. (#4837, #4838) (#4840)
Backport of #4838 and #4837. ## Motivation We have several WARN- and ERROR-level logs that can occur during normal operations, without a faulty validity threshold among the validators. `query-validators` allows filtering by weight. The minimum voting weight is a positional argument, which is confusing and less explicit. ## Proposal Downgrade the logs to INFO. Make `--min-votes` a named option. ## Test Plan (Only log level changes.) ## Release Plan - These changes should be backported to `testnet_conway`, then - be released in a new SDK. (Low priority.) ## Links - PRs to main: #4837, #4838 - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 5fb1616 commit 4713776

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

CLI.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,15 @@ Show the version and genesis config hash of a new validator, and print a warning
462462

463463
Show the current set of validators for a chain. Also print some information about the given chain while we are at it
464464

465-
**Usage:** `linera query-validators [CHAIN_ID] [MIN_VOTES]`
465+
**Usage:** `linera query-validators [OPTIONS] [CHAIN_ID]`
466466

467467
###### **Arguments:**
468468

469469
* `<CHAIN_ID>` — The chain to query. If omitted, query the default chain of the wallet
470-
* `<MIN_VOTES>` — Skip validators with less voting weight that this
470+
471+
###### **Options:**
472+
473+
* `--min-votes <MIN_VOTES>` — Skip validators with less voting weight that this
471474

472475

473476

linera-core/src/client/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ impl<Env: Environment> Client<Env> {
292292
.download_certificates_from(&remote_node, chain_id, target_next_block_height)
293293
.await
294294
{
295-
Err(err) => warn!(
295+
Err(err) => info!(
296296
"Failed to download certificates from validator {:?}: {err}",
297297
remote_node.public_key
298298
),
@@ -1126,7 +1126,7 @@ impl<Env: Environment> Client<Env> {
11261126
{
11271127
Ok(content) => content,
11281128
Err(err) => {
1129-
warn!(
1129+
info!(
11301130
"Skipping proposal from {owner} and validator {} at \
11311131
height {}; failed to download {blob_id}: {err}",
11321132
remote_node.public_key, local_info.next_block_height
@@ -3132,7 +3132,7 @@ impl<Env: Environment> ChainClient<Env> {
31323132
if let Some(round_timeout) = info.manager.round_timeout {
31333133
if round_timeout <= self.storage_client().clock().current_time() {
31343134
if let Err(e) = self.request_leader_timeout().await {
3135-
warn!("Failed to obtain a timeout certificate: {}", e);
3135+
debug!("Failed to obtain a timeout certificate: {}", e);
31363136
} else {
31373137
info = self.chain_info_with_manager_values().await?;
31383138
}
@@ -3816,7 +3816,7 @@ impl<Env: Environment> ChainClient<Env> {
38163816
)
38173817
.await?;
38183818
if self.local_next_height_to_receive(origin).await? <= height {
3819-
warn!(
3819+
info!(
38203820
chain_id = %self.chain_id,
38213821
"NewIncomingBundle: Fail to synchronize new message after notification"
38223822
);
@@ -3868,7 +3868,7 @@ impl<Env: Environment> ChainClient<Env> {
38683868
return Ok(());
38693869
};
38703870
if (info.next_block_height, info.manager.current_round) < (height, round) {
3871-
error!(
3871+
info!(
38723872
chain_id = %self.chain_id,
38733873
"NewRound: Fail to synchronize new block after notification"
38743874
);
@@ -4001,7 +4001,7 @@ impl<Env: Environment> ChainClient<Env> {
40014001
})
40024002
.filter_map(move |result| async move {
40034003
if let Err(error) = &result {
4004-
warn!(?error, "Could not connect to validator {public_key}");
4004+
info!(?error, "Could not connect to validator {public_key}");
40054005
} else {
40064006
debug!("Connected to validator {public_key}");
40074007
}
@@ -4023,7 +4023,7 @@ impl<Env: Environment> ChainClient<Env> {
40234023
)
40244024
.await
40254025
{
4026-
tracing::warn!(
4026+
tracing::info!(
40274027
chain_id = %this.chain_id,
40284028
validator_public_key = ?remote_node.public_key,
40294029
?notification,

linera-core/src/remote_node.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use linera_chain::{
2222
},
2323
};
2424
use rand::seq::SliceRandom as _;
25-
use tracing::{debug, instrument, warn};
25+
use tracing::{debug, info, instrument};
2626

2727
use crate::{
2828
data_types::{ChainInfo, ChainInfoQuery, ChainInfoResponse},
@@ -186,7 +186,7 @@ impl<N: ValidatorNode> RemoteNode<N> {
186186
) -> Result<ConfirmedBlockCertificate, NodeError> {
187187
let certificate = self.node.blob_last_used_by_certificate(blob_id).await?;
188188
if !certificate.block().requires_or_creates_blob(&blob_id) {
189-
warn!(
189+
info!(
190190
"Got invalid last used by certificate for blob {} from validator {}",
191191
blob_id, self.public_key
192192
);
@@ -338,13 +338,13 @@ impl<N: ValidatorNode> RemoteNode<N> {
338338
let public_key = &self.public_key;
339339
for blob_id in blob_ids {
340340
if !required.contains(blob_id) {
341-
warn!("validator {public_key} requested blob {blob_id:?} but it is not required");
341+
info!("validator {public_key} requested blob {blob_id:?} but it is not required");
342342
return Err(NodeError::UnexpectedEntriesInBlobsNotFound);
343343
}
344344
}
345345
let unique_missing_blob_ids = blob_ids.iter().copied().collect::<HashSet<_>>();
346346
if blob_ids.len() > unique_missing_blob_ids.len() {
347-
warn!("blobs requested by validator {public_key} contain duplicates");
347+
info!("blobs requested by validator {public_key} contain duplicates");
348348
return Err(NodeError::DuplicatesInBlobsNotFound);
349349
}
350350
Ok(())

linera-service/src/cli/command.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ pub enum ClientCommand {
344344
/// The chain to query. If omitted, query the default chain of the wallet.
345345
chain_id: Option<ChainId>,
346346
/// Skip validators with less voting weight that this.
347+
#[arg(long)]
347348
min_votes: Option<u64>,
348349
},
349350

0 commit comments

Comments
 (0)