2020-04-29 17:40:33 +00:00
|
|
|
// Package beacon defines a gRPC beacon service implementation, providing
|
|
|
|
// useful endpoints for checking fetching chain-specific data such as
|
|
|
|
// blocks, committees, validators, assignments, and more.
|
2019-11-12 17:01:27 +00:00
|
|
|
package beacon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"time"
|
|
|
|
|
2022-08-16 12:20:13 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/blockchain"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/cache/depositcache"
|
|
|
|
blockfeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/block"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/operation"
|
|
|
|
statefeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/state"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/db"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/execution"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/operations/attestations"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/operations/slashings"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/p2p"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/state/stategen"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/sync"
|
|
|
|
ethpb "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1"
|
2019-11-12 17:01:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Server defines a server implementation of the gRPC Beacon Chain service,
|
2021-06-26 19:00:33 +00:00
|
|
|
// providing RPC endpoints to access data relevant to the Ethereum beacon chain.
|
2019-11-12 17:01:27 +00:00
|
|
|
type Server struct {
|
2020-03-08 21:39:54 +00:00
|
|
|
BeaconDB db.ReadOnlyDatabase
|
|
|
|
Ctx context.Context
|
2022-08-01 14:43:47 +00:00
|
|
|
ChainStartFetcher execution.ChainStartFetcher
|
2020-03-08 21:39:54 +00:00
|
|
|
HeadFetcher blockchain.HeadFetcher
|
2020-12-16 19:31:34 +00:00
|
|
|
CanonicalFetcher blockchain.CanonicalFetcher
|
2020-03-08 21:39:54 +00:00
|
|
|
FinalizationFetcher blockchain.FinalizationFetcher
|
|
|
|
DepositFetcher depositcache.DepositFetcher
|
2022-08-01 14:43:47 +00:00
|
|
|
BlockFetcher execution.POWBlockFetcher
|
2020-03-08 21:39:54 +00:00
|
|
|
GenesisTimeFetcher blockchain.TimeFetcher
|
|
|
|
StateNotifier statefeed.Notifier
|
|
|
|
BlockNotifier blockfeed.Notifier
|
|
|
|
AttestationNotifier operation.Notifier
|
2020-03-12 20:29:23 +00:00
|
|
|
Broadcaster p2p.Broadcaster
|
2020-03-08 21:39:54 +00:00
|
|
|
AttestationsPool attestations.Pool
|
2021-02-23 15:17:07 +00:00
|
|
|
SlashingsPool slashings.PoolManager
|
2020-03-08 21:39:54 +00:00
|
|
|
ChainStartChan chan time.Time
|
|
|
|
ReceivedAttestationsBuffer chan *ethpb.Attestation
|
|
|
|
CollectedAttestationsBuffer chan []*ethpb.Attestation
|
2021-03-08 22:37:33 +00:00
|
|
|
StateGen stategen.StateManager
|
2020-05-10 20:08:45 +00:00
|
|
|
SyncChecker sync.Checker
|
2022-03-09 19:33:18 +00:00
|
|
|
ReplayerBuilder stategen.ReplayerBuilder
|
2022-05-09 23:12:50 +00:00
|
|
|
HeadUpdater blockchain.HeadUpdater
|
2022-06-09 17:37:52 +00:00
|
|
|
OptimisticModeFetcher blockchain.OptimisticModeFetcher
|
2019-11-12 17:01:27 +00:00
|
|
|
}
|