@@ -427,7 +427,7 @@ pub fn on_gossip_attestation(
427427 metrics:: update_gossip_signatures ( store. gossip_signatures_count ( ) ) ;
428428 }
429429
430- metrics:: inc_attestations_valid ( 1 ) ;
430+ metrics:: inc_attestations_valid ( ) ;
431431
432432 let slot = attestation. data . slot ;
433433 let target_slot = attestation. data . target . slot ;
@@ -536,7 +536,7 @@ fn on_gossip_aggregated_attestation_core(
536536 "Aggregated attestation processed"
537537 ) ;
538538
539- metrics:: inc_attestations_valid ( 1 ) ;
539+ metrics:: inc_attestations_valid ( ) ;
540540
541541 Ok ( ( ) )
542542}
@@ -569,7 +569,7 @@ fn on_block_core(
569569 signed_block : SignedBlock ,
570570 verify : bool ,
571571) -> Result < ( ) , StoreError > {
572- let _timing = metrics:: time_fork_choice_block_processing ( ) ;
572+ let timing = metrics:: time_fork_choice_block_processing ( ) ;
573573 let block_start = std:: time:: Instant :: now ( ) ;
574574
575575 let block = & signed_block. message ;
@@ -581,6 +581,7 @@ fn on_block_core(
581581 . has_state ( & block_root)
582582 . expect ( "DB read should succeed" )
583583 {
584+ timing. discard ( ) ;
584585 return Ok ( ( ) ) ;
585586 }
586587
@@ -682,11 +683,11 @@ fn on_block_core(
682683 . insert_state ( block_root, post_state)
683684 . expect ( "DB insert should succeed" ) ;
684685
685- for att in block . body . attestations . iter ( ) {
686- // Count each participating validator as a valid attestation.
687- let count = validator_indices ( & att . aggregation_bits ) . count ( ) as u64 ;
688- metrics :: inc_attestations_valid ( count ) ;
689- }
686+ // Block-included attestations are intentionally not counted here.
687+ // `lean_attestations_valid_total` tracks the gossip validation pipeline
688+ // (symmetric with `inc_attestations_invalid`), matching leanSpec. Votes
689+ // arriving inside a block are counted by
690+ // `lean_state_transition_attestations_processed_total` instead.
690691
691692 // Update forkchoice head based on new block and attestations
692693 update_head ( store, false ) ;
0 commit comments