stages

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0, MIT Imports: 31 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TargetFunds  = abi.TokenAmount(types.MustParseFIL("1000FIL"))
	MinimumFunds = abi.TokenAmount(types.MustParseFIL("100FIL"))
)

Functions

This section is empty.

Types

type Committer

type Committer interface {
	EnqueueProveCommit(addr address.Address, preCommitEpoch abi.ChainEpoch, info minertypes.SectorPreCommitInfo) error
}

type Funding

type Funding interface {
	SendAndFund(*blockbuilder.BlockBuilder, *types.Message) (*types.MessageReceipt, error)
	Fund(*blockbuilder.BlockBuilder, address.Address) error
}

type FundingStage

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

func NewFundingStage

func NewFundingStage() (*FundingStage, error)

func (*FundingStage) Fund

func (fs *FundingStage) Fund(bb *blockbuilder.BlockBuilder, target address.Address) error

func (*FundingStage) Name

func (*FundingStage) Name() string

func (*FundingStage) PackMessages

func (fs *FundingStage) PackMessages(ctx context.Context, bb *blockbuilder.BlockBuilder) (_err error)

func (*FundingStage) SendAndFund

func (fs *FundingStage) SendAndFund(bb *blockbuilder.BlockBuilder, msg *types.Message) (res *types.MessageReceipt, err error)

SendAndFund "packs" the given message, funding the actor if necessary. It:

  1. Tries to send the given message.
  2. If that fails, it checks to see if the exit code was ErrInsufficientFunds.
  3. If so, it sends 1K FIL from the "burnt funds actor" (because we need to send it from somewhere) and re-tries the message.0

type PreCommitStage

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

func NewPreCommitStage

func NewPreCommitStage(funding Funding, committer Committer) (*PreCommitStage, error)

func (*PreCommitStage) Name

func (*PreCommitStage) Name() string

func (*PreCommitStage) PackMessages

func (stage *PreCommitStage) PackMessages(ctx context.Context, bb *blockbuilder.BlockBuilder) (_err error)

PackMessages packs pre-commit messages until the block is full.

type ProveCommitStage

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

func NewProveCommitStage

func NewProveCommitStage(funding Funding) (*ProveCommitStage, error)

func (*ProveCommitStage) EnqueueProveCommit

func (stage *ProveCommitStage) EnqueueProveCommit(
	minerAddr address.Address, preCommitEpoch abi.ChainEpoch, info minertypes.SectorPreCommitInfo,
) error

func (*ProveCommitStage) Name

func (*ProveCommitStage) Name() string

func (*ProveCommitStage) PackMessages

func (stage *ProveCommitStage) PackMessages(ctx context.Context, bb *blockbuilder.BlockBuilder) (_err error)

PackMessages packs all prove-commits for all "ready to be proven" sectors until it fills the block or runs out.

type Stage

type Stage interface {
	Name() string
	PackMessages(ctx context.Context, bb *blockbuilder.BlockBuilder) error
}

Stage is a stage of the simulation. It's asked to pack messages for every block.

func DefaultPipeline

func DefaultPipeline() ([]Stage, error)

DefaultPipeline returns the default stage pipeline. This pipeline.

1. Funds a "funding" actor, if necessary. 2. Submits any ready window posts. 3. Submits any ready prove commits. 4. Submits pre-commits with the remaining gas.

type WindowPoStStage

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

func NewWindowPoStStage

func NewWindowPoStStage() (*WindowPoStStage, error)

func (*WindowPoStStage) Name

func (*WindowPoStStage) Name() string

func (*WindowPoStStage) PackMessages

func (stage *WindowPoStStage) PackMessages(ctx context.Context, bb *blockbuilder.BlockBuilder) (_err error)

PackMessages packs window posts until either the block is full or all healty sectors have been proven. It does not recover sectors.

Jump to

Keyboard shortcuts

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