Skip to content

Commit 668646d

Browse files
authored
Improve log messages in synchronize_chain_state_from. (#4423)
## Motivation I can't reproduce #4422 locally, so we have to try to get more helpful logs in CI if it happens again. ## Proposal Improve log messages. Also fix one `continue` in `synchronize_chain_state_from`: If we can't download any of the required blobs we can skip this proposal immediately, not just this blob. ## Test Plan CI ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links - Related to #4422. - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent d594257 commit 668646d

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

linera-core/src/client/mod.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,10 @@ impl<Env: Environment> Client<Env> {
975975

976976
// If we are at the same height as the remote node, we also update our chain manager.
977977
if local_info.next_block_height != remote_info.next_block_height {
978+
debug!(
979+
"Synced from validator {}; but remote height is {} and local height is {}",
980+
remote_node.public_key, remote_info.next_block_height, local_info.next_block_height
981+
);
978982
return Ok(());
979983
};
980984

@@ -997,14 +1001,14 @@ impl<Env: Environment> Client<Env> {
9971001
let hash = cert.hash();
9981002
if let Err(err) = self.try_process_locking_block_from(remote_node, cert).await {
9991003
debug!(
1000-
"Skipping certificate {hash} from validator {}: {err}",
1001-
remote_node.public_key
1004+
"Skipping locked block {hash} from validator {} at height {}: {err}",
1005+
remote_node.public_key, local_info.next_block_height,
10021006
);
10031007
}
10041008
}
10051009
}
10061010
}
1007-
for proposal in proposals {
1011+
'proposal_loop: for proposal in proposals {
10081012
let owner: AccountOwner = proposal.owner();
10091013
if let Err(mut err) = self
10101014
.local_node
@@ -1023,9 +1027,12 @@ impl<Env: Environment> Client<Env> {
10231027
{
10241028
Ok(content) => content,
10251029
Err(err) => {
1026-
let public_key = &remote_node.public_key;
1027-
warn!("Skipping proposal from {owner} and validator {public_key}: {err}");
1028-
continue;
1030+
warn!(
1031+
"Skipping proposal from {owner} and validator {} at \
1032+
height {}; failed to download {blob_id}: {err}",
1033+
remote_node.public_key, local_info.next_block_height
1034+
);
1035+
continue 'proposal_loop;
10291036
}
10301037
};
10311038
blobs.push(Blob::new(blob_content));
@@ -1063,8 +1070,10 @@ impl<Env: Environment> Client<Env> {
10631070
}
10641071
}
10651072

1066-
let public_key = &remote_node.public_key;
1067-
debug!("Skipping proposal from {owner} and validator {public_key}: {err}");
1073+
debug!(
1074+
"Skipping proposal from {owner} and validator {} at height {}: {err}",
1075+
remote_node.public_key, local_info.next_block_height
1076+
);
10681077
}
10691078
}
10701079
Ok(())

linera-core/src/unit_tests/wasm_client_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ where
988988
.set_fault_type([0, 1, 2, 3], FaultType::Honest)
989989
.await;
990990

991-
// Now player A claim victory since B has timed out. This works because it sees the existing
991+
// Now player A claims victory since B has timed out. This works because it sees the existing
992992
// block proposal and makes a new proposal in the next round instead.
993993
let claim_victory_operation = HexOperation::ClaimVictory;
994994
client_a.synchronize_from_validators().await?;

0 commit comments

Comments
 (0)