Skip to content

Commit 0921d7d

Browse files
authored
Change multiline logs to single line (anza-xyz#5112)
1 parent 81649e6 commit 0921d7d

16 files changed

+82
-115
lines changed

accounts-cluster-bench/src/main.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1202,11 +1202,11 @@ fn main() {
12021202
.takes_value(true)
12031203
.value_name("BYTES")
12041204
.help(
1205-
"Every `n` batches, create a batch of close transactions for
1206-
the earliest remaining batch of accounts created.
1207-
Note: Should be > 1 to avoid situations where the close \
1208-
transactions will be submitted before the corresponding \
1209-
create transactions have been confirmed",
1205+
"Every `n` batches, create a batch of close transactions for \
1206+
the earliest remaining batch of accounts created. \
1207+
Note: Should be > 1 to avoid situations where the close \
1208+
transactions will be submitted before the corresponding \
1209+
create transactions have been confirmed",
12101210
),
12111211
)
12121212
.arg(

accounts-db/src/accounts_db.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5677,8 +5677,8 @@ impl AccountsDb {
56775677
pub fn purge_slot(&self, slot: Slot, bank_id: BankId, is_serialized_with_abs: bool) {
56785678
if self.is_bank_drop_callback_enabled.load(Ordering::Acquire) && !is_serialized_with_abs {
56795679
panic!(
5680-
"bad drop callpath detected; Bank::drop() must run serially with other logic in
5681-
ABS like clean_accounts()"
5680+
"bad drop callpath detected; Bank::drop() must run serially with other logic in \
5681+
ABS like clean_accounts()"
56825682
)
56835683
}
56845684

core/src/consensus.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ impl Tower {
576576
if let Some(last_voted_slot) = self.last_vote.last_voted_slot() {
577577
if heaviest_slot_on_same_fork <= last_voted_slot {
578578
warn!(
579-
"Trying to refresh timestamp for vote on {last_voted_slot}
579+
"Trying to refresh timestamp for vote on {last_voted_slot} \
580580
using smaller heaviest bank {heaviest_slot_on_same_fork}"
581581
);
582582
return;
@@ -588,8 +588,8 @@ impl Tower {
588588
self.last_vote.set_timestamp(Some(timestamp));
589589
} else {
590590
warn!(
591-
"Trying to refresh timestamp for last vote on heaviest bank on same fork
592-
{heaviest_slot_on_same_fork}, but there is no vote to refresh"
591+
"Trying to refresh timestamp for last vote on heaviest bank on same fork \
592+
{heaviest_slot_on_same_fork}, but there is no vote to refresh"
593593
);
594594
}
595595
}
@@ -1115,8 +1115,8 @@ impl Tower {
11151115
last_vote_ancestors,
11161116
)
11171117
.expect(
1118-
"candidate_slot and switch_slot exist in descendants map,
1119-
so they must exist in ancestors map",
1118+
"candidate_slot and switch_slot exist in descendants map, \
1119+
so they must exist in ancestors map",
11201120
)
11211121
}
11221122
{

core/src/consensus/fork_choice.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,13 @@ fn recheck_fork_decision_failed_switch_threshold(
144144
// then there will be no blocks to include the votes for slot 4, and the network halts
145145
// because 90% of validators can't vote
146146
info!(
147-
"Waiting to switch vote to {},
148-
resetting to slot {:?} for now,
149-
switch proof stake: {},
150-
threshold stake: {},
151-
total stake: {}",
152-
heaviest_bank_slot,
147+
"Waiting to switch vote to {heaviest_bank_slot}, \
148+
resetting to slot {:?} for now, \
149+
switch proof stake: {switch_proof_stake}, \
150+
threshold stake: {}, \
151+
total stake: {total_stake}",
153152
reset_bank.as_ref().map(|b| b.slot()),
154-
switch_proof_stake,
155153
total_stake as f64 * SWITCH_FORK_THRESHOLD,
156-
total_stake
157154
);
158155
failure_reasons.push(HeaviestForkFailures::FailedSwitchThreshold(
159156
heaviest_bank_slot,

core/src/consensus/heaviest_subtree_fork_choice.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1033,10 +1033,8 @@ impl HeaviestSubtreeForkChoice {
10331033
{
10341034
assert!(if new_vote_slot == old_latest_vote_slot {
10351035
warn!(
1036-
"Got a duplicate vote for
1037-
validator: {},
1038-
slot_hash: {:?}",
1039-
pubkey, new_vote_slot_hash
1036+
"Got a duplicate vote for validator: {pubkey}, \
1037+
slot_hash: {new_vote_slot_hash:?}",
10401038
);
10411039
// If the slots are equal, then the new
10421040
// vote must be for a smaller hash

core/src/consensus/progress_map.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -400,18 +400,17 @@ impl ProgressMap {
400400
pub fn log_propagated_stats(&self, slot: Slot, bank_forks: &RwLock<BankForks>) {
401401
if let Some(stats) = self.get_propagated_stats(slot) {
402402
info!(
403-
"Propagated stats:
404-
total staked: {},
405-
observed staked: {},
406-
vote pubkeys: {:?},
407-
node_pubkeys: {:?},
408-
slot: {},
409-
epoch: {:?}",
403+
"Propagated stats: \
404+
total staked: {}, \
405+
observed staked: {}, \
406+
vote pubkeys: {:?}, \
407+
node_pubkeys: {:?}, \
408+
slot: {slot}, \
409+
epoch: {:?}",
410410
stats.total_epoch_stake,
411411
stats.propagated_validators_stake,
412412
stats.propagated_validators,
413413
stats.propagated_node_ids,
414-
slot,
415414
bank_forks.read().unwrap().get(slot).map(|x| x.epoch()),
416415
);
417416
}

core/src/optimistic_confirmation_verifier.rs

+9-14
Original file line numberDiff line numberDiff line change
@@ -107,26 +107,21 @@ impl OptimisticConfirmationVerifier {
107107
.unwrap_or(0);
108108

109109
error!(
110-
"{},
111-
hash: {},
112-
epoch: {},
113-
voted keys: {:?},
114-
root: {},
115-
root bank hash: {},
116-
voted stake: {},
117-
total epoch stake: {},
118-
pct: {}",
110+
"{}, \
111+
hash: {hash}, \
112+
epoch: {epoch}, \
113+
voted keys: {:?}, \
114+
root: {root}, \
115+
root bank hash: {}, \
116+
voted stake: {voted_stake}, \
117+
total epoch stake: {total_epoch_stake}, \
118+
pct: {}",
119119
Self::format_optimistic_confirmed_slot_violation_log(*optimistic_slot),
120-
hash,
121-
epoch,
122120
r_slot_tracker
123121
.as_ref()
124122
.and_then(|s| s.optimistic_votes_tracker(hash))
125123
.map(|s| s.voted()),
126-
root,
127124
root_bank.hash(),
128-
voted_stake,
129-
total_epoch_stake,
130125
voted_stake as f64 / total_epoch_stake as f64,
131126
);
132127
voted_stake

core/src/repair/ancestor_hashes_service.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,8 @@ impl AncestorHashesService {
740740

741741
for (slot, request_type) in potential_slot_requests.take(number_of_allowed_requests) {
742742
warn!(
743-
"Cluster froze slot: {}, but we marked it as {}.
743+
"Cluster froze slot: {slot}, but we marked it as {}. \
744744
Initiating protocol to sample cluster for dead slot ancestors.",
745-
slot,
746745
if request_type.is_pruned() {
747746
"pruned"
748747
} else {

core/src/repair/cluster_slot_state_verifier.rs

+11-13
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,8 @@ fn check_epoch_slots_hash_against_bank_status(
434434
BankStatus::Frozen(bank_frozen_hash) => {
435435
// The epoch slots hash does not match our frozen hash.
436436
warn!(
437-
"EpochSlots sample returned slot {} with hash {}, but our version
438-
has hash {:?}",
439-
slot, epoch_slots_frozen_hash, bank_frozen_hash
437+
"EpochSlots sample returned slot {slot} with hash {epoch_slots_frozen_hash}, \
438+
but our version has hash {bank_frozen_hash:?}",
440439
);
441440
if !is_popular_pruned {
442441
// If the slot is not already pruned notify fork choice to mark as invalid
@@ -446,8 +445,8 @@ fn check_epoch_slots_hash_against_bank_status(
446445
BankStatus::Dead => {
447446
// Cluster sample found a hash for our dead slot, we must have the wrong version
448447
warn!(
449-
"EpochSlots sample returned slot {} with hash {}, but we marked slot dead",
450-
slot, epoch_slots_frozen_hash
448+
"EpochSlots sample returned slot {slot} with hash {epoch_slots_frozen_hash}, \
449+
but we marked slot dead",
451450
);
452451
}
453452
BankStatus::Unprocessed => {
@@ -456,8 +455,8 @@ fn check_epoch_slots_hash_against_bank_status(
456455
assert!(is_popular_pruned);
457456
// The cluster sample found the troublesome slot which caused this fork to be pruned
458457
warn!(
459-
"EpochSlots sample returned slot {slot} with hash {epoch_slots_frozen_hash}, but \
460-
we have pruned it due to incorrect ancestry"
458+
"EpochSlots sample returned slot {slot} with hash {epoch_slots_frozen_hash}, \
459+
but we have pruned it due to incorrect ancestry"
461460
);
462461
}
463462
}
@@ -644,9 +643,8 @@ fn on_epoch_slots_frozen(
644643
if let Some(duplicate_confirmed_hash) = duplicate_confirmed_hash {
645644
if epoch_slots_frozen_hash != duplicate_confirmed_hash {
646645
warn!(
647-
"EpochSlots sample returned slot {} with hash {}, but we already saw \
648-
duplicate confirmation on hash: {:?}",
649-
slot, epoch_slots_frozen_hash, duplicate_confirmed_hash
646+
"EpochSlots sample returned slot {slot} with hash {epoch_slots_frozen_hash}, \
647+
but we already saw duplicate confirmation on hash: {duplicate_confirmed_hash:?}",
650648
);
651649
}
652650
return vec![];
@@ -778,9 +776,9 @@ fn get_duplicate_confirmed_hash(
778776
(Some(local_duplicate_confirmed_hash), Some(duplicate_confirmed_hash)) => {
779777
if local_duplicate_confirmed_hash != duplicate_confirmed_hash {
780778
error!(
781-
"For slot {}, the gossip duplicate confirmed hash {}, is not equal
782-
to the confirmed hash we replayed: {}",
783-
slot, duplicate_confirmed_hash, local_duplicate_confirmed_hash
779+
"For slot {slot}, the gossip duplicate confirmed hash: \
780+
{duplicate_confirmed_hash} is not equal to the confirmed hash we replayed: \
781+
{local_duplicate_confirmed_hash}",
784782
);
785783
}
786784
Some(local_duplicate_confirmed_hash)

core/src/repair/duplicate_repair_status.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ impl AncestorRequestStatus {
473473
// replay dump then repair to fix.
474474

475475
warn!(
476-
"Blockstore is missing frozen hash for slot {},
477-
which the cluster claims is an ancestor of dead slot {}. Potentially
478-
our version of the dead slot chains to the wrong fork!",
479-
ancestor_slot, self.requested_mismatched_slot
476+
"Blockstore is missing frozen hash for slot {ancestor_slot}, \
477+
which the cluster claims is an ancestor of dead slot {}. Potentially \
478+
our version of the dead slot chains to the wrong fork!",
479+
self.requested_mismatched_slot
480480
);
481481
}
482482
last_ancestor = *ancestor_slot;

core/src/repair/serve_repair.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ impl ServeRepair {
503503
error!("Unexpected legacy request: {request:?}");
504504
debug_assert!(
505505
false,
506-
"Legacy requests should have been filtered out during signature
507-
verification. {request:?}"
506+
"Legacy requests should have been filtered out during signature \
507+
verification. {request:?}"
508508
);
509509
(None, "Legacy")
510510
}
@@ -958,8 +958,8 @@ impl ServeRepair {
958958
error!("Unexpected legacy request: {request:?}");
959959
debug_assert!(
960960
false,
961-
"Legacy requests should have been filtered out during signature
962-
verification. {request:?}"
961+
"Legacy requests should have been filtered out during signature \
962+
verification. {request:?}"
963963
);
964964
None
965965
}

core/src/replay_stage.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3582,10 +3582,10 @@ impl ReplayStage {
35823582
return;
35833583
}
35843584
info!(
3585-
"Frozen bank vote state slot {:?}
3586-
is newer than our local vote state slot {:?},
3587-
adopting the bank vote state as our own.
3588-
Bank votes: {:?}, root: {:?},
3585+
"Frozen bank vote state slot {:?} \
3586+
is newer than our local vote state slot {:?}, \
3587+
adopting the bank vote state as our own. \
3588+
Bank votes: {:?}, root: {:?}, \
35893589
Local votes: {:?}, root: {:?}",
35903590
bank_vote_state.last_voted_slot(),
35913591
tower.vote_state.last_voted_slot(),
@@ -3609,7 +3609,7 @@ impl ReplayStage {
36093609
.votes
36103610
.retain(|lockout| lockout.slot() > local_root);
36113611
info!(
3612-
"Local root is larger than on chain root,
3612+
"Local root is larger than on chain root, \
36133613
overwrote bank root {:?} and updated votes {:?}",
36143614
bank_vote_state.root_slot, bank_vote_state.votes
36153615
);

ledger/src/blockstore.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3833,9 +3833,8 @@ impl Blockstore {
38333833
let results = self.check_last_fec_set(slot);
38343834
let Ok(results) = results else {
38353835
warn!(
3836-
"Unable to check the last fec set for slot {} {},
3836+
"Unable to check the last fec set for slot {slot} {bank_hash}, \
38373837
marking as dead: {results:?}",
3838-
slot, bank_hash,
38393838
);
38403839
if feature_set.is_active(&solana_sdk::feature_set::vote_only_full_fec_sets::id()) {
38413840
return Err(BlockstoreProcessorError::IncompleteFinalFecSet);

ledger/src/blockstore/blockstore_purge.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,8 @@ impl Blockstore {
170170
.put_in_batch(&mut write_batch, parent_slot, &parent_slot_meta)?;
171171
} else {
172172
error!(
173-
"Parent slot meta {} for child {} is missing or cleaned up.
174-
Falling back to orphan repair to remedy the situation",
175-
parent_slot, slot
173+
"Parent slot meta {parent_slot} for child {slot} is missing or cleaned up. \
174+
Falling back to orphan repair to remedy the situation",
176175
);
177176
}
178177
}

0 commit comments

Comments
 (0)