Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions client/src/transaction_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl TransactionExecutor {
return Some((sig, timestamp(), id));
}
Err(e) => {
info!("error: {:#?}", e);
info!("error: {e:#?}");
}
}
None
Expand Down Expand Up @@ -136,7 +136,7 @@ impl TransactionExecutor {
let mut retain = true;
let sent_ts = sigs_w[i].1;
if let Some(e) = &statuses[j] {
debug!("error: {:?}", e);
debug!("error: {e:?}");
if e.status.is_ok() {
success += 1;
} else {
Expand Down Expand Up @@ -169,8 +169,7 @@ impl TransactionExecutor {
);
if last_log.elapsed().as_millis() > 5000 {
info!(
"success: {} error: {} timed_out: {}",
success, error_count, timed_out,
"success: {success} error: {error_count} timed_out: {timed_out}",
);
last_log = Instant::now();
}
Expand Down
9 changes: 6 additions & 3 deletions geyser-plugin-manager/src/geyser_plugin_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ impl GeyserPluginManager {
return Err(jsonrpc_core::Error {
code: ErrorCode::InvalidRequest,
message: format!(
"There already exists a plugin named {} loaded, while reloading {name}. Did not load requested plugin",
"There already exists a plugin named {} loaded, while reloading {name}. Did \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was before your formatting, but I don't really like that one is passed as argument and the other is embedded. Maybe move name out from {}?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm undecided on where I stand with format strings like these. But for the sake of this PR, I'm inclined to leave it as is; I'm mostly just trying to get us to a point where we can turn on an extra lint.

There are a bunch of these in the codebase, so if we do want to change, I think it'd be good to get a loose decision and then tackle making the codebase uniform in a separate change(s)

not load requested plugin",
new_plugin.name()
),
data: None,
Expand Down Expand Up @@ -357,7 +358,8 @@ pub(crate) fn load_plugin_from_config(
Ok(file) => file,
Err(err) => {
return Err(GeyserPluginManagerError::CannotOpenConfigFile(format!(
"Failed to open the plugin config file {geyser_plugin_config_file:?}, error: {err:?}"
"Failed to open the plugin config file {geyser_plugin_config_file:?}, error: \
{err:?}"
)));
}
};
Expand All @@ -373,7 +375,8 @@ pub(crate) fn load_plugin_from_config(
Ok(value) => value,
Err(err) => {
return Err(GeyserPluginManagerError::InvalidConfigFileFormat(format!(
"The config file {geyser_plugin_config_file:?} is not in a valid Json5 format, error: {err:?}"
"The config file {geyser_plugin_config_file:?} is not in a valid Json5 format, \
error: {err:?}"
)));
}
};
Expand Down
5 changes: 1 addition & 4 deletions geyser-plugin-manager/src/geyser_plugin_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ impl GeyserPluginService {
Arc<AtomicBool>,
)>,
) -> Result<Self, GeyserPluginServiceError> {
info!(
"Starting GeyserPluginService from config files: {:?}",
geyser_plugin_config_files
);
info!("Starting GeyserPluginService from config files: {geyser_plugin_config_files:?}");
let mut plugin_manager = GeyserPluginManager::new();

for geyser_plugin_config_file in geyser_plugin_config_files {
Expand Down
2 changes: 1 addition & 1 deletion pubsub-client/src/nonblocking/pubsub_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ impl PubsubClient {
}
}
} else {
error!("Unknown request id: {}", id);
error!("Unknown request id: {id}");
break;
}
continue;
Expand Down
8 changes: 4 additions & 4 deletions pubsub-client/src/pubsub_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ fn connect_with_retry(

connection_retries -= 1;
debug!(
"Too many requests: server responded with {:?}, {} retries left, pausing for {:?}",
response, connection_retries, duration
"Too many requests: server responded with {response:?}, {connection_retries} \
retries left, pausing for {duration:?}"
);

sleep(duration);
Expand Down Expand Up @@ -785,7 +785,7 @@ impl PubsubClient {
let handler = move |message| match sender.send(message) {
Ok(_) => (),
Err(err) => {
info!("receive error: {:?}", err);
info!("receive error: {err:?}");
}
};
Self::cleanup_with_handler(exit, socket, handler);
Expand All @@ -810,7 +810,7 @@ impl PubsubClient {
// Nothing useful, means we received a ping message
}
Err(err) => {
info!("receive error: {:?}", err);
info!("receive error: {err:?}");
break;
}
}
Expand Down
8 changes: 4 additions & 4 deletions rpc-client/src/http_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ impl RpcSender for HttpSender {

too_many_requests_retries -= 1;
debug!(
"Too many requests: server responded with {:?}, {} retries left, pausing for {:?}",
response, too_many_requests_retries, duration
);
"Too many requests: server responded with {response:?}, \
{too_many_requests_retries} retries left, pausing for {duration:?}"
);

sleep(duration).await;
stats_updater.add_rate_limited_time(duration);
Expand All @@ -194,7 +194,7 @@ impl RpcSender for HttpSender {
match serde_json::from_value::<RpcSimulateTransactionResult>(json["error"]["data"].clone()) {
Ok(data) => RpcResponseErrorData::SendTransactionPreflightFailure(data),
Err(err) => {
debug!("Failed to deserialize RpcSimulateTransactionResult: {:?}", err);
debug!("Failed to deserialize RpcSimulateTransactionResult: {err:?}");
RpcResponseErrorData::Empty
}
}
Expand Down
50 changes: 20 additions & 30 deletions rpc-client/src/nonblocking/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,8 @@ impl RpcClient {
}

Err(RpcError::ForUser(
"unable to confirm transaction. \
This can happen in situations such as transaction expiration \
and insufficient fee-payer funds"
"unable to confirm transaction. This can happen in situations such as transaction \
expiration and insufficient fee-payer funds"
.to_string(),
)
.into())
Expand Down Expand Up @@ -989,7 +988,7 @@ impl RpcClient {
data,
}) = err.kind()
{
debug!("{} {}", code, message);
debug!("{code} {message}");
if let RpcResponseErrorData::SendTransactionPreflightFailure(
RpcSimulateTransactionResult {
logs: Some(logs), ..
Expand Down Expand Up @@ -1204,9 +1203,8 @@ impl RpcClient {
}
} else {
return Err(RpcError::ForUser(
"unable to confirm transaction. \
This can happen in situations such as transaction expiration \
and insufficient fee-payer funds"
"unable to confirm transaction. This can happen in situations such as transaction \
expiration and insufficient fee-payer funds"
.to_string(),
)
.into());
Expand Down Expand Up @@ -1237,11 +1235,12 @@ impl RpcClient {
.await
.unwrap_or(confirmations);
if now.elapsed().as_secs() >= MAX_HASH_AGE_IN_SECONDS as u64 {
return Err(
RpcError::ForUser("transaction not finalized. \
This can happen when a transaction lands in an abandoned fork. \
Please retry.".to_string()).into(),
);
return Err(RpcError::ForUser(
"transaction not finalized. This can happen when a transaction lands in an \
abandoned fork. Please retry."
.to_string(),
)
.into());
}
}
}
Expand Down Expand Up @@ -2316,8 +2315,7 @@ impl RpcClient {
}

info!(
"Waiting for stake to drop below {} current: {:.1}",
max_stake_percent, current_percent
"Waiting for stake to drop below {max_stake_percent} current: {current_percent:.1}"
);
sleep(Duration::from_secs(5)).await;
}
Expand Down Expand Up @@ -2945,7 +2943,7 @@ impl RpcClient {
}
let result = serde_json::from_value(result_json)
.map_err(|err| ClientError::new_with_request(err.into(), request))?;
trace!("Response block timestamp {:?} {:?}", slot, result);
trace!("Response block timestamp {slot:?} {result:?}");
Ok(result)
})
.map_err(|err| err.into_with_request(request))?
Expand Down Expand Up @@ -3604,7 +3602,7 @@ impl RpcClient {
context,
value: rpc_account,
} = serde_json::from_value::<Response<Option<UiAccount>>>(result_json)?;
trace!("Response account {:?} {:?}", pubkey, rpc_account);
trace!("Response account {pubkey:?} {rpc_account:?}");
let account = rpc_account.and_then(|rpc_account| rpc_account.decode());

Ok(Response {
Expand Down Expand Up @@ -3891,11 +3889,7 @@ impl RpcClient {

let minimum_balance: u64 = serde_json::from_value(minimum_balance_json)
.map_err(|err| ClientError::new_with_request(err.into(), request))?;
trace!(
"Response minimum balance {:?} {:?}",
data_len,
minimum_balance
);
trace!("Response minimum balance {data_len:?} {minimum_balance:?}");
Ok(minimum_balance)
}

Expand Down Expand Up @@ -4227,7 +4221,7 @@ impl RpcClient {
context,
value: rpc_account,
} = serde_json::from_value::<Response<Option<UiAccount>>>(result_json)?;
trace!("Response account {:?} {:?}", pubkey, rpc_account);
trace!("Response account {pubkey:?} {rpc_account:?}");
let response = {
if let Some(rpc_account) = rpc_account {
if let UiAccountData::Json(account_data) = rpc_account.data {
Expand Down Expand Up @@ -4450,8 +4444,7 @@ impl RpcClient {
})
.map_err(|_| {
RpcError::ForUser(
"airdrop request failed. \
This can happen when the rate limit is reached."
"airdrop request failed. This can happen when the rate limit is reached."
.to_string(),
)
.into()
Expand Down Expand Up @@ -4514,10 +4507,7 @@ impl RpcClient {
return balance_result;
}
trace!(
"wait_for_balance_with_commitment [{}] {:?} {:?}",
run,
balance_result,
expected_balance
"wait_for_balance_with_commitment [{run}] {balance_result:?} {expected_balance:?}"
);
if let (Some(expected_balance), Ok(balance_result)) = (expected_balance, balance_result)
{
Expand Down Expand Up @@ -4591,7 +4581,7 @@ impl RpcClient {
}
}
Err(err) => {
debug!("check_confirmations request failed: {:?}", err);
debug!("check_confirmations request failed: {err:?}");
}
};
if now.elapsed().as_secs() > 20 {
Expand Down Expand Up @@ -4707,7 +4697,7 @@ impl RpcClient {
return Ok(new_blockhash);
}
}
debug!("Got same blockhash ({:?}), will retry...", blockhash);
debug!("Got same blockhash ({blockhash:?}), will retry...");

// Retry ~twice during a slot
sleep(Duration::from_millis(DEFAULT_MS_PER_SLOT / 2)).await;
Expand Down
4 changes: 2 additions & 2 deletions rpc-test/tests/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn test_rpc_send_tx() {
.parse()
.unwrap();

info!("blockhash: {:?}", blockhash);
info!("blockhash: {blockhash:?}");
let tx = system_transaction::transfer(
&alice,
&bob_pubkey,
Expand Down Expand Up @@ -442,7 +442,7 @@ fn test_rpc_subscriptions() {
sleep(Duration::from_millis(100));
}
if mint_balance != expected_mint_balance {
error!("mint-check timeout. mint_balance {:?}", mint_balance);
error!("mint-check timeout. mint_balance {mint_balance:?}");
}

// Wait for all signature subscriptions
Expand Down
16 changes: 5 additions & 11 deletions rpc/src/optimistically_confirmed_bank_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,7 @@ impl OptimisticallyConfirmedBankTracker {
match sender.send(notification.clone()) {
Ok(_) => {}
Err(err) => {
info!(
"Failed to send notification {:?}, error: {:?}",
notification, err
);
info!("Failed to send notification {notification:?}, error: {err:?}");
}
}
}
Expand Down Expand Up @@ -250,10 +247,7 @@ impl OptimisticallyConfirmedBankTracker {
let root = roots[i];
if root > *newest_root_slot {
let parent = roots[i - 1];
debug!(
"Doing SlotNotification::Root for root {}, parent: {}",
root, parent
);
debug!("Doing SlotNotification::Root for root {root}, parent: {parent}");
Self::notify_slot_status(
slot_notification_subscribers,
SlotNotification::Root((root, parent)),
Expand All @@ -276,7 +270,7 @@ impl OptimisticallyConfirmedBankTracker {
slot_notification_subscribers: &Option<Arc<RwLock<Vec<SlotNotificationSender>>>>,
prioritization_fee_cache: &PrioritizationFeeCache,
) {
debug!("received bank notification: {:?}", notification);
debug!("received bank notification: {notification:?}");
match notification {
BankNotification::OptimisticallyConfirmed(slot) => {
let bank = bank_forks.read().unwrap().get(slot);
Expand Down Expand Up @@ -344,8 +338,8 @@ impl OptimisticallyConfirmedBankTracker {

if pending_optimistically_confirmed_banks.remove(&bank.slot()) {
debug!(
"Calling notify_gossip_subscribers to send deferred notification {:?}",
frozen_slot
"Calling notify_gossip_subscribers to send deferred notification \
{frozen_slot:?}"
);

Self::notify_or_defer_confirmed_banks(
Expand Down
Loading
Loading