mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-12 04:30:04 +00:00
Better import alias names (#9149)
This commit is contained in:
parent
466546bb40
commit
6c8fd745a4
@ -29,17 +29,17 @@ import (
|
|||||||
"github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/debug"
|
"github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/debug"
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/events"
|
"github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/events"
|
||||||
node "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/node"
|
node "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/node"
|
||||||
beacon2 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/beacon"
|
beaconv1alpha1 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/beacon"
|
||||||
debug2 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/debug"
|
debugv1alpha1 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/debug"
|
||||||
node2 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/node"
|
nodev1alpha1 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/node"
|
||||||
validator2 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/validator"
|
validatorv1alpha1 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/validator"
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/rpc/statefetcher"
|
"github.com/prysmaticlabs/prysm/beacon-chain/rpc/statefetcher"
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/state/stategen"
|
"github.com/prysmaticlabs/prysm/beacon-chain/state/stategen"
|
||||||
chainSync "github.com/prysmaticlabs/prysm/beacon-chain/sync"
|
chainSync "github.com/prysmaticlabs/prysm/beacon-chain/sync"
|
||||||
pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||||
pbrpc "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
pbrpc "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||||
ethpbv1 "github.com/prysmaticlabs/prysm/proto/eth/v1"
|
ethpbv1 "github.com/prysmaticlabs/prysm/proto/eth/v1"
|
||||||
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
ethpbv1alpha1 "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
||||||
"github.com/prysmaticlabs/prysm/shared/featureconfig"
|
"github.com/prysmaticlabs/prysm/shared/featureconfig"
|
||||||
"github.com/prysmaticlabs/prysm/shared/logutil"
|
"github.com/prysmaticlabs/prysm/shared/logutil"
|
||||||
"github.com/prysmaticlabs/prysm/shared/params"
|
"github.com/prysmaticlabs/prysm/shared/params"
|
||||||
@ -62,7 +62,7 @@ type Service struct {
|
|||||||
listener net.Listener
|
listener net.Listener
|
||||||
grpcServer *grpc.Server
|
grpcServer *grpc.Server
|
||||||
canonicalStateChan chan *pbp2p.BeaconState
|
canonicalStateChan chan *pbp2p.BeaconState
|
||||||
incomingAttestation chan *ethpb.Attestation
|
incomingAttestation chan *ethpbv1alpha1.Attestation
|
||||||
credentialError error
|
credentialError error
|
||||||
connectedRPCClients map[net.Addr]bool
|
connectedRPCClients map[net.Addr]bool
|
||||||
clientConnectionLock sync.Mutex
|
clientConnectionLock sync.Mutex
|
||||||
@ -116,7 +116,7 @@ func NewService(ctx context.Context, cfg *Config) *Service {
|
|||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
cancel: cancel,
|
cancel: cancel,
|
||||||
canonicalStateChan: make(chan *pbp2p.BeaconState, params.BeaconConfig().DefaultBufferSize),
|
canonicalStateChan: make(chan *pbp2p.BeaconState, params.BeaconConfig().DefaultBufferSize),
|
||||||
incomingAttestation: make(chan *ethpb.Attestation, params.BeaconConfig().DefaultBufferSize),
|
incomingAttestation: make(chan *ethpbv1alpha1.Attestation, params.BeaconConfig().DefaultBufferSize),
|
||||||
connectedRPCClients: make(map[net.Addr]bool),
|
connectedRPCClients: make(map[net.Addr]bool),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -165,7 +165,7 @@ func (s *Service) Start() {
|
|||||||
}
|
}
|
||||||
s.grpcServer = grpc.NewServer(opts...)
|
s.grpcServer = grpc.NewServer(opts...)
|
||||||
|
|
||||||
validatorServer := &validator2.Server{
|
validatorServer := &validatorv1alpha1.Server{
|
||||||
Ctx: s.ctx,
|
Ctx: s.ctx,
|
||||||
BeaconDB: s.cfg.BeaconDB,
|
BeaconDB: s.cfg.BeaconDB,
|
||||||
AttestationCache: cache.NewAttestationCache(),
|
AttestationCache: cache.NewAttestationCache(),
|
||||||
@ -192,7 +192,7 @@ func (s *Service) Start() {
|
|||||||
SlashingsPool: s.cfg.SlashingsPool,
|
SlashingsPool: s.cfg.SlashingsPool,
|
||||||
StateGen: s.cfg.StateGen,
|
StateGen: s.cfg.StateGen,
|
||||||
}
|
}
|
||||||
nodeServer := &node2.Server{
|
nodeServer := &nodev1alpha1.Server{
|
||||||
LogsStreamer: logutil.NewStreamServer(),
|
LogsStreamer: logutil.NewStreamServer(),
|
||||||
StreamLogsBufferSize: 1000, // Enough to handle bursts of beacon node logs for gRPC streaming.
|
StreamLogsBufferSize: 1000, // Enough to handle bursts of beacon node logs for gRPC streaming.
|
||||||
BeaconDB: s.cfg.BeaconDB,
|
BeaconDB: s.cfg.BeaconDB,
|
||||||
@ -216,7 +216,7 @@ func (s *Service) Start() {
|
|||||||
HeadFetcher: s.cfg.HeadFetcher,
|
HeadFetcher: s.cfg.HeadFetcher,
|
||||||
}
|
}
|
||||||
|
|
||||||
beaconChainServer := &beacon2.Server{
|
beaconChainServer := &beaconv1alpha1.Server{
|
||||||
Ctx: s.ctx,
|
Ctx: s.ctx,
|
||||||
BeaconDB: s.cfg.BeaconDB,
|
BeaconDB: s.cfg.BeaconDB,
|
||||||
AttestationsPool: s.cfg.AttestationsPool,
|
AttestationsPool: s.cfg.AttestationsPool,
|
||||||
@ -235,8 +235,8 @@ func (s *Service) Start() {
|
|||||||
Broadcaster: s.cfg.Broadcaster,
|
Broadcaster: s.cfg.Broadcaster,
|
||||||
StateGen: s.cfg.StateGen,
|
StateGen: s.cfg.StateGen,
|
||||||
SyncChecker: s.cfg.SyncService,
|
SyncChecker: s.cfg.SyncService,
|
||||||
ReceivedAttestationsBuffer: make(chan *ethpb.Attestation, attestationBufferSize),
|
ReceivedAttestationsBuffer: make(chan *ethpbv1alpha1.Attestation, attestationBufferSize),
|
||||||
CollectedAttestationsBuffer: make(chan []*ethpb.Attestation, attestationBufferSize),
|
CollectedAttestationsBuffer: make(chan []*ethpbv1alpha1.Attestation, attestationBufferSize),
|
||||||
}
|
}
|
||||||
beaconChainServerV1 := &beacon.Server{
|
beaconChainServerV1 := &beacon.Server{
|
||||||
BeaconDB: s.cfg.BeaconDB,
|
BeaconDB: s.cfg.BeaconDB,
|
||||||
@ -256,10 +256,10 @@ func (s *Service) Start() {
|
|||||||
},
|
},
|
||||||
VoluntaryExitsPool: s.cfg.ExitPool,
|
VoluntaryExitsPool: s.cfg.ExitPool,
|
||||||
}
|
}
|
||||||
ethpb.RegisterNodeServer(s.grpcServer, nodeServer)
|
ethpbv1alpha1.RegisterNodeServer(s.grpcServer, nodeServer)
|
||||||
ethpbv1.RegisterBeaconNodeServer(s.grpcServer, nodeServerV1)
|
ethpbv1.RegisterBeaconNodeServer(s.grpcServer, nodeServerV1)
|
||||||
pbrpc.RegisterHealthServer(s.grpcServer, nodeServer)
|
pbrpc.RegisterHealthServer(s.grpcServer, nodeServer)
|
||||||
ethpb.RegisterBeaconChainServer(s.grpcServer, beaconChainServer)
|
ethpbv1alpha1.RegisterBeaconChainServer(s.grpcServer, beaconChainServer)
|
||||||
ethpbv1.RegisterBeaconChainServer(s.grpcServer, beaconChainServerV1)
|
ethpbv1.RegisterBeaconChainServer(s.grpcServer, beaconChainServerV1)
|
||||||
ethpbv1.RegisterEventsServer(s.grpcServer, &events.Server{
|
ethpbv1.RegisterEventsServer(s.grpcServer, &events.Server{
|
||||||
Ctx: s.ctx,
|
Ctx: s.ctx,
|
||||||
@ -269,7 +269,7 @@ func (s *Service) Start() {
|
|||||||
})
|
})
|
||||||
if s.cfg.EnableDebugRPCEndpoints {
|
if s.cfg.EnableDebugRPCEndpoints {
|
||||||
log.Info("Enabled debug gRPC endpoints")
|
log.Info("Enabled debug gRPC endpoints")
|
||||||
debugServer := &debug2.Server{
|
debugServer := &debugv1alpha1.Server{
|
||||||
GenesisTimeFetcher: s.cfg.GenesisTimeFetcher,
|
GenesisTimeFetcher: s.cfg.GenesisTimeFetcher,
|
||||||
BeaconDB: s.cfg.BeaconDB,
|
BeaconDB: s.cfg.BeaconDB,
|
||||||
StateGen: s.cfg.StateGen,
|
StateGen: s.cfg.StateGen,
|
||||||
@ -290,7 +290,7 @@ func (s *Service) Start() {
|
|||||||
pbrpc.RegisterDebugServer(s.grpcServer, debugServer)
|
pbrpc.RegisterDebugServer(s.grpcServer, debugServer)
|
||||||
ethpbv1.RegisterBeaconDebugServer(s.grpcServer, debugServerV1)
|
ethpbv1.RegisterBeaconDebugServer(s.grpcServer, debugServerV1)
|
||||||
}
|
}
|
||||||
ethpb.RegisterBeaconNodeValidatorServer(s.grpcServer, validatorServer)
|
ethpbv1alpha1.RegisterBeaconNodeValidatorServer(s.grpcServer, validatorServer)
|
||||||
|
|
||||||
// Register reflection service on gRPC server.
|
// Register reflection service on gRPC server.
|
||||||
reflection.Register(s.grpcServer)
|
reflection.Register(s.grpcServer)
|
||||||
|
Loading…
Reference in New Issue
Block a user