Skip to content

Commit d468365

Browse files
committed
Rewrite submit_block relay communication to support SSZ and JSON
content negotiation. Includes: - SSZ-first request encoding with JSON fallback on 406/415 - Content-Type and Eth-Consensus-Version header handling - Fork-aware SSZ decoding for relay responses - MIME parameter tolerance on relay response Content-Type - v2 to v1 fallback forwards payload to BN (prevents silent block loss) - V2 fallback metric counter - Comprehensive submit_block integration tests for both encodings
1 parent 760221e commit d468365

6 files changed

Lines changed: 939 additions & 185 deletions

File tree

crates/pbs/src/metrics.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,14 @@ lazy_static! {
6060
&["http_status_code", "endpoint"],
6161
PBS_METRICS_REGISTRY
6262
).unwrap();
63+
64+
/// Count of v2 submit_block requests that fell back to the v1 endpoint
65+
/// because the relay returned 404 on v2. A high value indicates the relay
66+
/// fleet has not been upgraded to support submitBlindedBlockV2.
67+
pub static ref V2_FALLBACK_TO_V1: IntCounterVec = register_int_counter_vec_with_registry!(
68+
"pbs_submit_block_v2_fallback_to_v1_total",
69+
"Count of v2 submit_block requests that fell back to v1 because the relay did not support v2",
70+
&["relay_id"],
71+
PBS_METRICS_REGISTRY
72+
).unwrap();
6373
}

0 commit comments

Comments
 (0)