Documentation ¶
Index ¶
- Variables
- type Config
- type DataFetch
- type ForkFinder
- func (ff *ForkFinder) AddResynced(lid types.LayerID, hash types.Hash32)
- func (ff *ForkFinder) FindFork(ctx context.Context, peer p2p.Peer, diffLid types.LayerID, ...) (types.LayerID, error)
- func (ff *ForkFinder) NeedResync(lid types.LayerID, hash types.Hash32) bool
- func (ff *ForkFinder) NumPeersCached() int
- func (ff *ForkFinder) Purge(all bool, toPurge ...p2p.Peer)
- func (ff *ForkFinder) UpdateAgreement(peer p2p.Peer, lid types.LayerID, hash types.Hash32, created time.Time)
- type Option
- type Syncer
Constants ¶
This section is empty.
Variables ¶
var ( ErrPeerMeshChangedMidSession = errors.New("peer mesh changed mid session") ErrNodeMeshChangedMidSession = errors.New("node mesh changed mid session") )
var (
MalPeerError = peerError.WithLabelValues("mal")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Interval time.Duration `mapstructure:"interval"` EpochEndFraction float64 `mapstructure:"epochendfraction"` HareDelayLayers uint32 SyncCertDistance uint32 // TallyVotesFrequency how often to tally votes during layers sync. // Setting this to 0.25 will tally votes after downloading data for quarter of the epoch. TallyVotesFrequency float64 MaxStaleDuration time.Duration `mapstructure:"maxstaleduration"` Standalone bool GossipDuration time.Duration `mapstructure:"gossipduration"` DisableMeshAgreement bool `mapstructure:"disable-mesh-agreement"` OutOfSyncThresholdLayers uint32 `mapstructure:"out-of-sync-threshold"` AtxSync atxsync.Config `mapstructure:"atx-sync"` MalSync malsync.Config `mapstructure:"malfeasance-sync"` }
Config is the config params for syncer.
type DataFetch ¶
type DataFetch struct {
// contains filtered or unexported fields
}
DataFetch contains the logic of fetching mesh data.
func NewDataFetch ¶
func NewDataFetch( msh meshProvider, fetch fetcher, tortoise system.Tortoise, lg log.Log, ) *DataFetch
NewDataFetch creates a new DataFetch instance.
func (*DataFetch) PollLayerData ¶
PollLayerData polls all peers for data in the specified layer.
func (*DataFetch) PollLayerOpinions ¶
type ForkFinder ¶
type ForkFinder struct {
// contains filtered or unexported fields
}
func NewForkFinder ¶
func (*ForkFinder) AddResynced ¶
func (ff *ForkFinder) AddResynced(lid types.LayerID, hash types.Hash32)
func (*ForkFinder) FindFork ¶
func (ff *ForkFinder) FindFork( ctx context.Context, peer p2p.Peer, diffLid types.LayerID, diffHash types.Hash32, ) (types.LayerID, error)
FindFork finds the point of divergence in layer opinions between the node and the specified peer from a given disagreed layer.
func (*ForkFinder) NeedResync ¶
func (*ForkFinder) NumPeersCached ¶
func (ff *ForkFinder) NumPeersCached() int
NumPeersCached returns the number of peer agreement cached.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer is responsible to keep the node in sync with the network.
func NewSyncer ¶
func NewSyncer( cdb *datastore.CachedDB, ticker layerTicker, beacon system.BeaconGetter, mesh *mesh.Mesh, tortoise system.Tortoise, fetcher fetcher, patrol layerPatrol, ch certHandler, atxSyncer atxSyncer, malSyncer malSyncer, opts ...Option, ) *Syncer
NewSyncer creates a new Syncer instance.
func (*Syncer) Close ¶
func (s *Syncer) Close()
Close stops the syncing process and the goroutines syncer spawns.
func (*Syncer) ListenToATXGossip ¶
ListenToATXGossip returns true if the node is listening to gossip for ATXs data.
func (*Syncer) ListenToGossip ¶
ListenToGossip returns true if the node is listening to gossip for blocks/TXs data.
func (*Syncer) RegisterForATXSynced ¶
func (s *Syncer) RegisterForATXSynced() <-chan struct{}
RegisterForATXSynced returns a channel for notification when the node enters ATX synced state.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Package blockssync is a generated GoMock package.
|
Package blockssync is a generated GoMock package. |
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |