Documentation ¶
Index ¶
- Constants
- type ActiveSync
- type ChainSyncProvider
- type ComputeStateOutput
- type InvocResult
- type MsgGasCost
- type SyncState
- type SyncStateStage
- type SyncerAPI
- func (syncerAPI *SyncerAPI) ChainSyncHandleNewTipSet(ci *types.ChainInfo) error
- func (syncerAPI *SyncerAPI) ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (big.Int, error)
- func (syncerAPI *SyncerAPI) Concurrent() int64
- func (syncerAPI *SyncerAPI) SetConcurrent(concurrent int64)
- func (syncerAPI *SyncerAPI) StateCall(ctx context.Context, msg *types.UnsignedMessage, tsk types.TipSetKey) (*InvocResult, error)
- func (syncerAPI *SyncerAPI) SyncState(ctx context.Context) (*SyncState, error)
- func (syncerAPI *SyncerAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error
- func (syncerAPI *SyncerAPI) SyncerTracker() *syncTypes.TargetTracker
- type SyncerSubmodule
Constants ¶
const ( StageIdle = SyncStateStage(iota) StageHeaders StagePersistHeaders StageMessages StageSyncComplete StageSyncErrored StageFetchingMessages )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveSync ¶
type ChainSyncProvider ¶
type ChainSyncProvider struct {
// contains filtered or unexported fields
}
ChainSyncProvider provides access to chain sync operations and their status.
func NewChainSyncProvider ¶
func NewChainSyncProvider(chainSyncer chainSync) *ChainSyncProvider
NewChainSyncProvider returns a new ChainSyncProvider.
func (*ChainSyncProvider) HandleNewTipSet ¶
func (chs *ChainSyncProvider) HandleNewTipSet(ci *types.ChainInfo) error
HandleNewTipSet extends the Syncer's chain store with the given tipset if they represent a valid extension. It limits the length of new chains it will attempt to validate and caches invalid blocks it has encountered to help prevent DOS.
type ComputeStateOutput ¶ added in v0.9.1
type ComputeStateOutput struct { Root cid.Cid Trace []*InvocResult }
type InvocResult ¶
type InvocResult struct { MsgCid cid.Cid Msg *types.UnsignedMessage MsgRct *types.MessageReceipt GasCost MsgGasCost ExecutionTrace types.ExecutionTrace Error string Duration time.Duration }
type MsgGasCost ¶
type MsgGasCost struct { Message cid.Cid // Can be different than requested, in case it was replaced, but only gas values changed GasUsed abi.TokenAmount BaseFeeBurn abi.TokenAmount OverEstimationBurn abi.TokenAmount MinerPenalty abi.TokenAmount MinerTip abi.TokenAmount Refund abi.TokenAmount TotalCost abi.TokenAmount }
type SyncState ¶
type SyncState struct { ActiveSyncs []ActiveSync VMApplied uint64 }
type SyncStateStage ¶
type SyncStateStage int
just compatible code lotus
func (SyncStateStage) String ¶
func (v SyncStateStage) String() string
type SyncerAPI ¶
type SyncerAPI struct {
// contains filtered or unexported fields
}
func (*SyncerAPI) ChainSyncHandleNewTipSet ¶
ChainSyncHandleNewTipSet submits a chain head to the syncer for processing.
func (*SyncerAPI) ChainTipSetWeight ¶
func (*SyncerAPI) Concurrent ¶ added in v0.9.4
SyncerStatus returns the current status of the active or last active chain sync operation.
func (*SyncerAPI) SetConcurrent ¶ added in v0.9.1
SyncerStatus returns the current status of the active or last active chain sync operation.
func (*SyncerAPI) StateCall ¶
func (syncerAPI *SyncerAPI) StateCall(ctx context.Context, msg *types.UnsignedMessage, tsk types.TipSetKey) (*InvocResult, error)
func (*SyncerAPI) SyncSubmitBlock ¶
func (*SyncerAPI) SyncerTracker ¶
func (syncerAPI *SyncerAPI) SyncerTracker() *syncTypes.TargetTracker
SyncerStatus returns the current status of the active or last active chain sync operation.
type SyncerSubmodule ¶
type SyncerSubmodule struct { BlockstoreModule *blockstore.BlockstoreSubmodule ChainModule *chain2.ChainSubmodule NetworkModule *network.NetworkSubmodule DiscoverySubmodule *discovery.DiscoverySubmodule BlockTopic *pubsub.Topic BlockSub pubsub.Subscription ChainSelector nodeChainSelector Consensus consensus.Protocol ChainSyncManager *chainsync.Manager Drand beacon.Schedule SyncProvider ChainSyncProvider SlashFilter slashfilter.ISlashFilter BlockValidator *consensus.BlockValidator // cancelChainSync cancels the context for chain sync subscriptions and handlers. CancelChainSync context.CancelFunc }
SyncerSubmodule enhances the node with chain syncing capabilities
func NewSyncerSubmodule ¶
func NewSyncerSubmodule(ctx context.Context, config syncerConfig, blockstore *blockstore.BlockstoreSubmodule, network *network.NetworkSubmodule, discovery *discovery.DiscoverySubmodule, chn *chain2.ChainSubmodule, postVerifier consensus.ProofVerifier) (*SyncerSubmodule, error)
NewSyncerSubmodule creates a new chain submodule.
func (*SyncerSubmodule) API ¶
func (syncer *SyncerSubmodule) API() *SyncerAPI
func (*SyncerSubmodule) Start ¶
func (syncer *SyncerSubmodule) Start(ctx context.Context) error
Start starts the syncer submodule for a node.
func (*SyncerSubmodule) Stop ¶
func (syncer *SyncerSubmodule) Stop(ctx context.Context)