Documentation ¶
Overview ¶
Package london provides wrappers to deterministically generate a tip cap + fee cap for evm based chains.
Index ¶
- type FeeOracle
- type HeightOracleBackend
- func (h HeightOracleBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
- func (h HeightOracleBackend) ChainConfig() *params.ChainConfig
- func (h HeightOracleBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)
- func (h HeightOracleBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)
- func (h HeightOracleBackend) PendingBlockAndReceipts() (*types.Block, types.Receipts)
- func (h HeightOracleBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeeOracle ¶
type FeeOracle struct {
// contains filtered or unexported fields
}
FeeOracle is the fee oracle to use for v2 gas price calculations.
func NewFeeOracle ¶
func NewFeeOracle(chain backend.OracleBackendChain, height uint64, config gasprice.Config) FeeOracle
NewFeeOracle creates a new fee oracle.
func (*FeeOracle) SuggestFeeCap ¶
SuggestFeeCap calculates the suggested fee cap in a deterministic manner. because this is done from gas block, it is advisable to bump this number by a percentage.
type HeightOracleBackend ¶
type HeightOracleBackend struct {
// contains filtered or unexported fields
}
HeightOracleBackend is an oracle that deterministically gets gas + fee prices for a given backend.
func NewOracleBackendFromHeight ¶
func NewOracleBackendFromHeight(chain backend.OracleBackendChain, height uint64) HeightOracleBackend
NewOracleBackendFromHeight creates a fee oracle for deterministically generating gas prices from a given height that hijacks the header by number method (when it's passed -1) and returns the block height passed in the constructor it also overrides PendingBlockAndReceipts to always return nil since these cannot deterministically be used cross-client.
func (HeightOracleBackend) BlockByNumber ¶
func (h HeightOracleBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
BlockByNumber wraps the oracle backend. nolint: wrapcheck
func (HeightOracleBackend) ChainConfig ¶
func (h HeightOracleBackend) ChainConfig() *params.ChainConfig
ChainConfig gets the chainconfig for the chain.
func (HeightOracleBackend) GetReceipts ¶
func (h HeightOracleBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)
GetReceipts gets receipts for a block in a single rpc call. nolint: wrapcheck
func (HeightOracleBackend) HeaderByNumber ¶
func (h HeightOracleBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)
HeaderByNumber wraps oracle baccend. nolint: wrapcheck
func (HeightOracleBackend) PendingBlockAndReceipts ¶
func (h HeightOracleBackend) PendingBlockAndReceipts() (*types.Block, types.Receipts)
PendingBlockAndReceipts always returns nil since we can't use this cross-client in a deterministic way.
func (HeightOracleBackend) SubscribeChainHeadEvent ¶
func (h HeightOracleBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription
SubscribeChainHeadEvent is not used, but required for analytics compatibility).