mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Add additional logs to validator client
This commit is contained in:
@@ -26,7 +26,7 @@ slot_clock = { path = "../eth2/utils/slot_clock" }
|
||||
types = { path = "../eth2/types" }
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
slog = "^2.2.3"
|
||||
slog = { version = "^2.2.3" , features = ["max_level_trace", "release_max_level_trace"] }
|
||||
slog-async = "^2.3.0"
|
||||
slog-json = "^2.3"
|
||||
slog-term = "^2.4.0"
|
||||
|
||||
@@ -232,7 +232,11 @@ impl Config {
|
||||
let keypairs = match &self.key_source {
|
||||
KeySource::Disk => self.fetch_keys_from_disk(log)?,
|
||||
KeySource::TestingKeypairRange(range) => {
|
||||
warn!(log, "Using insecure private keys");
|
||||
warn!(
|
||||
log,
|
||||
"Using insecure interop private keys";
|
||||
"range" => format!("{:?}", range)
|
||||
);
|
||||
self.fetch_testing_keypairs(range.clone())?
|
||||
}
|
||||
KeySource::YamlKeypairs(path) => {
|
||||
|
||||
@@ -82,7 +82,8 @@ fn main() {
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("server-grpc-port")
|
||||
.long("g")
|
||||
.long("server-grpc-port")
|
||||
.short("g")
|
||||
.value_name("PORT")
|
||||
.help("Port to use for gRPC API connection to the server.")
|
||||
.default_value(DEFAULT_SERVER_GRPC_PORT)
|
||||
@@ -90,7 +91,8 @@ fn main() {
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("server-http-port")
|
||||
.long("h")
|
||||
.long("server-http-port")
|
||||
.short("h")
|
||||
.value_name("PORT")
|
||||
.help("Port to use for HTTP API connection to the server.")
|
||||
.default_value(DEFAULT_SERVER_HTTP_PORT)
|
||||
@@ -104,7 +106,7 @@ fn main() {
|
||||
.help("The title of the spec constants for chain config.")
|
||||
.takes_value(true)
|
||||
.possible_values(&["info", "debug", "trace", "warn", "error", "crit"])
|
||||
.default_value("info"),
|
||||
.default_value("trace"),
|
||||
)
|
||||
/*
|
||||
* The "testnet" sub-command.
|
||||
@@ -152,7 +154,9 @@ fn main() {
|
||||
Some("crit") => drain.filter_level(Level::Critical),
|
||||
_ => unreachable!("guarded by clap"),
|
||||
};
|
||||
|
||||
let mut log = slog::Logger::root(drain.fuse(), o!());
|
||||
|
||||
let (client_config, eth2_config) = match get_configs(&matches, &mut log) {
|
||||
Ok(tuple) => tuple,
|
||||
Err(e) => {
|
||||
|
||||
@@ -22,7 +22,7 @@ use protos::services_grpc::{
|
||||
AttestationServiceClient, BeaconBlockServiceClient, BeaconNodeServiceClient,
|
||||
ValidatorServiceClient,
|
||||
};
|
||||
use slog::{crit, error, info, warn};
|
||||
use slog::{crit, error, info, trace, warn};
|
||||
use slot_clock::{SlotClock, SystemTimeSlotClock};
|
||||
use std::marker::PhantomData;
|
||||
use std::sync::Arc;
|
||||
@@ -289,6 +289,11 @@ impl<B: BeaconNodeDuties + 'static, S: Signer + 'static, E: EthSpec> Service<B,
|
||||
/* process any required duties for validators */
|
||||
self.process_duties();
|
||||
|
||||
trace!(
|
||||
self.log,
|
||||
"Per slot execution finished";
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -328,6 +333,13 @@ impl<B: BeaconNodeDuties + 'static, S: Signer + 'static, E: EthSpec> Service<B,
|
||||
.current_slot
|
||||
.expect("The current slot must be updated before checking for duties")
|
||||
.epoch(self.slots_per_epoch);
|
||||
|
||||
trace!(
|
||||
self.log,
|
||||
"Checking for duties";
|
||||
"epoch" => current_epoch
|
||||
);
|
||||
|
||||
// spawn a new thread separate to the runtime
|
||||
// TODO: Handle thread termination/timeout
|
||||
// TODO: Add duties thread back in, with channel to process duties in duty change.
|
||||
@@ -345,6 +357,12 @@ impl<B: BeaconNodeDuties + 'static, S: Signer + 'static, E: EthSpec> Service<B,
|
||||
self.current_slot
|
||||
.expect("The current slot must be updated before processing duties"),
|
||||
) {
|
||||
trace!(
|
||||
self.log,
|
||||
"Processing duties";
|
||||
"work_items" => work.len()
|
||||
);
|
||||
|
||||
for (signer_index, work_type) in work {
|
||||
if work_type.produce_block {
|
||||
// we need to produce a block
|
||||
|
||||
Reference in New Issue
Block a user