winning

package
v1.24.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: Apache-2.0, MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const InclusionCheckInterval = 5 * time.Minute
View Source
const MinInclusionEpochs = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type InclusionCheckNodeApi

type InclusionCheckNodeApi interface {
	ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)
	ChainHead(context.Context) (*types.TipSet, error)
}

type InclusionCheckTask

type InclusionCheckTask struct {
	// contains filtered or unexported fields
}

func NewInclusionCheckTask

func NewInclusionCheckTask(db *harmonydb.DB, api InclusionCheckNodeApi) *InclusionCheckTask

func (*InclusionCheckTask) Adder

func (i *InclusionCheckTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*InclusionCheckTask) CanAccept

func (*InclusionCheckTask) Do

func (i *InclusionCheckTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*InclusionCheckTask) TypeDetails

type MiningBase

type MiningBase struct {
	TipSet      *types.TipSet
	ComputeTime time.Time
	AddRounds   abi.ChainEpoch
}

MiningBase is the tipset on top of which we plan to construct our next block. Refer to godocs on GetBestMiningCandidate.

type WinPostAPI

type WinPostAPI interface {
	ChainHead(context.Context) (*types.TipSet, error)
	ChainTipSetWeight(context.Context, types.TipSetKey) (types.BigInt, error)
	ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error)

	StateGetBeaconEntry(context.Context, abi.ChainEpoch) (*types.BeaconEntry, error)
	SyncSubmitBlock(context.Context, *types.BlockMsg) error
	StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error)
	StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error)
	StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
	StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error)

	MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error)
	MinerCreateBlock(context.Context, *api.BlockTemplate) (*types.BlockMsg, error)
	MpoolSelect(context.Context, types.TipSetKey, float64) ([]*types.SignedMessage, error)

	WalletSign(context.Context, address.Address, []byte) (*crypto.Signature, error)
}

type WinPostTask

type WinPostTask struct {
	// contains filtered or unexported fields
}

func NewWinPostTask

func NewWinPostTask(max int, db *harmonydb.DB, remote *paths.Remote, verifier storiface.Verifier, paramck func() (bool, error), api WinPostAPI, actors map[dtypes.MinerAddress]bool) *WinPostTask

func (*WinPostTask) Adder

func (t *WinPostTask) Adder(taskFunc harmonytask.AddTaskFunc)

func (*WinPostTask) CanAccept

func (t *WinPostTask) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.TaskEngine) (*harmonytask.TaskID, error)

func (*WinPostTask) Do

func (t *WinPostTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*WinPostTask) GetSpid added in v1.22.1

func (t *WinPostTask) GetSpid(db *harmonydb.DB, taskID int64) string

func (*WinPostTask) TypeDetails

func (t *WinPostTask) TypeDetails() harmonytask.TaskTypeDetails

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL