Skip to content

Commit

Permalink
Merge branch 'unstable' of https://github.com/sigp/lighthouse into sy…
Browse files Browse the repository at this point in the history
…nc-merged-lookup
  • Loading branch information
realbigsean committed Apr 30, 2024
2 parents 13bc011 + c8ffafb commit c309c07
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 26 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions beacon_node/network/src/network_beacon_processor/gossip_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,24 +778,28 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
"block_root" => %block_root,
);
}
Err(BlockError::BlockIsAlreadyKnown(_)) => {
debug!(
self.log,
"Ignoring gossip blob already imported";
"block_root" => ?block_root,
"blob_index" => blob_index,
);
}
Err(err) => {
debug!(
self.log,
"Invalid gossip blob";
"outcome" => ?err,
"block root" => ?block_root,
"block slot" => blob_slot,
"blob index" => blob_index,
"block_root" => ?block_root,
"block_slot" => blob_slot,
"blob_index" => blob_index,
);
self.gossip_penalize_peer(
peer_id,
PeerAction::MidToleranceError,
"bad_gossip_blob_ssz",
);
trace!(
self.log,
"Invalid gossip blob ssz";
);
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions beacon_node/network/src/sync/backfill_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@ pub enum ProcessResult {
}

/// The ways a backfill sync can fail.
// The info in the enum variants is displayed in logging, clippy thinks it's dead code.
#[derive(Debug)]
pub enum BackFillError {
/// A batch failed to be downloaded.
BatchDownloadFailed(BatchId),
BatchDownloadFailed(#[allow(dead_code)] BatchId),
/// A batch could not be processed.
BatchProcessingFailed(BatchId),
BatchProcessingFailed(#[allow(dead_code)] BatchId),
/// A batch entered an invalid state.
BatchInvalidState(BatchId, String),
BatchInvalidState(#[allow(dead_code)] BatchId, #[allow(dead_code)] String),
/// The sync algorithm entered an invalid state.
InvalidSyncState(String),
InvalidSyncState(#[allow(dead_code)] String),
/// The chain became paused.
Paused,
}
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/src/sync/block_lookups/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl<T: BeaconChainTypes> RequestState<T> for BlockRequestState<T::EthSpec> {
}
}

impl<T: BeaconChainTypes> RequestState<T> for BlobRequestState<T::EthSpec> {
impl<T: BeaconChainTypes> RequestState<T> for BlobRequestState {
type RequestType = BlobsByRootSingleBlockRequest;
type VerifiedResponseType = FixedBlobSidecarList<T::EthSpec>;

Expand Down
8 changes: 4 additions & 4 deletions common/logging/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ pub fn create_tracing_layer(base_tracing_log_path: PathBuf) {
return;
};

let (libp2p_non_blocking_writer, libp2p_guard) = NonBlocking::new(libp2p_writer);
let (discv5_non_blocking_writer, discv5_guard) = NonBlocking::new(discv5_writer);
let (libp2p_non_blocking_writer, _libp2p_guard) = NonBlocking::new(libp2p_writer);
let (discv5_non_blocking_writer, _discv5_guard) = NonBlocking::new(discv5_writer);

let custom_layer = LoggingLayer {
libp2p_non_blocking_writer,
libp2p_guard,
_libp2p_guard,
discv5_non_blocking_writer,
discv5_guard,
_discv5_guard,
};

if let Err(e) = tracing_subscriber::fmt()
Expand Down
4 changes: 2 additions & 2 deletions common/logging/src/tracing_logging_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use tracing_subscriber::Layer;

pub struct LoggingLayer {
pub libp2p_non_blocking_writer: NonBlocking,
pub libp2p_guard: WorkerGuard,
pub _libp2p_guard: WorkerGuard,
pub discv5_non_blocking_writer: NonBlocking,
pub discv5_guard: WorkerGuard,
pub _discv5_guard: WorkerGuard,
}

impl<S> Layer<S> for LoggingLayer
Expand Down
1 change: 1 addition & 0 deletions validator_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ sysinfo = { workspace = true }
system_health = { path = "../common/system_health" }
logging = { workspace = true }
strum = { workspace = true }
fdlimit = "0.3.0"
11 changes: 6 additions & 5 deletions validator_client/src/duties_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ const _: () = assert!({
/// bringing in the entire crate.
const _: () = assert!(ATTESTATION_SUBSCRIPTION_OFFSETS[0] > 2);

// The info in the enum variants is displayed in logging, clippy thinks it's dead code.
#[derive(Debug)]
pub enum Error {
UnableToReadSlotClock,
FailedToDownloadAttesters(String),
FailedToProduceSelectionProof(ValidatorStoreError),
InvalidModulo(ArithError),
Arith(ArithError),
SyncDutiesNotFound(u64),
FailedToDownloadAttesters(#[allow(dead_code)] String),
FailedToProduceSelectionProof(#[allow(dead_code)] ValidatorStoreError),
InvalidModulo(#[allow(dead_code)] ArithError),
Arith(#[allow(dead_code)] ArithError),
SyncDutiesNotFound(#[allow(dead_code)] u64),
}

impl From<ArithError> for Error {
Expand Down
4 changes: 2 additions & 2 deletions validator_client/src/http_metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use warp::{http::Response, Filter};

#[derive(Debug)]
pub enum Error {
Warp(warp::Error),
Other(String),
Warp(#[allow(dead_code)] warp::Error),
Other(#[allow(dead_code)] String),
}

impl From<warp::Error> for Error {
Expand Down
23 changes: 22 additions & 1 deletion validator_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use notifier::spawn_notifier;
use parking_lot::RwLock;
use preparation_service::{PreparationService, PreparationServiceBuilder};
use reqwest::Certificate;
use slog::{error, info, warn, Logger};
use slog::{debug, error, info, warn, Logger};
use slot_clock::SlotClock;
use slot_clock::SystemTimeSlotClock;
use std::fs::File;
Expand Down Expand Up @@ -121,6 +121,27 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
pub async fn new(context: RuntimeContext<E>, config: Config) -> Result<Self, String> {
let log = context.log().clone();

// Attempt to raise soft fd limit. The behavior is OS specific:
// `linux` - raise soft fd limit to hard
// `macos` - raise soft fd limit to `min(kernel limit, hard fd limit)`
// `windows` & rest - noop
match fdlimit::raise_fd_limit().map_err(|e| format!("Unable to raise fd limit: {}", e))? {
fdlimit::Outcome::LimitRaised { from, to } => {
debug!(
log,
"Raised soft open file descriptor resource limit";
"old_limit" => from,
"new_limit" => to
);
}
fdlimit::Outcome::Unsupported => {
debug!(
log,
"Raising soft open file descriptor resource limit is not supported"
);
}
};

info!(
log,
"Starting validator client";
Expand Down

0 comments on commit c309c07

Please sign in to comment.