f3

package
v1.24.5 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ParticipationCheckProgressMaxAttempts defines the maximum number of failed attempts
	// before we abandon the current lease and restart the participation process.
	//
	// The default backoff takes 12 attempts to reach a maximum delay of 1 minute.
	// Allowing for 13 failures results in approximately 2 minutes of backoff since
	// the lease was granted. Given a lease validity of up to 5 instances, this means
	// we would give up on checking the lease during its mid-validity period;
	// typically when we would try to renew the participation ticket. Hence, the value
	// to 13.
	ParticipationCheckProgressMaxAttempts = 13

	// ParticipationLeaseTerm is the number of instances the miner will attempt to lease from nodes.
	ParticipationLeaseTerm = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type F3ParticipationAPI

type F3ParticipationAPI interface {
	F3GetOrRenewParticipationTicket(ctx context.Context, minerID address.Address, previous api.F3ParticipationTicket, instances uint64) (api.F3ParticipationTicket, error) //perm:sign
	F3Participate(ctx context.Context, ticket api.F3ParticipationTicket) (api.F3ParticipationLease, error)
	F3GetManifest(ctx context.Context) (*manifest.Manifest, error)
}

type F3Task

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

func NewF3Task

func NewF3Task(db *harmonydb.DB, api F3ParticipationAPI, actors map[dtypes.MinerAddress]bool) *F3Task

func (*F3Task) Adder

func (f *F3Task) Adder(taskFunc harmonytask.AddTaskFunc)

func (*F3Task) CanAccept

func (f *F3Task) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.TaskEngine) (*harmonytask.TaskID, error)

func (*F3Task) Do

func (f *F3Task) Do(taskID harmonytask.TaskID, stillOwned func() bool) (done bool, err error)

func (*F3Task) GetSpid

func (f *F3Task) GetSpid(db *harmonydb.DB, taskID int64) string

func (*F3Task) TypeDetails

func (f *F3Task) TypeDetails() harmonytask.TaskTypeDetails

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳