storageingest

package
v1.24.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const IdealEndEpochBuffer = 2 * builtin.EpochsInDay
View Source
const MaxEndEpochBufferUnverified = 180 * builtin.EpochsInDay

Variables

View Source
var SnapImmutableDeadlineEpochsBuffer = abi.ChainEpoch(40)

assuming that snap takes up to 20min to get to submitting the message we want to avoid sectors from deadlines which will become immutable in the next 20min (40 epochs) NOTE: Don't set this value to more than one deadline (60 epochs)

Functions

func SealNow

func SealNow(ctx context.Context, node SealNowNodeApi, db *harmonydb.DB, act address.Address, sector abi.SectorNumber, synthetic bool) error

SealNow is triggerred by the user to seal a sector immediately. Can be from the CLI or the web interface.

Types

type Ingester

type Ingester interface {
	AllocatePieceToSector(ctx context.Context, tx *harmonydb.Tx, maddr address.Address, piece lpiece.PieceDealInfo, rawSize int64, source url.URL, header http.Header) (*abi.SectorNumber, *abi.RegisteredSealProof, error)
	GetExpectedSealDuration() abi.ChainEpoch
}

type PieceIngester

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

func NewPieceIngester

func NewPieceIngester(ctx context.Context, db *harmonydb.DB, api PieceIngesterApi, miners []address.Address, cfg *config.CurioConfig) (*PieceIngester, error)

func (*PieceIngester) AllocatePieceToSector

func (p *PieceIngester) AllocatePieceToSector(ctx context.Context, tx *harmonydb.Tx, maddr address.Address, piece lpiece.PieceDealInfo, rawSize int64, source url.URL, header http.Header) (*abi.SectorNumber, *abi.RegisteredSealProof, error)

func (*PieceIngester) GetExpectedSealDuration

func (p *PieceIngester) GetExpectedSealDuration() abi.ChainEpoch

func (*PieceIngester) Seal

func (p *PieceIngester) Seal() error

type PieceIngesterApi

type PieceIngesterApi interface {
	ChainHead(context.Context) (*types.TipSet, error)
	StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error)
	StateMinerAllocated(ctx context.Context, a address.Address, key types.TipSetKey) (*bitfield.BitField, error)
	StateNetworkVersion(ctx context.Context, key types.TipSetKey) (network.Version, error)
	StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifregtypes.AllocationId, tsk types.TipSetKey) (*verifregtypes.Allocation, error)
	StateGetAllocationForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*verifregtypes.Allocation, error)
	StateGetAllocationIdForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (verifregtypes.AllocationId, error)
	StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error)
	StateSectorGetInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)

	StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error)
	StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]api.Partition, error)
	StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error)
}

type PieceIngesterSnap

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

func NewPieceIngesterSnap

func NewPieceIngesterSnap(ctx context.Context, db *harmonydb.DB, api PieceIngesterApi, miners []address.Address, cfg *config.CurioConfig) (*PieceIngesterSnap, error)

func (*PieceIngesterSnap) AllocatePieceToSector

func (p *PieceIngesterSnap) AllocatePieceToSector(ctx context.Context, tx *harmonydb.Tx, maddr address.Address, piece lpiece.PieceDealInfo, rawSize int64, source url.URL, header http.Header) (*abi.SectorNumber, *abi.RegisteredSealProof, error)

func (*PieceIngesterSnap) GetExpectedSealDuration

func (p *PieceIngesterSnap) GetExpectedSealDuration() abi.ChainEpoch

func (*PieceIngesterSnap) Seal

func (p *PieceIngesterSnap) Seal() error

type SealNowNodeApi

type SealNowNodeApi interface {
	StateMinerInfo(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MinerInfo, error)
	StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (networkVersion network.Version, err error)
}

Jump to

Keyboard shortcuts

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