Documentation
¶
Index ¶
- Constants
- func GasEstimateCallWithGas(ctx context.Context, cstore ChainStoreAPI, smgr StateManagerAPI, ...) (*api.InvocResult, []types.ChainMsg, *types.TipSet, error)
- func GasEstimateCallWithGasSkipSenderValidation(ctx context.Context, cstore ChainStoreAPI, smgr StateManagerAPI, ...) (*api.InvocResult, []types.ChainMsg, *types.TipSet, error)
- func GasEstimateFeeCap(ctx context.Context, cstore ChainStoreAPI, msg *types.Message, ...) (types.BigInt, error)
- func GasEstimateGasLimit(ctx context.Context, cstore ChainStoreAPI, smgr StateManagerAPI, ...) (int64, error)
- func GasEstimateGasLimitSkipSenderValidation(ctx context.Context, cstore ChainStoreAPI, smgr StateManagerAPI, ...) (int64, error)
- func GasEstimateGasPremium(ctx context.Context, cstore ChainStoreAPI, cache *GasPriceCache, ...) (types.BigInt, error)
- type ChainStoreAPI
- type GasMeta
- type GasPriceCache
- type MessagePoolAPI
- type StateManagerAPI
Constants ¶
const MaxGasHistory = 128
const MaxSpendOnFeeDenom = 100
const MinGasPremium = 100e3
Variables ¶
This section is empty.
Functions ¶
func GasEstimateCallWithGas ¶
func GasEstimateCallWithGas( ctx context.Context, cstore ChainStoreAPI, smgr StateManagerAPI, mpool MessagePoolAPI, msgIn *types.Message, currTs *types.TipSet, ) (*api.InvocResult, []types.ChainMsg, *types.TipSet, error)
GasEstimateCallWithGas invokes a message "msgIn" on the earliest available tipset with pending messages in the message pool. The function returns the result of the message invocation, the pending messages, the tipset used for the invocation, and an error if occurred. The returned information can be used to make subsequent calls to CallWithGas with the same parameters.
func GasEstimateCallWithGasSkipSenderValidation ¶ added in v1.36.2
func GasEstimateCallWithGasSkipSenderValidation( ctx context.Context, cstore ChainStoreAPI, smgr StateManagerAPI, mpool MessagePoolAPI, msgIn *types.Message, currTs *types.TipSet, ) (*api.InvocResult, []types.ChainMsg, *types.TipSet, error)
GasEstimateCallWithGasSkipSenderValidation is like GasEstimateCallWithGas but skips sender validation, allowing invocation from contract or non-existent senders.
func GasEstimateFeeCap ¶
func GasEstimateGasLimit ¶
func GasEstimateGasLimit( ctx context.Context, cstore ChainStoreAPI, smgr StateManagerAPI, mpool *messagepool.MessagePool, msgIn *types.Message, currTs *types.TipSet, ) (int64, error)
func GasEstimateGasLimitSkipSenderValidation ¶ added in v1.36.2
func GasEstimateGasLimitSkipSenderValidation( ctx context.Context, cstore ChainStoreAPI, smgr StateManagerAPI, mpool MessagePoolAPI, msgIn *types.Message, currTs *types.TipSet, ) (int64, error)
GasEstimateGasLimitSkipSenderValidation is like GasEstimateGasLimit but skips sender validation. This allows gas estimation for messages from non-existent addresses, matching Geth's eth_estimateGas behavior.
func GasEstimateGasPremium ¶
func GasEstimateGasPremium(ctx context.Context, cstore ChainStoreAPI, cache *GasPriceCache, nblocksincl uint64, tsKey types.TipSetKey) (types.BigInt, error)
Types ¶
type ChainStoreAPI ¶
type ChainStoreAPI interface {
GetHeaviestTipSet() *types.TipSet
GetTipSetFromKey(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
LoadTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
MessagesForTipset(ctx context.Context, ts *types.TipSet) ([]types.ChainMsg, error)
}
type GasPriceCache ¶
type GasPriceCache struct {
// contains filtered or unexported fields
}
func NewGasPriceCache ¶
func NewGasPriceCache() *GasPriceCache
func (*GasPriceCache) GetTSGasStats ¶
func (g *GasPriceCache) GetTSGasStats(ctx context.Context, cstore ChainStoreAPI, ts *types.TipSet) ([]GasMeta, error)
type MessagePoolAPI ¶
type StateManagerAPI ¶
type StateManagerAPI interface {
ParentState(ts *types.TipSet) (*state.StateTree, error)
CallWithGas(ctx context.Context, msg *types.Message, priorMsgs []types.ChainMsg, ts *types.TipSet, applyTsMessages bool) (*api.InvocResult, error)
CallWithGasSkipSenderValidation(ctx context.Context, msg *types.Message, priorMsgs []types.ChainMsg, ts *types.TipSet, applyTsMessages bool) (*api.InvocResult, error)
ResolveToDeterministicAddress(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error)
}