Documentation
¶
Index ¶
- Constants
- Variables
- func CapGasFee(mff DefaultMaxFeeFunc, msg *types.UnsignedMessage, maxFee abi.TokenAmount)
- func ComputeMinRBF(curPrem abi.TokenAmount) abi.TokenAmount
- type DefaultMaxFeeFunc
- type MessagePool
- func (mp *MessagePool) Add(m *types.SignedMessage) error
- func (mp *MessagePool) Clear(local bool)
- func (mp *MessagePool) Close() error
- func (mp *MessagePool) DeleteByAdress(address address.Address) error
- func (mp *MessagePool) GasEstimateFeeCap(ctx context.Context, msg *types.UnsignedMessage, maxqueueblks int64, ...) (tbig.Int, error)
- func (mp *MessagePool) GasEstimateGasLimit(ctx context.Context, msgIn *types.UnsignedMessage, tsk block.TipSetKey) (int64, error)
- func (mp *MessagePool) GasEstimateGasPremium(ctx context.Context, nblocksincl uint64, sender address.Address, ...) (tbig.Int, error)
- func (mp *MessagePool) GasEstimateMessageGas(ctx context.Context, msg *types.UnsignedMessage, spec *types.MessageSendSpec, ...) (*types.UnsignedMessage, error)
- func (mp *MessagePool) GetConfig() *MpoolConfig
- func (mp *MessagePool) GetNonce(addr address.Address) (uint64, error)
- func (mp *MessagePool) HeadChange(revert []*block.TipSet, apply []*block.TipSet) error
- func (mp *MessagePool) MessagesForBlocks(blks []*block.Block) ([]*types.SignedMessage, error)
- func (mp *MessagePool) Pending() ([]*types.SignedMessage, *block.TipSet)
- func (mp *MessagePool) PendingFor(a address.Address) ([]*types.SignedMessage, *block.TipSet)
- func (mp *MessagePool) Prune()
- func (mp *MessagePool) PublishMsgForWallet(addr address.Address) error
- func (mp *MessagePool) Push(m *types.SignedMessage) (cid.Cid, error)
- func (mp *MessagePool) PushUntrusted(m *types.SignedMessage) (cid.Cid, error)
- func (mp *MessagePool) RecoverSig(msg *types.UnsignedMessage) *types.SignedMessage
- func (mp *MessagePool) Remove(from address.Address, nonce uint64, applied bool)
- func (mp *MessagePool) SelectMessages(ts *block.TipSet, tq float64) (msgs []*types.SignedMessage, err error)
- func (mp *MessagePool) SetConfig(cfg *MpoolConfig) error
- func (mp *MessagePool) Updates(ctx context.Context) (<-chan MpoolUpdate, error)
- func (mp *MessagePool) VerifyMsgSig(m *types.SignedMessage) error
- type MessagePoolEvt
- type MessagePoolEvtMessage
- type MpoolChange
- type MpoolConfig
- type MpoolLocker
- type MpoolUpdate
- type Provider
Constants ¶
View Source
const MaxBlocks = 15
View Source
const MinGasPremium = 100e3
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 MaxBlockMessages = 16000
View Source
var MaxNonceGap = uint64(4)
View Source
var MaxUntrustedActorPendingMessages = 10
View Source
var RepublishBatchDelay = 100 * time.Millisecond
View Source
var RepublishInterval = time.Duration(10*constants.BlockDelaySecs+constants.PropagationDelaySecs) * time.Second
Functions ¶
func CapGasFee ¶
func CapGasFee(mff DefaultMaxFeeFunc, msg *types.UnsignedMessage, maxFee abi.TokenAmount)
func ComputeMinRBF ¶
func ComputeMinRBF(curPrem abi.TokenAmount) abi.TokenAmount
Types ¶
type DefaultMaxFeeFunc ¶
type DefaultMaxFeeFunc func() (abi.TokenAmount, error)
type MessagePool ¶
type MessagePool struct {
GetMaxFee DefaultMaxFeeFunc
// contains filtered or unexported fields
}
func New ¶
func New(api Provider, ds repo.Datastore, forkParams *config.ForkUpgradeConfig, netName string, gp gasPredictor, ap actorProvider, j journal.Journal) (*MessagePool, error)
func (*MessagePool) Add ¶
func (mp *MessagePool) Add(m *types.SignedMessage) error
func (*MessagePool) Clear ¶
func (mp *MessagePool) Clear(local bool)
func (*MessagePool) Close ¶
func (mp *MessagePool) Close() error
func (*MessagePool) DeleteByAdress ¶
func (mp *MessagePool) DeleteByAdress(address address.Address) error
func (*MessagePool) GasEstimateFeeCap ¶
func (*MessagePool) GasEstimateGasLimit ¶
func (mp *MessagePool) GasEstimateGasLimit(ctx context.Context, msgIn *types.UnsignedMessage, tsk block.TipSetKey) (int64, error)
func (*MessagePool) GasEstimateGasPremium ¶
func (*MessagePool) GasEstimateMessageGas ¶
func (mp *MessagePool) GasEstimateMessageGas(ctx context.Context, msg *types.UnsignedMessage, spec *types.MessageSendSpec, _ block.TipSetKey) (*types.UnsignedMessage, error)
func (*MessagePool) GetConfig ¶
func (mp *MessagePool) GetConfig() *MpoolConfig
func (*MessagePool) GetNonce ¶
func (mp *MessagePool) GetNonce(addr address.Address) (uint64, error)
func (*MessagePool) HeadChange ¶
func (*MessagePool) MessagesForBlocks ¶
func (mp *MessagePool) MessagesForBlocks(blks []*block.Block) ([]*types.SignedMessage, error)
func (*MessagePool) Pending ¶
func (mp *MessagePool) Pending() ([]*types.SignedMessage, *block.TipSet)
func (*MessagePool) PendingFor ¶
func (mp *MessagePool) PendingFor(a address.Address) ([]*types.SignedMessage, *block.TipSet)
func (*MessagePool) Prune ¶
func (mp *MessagePool) Prune()
func (*MessagePool) PublishMsgForWallet ¶
func (mp *MessagePool) PublishMsgForWallet(addr address.Address) error
func (*MessagePool) Push ¶
func (mp *MessagePool) Push(m *types.SignedMessage) (cid.Cid, error)
func (*MessagePool) PushUntrusted ¶
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.UnsignedMessage) *types.SignedMessage
func (*MessagePool) Remove ¶
func (mp *MessagePool) Remove(from address.Address, nonce uint64, applied bool)
func (*MessagePool) SelectMessages ¶
func (mp *MessagePool) SelectMessages(ts *block.TipSet, tq float64) (msgs []*types.SignedMessage, err error)
func (*MessagePool) SetConfig ¶
func (mp *MessagePool) SetConfig(cfg *MpoolConfig) error
func (*MessagePool) Updates ¶
func (mp *MessagePool) Updates(ctx context.Context) (<-chan MpoolUpdate, error)
func (*MessagePool) VerifyMsgSig ¶
func (mp *MessagePool) VerifyMsgSig(m *types.SignedMessage) error
type MessagePoolEvt ¶
type MessagePoolEvt struct {
Action string
Messages []MessagePoolEvtMessage
Error error `json:",omitempty"`
}
MessagePoolEvt is the journal entry for message pool events.
type MessagePoolEvtMessage ¶
type MessagePoolEvtMessage struct {
types.UnsignedMessage
CID cid.Cid
}
type MpoolConfig ¶
type MpoolConfig struct {
PriorityAddrs []address.Address
SizeLimitHigh int
SizeLimitLow int
ReplaceByFeeRatio float64
PruneCooldown time.Duration
GasLimitOverestimation float64
}
func DefaultConfig ¶
func DefaultConfig() *MpoolConfig
func (*MpoolConfig) Clone ¶
func (mc *MpoolConfig) Clone() *MpoolConfig
type MpoolLocker ¶
type MpoolLocker struct {
// contains filtered or unexported fields
}
func NewMpoolLocker ¶
func NewMpoolLocker() *MpoolLocker
type MpoolUpdate ¶
type MpoolUpdate struct {
Type MpoolChange
Message *types.SignedMessage
}
type Provider ¶
type Provider interface {
ChainHead() (*block.TipSet, error)
ChainTipSet(block.TipSetKey) (*block.TipSet, error)
SubscribeHeadChanges(func(rev, app []*block.TipSet) error) *block.TipSet
PutMessage(m types.ChainMsg) (cid.Cid, error)
PubSubPublish(string, []byte) error
GetActorAfter(address.Address, *block.TipSet) (*types.Actor, error)
StateAccountKey(context.Context, address.Address, *block.TipSet) (address.Address, error)
MessagesForBlock(block2 *block.Block) ([]*types.UnsignedMessage, []*types.SignedMessage, error)
MessagesForTipset(*block.TipSet) ([]types.ChainMsg, error)
LoadTipSet(tsk block.TipSetKey) (*block.TipSet, error)
ChainComputeBaseFee(ctx context.Context, ts *block.TipSet) (tbig.Int, error)
}
func NewProvider ¶
func NewProvider(sm *chain.Store, cms *chain.MessageStore, cfg *config.NetworkParamsConfig, ps *pubsub.PubSub) Provider
Source Files
¶
Click to show internal directories.
Click to hide internal directories.