Skip to content

Commit 6817c85

Browse files
committed
Resolve merge conflicts
2 parents 6c7c99d + f584521 commit 6817c85

File tree

7 files changed

+103
-35
lines changed

7 files changed

+103
-35
lines changed

beacon_node/beacon_chain/src/fetch_blobs/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,24 @@ async fn fetch_and_process_blobs_v2<T: BeaconChainTypes>(
247247

248248
metrics::observe(&metrics::BLOBS_FROM_EL_EXPECTED, num_expected_blobs as f64);
249249
debug!(num_expected_blobs, "Fetching blobs from the EL");
250+
251+
// Track request count and duration for standardized metrics
252+
inc_counter(&metrics::BEACON_ENGINE_GET_BLOBS_V2_REQUESTS_TOTAL);
253+
let _timer =
254+
metrics::start_timer(&metrics::BEACON_ENGINE_GET_BLOBS_V2_REQUEST_DURATION_SECONDS);
255+
250256
let response = chain_adapter
251257
.get_blobs_v2(versioned_hashes)
252258
.await
253259
.inspect_err(|_| {
254260
inc_counter(&metrics::BLOBS_FROM_EL_ERROR_TOTAL);
255261
})?;
256262

263+
drop(_timer);
264+
265+
// Track successful response
266+
inc_counter(&metrics::BEACON_ENGINE_GET_BLOBS_V2_RESPONSES_TOTAL);
267+
257268
let Some(blobs_and_proofs) = response else {
258269
debug!(num_expected_blobs, "No blobs fetched from the EL");
259270
inc_counter(&metrics::BLOBS_FROM_EL_MISS_TOTAL);

beacon_node/beacon_chain/src/metrics.rs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,10 +1613,9 @@ pub static BLOB_SIDECAR_INCLUSION_PROOF_COMPUTATION: LazyLock<Result<Histogram>>
16131613
)
16141614
});
16151615
pub static DATA_COLUMN_SIDECAR_COMPUTATION: LazyLock<Result<HistogramVec>> = LazyLock::new(|| {
1616-
try_create_histogram_vec_with_buckets(
1616+
try_create_histogram_vec(
16171617
"beacon_data_column_sidecar_computation_seconds",
16181618
"Time taken to compute data column sidecar, including cells, proofs and inclusion proof",
1619-
Ok(vec![0.1, 0.15, 0.25, 0.35, 0.5, 0.7, 1.0, 2.5, 5.0, 10.0]),
16201619
&["blob_count"],
16211620
)
16221621
});
@@ -1690,6 +1689,33 @@ pub static BLOBS_FROM_EL_RECEIVED: LazyLock<Result<Histogram>> = LazyLock::new(|
16901689
)
16911690
});
16921691

1692+
/*
1693+
* Standardized getBlobs metrics across clients from https://github.com/ethereum/beacon-metrics
1694+
*/
1695+
pub static BEACON_ENGINE_GET_BLOBS_V2_REQUESTS_TOTAL: LazyLock<Result<IntCounter>> =
1696+
LazyLock::new(|| {
1697+
try_create_int_counter(
1698+
"beacon_engine_getBlobsV2_requests_total",
1699+
"Total number of engine_getBlobsV2 requests made to the execution layer",
1700+
)
1701+
});
1702+
1703+
pub static BEACON_ENGINE_GET_BLOBS_V2_RESPONSES_TOTAL: LazyLock<Result<IntCounter>> =
1704+
LazyLock::new(|| {
1705+
try_create_int_counter(
1706+
"beacon_engine_getBlobsV2_responses_total",
1707+
"Total number of successful engine_getBlobsV2 responses from the execution layer",
1708+
)
1709+
});
1710+
1711+
pub static BEACON_ENGINE_GET_BLOBS_V2_REQUEST_DURATION_SECONDS: LazyLock<Result<Histogram>> =
1712+
LazyLock::new(|| {
1713+
try_create_histogram(
1714+
"beacon_engine_getBlobsV2_request_duration_seconds",
1715+
"Duration of engine_getBlobsV2 requests to the execution layer in seconds",
1716+
)
1717+
});
1718+
16931719
/*
16941720
* Light server message verification
16951721
*/

beacon_node/beacon_processor/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -723,13 +723,13 @@ impl<E: EthSpec> BeaconProcessor<E> {
723723
}
724724
Work::Status { .. } => work_queues.status_queue.push(work, work_id),
725725
Work::BlocksByRangeRequest { .. } => {
726-
work_queues.bbrange_queue.push(work, work_id)
726+
work_queues.block_brange_queue.push(work, work_id)
727727
}
728728
Work::BlocksByRootsRequest { .. } => {
729-
work_queues.bbroots_queue.push(work, work_id)
729+
work_queues.block_broots_queue.push(work, work_id)
730730
}
731731
Work::BlobsByRangeRequest { .. } => {
732-
work_queues.blbrange_queue.push(work, work_id)
732+
work_queues.blob_brange_queue.push(work, work_id)
733733
}
734734
Work::LightClientBootstrapRequest { .. } => {
735735
work_queues.lc_bootstrap_queue.push(work, work_id)
@@ -753,7 +753,7 @@ impl<E: EthSpec> BeaconProcessor<E> {
753753
.gossip_bls_to_execution_change_queue
754754
.push(work, work_id),
755755
Work::BlobsByRootsRequest { .. } => {
756-
work_queues.blbroots_queue.push(work, work_id)
756+
work_queues.blob_broots_queue.push(work, work_id)
757757
}
758758
Work::DataColumnsByRootsRequest { .. } => {
759759
work_queues.dcbroots_queue.push(work, work_id)
@@ -829,10 +829,10 @@ impl<E: EthSpec> BeaconProcessor<E> {
829829
WorkType::ChainSegment => work_queues.chain_segment_queue.len(),
830830
WorkType::ChainSegmentBackfill => work_queues.backfill_chain_segment.len(),
831831
WorkType::Status => work_queues.status_queue.len(),
832-
WorkType::BlocksByRangeRequest => work_queues.blbrange_queue.len(),
833-
WorkType::BlocksByRootsRequest => work_queues.blbroots_queue.len(),
834-
WorkType::BlobsByRangeRequest => work_queues.bbrange_queue.len(),
835-
WorkType::BlobsByRootsRequest => work_queues.bbroots_queue.len(),
832+
WorkType::BlocksByRangeRequest => work_queues.block_brange_queue.len(),
833+
WorkType::BlocksByRootsRequest => work_queues.block_broots_queue.len(),
834+
WorkType::BlobsByRangeRequest => work_queues.blob_brange_queue.len(),
835+
WorkType::BlobsByRootsRequest => work_queues.blob_broots_queue.len(),
836836
WorkType::DataColumnsByRootsRequest => work_queues.dcbroots_queue.len(),
837837
WorkType::DataColumnsByRangeRequest => work_queues.dcbrange_queue.len(),
838838
WorkType::GossipBlsToExecutionChange => {

beacon_node/beacon_processor/src/scheduler/work_queue.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ pub struct BeaconProcessorQueueLengths {
151151
gossip_data_column_queue: usize,
152152
delayed_block_queue: usize,
153153
status_queue: usize,
154-
bbrange_queue: usize,
155-
bbroots_queue: usize,
156-
blbroots_queue: usize,
157-
blbrange_queue: usize,
154+
block_brange_queue: usize,
155+
block_broots_queue: usize,
156+
blob_broots_queue: usize,
157+
blob_brange_queue: usize,
158158
dcbroots_queue: usize,
159159
dcbrange_queue: usize,
160160
gossip_bls_to_execution_change_queue: usize,
@@ -217,10 +217,10 @@ impl BeaconProcessorQueueLengths {
217217
gossip_data_column_queue: 1024,
218218
delayed_block_queue: 1024,
219219
status_queue: 1024,
220-
bbrange_queue: 1024,
221-
bbroots_queue: 1024,
222-
blbroots_queue: 1024,
223-
blbrange_queue: 1024,
220+
block_brange_queue: 1024,
221+
block_broots_queue: 1024,
222+
blob_broots_queue: 1024,
223+
blob_brange_queue: 1024,
224224
dcbroots_queue: 1024,
225225
dcbrange_queue: 1024,
226226
gossip_bls_to_execution_change_queue: 16384,
@@ -261,10 +261,10 @@ pub struct WorkQueues<E: EthSpec> {
261261
pub gossip_data_column_queue: FifoQueue<Work<E>>,
262262
pub delayed_block_queue: FifoQueue<Work<E>>,
263263
pub status_queue: FifoQueue<Work<E>>,
264-
pub bbrange_queue: FifoQueue<Work<E>>,
265-
pub bbroots_queue: FifoQueue<Work<E>>,
266-
pub blbroots_queue: FifoQueue<Work<E>>,
267-
pub blbrange_queue: FifoQueue<Work<E>>,
264+
pub block_brange_queue: FifoQueue<Work<E>>,
265+
pub block_broots_queue: FifoQueue<Work<E>>,
266+
pub blob_broots_queue: FifoQueue<Work<E>>,
267+
pub blob_brange_queue: FifoQueue<Work<E>>,
268268
pub dcbroots_queue: FifoQueue<Work<E>>,
269269
pub dcbrange_queue: FifoQueue<Work<E>>,
270270
pub gossip_bls_to_execution_change_queue: FifoQueue<Work<E>>,
@@ -327,10 +327,10 @@ impl<E: EthSpec> WorkQueues<E> {
327327
let delayed_block_queue = FifoQueue::new(queue_lengths.delayed_block_queue);
328328

329329
let status_queue = FifoQueue::new(queue_lengths.status_queue);
330-
let bbrange_queue = FifoQueue::new(queue_lengths.bbrange_queue);
331-
let bbroots_queue = FifoQueue::new(queue_lengths.bbroots_queue);
332-
let blbroots_queue = FifoQueue::new(queue_lengths.blbroots_queue);
333-
let blbrange_queue = FifoQueue::new(queue_lengths.blbrange_queue);
330+
let block_brange_queue = FifoQueue::new(queue_lengths.block_brange_queue);
331+
let block_broots_queue = FifoQueue::new(queue_lengths.block_broots_queue);
332+
let blob_broots_queue = FifoQueue::new(queue_lengths.blob_broots_queue);
333+
let blob_brange_queue = FifoQueue::new(queue_lengths.blob_brange_queue);
334334
let dcbroots_queue = FifoQueue::new(queue_lengths.dcbroots_queue);
335335
let dcbrange_queue = FifoQueue::new(queue_lengths.dcbrange_queue);
336336

@@ -377,10 +377,10 @@ impl<E: EthSpec> WorkQueues<E> {
377377
gossip_data_column_queue,
378378
delayed_block_queue,
379379
status_queue,
380-
bbrange_queue,
381-
bbroots_queue,
382-
blbroots_queue,
383-
blbrange_queue,
380+
block_brange_queue,
381+
block_broots_queue,
382+
blob_broots_queue,
383+
blob_brange_queue,
384384
dcbroots_queue,
385385
dcbrange_queue,
386386
gossip_bls_to_execution_change_queue,

common/eth2_config/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const HOLESKY_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url
3333
checksum: "0xd750639607c337bbb192b15c27f447732267bf72d1650180a0e44c2d93a80741",
3434
genesis_validators_root: "0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1",
3535
genesis_state_root: "0x0ea3f6f9515823b59c863454675fefcd1d8b4f2dbe454db166206a41fda060a0",
36+
// ref: https://github.com/eth-clients/holesky/blob/main/README.md - Launch Epoch time
37+
genesis_time: 1695902400,
3638
};
3739

3840
const HOODI_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url {
@@ -44,6 +46,8 @@ const HOODI_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url {
4446
checksum: "0x7f42257ef69e055496c964a753bb07e54001ccd57ab467ef72d67af086bcfce7",
4547
genesis_validators_root: "0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f",
4648
genesis_state_root: "0x2683ebc120f91f740c7bed4c866672d01e1ba51b4cc360297138465ee5df40f0",
49+
// ref: https://github.com/eth-clients/hoodi/blob/main/README.md - Launch Epoch time
50+
genesis_time: 1742213400,
4751
};
4852

4953
const CHIADO_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url {
@@ -52,6 +56,8 @@ const CHIADO_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url
5256
checksum: "0xd4a039454c7429f1dfaa7e11e397ef3d0f50d2d5e4c0e4dc04919d153aa13af1",
5357
genesis_validators_root: "0x9d642dac73058fbf39c0ae41ab1e34e4d889043cb199851ded7095bc99eb4c1e",
5458
genesis_state_root: "0xa48419160f8f146ecaa53d12a5d6e1e6af414a328afdc56b60d5002bb472a077",
59+
// ref: https://github.com/gnosischain/configs/blob/main/chiado/genesis.ssz
60+
genesis_time: 1665396300,
5561
};
5662

5763
/// The core configuration of a Lighthouse beacon node.
@@ -117,6 +123,10 @@ pub enum GenesisStateSource {
117123
///
118124
/// The format should be 0x-prefixed ASCII bytes.
119125
genesis_state_root: &'static str,
126+
/// The genesis time.
127+
///
128+
/// The format should be u64.
129+
genesis_time: u64,
120130
},
121131
}
122132

common/eth2_network_config/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ impl Eth2NetworkConfig {
133133
self.genesis_state_source != GenesisStateSource::Unknown
134134
}
135135

136+
/// The `genesis_time` of the genesis state.
137+
pub fn genesis_time<E: EthSpec>(&self) -> Result<Option<u64>, String> {
138+
if let GenesisStateSource::Url { genesis_time, .. } = self.genesis_state_source {
139+
Ok(Some(genesis_time))
140+
} else {
141+
self.get_genesis_state_from_bytes::<E>()
142+
.map(|state| Some(state.genesis_time()))
143+
}
144+
}
145+
136146
/// The `genesis_validators_root` of the genesis state.
137147
pub fn genesis_validators_root<E: EthSpec>(&self) -> Result<Option<Hash256>, String> {
138148
if let GenesisStateSource::Url {

validator_client/src/lib.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,22 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
364364
context.eth2_config.spec.clone(),
365365
);
366366

367-
// Perform some potentially long-running initialization tasks.
368-
let (genesis_time, genesis_validators_root) = tokio::select! {
369-
tuple = init_from_beacon_node::<E>(&beacon_nodes, &proposer_nodes) => tuple?,
370-
() = context.executor.exit() => return Err("Shutting down".to_string())
371-
};
367+
let (genesis_time, genesis_validators_root) =
368+
if let Some(eth2_network_config) = context.eth2_network_config.as_ref() {
369+
let time = eth2_network_config
370+
.genesis_time::<E>()?
371+
.ok_or("no genesis time")?;
372+
let root = eth2_network_config
373+
.genesis_validators_root::<E>()?
374+
.ok_or("no genesis validators root")?;
375+
(time, root)
376+
} else {
377+
// Perform some potentially long-running initialization tasks.
378+
tokio::select! {
379+
tuple = init_from_beacon_node::<E>(&beacon_nodes, &proposer_nodes) => tuple?,
380+
() = context.executor.exit() => return Err("Shutting down".to_string()),
381+
}
382+
};
372383

373384
// Update the metrics server.
374385
if let Some(ctx) = &validator_metrics_ctx {

0 commit comments

Comments
 (0)