Documentation
¶
Index ¶
Constants ¶
View Source
const VersionCapability = 7
Variables ¶
View Source
var ( DefaultCommitteeLookback uint64 = 10 // Default configuration for the EC Backend DefaultEcConfig = EcConfig{ Finality: 900, Period: 30 * time.Second, DelayMultiplier: 2., BaseDecisionBackoffTable: []float64{1.3, 1.69, 2.2, 2.86, 3.71, 4.83, 6.27, 7.5}, HeadLookback: 0, Finalize: true, } DefaultGpbftConfig = GpbftConfig{ Delta: 6 * time.Second, DeltaBackOffExponent: 2.0, QualityDeltaMultiplier: 1.0, MaxLookaheadRounds: 5, ChainProposedLength: gpbft.ChainDefaultLen, RebroadcastBackoffBase: 6 * time.Second, RebroadcastBackoffSpread: 0.1, RebroadcastBackoffExponent: 1.3, RebroadcastBackoffMax: 60 * time.Second, } DefaultCxConfig = CxConfig{ ClientRequestTimeout: 10 * time.Second, ServerRequestTimeout: time.Minute, MinimumPollInterval: DefaultEcConfig.Period, MaximumPollInterval: 4 * DefaultEcConfig.Period, } DefaultPubSubConfig = PubSubConfig{ CompressionEnabled: true, ChainCompressionEnabled: true, GMessageSubscriptionBufferSize: 128, ValidatedMessageBufferSize: 128, } DefaultChainExchangeConfig = ChainExchangeConfig{ SubscriptionBufferSize: 32, MaxChainLength: gpbft.ChainDefaultLen, MaxInstanceLookahead: DefaultCommitteeLookback, MaxDiscoveredChainsPerInstance: 1_000, MaxWantedChainsPerInstance: 1_000, RebroadcastInterval: 2 * time.Second, MaxTimestampAge: 8 * time.Second, } DefaultPartialMessageManagerConfig = PartialMessageManagerConfig{ PendingDiscoveredChainsBufferSize: 100, PendingPartialMessagesBufferSize: 100, PendingChainBroadcastsBufferSize: 100, PendingInstanceRemovalBufferSize: 10, CompletedMessagesBufferSize: 100, MaxBufferedMessagesPerInstance: 25_000, MaxCachedValidatedMessagesPerInstance: 25_000, } // Default instance alignment when catching up. DefaultCatchUpAlignment = DefaultEcConfig.Period / 2 )
View Source
var ErrNoManifest = errors.New("no known manifest")
ErrNoManifest is returned when no manifest is known.
Functions ¶
func ChainExchangeTopicFromNetworkName ¶ added in v0.8.0
func ChainExchangeTopicFromNetworkName(nn gpbft.NetworkName) string
func PubSubTopicFromNetworkName ¶
func PubSubTopicFromNetworkName(nn gpbft.NetworkName) string
Types ¶
type ChainExchangeConfig ¶ added in v0.8.0
type ChainExchangeConfig struct {
SubscriptionBufferSize int
MaxChainLength int
MaxInstanceLookahead uint64
MaxDiscoveredChainsPerInstance int
MaxWantedChainsPerInstance int
RebroadcastInterval time.Duration
MaxTimestampAge time.Duration
}
func (*ChainExchangeConfig) Validate ¶ added in v0.8.0
func (cx *ChainExchangeConfig) Validate() error
type CxConfig ¶
type CxConfig struct {
// Request timeout for the certificate exchange client.
ClientRequestTimeout time.Duration
// Request timeout for the certificate exchange server.
ServerRequestTimeout time.Duration
// Minimum CX polling interval.
MinimumPollInterval time.Duration
// Maximum CX polling interval.
MaximumPollInterval time.Duration
}
Certificate Exchange config
type EcConfig ¶
type EcConfig struct {
// The delay between tipsets.
Period time.Duration
// Number of epochs required to reach EC defined finality
Finality int64
// The multiplier on top of the Period of the time we will wait before starting a new instance,
// referencing the timestamp of the latest finalized tipset.
DelayMultiplier float64
// Table of incremental multipliers to backoff in units of Delay in case of base decisions
BaseDecisionBackoffTable []float64
// HeadLookback number of unfinalized tipsets to remove from the head
HeadLookback int
// Finalize indicates whether F3 should finalize tipsets as F3 agrees on them.
Finalize bool
}
type GpbftConfig ¶
type GpbftConfig struct {
Delta time.Duration
DeltaBackOffExponent float64
QualityDeltaMultiplier float64
MaxLookaheadRounds uint64
ChainProposedLength int
RebroadcastBackoffBase time.Duration
RebroadcastBackoffExponent float64
RebroadcastBackoffSpread float64
RebroadcastBackoffMax time.Duration
}
func (*GpbftConfig) ToOptions ¶ added in v0.1.0
func (g *GpbftConfig) ToOptions() []gpbft.Option
func (*GpbftConfig) Validate ¶ added in v0.0.5
func (g *GpbftConfig) Validate() error
type Manifest ¶
type Manifest struct {
// ProtocolVersion specifies protocol version to be used
ProtocolVersion uint64
// Initial instance to used for the f3 instance
InitialInstance uint64
// BootstrapEpoch from which the manifest should be applied
BootstrapEpoch int64
// Network name to apply for this manifest.
NetworkName gpbft.NetworkName
// InitialPowerTable specifies the optional CID of the initial power table
InitialPowerTable cid.Cid // !Defined() if nil
// We take the current power table from the head tipset this many instances ago.
CommitteeLookback uint64
// The alignment of instances while catching up. This should be slightly larger than the
// expected time to complete an instance.
//
// A good default is `4 * Manifest.Gpbft.Delta` (the expected time for a single-round
// instance).
CatchUpAlignment time.Duration
// Config parameters for gpbft
Gpbft GpbftConfig
// EC-specific parameters
EC EcConfig
// Certificate Exchange specific parameters
CertificateExchange CxConfig
// PubSubConfig specifies the pubsub related configuration.
PubSub PubSubConfig
// ChainExchange specifies the chain exchange configuration parameters.
ChainExchange ChainExchangeConfig
// PartialMessageManager specifies the configuration for the partial message manager.
PartialMessageManager PartialMessageManagerConfig
}
Manifest identifies the specific configuration for the F3 instance currently running.
func LocalDevnetManifest ¶
func LocalDevnetManifest() Manifest
func (*Manifest) DatastorePrefix ¶
func (*Manifest) GpbftOptions ¶
func (*Manifest) Marshal ¶
Marshal the manifest into JSON We use JSON because we need to serialize a float and time.Duration and the cbor serializer we use do not support these types yet.
func (*Manifest) PubSubTopic ¶
type PartialMessageManagerConfig ¶ added in v0.8.3
type PartialMessageManagerConfig struct {
PendingDiscoveredChainsBufferSize int
PendingPartialMessagesBufferSize int
PendingChainBroadcastsBufferSize int
PendingInstanceRemovalBufferSize int
CompletedMessagesBufferSize int
MaxBufferedMessagesPerInstance int
MaxCachedValidatedMessagesPerInstance int
}
func (*PartialMessageManagerConfig) Validate ¶ added in v0.8.3
func (pmm *PartialMessageManagerConfig) Validate() error
type PubSubConfig ¶ added in v0.8.0
type PubSubConfig struct {
CompressionEnabled bool
ChainCompressionEnabled bool
GMessageSubscriptionBufferSize int
ValidatedMessageBufferSize int
}
func (*PubSubConfig) Validate ¶ added in v0.8.0
func (p *PubSubConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.