@@ -48,9 +48,9 @@ use bytes::Bytes;
4848use directory:: DEFAULT_ROOT_DIR ;
4949use eth2:: types:: {
5050 self as api_types, BroadcastValidation , ContextDeserialize , EndpointVersion , ForkChoice ,
51- ForkChoiceNode , LightClientUpdatesQuery , PublishBlockRequest , StateId as CoreStateId ,
52- ValidatorBalancesRequestBody , ValidatorId , ValidatorIdentitiesRequestBody , ValidatorStatus ,
53- ValidatorsRequestBody ,
51+ ForkChoiceExtraData , ForkChoiceNode , LightClientUpdatesQuery , PublishBlockRequest ,
52+ StateId as CoreStateId , ValidatorBalancesRequestBody , ValidatorId ,
53+ ValidatorIdentitiesRequestBody , ValidatorStatus , ValidatorsRequestBody ,
5454} ;
5555use eth2:: { CONSENSUS_VERSION_HEADER , CONTENT_TYPE_HEADER , SSZ_CONTENT_TYPE_HEADER } ;
5656use health_metrics:: observe:: Observe ;
@@ -3033,6 +3033,32 @@ pub fn serve<T: BeaconChainTypes>(
30333033 . execution_status
30343034 . block_hash ( )
30353035 . map ( |block_hash| block_hash. into_root ( ) ) ,
3036+ extra_data : ForkChoiceExtraData {
3037+ target_root : node. target_root ,
3038+ justified_root : node. justified_checkpoint . root ,
3039+ finalized_root : node. finalized_checkpoint . root ,
3040+ unrealized_justified_root : node
3041+ . unrealized_justified_checkpoint
3042+ . map ( |checkpoint| checkpoint. root ) ,
3043+ unrealized_finalized_root : node
3044+ . unrealized_finalized_checkpoint
3045+ . map ( |checkpoint| checkpoint. root ) ,
3046+ unrealized_justified_epoch : node
3047+ . unrealized_justified_checkpoint
3048+ . map ( |checkpoint| checkpoint. epoch ) ,
3049+ unrealized_finalized_epoch : node
3050+ . unrealized_finalized_checkpoint
3051+ . map ( |checkpoint| checkpoint. epoch ) ,
3052+ execution_status : node. execution_status . to_string ( ) ,
3053+ best_child : node
3054+ . best_child
3055+ . and_then ( |index| proto_array. nodes . get ( index) )
3056+ . map ( |child| child. root ) ,
3057+ best_descendant : node
3058+ . best_descendant
3059+ . and_then ( |index| proto_array. nodes . get ( index) )
3060+ . map ( |descendant| descendant. root ) ,
3061+ } ,
30363062 }
30373063 } )
30383064 . collect :: < Vec < _ > > ( ) ;
0 commit comments