add better logging

This commit is contained in:
Eitan Seri-Levi
2025-03-27 14:00:55 -06:00
parent 19d43a2a8e
commit 7d699224cb
6 changed files with 34 additions and 3 deletions

1
Cargo.lock generated
View File

@@ -6820,6 +6820,7 @@ dependencies = [
"serde",
"serde_yaml",
"superstruct",
"tracing",
"types",
]

View File

@@ -19,6 +19,7 @@ use types::{
AbstractExecPayload, BeaconBlockRef, BeaconState, BeaconStateError, Checkpoint, Epoch, EthSpec,
FixedBytesExtended, Hash256, Slot,
};
use tracing::info;
#[derive(Debug)]
pub enum Error {
@@ -352,6 +353,11 @@ where
}
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
.insert(slot, block_root);
}

View File

@@ -24,7 +24,7 @@ use state_processing::per_block_processing::{
};
use std::sync::Arc;
use tokio::task::JoinHandle;
use tracing::{debug, warn};
use tracing::{debug, warn, info};
use tree_hash::TreeHash;
use types::payload::BlockProductionVersion;
use types::*;
@@ -164,6 +164,11 @@ async fn notify_new_payload<T: BeaconChainTypes>(
.ok_or(ExecutionPayloadError::NoExecutionConnection)?;
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
.notify_new_payload(NewPayloadRequest::try_from_block_and_il_transactions(
block,
@@ -217,7 +222,11 @@ async fn notify_new_payload<T: BeaconChainTypes>(
// transactions for this slot, update the fork choice store before processing
// the invalid EL payload.
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
.set_unsatisfied_inclusion_list_block(
block.slot(),

View File

@@ -196,7 +196,8 @@ fn verify_and_publish_inclusion_list<T: BeaconChainTypes>(
info!(
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?

View File

@@ -16,3 +16,4 @@ serde = { workspace = true }
serde_yaml = { workspace = true }
superstruct = { workspace = true }
types = { workspace = true }
tracing = { workspace = true }

View File

@@ -10,6 +10,7 @@ use types::{
AttestationShufflingId, ChainSpec, Checkpoint, Epoch, EthSpec, ExecutionBlockHash,
FixedBytesExtended, Hash256, Slot,
};
use tracing::info;
// Define a "legacy" implementation of `Option<usize>` which uses four bytes for encoding the union
// selector.
@@ -197,6 +198,7 @@ impl ProtoArray {
let execution_status_is_invalid = node.execution_status.is_invalid();
// TODO(focil) seems sketchy...
// TODO(focil) improve loggings
// modify is viable for head
// debug/fork_choice
let mut node_delta = if execution_status_is_invalid
@@ -206,6 +208,12 @@ impl ProtoArray {
.get(&current_slot)
.unwrap_or(&Hash256::ZERO)
{
info!(
root = %node.root,
?current_slot,
is_unsatisfied_il_block = self.unsatisfied_inclusion_list_blocks.contains_key(&current_slot),
"Potentially unsatisfied IL block",
);
// If the node has an invalid execution payload, or the payload doesn't satisfy
// an inclusion list, reduce its weight to zero.
0_i64
@@ -905,6 +913,11 @@ impl ProtoArray {
.get(&current_slot)
.unwrap_or(&Hash256::ZERO)
{
info!(
?current_slot,
source = "node_is_viable_for_head",
"this block doesn't satisfy the inclusion list"
);
return false;
}