Skip to content

Commit 17d9a62

Browse files
committed
Add more logs in the BN HTTP API during block production (#4025)
## Issue Addressed NA ## Proposed Changes Adds two new `DEBG` logs to the HTTP API: 1. As soon as we are requested to produce a block. 2. As soon as a signed block is received. In #3858 we added some very helpful logs to the VC so we could see when things are happening with block proposals in the VC. After doing some more debugging, I found that I can tell when the VC is sending a block but I *can't* tell the time that the BN receives it (I can only get the time after the BN has started doing some work with the block). Knowing when the VC published and as soon as the BN receives is useful for determining the delays introduced by network latency (and some other things like JSON decoding, etc). ## Additional Info NA
1 parent 0155455 commit 17d9a62

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

beacon_node/http_api/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2380,11 +2380,19 @@ pub fn serve<T: BeaconChainTypes>(
23802380
.and(not_while_syncing_filter.clone())
23812381
.and(warp::query::<api_types::ValidatorBlocksQuery>())
23822382
.and(chain_filter.clone())
2383+
.and(log_filter.clone())
23832384
.and_then(
23842385
|endpoint_version: EndpointVersion,
23852386
slot: Slot,
23862387
query: api_types::ValidatorBlocksQuery,
2387-
chain: Arc<BeaconChain<T>>| async move {
2388+
chain: Arc<BeaconChain<T>>,
2389+
log: Logger| async move {
2390+
debug!(
2391+
log,
2392+
"Block production request from HTTP API";
2393+
"slot" => slot
2394+
);
2395+
23882396
let randao_reveal = query.randao_reveal.decompress().map_err(|e| {
23892397
warp_utils::reject::custom_bad_request(format!(
23902398
"randao reveal is not a valid BLS signature: {:?}",

beacon_node/http_api/src/publish_blocks.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use beacon_chain::{
55
};
66
use lighthouse_network::{PubsubMessage, SignedBeaconBlockAndBlobsSidecar};
77
use network::NetworkMessage;
8-
use slog::{error, info, warn, Logger};
8+
use slog::{debug, error, info, warn, Logger};
99
use slot_clock::SlotClock;
1010
use std::sync::Arc;
1111
use tokio::sync::mpsc::UnboundedSender;
@@ -27,6 +27,12 @@ pub async fn publish_block<T: BeaconChainTypes>(
2727
) -> Result<(), Rejection> {
2828
let seen_timestamp = timestamp_now();
2929

30+
debug!(
31+
log,
32+
"Signed block published to HTTP API";
33+
"slot" => block.slot()
34+
);
35+
3036
// Send the block, regardless of whether or not it is valid. The API
3137
// specification is very clear that this is the desired behaviour.
3238

0 commit comments

Comments
 (0)