Skip to content

Commit aa080ba

Browse files
authored
CBST-19: missing relays warning (#185)
1 parent d2a882d commit aa080ba

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

crates/common/src/pbs/event.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ pub enum BuilderEvent {
3131
GetStatusResponse,
3232
SubmitBlockRequest(Box<SignedBlindedBeaconBlock>),
3333
SubmitBlockResponse(Box<SubmitBlindedBlockResponse>),
34-
MissedPayload { block_hash: B256, relays: String },
34+
MissedPayload {
35+
/// Hash for the block for which no payload was received
36+
block_hash: B256,
37+
/// Relays which delivered the header but for which no payload was
38+
/// received
39+
missing_relays: String,
40+
},
3541
RegisterValidatorRequest(Vec<ValidatorRegistration>),
3642
RegisterValidatorResponse,
3743
}

crates/pbs/src/routes/submit_block.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,21 @@ pub async fn handle_submit_block<S: BuilderApiState, A: BuilderApi<S>>(
4949

5050
Err(err) => {
5151
if let Some(fault_pubkeys) = state.get_relays_by_block_hash(slot, block_hash) {
52-
let fault_relays = state
52+
let missing_relays = state
5353
.relays()
5454
.iter()
5555
.filter(|relay| fault_pubkeys.contains(&relay.pubkey()))
5656
.map(|relay| &**relay.id)
5757
.collect::<Vec<_>>()
5858
.join(",");
5959

60-
error!(%err, %block_hash, fault_relays, "CRITICAL: no payload received from relays");
61-
state.publish_event(BuilderEvent::MissedPayload {
62-
block_hash,
63-
relays: fault_relays,
64-
});
60+
error!(%err, %block_hash, missing_relays, "CRITICAL: no payload received from relays");
61+
state.publish_event(BuilderEvent::MissedPayload { block_hash, missing_relays });
6562
} else {
6663
error!(%err, %block_hash, "CRITICAL: no payload delivered and no relay for block hash. Was getHeader even called?");
6764
state.publish_event(BuilderEvent::MissedPayload {
6865
block_hash,
69-
relays: String::default(),
66+
missing_relays: String::default(),
7067
});
7168
};
7269

0 commit comments

Comments
 (0)