Skip to content

Commit

Permalink
Minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
macladson committed Jan 12, 2025
1 parent ac51378 commit e87898d
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 58 deletions.
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/beacon_block_streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ impl<T: BeaconChainTypes> BeaconBlockStreamer<T> {
sent = n_sent,
succeeded = n_success,
failed = (n_sent - n_success),
?engine_requests,
engine_requests,
"BeaconBlockStreamer finished"
);
}
Expand Down
23 changes: 15 additions & 8 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2923,10 +2923,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
Ok(verified) => {
let commitments_formatted = verified.block.commitments_formatted();
debug!(
graffiti = %graffiti_string,
graffiti = graffiti_string,
%slot,
root = ?verified.block_root(),
commitments = %commitments_formatted,
commitments = commitments_formatted,
"Successfully verified gossip block"
);

Expand Down Expand Up @@ -4244,7 +4244,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
debug!(
error = ?e,
epoch = %a.data().target.epoch,
%validator_index,
validator_index,
"Failed to register observed block attester"
)
}
Expand Down Expand Up @@ -4709,7 +4709,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
if proposer_head != head_block_root && proposer_head != head_parent_block_root {
warn!(
block_root = ?proposer_head,
head_block_root =?head_block_root,
head_block_root = ?head_block_root,
"Unable to compute payload attributes"
);
return Ok(None);
Expand Down Expand Up @@ -5834,7 +5834,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
if let Err(e) = fork_choice_result {
crit!(
error = ?e,
latest_valid_ancestor=?op.latest_valid_ancestor(),
latest_valid_ancestor = ?op.latest_valid_ancestor(),
block_root = ?op.block_root(),
"Failed to process invalid payload"
);
Expand Down Expand Up @@ -6445,7 +6445,11 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
state: &BeaconState<T::EthSpec>,
) -> Result<(), BeaconChainError> {
let finalized_checkpoint = state.finalized_checkpoint();
info!(weak_subjectivity_epoch = %wss_checkpoint.epoch, weak_subjectivity_root = ?wss_checkpoint.root,"Verifying the configured weak subjectivity checkpoint");
info!(
weak_subjectivity_epoch = %wss_checkpoint.epoch,
weak_subjectivity_root = ?wss_checkpoint.root,
"Verifying the configured weak subjectivity checkpoint"
);
// If epochs match, simply compare roots.
if wss_checkpoint.epoch == finalized_checkpoint.epoch
&& wss_checkpoint.root != finalized_checkpoint.root
Expand All @@ -6467,15 +6471,18 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
Some(root) => {
if root != wss_checkpoint.root {
crit!(
weak_subjectivity_root =?wss_checkpoint.root,
weak_subjectivity_root = ?wss_checkpoint.root,
finalized_checkpoint_root = ?finalized_checkpoint.root,
"Root found at the specified checkpoint differs"
);
return Err(BeaconChainError::WeakSubjectivtyVerificationFailure);
}
}
None => {
crit!(wss_checkpoint_slot = ?slot, "The root at the start slot of the given epoch could not be found");
crit!(
wss_checkpoint_slot = ?slot,
"The root at the start slot of the given epoch could not be found"
);
return Err(BeaconChainError::WeakSubjectivtyVerificationFailure);
}
}
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/block_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ impl<T: BeaconChainTypes> GossipVerifiedBlock<T> {
let (mut parent, block) = load_parent(block, chain)?;

debug!(
parent_root = %parent.beacon_block_root,
parent_root = ?parent.beacon_block_root,
parent_slot = %parent.beacon_block.slot(),
?block_root,
block_slot = %block.slot(),
Expand Down
1 change: 0 additions & 1 deletion beacon_node/beacon_chain/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,6 @@ mod test {
use std::time::Duration;
use store::config::StoreConfig;
use store::{HotColdDB, MemoryStore};

use task_executor::test_utils::TestRuntime;
use types::{EthSpec, MinimalEthSpec, Slot};

Expand Down
6 changes: 3 additions & 3 deletions beacon_node/beacon_chain/src/canonical_head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1422,13 +1422,13 @@ fn observe_head_block_delays<E: EthSpec, S: SlotClock>(
} else {
debug!(
block_root = ?head_block_root,
proposer_index= head_block_proposer_index,
proposer_index = head_block_proposer_index,
slot = %head_block_slot,
total_delay_ms = block_delay_total.as_millis(),
observed_delay_ms = format_delay(&block_delays.observed),
blob_delay_ms = format_delay(&block_delays.all_blobs_observed),
consensus_time_ms =format_delay(&block_delays.consensus_verification_time),
execution_time_ms= format_delay(&block_delays.execution_time),
consensus_time_ms = format_delay(&block_delays.consensus_verification_time),
execution_time_ms = format_delay(&block_delays.execution_time),
available_delay_ms = format_delay(&block_delays.available),
attestable_delay_ms = format_delay(&block_delays.attestable),
imported_time_ms = format_delay(&block_delays.imported),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ mod test {
.expect("should be deneb fork")
.clone(),
) {
info!(commitment = ?comm ,"kzg commitment");
info!(commitment = ?comm, "kzg commitment");
}
info!("done printing kzg commitments");

Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/execution_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async fn notify_new_payload<T: BeaconChainTypes>(
?validation_error,
?execution_block_hash,
root = ?block.tree_hash_root(),
graffiti =block.body().graffiti().as_utf8_lossy(),
graffiti = block.body().graffiti().as_utf8_lossy(),
proposer_index = block.proposer_index(),
slot = %block.slot(),
method = "new_payload",
Expand Down
9 changes: 6 additions & 3 deletions beacon_node/beacon_chain/src/graffiti_calculator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ async fn engine_version_cache_refresh_service<T: BeaconChainTypes>(
debug!("Engine version cache refresh service firing");

match execution_layer.get_engine_version(None).await {
Err(e) => warn!( error = ?e,"Failed to populate engine version cache"),
Err(e) => warn!( error = ?e, "Failed to populate engine version cache"),
Ok(versions) => {
if versions.is_empty() {
// Empty array indicates the EL doesn't support the method
Expand Down Expand Up @@ -285,7 +285,10 @@ mod tests {
let graffiti_str =
std::str::from_utf8(graffiti_slice).expect("bytes should convert nicely to ascii");

info!(lighthouse_version = lighthouse_version::VERSION, graffiti_str = %graffiti_str, "results");
info!(
lighthouse_version = lighthouse_version::VERSION,
graffiti_str, "results"
);
println!("lighthouse_version: '{}'", lighthouse_version::VERSION);
println!("graffiti_str: '{}'", graffiti_str);

Expand Down Expand Up @@ -322,7 +325,7 @@ mod tests {
std::str::from_utf8(&found_graffiti_bytes[..expected_graffiti_prefix_len])
.expect("bytes should convert nicely to ascii");

info!(%expected_graffiti_string, %found_graffiti_string, "results");
info!(expected_graffiti_string, found_graffiti_string, "results");
println!("expected_graffiti_string: '{}'", expected_graffiti_string);
println!("found_graffiti_string: '{}'", found_graffiti_string);

Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/historical_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {

if blocks_to_import.len() != total_blocks {
debug!(
oldest_block_slot = ?anchor_info.oldest_block_slot,
?total_blocks,
oldest_block_slot = %anchor_info.oldest_block_slot,
total_blocks,
ignored = total_blocks.saturating_sub(blocks_to_import.len()),
"Ignoring some historic blocks"
);
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> BackgroundMigrator<E, Ho
}

debug!(
old_finalized_epoch = ?old_finalized_checkpoint.epoch,
new_finalized_epoch = ?new_finalized_checkpoint.epoch,
old_finalized_epoch = %old_finalized_checkpoint.epoch,
new_finalized_epoch = %new_finalized_checkpoint.epoch,
"Starting database pruning"
);
// For each slot between the new finalized checkpoint and the old finalized checkpoint,
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/state_advance_timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async fn state_advance_timer<T: BeaconChainTypes>(
Err(Error::MaxDistanceExceeded {
current_slot,
head_slot,
}) => debug!(?head_slot, ?current_slot, "Refused to advance head state"),
}) => debug!(%head_slot, %current_slot, "Refused to advance head state"),
other => warn!(
reason = ?other,
"Did not advance head state"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ impl<S: SlotClock> ReprocessQueue<S> {
hint = "system may be overloaded",
?block_root,
failed_to_send_count,
?sent_count,
sent_count,
"Ignored scheduled sampling requests for block"
);
}
Expand Down
7 changes: 3 additions & 4 deletions beacon_node/http_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub use publish_blocks::{
publish_blinded_block, publish_block, reconstruct_block, ProvenancedBlock,
};
use serde::{Deserialize, Serialize};

use slot_clock::SlotClock;
use ssz::Encode;
pub use state_id::StateId;
Expand Down Expand Up @@ -2157,7 +2156,7 @@ pub fn serve<T: BeaconChainTypes>(
}
Err(e) => {
warn!(
%validator_index,
validator_index,
reason = ?e,
source = "HTTP",
"Invalid BLS to execution change"
Expand Down Expand Up @@ -3452,7 +3451,7 @@ pub fn serve<T: BeaconChainTypes>(
request_index = index,
aggregator_index = aggregate.message().aggregator_index(),
attestation_index = aggregate.message().aggregate().committee_index(),
attestation_slot = ?aggregate.message().aggregate().data().slot,
attestation_slot = %aggregate.message().aggregate().data().slot,
"Failure verifying aggregate and proofs"
);
failures.push(api_types::Failure::new(index, format!("Verification: {:?}", e)));
Expand All @@ -3473,7 +3472,7 @@ pub fn serve<T: BeaconChainTypes>(
request_index = index,
aggregator_index = verified_aggregate.aggregate().message().aggregator_index(),
attestation_index = verified_aggregate.attestation().committee_index(),
attestation_slot = ?verified_aggregate.attestation().data().slot,
attestation_slot = %verified_aggregate.attestation().data().slot,
"Failure applying verified aggregate attestation to fork choice"
);
failures.push(api_types::Failure::new(index, format!("Fork choice: {:?}", e)));
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/http_api/src/publish_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub async fn publish_block<T: BeaconChainTypes, B: IntoGossipVerifiedBlock<T>>(
};
let block = unverified_block.inner_block();

debug!( slot = %block.slot(), "Signed block received in HTTP API");
debug!(slot = %block.slot(), "Signed block received in HTTP API");

/* actually publish a block */
let publish_block_p2p = move |block: Arc<SignedBeaconBlock<T::EthSpec>>,
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/lighthouse_network/src/discovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ impl<E: EthSpec> NetworkBehaviour for Discovery<E> {
*/
}
discv5::Event::SocketUpdated(socket_addr) => {
info!( ip = %socket_addr.ip(), udp_port = %socket_addr.port(),"Address updated");
info!(ip = %socket_addr.ip(), udp_port = %socket_addr.port(),"Address updated");
metrics::inc_counter(&metrics::ADDRESS_UPDATE_COUNT);
// Discv5 will have updated our local ENR. We save the updated version
// to disk.
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/lighthouse_network/src/peer_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ impl<E: EthSpec> PeerManager<E> {
) {
let client = self.network_globals.client(peer_id);
let score = self.network_globals.peers.read().score(peer_id);
debug!( %protocol, %err, %client, %peer_id, %score, ?direction, "RPC Error");
debug!(%protocol, %err, %client, %peer_id, %score, ?direction, "RPC Error");
metrics::inc_counter_vec(
&metrics::TOTAL_RPC_ERRORS_PER_CLIENT,
&[
Expand Down
33 changes: 26 additions & 7 deletions beacon_node/lighthouse_network/src/peer_manager/peerdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ impl<E: EthSpec> PeerDB<E> {
.checked_duration_since(Instant::now())
.map(|duration| duration.as_secs())
.unwrap_or_else(|| 0);
debug!(%peer_id, future_min_ttl_secs = min_ttl_secs,"Updating the time a peer is required for");
debug!(%peer_id, future_min_ttl_secs = min_ttl_secs, "Updating the time a peer is required for");
}
}

Expand Down Expand Up @@ -633,7 +633,7 @@ impl<E: EthSpec> PeerDB<E> {
.checked_duration_since(Instant::now())
.map(|duration| duration.as_secs())
.unwrap_or_else(|| 0);
trace!(%peer_id,min_ttl_secs,"Updating minimum duration a peer is required for");
trace!(%peer_id, min_ttl_secs, "Updating minimum duration a peer is required for");
});
}

Expand Down Expand Up @@ -1076,7 +1076,7 @@ impl<E: EthSpec> PeerDB<E> {
self.banned_peers_count = BannedPeersCount::default();
None
} {
debug!(%to_drop, "Removing old banned peer");
debug!(peer_id = %to_drop, "Removing old banned peer");
self.peers.remove(&to_drop);
unbanned_peers.push((to_drop, unbanned_ips))
}
Expand All @@ -1095,7 +1095,11 @@ impl<E: EthSpec> PeerDB<E> {
.min_by_key(|(_, age)| *age)
.map(|(id, _)| *id)
{
debug!(peer_id = %to_drop, disconnected_size = self.disconnected_peers.saturating_sub(1),"Removing old disconnected peer");
debug!(
peer_id = %to_drop,
disconnected_size = self.disconnected_peers.saturating_sub(1),
"Removing old disconnected peer"
);
self.peers.remove(&to_drop);
}
// If there is no minimum, this is a coding error. For safety we decrease
Expand All @@ -1119,7 +1123,12 @@ impl<E: EthSpec> PeerDB<E> {
ScoreTransitionResult::Banned
}
(ScoreState::ForcedDisconnect, ScoreState::Banned | ScoreState::Healthy) => {
debug!(%peer_id, score = %info.score(), past_score_state = %previous_state, "Peer transitioned to forced disconnect score state");
debug!(
%peer_id,
score = %info.score(),
past_score_state = %previous_state,
"Peer transitioned to forced disconnect score state"
);
// disconnect the peer if it's currently connected or dialing
if info.is_connected_or_dialing() {
ScoreTransitionResult::Disconnected
Expand All @@ -1132,11 +1141,21 @@ impl<E: EthSpec> PeerDB<E> {
}
}
(ScoreState::Healthy, ScoreState::ForcedDisconnect) => {
debug!(%peer_id, score = %info.score(), past_score_state = %previous_state, "Peer transitioned to healthy score state");
debug!(
%peer_id,
score = %info.score(),
past_score_state = %previous_state,
"Peer transitioned to healthy score state"
);
ScoreTransitionResult::NoAction
}
(ScoreState::Healthy, ScoreState::Banned) => {
debug!( %peer_id, score = %info.score(), past_score_state = %previous_state, "Peer transitioned to healthy score state");
debug!(
%peer_id,
score = %info.score(),
past_score_state = %previous_state,
"Peer transitioned to healthy score state"
);
// unban the peer if it was previously banned.
ScoreTransitionResult::Unbanned
}
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/lighthouse_network/src/rpc/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ where
let Some(inbound_info) = self.inbound_substreams.get_mut(&inbound_id) else {
if !matches!(response, RpcResponse::StreamTermination(..)) {
// the stream is closed after sending the expected number of responses
trace!(%response, id = ?inbound_id,"Inbound stream has expired. Response not sent");
trace!(%response, id = ?inbound_id, "Inbound stream has expired. Response not sent");
}
return;
};
Expand Down
4 changes: 0 additions & 4 deletions beacon_node/lighthouse_network/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,6 @@ where
(),
);

// let log = self
// .log
// .new(slog::o!("peer_id" => peer_id.to_string(), "connection_id" => connection_id.to_string()));

let handler = RPCHandler::new(
protocol,
self.fork_context.clone(),
Expand Down
Loading

0 comments on commit e87898d

Please sign in to comment.