2020-05-26 23:24:38 +00:00
|
|
|
package debug
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2021-03-12 00:03:19 +00:00
|
|
|
"github.com/golang/protobuf/ptypes/empty"
|
2021-07-28 21:23:44 +00:00
|
|
|
pbrpc "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
2020-05-26 23:24:38 +00:00
|
|
|
)
|
|
|
|
|
2022-03-09 03:05:51 +00:00
|
|
|
// GetForkChoice returns a fork choice store.
|
|
|
|
func (ds *Server) GetForkChoice(_ context.Context, _ *empty.Empty) (*pbrpc.ForkChoiceResponse, error) {
|
2022-04-28 11:34:25 +00:00
|
|
|
store := ds.ForkFetcher.ForkChoicer()
|
2020-05-26 23:24:38 +00:00
|
|
|
|
2022-03-09 03:05:51 +00:00
|
|
|
return &pbrpc.ForkChoiceResponse{
|
2022-06-09 22:28:30 +00:00
|
|
|
JustifiedEpoch: store.JustifiedCheckpoint().Epoch,
|
|
|
|
FinalizedEpoch: store.FinalizedCheckpoint().Epoch,
|
2022-03-09 03:05:51 +00:00
|
|
|
ForkchoiceNodes: store.ForkChoiceNodes(),
|
2020-05-26 23:24:38 +00:00
|
|
|
}, nil
|
|
|
|
}
|