Documentation ¶
Index ¶
- func MiningStep(ctx context.Context, kv kv.RwDB, mining *sync_stages.Sync, tmpDir string) (err error)
- func NewDefaultStages(ctx context.Context, db kv.RwDB, p2pCfg p2p.Config, cfg *ethconfig.Config, ...) []*sync_stages.Stage
- func NewDefaultZkStages(ctx context.Context, db kv.RwDB, p2pCfg p2p.Config, cfg *ethconfig.Config, ...) []*sync_stages.Stage
- func NewInMemoryExecution(ctx context.Context, db kv.RwDB, cfg *ethconfig.Config, ...) (*sync_stages.Sync, error)
- func SendPayloadStatus(hd *headerdownload.HeaderDownload, headBlockHash libcommon.Hash, err error)
- func StageLoop(ctx context.Context, chainConfig *chain.Config, db kv.RwDB, ...)
- func StageLoopStep(ctx context.Context, chainConfig *chain.Config, db kv.RwDB, ...) (headBlockHash libcommon.Hash, err error)
- func StateStep(ctx context.Context, batch kv.RwTx, stateSync *sync_stages.Sync, ...) (err error)
- type MockSentry
- func Mock(t *testing.T) *MockSentry
- func MockWithEverything(t *testing.T, gspec *types.Genesis, key *ecdsa.PrivateKey, prune prune.Mode, ...) *MockSentry
- func MockWithGenesis(t *testing.T, gspec *types.Genesis, key *ecdsa.PrivateKey, ...) *MockSentry
- func MockWithGenesisEngine(t *testing.T, gspec *types.Genesis, engine consensus.Engine, ...) *MockSentry
- func MockWithGenesisPruneMode(t *testing.T, gspec *types.Genesis, key *ecdsa.PrivateKey, prune prune.Mode, ...) *MockSentry
- func MockWithTxPool(t *testing.T) *MockSentry
- func MockWithZeroTTD(t *testing.T, withPosDownloader bool) *MockSentry
- func MockWithZeroTTDGnosis(t *testing.T, withPosDownloader bool) *MockSentry
- func (ms *MockSentry) Close()
- func (ms *MockSentry) EnableLogs()
- func (ms *MockSentry) HandShake(ctx context.Context, in *emptypb.Empty) (*proto_sentry.HandShakeReply, error)
- func (ms *MockSentry) HeaderDownload() *headerdownload.HeaderDownload
- func (ms *MockSentry) HistoryV3Components() *libstate.AggregatorV3
- func (ms *MockSentry) InsertChain(chain *core.ChainPack) error
- func (ms *MockSentry) Messages(req *proto_sentry.MessagesRequest, stream proto_sentry.Sentry_MessagesServer) error
- func (ms *MockSentry) NewHistoryStateReader(blockNum uint64, tx kv.Tx) state.StateReader
- func (ms *MockSentry) NewStateReader(tx kv.Tx) state.StateReader
- func (ms *MockSentry) NodeInfo(context.Context, *emptypb.Empty) (*ptypes.NodeInfoReply, error)
- func (ms *MockSentry) PeerById(context.Context, *proto_sentry.PeerByIdRequest) (*proto_sentry.PeerByIdReply, error)
- func (ms *MockSentry) PeerCount(context.Context, *proto_sentry.PeerCountRequest) (*proto_sentry.PeerCountReply, error)
- func (ms *MockSentry) PeerEvents(req *proto_sentry.PeerEventsRequest, ...) error
- func (ms *MockSentry) PeerMinBlock(context.Context, *proto_sentry.PeerMinBlockRequest) (*emptypb.Empty, error)
- func (ms *MockSentry) Peers(context.Context, *emptypb.Empty) (*proto_sentry.PeersReply, error)
- func (ms *MockSentry) PenalizePeer(context.Context, *proto_sentry.PenalizePeerRequest) (*emptypb.Empty, error)
- func (ms *MockSentry) ReceivePayloadStatus() engineapi.PayloadStatus
- func (ms *MockSentry) Send(req *proto_sentry.InboundMessage) (errs []error)
- func (ms *MockSentry) SendForkChoiceRequest(message *engineapi.ForkChoiceMessage)
- func (ms *MockSentry) SendMessageById(_ context.Context, r *proto_sentry.SendMessageByIdRequest) (*proto_sentry.SentPeers, error)
- func (ms *MockSentry) SendMessageByMinBlock(_ context.Context, r *proto_sentry.SendMessageByMinBlockRequest) (*proto_sentry.SentPeers, error)
- func (ms *MockSentry) SendMessageToAll(_ context.Context, r *proto_sentry.OutboundMessageData) (*proto_sentry.SentPeers, error)
- func (ms *MockSentry) SendMessageToRandomPeers(_ context.Context, r *proto_sentry.SendMessageToRandomPeersRequest) (*proto_sentry.SentPeers, error)
- func (ms *MockSentry) SendPayloadRequest(message *types.Block)
- func (ms *MockSentry) SentMessage(i int) *proto_sentry.OutboundMessageData
- func (ms *MockSentry) SetStatus(context.Context, *proto_sentry.StatusData) (*proto_sentry.SetStatusReply, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MiningStep ¶
func NewDefaultStages ¶
func NewDefaultStages(ctx context.Context, db kv.RwDB, p2pCfg p2p.Config, cfg *ethconfig.Config, controlServer *sentry.MultiClient, notifications *shards.Notifications, snapDownloader proto_downloader.DownloaderClient, snapshots *snapshotsync.RoSnapshots, agg *state.AggregatorV3, forkValidator *engineapi.ForkValidator, engine consensus.Engine, ) []*sync_stages.Stage
func NewDefaultZkStages ¶
func NewDefaultZkStages(ctx context.Context, db kv.RwDB, p2pCfg p2p.Config, cfg *ethconfig.Config, controlServer *sentry.MultiClient, notifications *shards.Notifications, snapDownloader proto_downloader.DownloaderClient, snapshots *snapshotsync.RoSnapshots, agg *state.AggregatorV3, forkValidator *engineapi.ForkValidator, engine consensus.Engine, l1Syncer *syncer.L1Syncer, datastreamClient *client.StreamClient, ) []*sync_stages.Stage
func NewInMemoryExecution ¶
func NewInMemoryExecution(ctx context.Context, db kv.RwDB, cfg *ethconfig.Config, controlServer *sentry.MultiClient, dirs datadir.Dirs, notifications *shards.Notifications, snapshots *snapshotsync.RoSnapshots, agg *state.AggregatorV3) (*sync_stages.Sync, error)
func SendPayloadStatus ¶
func SendPayloadStatus(hd *headerdownload.HeaderDownload, headBlockHash libcommon.Hash, err error)
func StageLoop ¶
func StageLoop( ctx context.Context, chainConfig *chain.Config, db kv.RwDB, sync *sync_stages.Sync, hd *headerdownload.HeaderDownload, notifications *shards.Notifications, updateHead func(ctx context.Context, headHeight, headTime uint64, hash libcommon.Hash, td *uint256.Int), waitForDone chan struct{}, loopMinTime time.Duration, )
StageLoop runs the continuous loop of staged sync
func StageLoopStep ¶
func StageLoopStep(ctx context.Context, chainConfig *chain.Config, db kv.RwDB, sync *sync_stages.Sync, notifications *shards.Notifications, initialCycle bool, updateHead func(ctx context.Context, headHeight uint64, headTime uint64, hash libcommon.Hash, td *uint256.Int), ) (headBlockHash libcommon.Hash, err error)
Types ¶
type MockSentry ¶
type MockSentry struct { proto_sentry.UnimplementedSentryServer Ctx context.Context Log log.Logger DB kv.RwDB Dirs datadir.Dirs Engine consensus.Engine ChainConfig *chain.Config Sync *sync_stages.Sync MiningSync *sync_stages.Sync PendingBlocks chan *types.Block MinedBlocks chan *types.Block Key *ecdsa.PrivateKey Genesis *types.Block SentryClient direct.SentryClient PeerId *ptypes.H512 UpdateHead func(Ctx context.Context, headHeight, headTime uint64, hash libcommon.Hash, td *uint256.Int) StreamWg sync.WaitGroup ReceiveWg sync.WaitGroup Address libcommon.Address Notifications *shards.Notifications // TxPool TxPoolFetch *txpool.Fetch TxPoolSend *txpool.Send TxPoolGrpcServer *txpool.GrpcServer TxPool *txpool.TxPool HistoryV3 bool TransactionsV3 bool BlockSnapshots *snapshotsync.RoSnapshots // contains filtered or unexported fields }
func Mock ¶
func Mock(t *testing.T) *MockSentry
Mock is convenience function to create a mock with some pre-set values
func MockWithEverything ¶
func MockWithGenesis ¶
func MockWithGenesis(t *testing.T, gspec *types.Genesis, key *ecdsa.PrivateKey, withPosDownloader bool) *MockSentry
func MockWithGenesisEngine ¶
func MockWithGenesisPruneMode ¶
func MockWithGenesisPruneMode(t *testing.T, gspec *types.Genesis, key *ecdsa.PrivateKey, prune prune.Mode, withPosDownloader bool) *MockSentry
func MockWithTxPool ¶
func MockWithTxPool(t *testing.T) *MockSentry
func MockWithZeroTTD ¶
func MockWithZeroTTD(t *testing.T, withPosDownloader bool) *MockSentry
func MockWithZeroTTDGnosis ¶
func MockWithZeroTTDGnosis(t *testing.T, withPosDownloader bool) *MockSentry
func (*MockSentry) Close ¶
func (ms *MockSentry) Close()
func (*MockSentry) EnableLogs ¶
func (ms *MockSentry) EnableLogs()
func (*MockSentry) HandShake ¶
func (ms *MockSentry) HandShake(ctx context.Context, in *emptypb.Empty) (*proto_sentry.HandShakeReply, error)
func (*MockSentry) HeaderDownload ¶
func (ms *MockSentry) HeaderDownload() *headerdownload.HeaderDownload
func (*MockSentry) HistoryV3Components ¶
func (ms *MockSentry) HistoryV3Components() *libstate.AggregatorV3
func (*MockSentry) InsertChain ¶
func (ms *MockSentry) InsertChain(chain *core.ChainPack) error
func (*MockSentry) Messages ¶
func (ms *MockSentry) Messages(req *proto_sentry.MessagesRequest, stream proto_sentry.Sentry_MessagesServer) error
func (*MockSentry) NewHistoryStateReader ¶
func (ms *MockSentry) NewHistoryStateReader(blockNum uint64, tx kv.Tx) state.StateReader
func (*MockSentry) NewStateReader ¶
func (ms *MockSentry) NewStateReader(tx kv.Tx) state.StateReader
func (*MockSentry) NodeInfo ¶
func (ms *MockSentry) NodeInfo(context.Context, *emptypb.Empty) (*ptypes.NodeInfoReply, error)
func (*MockSentry) PeerById ¶
func (ms *MockSentry) PeerById(context.Context, *proto_sentry.PeerByIdRequest) (*proto_sentry.PeerByIdReply, error)
func (*MockSentry) PeerCount ¶
func (ms *MockSentry) PeerCount(context.Context, *proto_sentry.PeerCountRequest) (*proto_sentry.PeerCountReply, error)
func (*MockSentry) PeerEvents ¶
func (ms *MockSentry) PeerEvents(req *proto_sentry.PeerEventsRequest, server proto_sentry.Sentry_PeerEventsServer) error
func (*MockSentry) PeerMinBlock ¶
func (ms *MockSentry) PeerMinBlock(context.Context, *proto_sentry.PeerMinBlockRequest) (*emptypb.Empty, error)
func (*MockSentry) Peers ¶
func (ms *MockSentry) Peers(context.Context, *emptypb.Empty) (*proto_sentry.PeersReply, error)
func (*MockSentry) PenalizePeer ¶
func (ms *MockSentry) PenalizePeer(context.Context, *proto_sentry.PenalizePeerRequest) (*emptypb.Empty, error)
func (*MockSentry) ReceivePayloadStatus ¶
func (ms *MockSentry) ReceivePayloadStatus() engineapi.PayloadStatus
func (*MockSentry) Send ¶
func (ms *MockSentry) Send(req *proto_sentry.InboundMessage) (errs []error)
Stream returns stream, waiting if necessary
func (*MockSentry) SendForkChoiceRequest ¶
func (ms *MockSentry) SendForkChoiceRequest(message *engineapi.ForkChoiceMessage)
func (*MockSentry) SendMessageById ¶
func (ms *MockSentry) SendMessageById(_ context.Context, r *proto_sentry.SendMessageByIdRequest) (*proto_sentry.SentPeers, error)
func (*MockSentry) SendMessageByMinBlock ¶
func (ms *MockSentry) SendMessageByMinBlock(_ context.Context, r *proto_sentry.SendMessageByMinBlockRequest) (*proto_sentry.SentPeers, error)
func (*MockSentry) SendMessageToAll ¶
func (ms *MockSentry) SendMessageToAll(_ context.Context, r *proto_sentry.OutboundMessageData) (*proto_sentry.SentPeers, error)
func (*MockSentry) SendMessageToRandomPeers ¶
func (ms *MockSentry) SendMessageToRandomPeers(_ context.Context, r *proto_sentry.SendMessageToRandomPeersRequest) (*proto_sentry.SentPeers, error)
func (*MockSentry) SendPayloadRequest ¶
func (ms *MockSentry) SendPayloadRequest(message *types.Block)
func (*MockSentry) SentMessage ¶
func (ms *MockSentry) SentMessage(i int) *proto_sentry.OutboundMessageData
func (*MockSentry) SetStatus ¶
func (ms *MockSentry) SetStatus(context.Context, *proto_sentry.StatusData) (*proto_sentry.SetStatusReply, error)
Click to show internal directories.
Click to hide internal directories.