11import { ChainForkConfig } from "@lodestar/config" ;
2- import { ForkExecution , ForkSeq , isForkExecution } from "@lodestar/params" ;
2+ import { ForkExecution , ForkSeq , isForkExecution , isForkLightClient } from "@lodestar/params" ;
33import {
44 CachedBeaconStateAllForks ,
55 CachedBeaconStateBellatrix ,
66 CachedBeaconStateCapella ,
77 CachedBeaconStateExecutions ,
8- computeEpochAtSlot ,
98 computeTimeAtSlot ,
109 getCurrentEpoch ,
1110 getExpectedWithdrawals ,
@@ -143,8 +142,15 @@ export async function produceBlockBody<T extends BlockType>(
143142 ? Object . assign ( { } , commonBlockBody )
144143 : await produceCommonBlockBody . call ( this , blockType , currentState , blockAttr ) ;
145144
146- const { attestations, deposits, voluntaryExits, attesterSlashings, proposerSlashings, blsToExecutionChanges} =
147- blockBody ;
145+ const {
146+ attestations,
147+ deposits,
148+ voluntaryExits,
149+ attesterSlashings,
150+ proposerSlashings,
151+ syncAggregate,
152+ blsToExecutionChanges,
153+ } = blockBody ;
148154
149155 Object . assign ( logMeta , {
150156 attestations : attestations . length ,
@@ -154,6 +160,12 @@ export async function produceBlockBody<T extends BlockType>(
154160 proposerSlashings : proposerSlashings . length ,
155161 } ) ;
156162
163+ if ( isForkLightClient ( fork ) ) {
164+ Object . assign ( logMeta , {
165+ syncAggregateParticipants : syncAggregate . syncCommitteeBits . getTrueBitIndexes ( ) . length ,
166+ } ) ;
167+ }
168+
157169 const endExecutionPayload = stepsMetrics ?. startTimer ( ) ;
158170 if ( isForkExecution ( fork ) ) {
159171 const safeBlockHash = this . forkChoice . getJustifiedBlock ( ) . executionPayloadBlockHash ?? ZERO_HASH_HEX ;
@@ -608,7 +620,6 @@ export async function produceCommonBlockBody<T extends BlockType>(
608620 ? this . metrics ?. executionBlockProductionTimeSteps
609621 : this . metrics ?. builderBlockProductionTimeSteps ;
610622
611- const blockEpoch = computeEpochAtSlot ( slot ) ;
612623 const fork = currentState . config . getForkName ( slot ) ;
613624
614625 // TODO:
@@ -653,7 +664,7 @@ export async function produceCommonBlockBody<T extends BlockType>(
653664 }
654665
655666 const endSyncAggregate = stepsMetrics ?. startTimer ( ) ;
656- if ( blockEpoch >= this . config . ALTAIR_FORK_EPOCH ) {
667+ if ( ForkSeq [ fork ] >= ForkSeq . altair ) {
657668 const syncAggregate = this . syncContributionAndProofPool . getAggregate ( parentSlot , parentBlockRoot ) ;
658669 this . metrics ?. production . producedSyncAggregateParticipants . observe (
659670 syncAggregate . syncCommitteeBits . getTrueBitIndexes ( ) . length
0 commit comments