Skip to content

Commit ebb844e

Browse files
committed
update block service to match unstable
1 parent 76effb7 commit ebb844e

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

common/eth2/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,6 +2217,7 @@ impl BeaconNodeHttpClient {
22172217
}
22182218

22192219
/// returns `GET v3/validator/blocks/{slot}` or `GET v4/validator/blocks/{slot}` URL path
2220+
#[allow(clippy::too_many_arguments)]
22202221
pub async fn get_validator_blocks_v3_and_v4_path(
22212222
&self,
22222223
version: EndpointVersion,

validator_client/validator_services/src/block_service.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,11 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> BlockService<S, T> {
346346
async move {
347347
let result = if service.chain_spec.fork_name_at_epoch(current_epoch).gloas_enabled() {
348348
service
349-
.publish_block_gloas(slot, validator_pubkey, builder_boost_factor)
349+
.get_validator_block_and_publish_block_gloas(slot, validator_pubkey, builder_boost_factor)
350350
.await
351351
} else {
352352
service
353-
.publish_block(slot, validator_pubkey, builder_boost_factor)
353+
.get_validator_block_and_publish_block(slot, validator_pubkey, builder_boost_factor)
354354
.await
355355
};
356356

@@ -445,6 +445,7 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> BlockService<S, T> {
445445
}
446446

447447
#[allow(clippy::too_many_arguments)]
448+
#[instrument(skip_all, fields(%slot, ?validator_pubkey))]
448449
async fn sign_and_publish_block_gloas(
449450
&self,
450451
proposer_fallback: ProposerFallback<T>,
@@ -458,6 +459,7 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> BlockService<S, T> {
458459
let res = self
459460
.validator_store
460461
.sign_block_gloas(*validator_pubkey, unsigned_block, slot)
462+
.instrument(info_span!("sign_block"))
461463
.await;
462464

463465
let signed_block = match res {
@@ -515,7 +517,12 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> BlockService<S, T> {
515517

516518
// TODO(EIP-7732): Remove this sometime after gloas is live and make publish_block_gloas the default
517519
// TODO(EIP-7732): Seems like block production testing is done through `simulator`. Discuss with team if that is sufficient for all this new gloas code.
518-
async fn publish_block(
520+
#[instrument(
521+
name = "block_proposal_duty_cycle",
522+
skip_all,
523+
fields(%slot, ?validator_pubkey)
524+
)]
525+
async fn get_validator_block_and_publish_block(
519526
self,
520527
slot: Slot,
521528
validator_pubkey: PublicKeyBytes,
@@ -658,7 +665,12 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> BlockService<S, T> {
658665
Ok(())
659666
}
660667

661-
async fn publish_block_gloas(
668+
#[instrument(
669+
name = "block_proposal_duty_cycle",
670+
skip_all,
671+
fields(%slot, ?validator_pubkey)
672+
)]
673+
async fn get_validator_block_and_publish_block_gloas(
662674
self,
663675
slot: Slot,
664676
validator_pubkey: PublicKeyBytes,
@@ -855,6 +867,7 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> BlockService<S, T> {
855867
Ok::<_, BlockError>(())
856868
}
857869

870+
#[instrument(skip_all)]
858871
async fn publish_signed_block_contents_gloas(
859872
&self,
860873
signed_block: &Arc<SignedBeaconBlock<S::E>>,

0 commit comments

Comments
 (0)