mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
add better logging
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -6820,6 +6820,7 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_yaml",
|
"serde_yaml",
|
||||||
"superstruct",
|
"superstruct",
|
||||||
|
"tracing",
|
||||||
"types",
|
"types",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ use types::{
|
|||||||
AbstractExecPayload, BeaconBlockRef, BeaconState, BeaconStateError, Checkpoint, Epoch, EthSpec,
|
AbstractExecPayload, BeaconBlockRef, BeaconState, BeaconStateError, Checkpoint, Epoch, EthSpec,
|
||||||
FixedBytesExtended, Hash256, Slot,
|
FixedBytesExtended, Hash256, Slot,
|
||||||
};
|
};
|
||||||
|
use tracing::info;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
@@ -352,6 +353,11 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn set_unsatisfied_inclusion_list_block(&mut self, slot: Slot, block_root: Hash256) {
|
fn set_unsatisfied_inclusion_list_block(&mut self, slot: Slot, block_root: Hash256) {
|
||||||
|
info!(
|
||||||
|
?slot,
|
||||||
|
%block_root,
|
||||||
|
"Set unsatisfied inclusion list block"
|
||||||
|
);
|
||||||
self.unsatisfied_inclusion_list_blocks
|
self.unsatisfied_inclusion_list_blocks
|
||||||
.insert(slot, block_root);
|
.insert(slot, block_root);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ use state_processing::per_block_processing::{
|
|||||||
};
|
};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::task::JoinHandle;
|
use tokio::task::JoinHandle;
|
||||||
use tracing::{debug, warn};
|
use tracing::{debug, warn, info};
|
||||||
use tree_hash::TreeHash;
|
use tree_hash::TreeHash;
|
||||||
use types::payload::BlockProductionVersion;
|
use types::payload::BlockProductionVersion;
|
||||||
use types::*;
|
use types::*;
|
||||||
@@ -164,6 +164,11 @@ async fn notify_new_payload<T: BeaconChainTypes>(
|
|||||||
.ok_or(ExecutionPayloadError::NoExecutionConnection)?;
|
.ok_or(ExecutionPayloadError::NoExecutionConnection)?;
|
||||||
|
|
||||||
let execution_block_hash = block.execution_payload()?.block_hash();
|
let execution_block_hash = block.execution_payload()?.block_hash();
|
||||||
|
|
||||||
|
info!(
|
||||||
|
il_tx_count = il_transactions.len(),
|
||||||
|
"Submit new payload with il_transactions"
|
||||||
|
);
|
||||||
let new_payload_response = execution_layer
|
let new_payload_response = execution_layer
|
||||||
.notify_new_payload(NewPayloadRequest::try_from_block_and_il_transactions(
|
.notify_new_payload(NewPayloadRequest::try_from_block_and_il_transactions(
|
||||||
block,
|
block,
|
||||||
@@ -217,7 +222,11 @@ async fn notify_new_payload<T: BeaconChainTypes>(
|
|||||||
// transactions for this slot, update the fork choice store before processing
|
// transactions for this slot, update the fork choice store before processing
|
||||||
// the invalid EL payload.
|
// the invalid EL payload.
|
||||||
if *validation_error == Some("INVALID_INCLUSION_LIST".to_string()) {
|
if *validation_error == Some("INVALID_INCLUSION_LIST".to_string()) {
|
||||||
debug!("Unsatisfied inclusion list");
|
debug!(
|
||||||
|
slot = ?block.slot(),
|
||||||
|
blocK_root = %block.tree_hash_root(),
|
||||||
|
"Unsatisfied inclusion list"
|
||||||
|
);
|
||||||
chain
|
chain
|
||||||
.set_unsatisfied_inclusion_list_block(
|
.set_unsatisfied_inclusion_list_block(
|
||||||
block.slot(),
|
block.slot(),
|
||||||
|
|||||||
@@ -196,7 +196,8 @@ fn verify_and_publish_inclusion_list<T: BeaconChainTypes>(
|
|||||||
|
|
||||||
info!(
|
info!(
|
||||||
slot = ?verified_inclusion_list.signed_il.message.slot,
|
slot = ?verified_inclusion_list.signed_il.message.slot,
|
||||||
"Published inclusion list"
|
validator_index = verified_inclusion_list.signed_il.message.validator_index,
|
||||||
|
"Verified inclusion list and republished"
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO(focil) add reprocess logic?
|
// TODO(focil) add reprocess logic?
|
||||||
|
|||||||
@@ -16,3 +16,4 @@ serde = { workspace = true }
|
|||||||
serde_yaml = { workspace = true }
|
serde_yaml = { workspace = true }
|
||||||
superstruct = { workspace = true }
|
superstruct = { workspace = true }
|
||||||
types = { workspace = true }
|
types = { workspace = true }
|
||||||
|
tracing = { workspace = true }
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ use types::{
|
|||||||
AttestationShufflingId, ChainSpec, Checkpoint, Epoch, EthSpec, ExecutionBlockHash,
|
AttestationShufflingId, ChainSpec, Checkpoint, Epoch, EthSpec, ExecutionBlockHash,
|
||||||
FixedBytesExtended, Hash256, Slot,
|
FixedBytesExtended, Hash256, Slot,
|
||||||
};
|
};
|
||||||
|
use tracing::info;
|
||||||
|
|
||||||
// Define a "legacy" implementation of `Option<usize>` which uses four bytes for encoding the union
|
// Define a "legacy" implementation of `Option<usize>` which uses four bytes for encoding the union
|
||||||
// selector.
|
// selector.
|
||||||
@@ -197,6 +198,7 @@ impl ProtoArray {
|
|||||||
let execution_status_is_invalid = node.execution_status.is_invalid();
|
let execution_status_is_invalid = node.execution_status.is_invalid();
|
||||||
|
|
||||||
// TODO(focil) seems sketchy...
|
// TODO(focil) seems sketchy...
|
||||||
|
// TODO(focil) improve loggings
|
||||||
// modify is viable for head
|
// modify is viable for head
|
||||||
// debug/fork_choice
|
// debug/fork_choice
|
||||||
let mut node_delta = if execution_status_is_invalid
|
let mut node_delta = if execution_status_is_invalid
|
||||||
@@ -206,6 +208,12 @@ impl ProtoArray {
|
|||||||
.get(¤t_slot)
|
.get(¤t_slot)
|
||||||
.unwrap_or(&Hash256::ZERO)
|
.unwrap_or(&Hash256::ZERO)
|
||||||
{
|
{
|
||||||
|
info!(
|
||||||
|
root = %node.root,
|
||||||
|
?current_slot,
|
||||||
|
is_unsatisfied_il_block = self.unsatisfied_inclusion_list_blocks.contains_key(¤t_slot),
|
||||||
|
"Potentially unsatisfied IL block",
|
||||||
|
);
|
||||||
// If the node has an invalid execution payload, or the payload doesn't satisfy
|
// If the node has an invalid execution payload, or the payload doesn't satisfy
|
||||||
// an inclusion list, reduce its weight to zero.
|
// an inclusion list, reduce its weight to zero.
|
||||||
0_i64
|
0_i64
|
||||||
@@ -905,6 +913,11 @@ impl ProtoArray {
|
|||||||
.get(¤t_slot)
|
.get(¤t_slot)
|
||||||
.unwrap_or(&Hash256::ZERO)
|
.unwrap_or(&Hash256::ZERO)
|
||||||
{
|
{
|
||||||
|
info!(
|
||||||
|
?current_slot,
|
||||||
|
source = "node_is_viable_for_head",
|
||||||
|
"this block doesn't satisfy the inclusion list"
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user