Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // IDRequestInterval specifies the interval for malfeasance proof id requests to the network. IDRequestInterval time.Duration `mapstructure:"id-request-interval"` // MalfeasanceIDPeers is the number of peers to fetch node IDs for malfeasance proofs from. MalfeasanceIDPeers int `mapstructure:"malfeasance-id-peers"` // Minimum number of peers to sync against for initial sync to be considered complete. MinSyncPeers int `mapstructure:"min-sync-peers"` // MaxEpochFraction specifies maximum fraction of epoch to expire before // synchronous malfeasance proof sync is needed upon startup. MaxEpochFraction float64 `mapstructure:"max-epoch-fraction"` // MaxBatchSize is the maximum number of node IDs to sync in a single request. MaxBatchSize int `mapstructure:"max-batch-size"` // RequestsLimit is the maximum number of requests for a single malfeasance proof. // // The purpose of it is to prevent peers from advertising invalid node ID and disappearing. // Which will make node ask other peers for invalid malfeasance proofs. // It will be reset to 0 once malfeasance proof is advertised again. RequestsLimit int `mapstructure:"requests-limit"` // RetryInterval specifies retry interval for the initial sync. RetryInterval time.Duration `mapstructure:"retry-interval"` }
func DefaultConfig ¶
func DefaultConfig() Config
type Opt ¶
type Opt func(*Syncer)
func WithConfig ¶
func WithLogger ¶
func WithPeerErrMetric ¶
func WithPeerErrMetric(counter counter) Opt
Click to show internal directories.
Click to hide internal directories.