fees

package
v1.16.37 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LowThroughputConfig is optimized for low disk usage and throughput (1.5M gas/s)
	// This is the default C-Chain configuration
	LowThroughputConfig = commontype.FeeConfig{
		GasLimit:                 big.NewInt(8_000_000),
		MinBaseFee:               big.NewInt(25_000_000_000),
		TargetGas:                big.NewInt(15_000_000),
		BaseFeeChangeDenominator: big.NewInt(36),
		MinBlockGasCost:          big.NewInt(0),
		MaxBlockGasCost:          big.NewInt(1_000_000),
		TargetBlockRate:          2,
		BlockGasCostStep:         big.NewInt(200_000),
	}

	// MediumThroughputConfig is optimized for medium disk usage and throughput (2M gas/s)
	MediumThroughputConfig = commontype.FeeConfig{
		GasLimit:                 big.NewInt(10_000_000),
		MinBaseFee:               big.NewInt(25_000_000_000),
		TargetGas:                big.NewInt(20_000_000),
		BaseFeeChangeDenominator: big.NewInt(36),
		MinBlockGasCost:          big.NewInt(0),
		MaxBlockGasCost:          big.NewInt(1_000_000),
		TargetBlockRate:          2,
		BlockGasCostStep:         big.NewInt(200_000),
	}

	// HighThroughputConfig is optimized for high disk usage and throughput (5M gas/s)
	HighThroughputConfig = commontype.FeeConfig{
		GasLimit:                 big.NewInt(15_000_000),
		MinBaseFee:               big.NewInt(25_000_000_000),
		TargetGas:                big.NewInt(50_000_000),
		BaseFeeChangeDenominator: big.NewInt(36),
		MinBlockGasCost:          big.NewInt(0),
		MaxBlockGasCost:          big.NewInt(1_000_000),
		TargetBlockRate:          2,
		BlockGasCostStep:         big.NewInt(200_000),
	}

	// DefaultFeeConfig is the standard fee configuration
	DefaultFeeConfig = LowThroughputConfig
)

Preset fee configurations for different network usage scenarios

Functions

func GetFeeConfigForThroughput

func GetFeeConfigForThroughput(throughput string) commontype.FeeConfig

GetFeeConfigForThroughput returns a fee configuration for the specified throughput level

Types

type FeeConfigBuilder

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

FeeConfigBuilder helps construct custom fee configurations

func NewFeeConfigBuilder

func NewFeeConfigBuilder() *FeeConfigBuilder

NewFeeConfigBuilder creates a new fee config builder with default values

func (*FeeConfigBuilder) Build

Build returns the constructed fee configuration

func (*FeeConfigBuilder) WithBaseFeeChangeDenominator

func (b *FeeConfigBuilder) WithBaseFeeChangeDenominator(denominator *big.Int) *FeeConfigBuilder

WithBaseFeeChangeDenominator sets the base fee change denominator

func (*FeeConfigBuilder) WithBlockGasCostStep

func (b *FeeConfigBuilder) WithBlockGasCostStep(blockGasCostStep *big.Int) *FeeConfigBuilder

WithBlockGasCostStep sets the block gas cost step

func (*FeeConfigBuilder) WithGasLimit

func (b *FeeConfigBuilder) WithGasLimit(gasLimit *big.Int) *FeeConfigBuilder

WithGasLimit sets the gas limit

func (*FeeConfigBuilder) WithMaxBlockGasCost

func (b *FeeConfigBuilder) WithMaxBlockGasCost(maxBlockGasCost *big.Int) *FeeConfigBuilder

WithMaxBlockGasCost sets the maximum block gas cost

func (*FeeConfigBuilder) WithMinBaseFee

func (b *FeeConfigBuilder) WithMinBaseFee(minBaseFee *big.Int) *FeeConfigBuilder

WithMinBaseFee sets the minimum base fee

func (*FeeConfigBuilder) WithMinBlockGasCost

func (b *FeeConfigBuilder) WithMinBlockGasCost(minBlockGasCost *big.Int) *FeeConfigBuilder

WithMinBlockGasCost sets the minimum block gas cost

func (*FeeConfigBuilder) WithTargetBlockRate

func (b *FeeConfigBuilder) WithTargetBlockRate(targetBlockRate uint64) *FeeConfigBuilder

WithTargetBlockRate sets the target block rate

func (*FeeConfigBuilder) WithTargetGas

func (b *FeeConfigBuilder) WithTargetGas(targetGas *big.Int) *FeeConfigBuilder

WithTargetGas sets the target gas

Jump to

Keyboard shortcuts

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