messagepool

package
v1.1.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0, MIT Imports: 36 Imported by: 14

Documentation

Index

Constants

View Source
const MaxBlocks = 15
View Source
const RbfDenom = 256

Variables

View Source
var (
	ReplaceByFeeRatioDefault  = 1.25
	MemPoolSizeLimitHiDefault = 30000
	MemPoolSizeLimitLoDefault = 20000
	PruneCooldownDefault      = time.Minute
	GasLimitOverestimation    = 1.25

	ConfigKey = datastore.NewKey("/mpool/config")
)
View Source
var (
	ErrMessageTooBig = errors.New("message too big")

	ErrMessageValueTooHigh = errors.New("cannot send more filecoin than will ever exist")

	ErrNonceTooLow = errors.New("message nonce too low")

	ErrGasFeeCapTooLow = errors.New("gas fee cap too low")

	ErrNotEnoughFunds = errors.New("not enough funds to execute transaction")

	ErrInvalidToAddr = errors.New("message had invalid to address")

	ErrSoftValidationFailure  = errors.New("validation failure")
	ErrRBFTooLowPremium       = errors.New("replace by fee has too low GasPremium")
	ErrTooManyPendingMessages = errors.New("too many pending messages for actor")
	ErrNonceGap               = errors.New("unfulfilled nonce gap")
)
View Source
var (
	HeadChangeCoalesceMinDelay      = 2 * time.Second
	HeadChangeCoalesceMaxDelay      = 6 * time.Second
	HeadChangeCoalesceMergeInterval = time.Second
)
View Source
var MaxActorPendingMessages = 1000
View Source
var MaxNonceGap = uint64(4)
View Source
var MaxUntrustedActorPendingMessages = 10
View Source
var RepublishBatchDelay = 100 * time.Millisecond

Functions

func CapGasFee added in v0.7.1

func CapGasFee(mff dtypes.DefaultMaxFeeFunc, msg *types.Message, maxFee abi.TokenAmount)

func ComputeMinRBF added in v0.6.2

func ComputeMinRBF(curPrem abi.TokenAmount) abi.TokenAmount

func DefaultConfig added in v0.5.0

func DefaultConfig() *types.MpoolConfig

Types

type MessagePool

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

func New

func (*MessagePool) Add

func (mp *MessagePool) Add(m *types.SignedMessage) error

func (*MessagePool) Clear added in v0.5.0

func (mp *MessagePool) Clear(local bool)

func (*MessagePool) Close

func (mp *MessagePool) Close() error

func (*MessagePool) GetConfig added in v0.5.0

func (mp *MessagePool) GetConfig() *types.MpoolConfig

func (*MessagePool) GetNonce

func (mp *MessagePool) GetNonce(addr address.Address) (uint64, error)

func (*MessagePool) HeadChange

func (mp *MessagePool) HeadChange(revert []*types.TipSet, apply []*types.TipSet) error

func (*MessagePool) MessagesForBlocks

func (mp *MessagePool) MessagesForBlocks(blks []*types.BlockHeader) ([]*types.SignedMessage, error)

func (*MessagePool) Pending

func (mp *MessagePool) Pending() ([]*types.SignedMessage, *types.TipSet)

func (*MessagePool) PendingFor added in v0.5.0

func (mp *MessagePool) PendingFor(a address.Address) ([]*types.SignedMessage, *types.TipSet)

func (*MessagePool) Prune added in v0.5.0

func (mp *MessagePool) Prune()

func (*MessagePool) Push

func (mp *MessagePool) Push(m *types.SignedMessage) (cid.Cid, error)

func (*MessagePool) PushUntrusted added in v0.9.0

func (mp *MessagePool) PushUntrusted(m *types.SignedMessage) (cid.Cid, error)

this method is provided for the gateway to push messages. differences from Push:

  • strict checks are enabled
  • extra strict add checks are used when adding the messages to the msgSet that means: no nonce gaps, at most 10 pending messages for the actor

func (*MessagePool) RecoverSig

func (mp *MessagePool) RecoverSig(msg *types.Message) *types.SignedMessage

func (*MessagePool) Remove

func (mp *MessagePool) Remove(from address.Address, nonce uint64, applied bool)

func (*MessagePool) SelectMessages added in v0.5.0

func (mp *MessagePool) SelectMessages(ts *types.TipSet, tq float64) ([]*types.SignedMessage, error)

func (*MessagePool) SetConfig added in v0.5.0

func (mp *MessagePool) SetConfig(cfg *types.MpoolConfig) error

func (*MessagePool) Updates

func (mp *MessagePool) Updates(ctx context.Context) (<-chan api.MpoolUpdate, error)

func (*MessagePool) VerifyMsgSig added in v0.3.1

func (mp *MessagePool) VerifyMsgSig(m *types.SignedMessage) error

type MessagePoolEvt added in v0.7.1

type MessagePoolEvt struct {
	Action   string
	Messages []MessagePoolEvtMessage
	Error    error `json:",omitempty"`
}

MessagePoolEvt is the journal entry for message pool events.

type MessagePoolEvtMessage added in v0.7.1

type MessagePoolEvtMessage struct {
	types.Message

	CID cid.Cid
}

type Provider

type Provider interface {
	SubscribeHeadChanges(func(rev, app []*types.TipSet) error) *types.TipSet
	PutMessage(m types.ChainMsg) (cid.Cid, error)
	PubSubPublish(string, []byte) error
	GetActorAfter(address.Address, *types.TipSet) (*types.Actor, error)
	StateAccountKey(context.Context, address.Address, *types.TipSet) (address.Address, error)
	MessagesForBlock(*types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error)
	MessagesForTipset(*types.TipSet) ([]types.ChainMsg, error)
	LoadTipSet(tsk types.TipSetKey) (*types.TipSet, error)
	ChainComputeBaseFee(ctx context.Context, ts *types.TipSet) (types.BigInt, error)
}

func NewProvider

func NewProvider(sm *stmgr.StateManager, ps *pubsub.PubSub) Provider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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