ethconfig

package
v3.0.0-alpha5.0...-c974331 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: LGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package ethconfig contains the configuration of the ETH and LES protocols.

Index

Constants

This section is empty.

Variables

View Source
var (
	FlagSnapKeepBlocks = "snap.keepblocks"
	FlagSnapStop       = "snap.stop"
	FlagSnapStateStop  = "snap.state.stop"
)
View Source
var BorDefaultMinerGasPrice = big.NewInt(25 * params.GWei)

BorDefaultMinerGasPrice defines the minimum gas price for bor validators to mine a transaction.

View Source
var DefaultTxPool2Config = func(fullCfg *Config) txpoolcfg.Config {
	pool1Cfg := &fullCfg.DeprecatedTxPool
	cfg := txpoolcfg.DefaultConfig
	cfg.PendingSubPoolLimit = int(pool1Cfg.GlobalSlots)
	cfg.BaseFeeSubPoolLimit = int(pool1Cfg.GlobalBaseFeeQueue)
	cfg.QueuedSubPoolLimit = int(pool1Cfg.GlobalQueue)
	cfg.PriceBump = pool1Cfg.PriceBump
	cfg.BlobPriceBump = fullCfg.TxPool.BlobPriceBump
	cfg.MinFeeCap = pool1Cfg.PriceLimit
	cfg.AccountSlots = pool1Cfg.AccountSlots
	cfg.BlobSlots = fullCfg.TxPool.BlobSlots
	cfg.TotalBlobPoolLimit = fullCfg.TxPool.TotalBlobPoolLimit
	cfg.LogEvery = 3 * time.Minute
	cfg.CommitEvery = 5 * time.Minute
	cfg.TracedSenders = pool1Cfg.TracedSenders
	cfg.CommitEvery = pool1Cfg.CommitEvery

	return cfg
}
View Source
var Defaults = Config{
	Sync: Sync{
		ExecWorkerCount:            estimate.BlocksExecution.WorkersHalf(),
		BodyCacheLimit:             256 * 1024 * 1024,
		BodyDownloadTimeoutSeconds: 2,

		ParallelStateFlushing: true,
	},
	Ethash: ethashcfg.Config{
		CachesInMem:      2,
		CachesLockMmap:   false,
		DatasetsInMem:    1,
		DatasetsOnDisk:   2,
		DatasetsLockMmap: false,
	},
	NetworkID: 1,
	Prune:     prune.DefaultMode,
	Miner: params.MiningConfig{
		GasLimit: 30_000_000,
		GasPrice: big.NewInt(params.GWei),
		Recommit: 3 * time.Second,
	},
	DeprecatedTxPool: DeprecatedDefaultTxPoolConfig,
	TxPool:           txpoolcfg.DefaultConfig,
	RPCGasCap:        50000000,
	GPO:              FullNodeGPO,
	RPCTxFeeCap:      1,

	ImportMode: false,
	Snapshot: BlocksFreezing{
		KeepBlocks: false,
		ProduceE2:  true,
		ProduceE3:  true,
	},
}

Defaults contains default settings for use on the Ethereum main net.

View Source
var DeprecatedDefaultTxPoolConfig = DeprecatedTxPoolConfig{
	PriceLimit: 1,
	PriceBump:  10,

	AccountSlots:       16,
	GlobalSlots:        10_000,
	GlobalBaseFeeQueue: 30_000,
	AccountQueue:       64,
	GlobalQueue:        30_000,

	Lifetime: 3 * time.Hour,
}

DeprecatedDefaultTxPoolConfig contains the default configurations for the transaction pool.

View Source
var FullNodeGPO = gaspricecfg.Config{
	Blocks:           20,
	Default:          big.NewInt(0),
	Percentile:       60,
	MaxHeaderHistory: 0,
	MaxBlockHistory:  0,
	MaxPrice:         gaspricecfg.DefaultMaxPrice,
	IgnorePrice:      gaspricecfg.DefaultIgnorePrice,
}

FullNodeGPO contains default gasprice oracle settings for full node.

View Source
var LightClientGPO = gaspricecfg.Config{
	Blocks:           2,
	Percentile:       60,
	MaxHeaderHistory: 300,
	MaxBlockHistory:  5,
	MaxPrice:         gaspricecfg.DefaultMaxPrice,
	IgnorePrice:      gaspricecfg.DefaultIgnorePrice,
}

LightClientGPO contains default gasprice oracle settings for light client.

Functions

This section is empty.

Types

type BlocksFreezing

type BlocksFreezing struct {
	KeepBlocks     bool // produce new snapshots of blocks but don't remove blocks from DB
	ProduceE2      bool // produce new block files
	ProduceE3      bool // produce new state files
	NoDownloader   bool // possible to use snapshots without calling Downloader
	Verify         bool // verify snapshots on startup
	DownloaderAddr string
	ChainName      string
}

func NewSnapCfg

func NewSnapCfg(keepBlocks, produceE2, produceE3 bool, chainName string) BlocksFreezing

func (BlocksFreezing) String

func (s BlocksFreezing) String() string

type Config

type Config struct {
	Sync

	// The genesis block, which is inserted if the database is empty.
	// If nil, the Ethereum main net block is used.
	Genesis *types.Genesis `toml:",omitempty"`

	// Protocol options
	NetworkID uint64 // Network ID to use for selecting peers to connect to

	// This can be set to list of enrtree:// URLs which will be queried for
	// for nodes to connect to.
	EthDiscoveryURLs []string

	Prune     prune.Mode
	BatchSize datasize.ByteSize // Batch size for execution stage

	ImportMode bool

	BadBlockHash common.Hash // hash of the block marked as bad

	Snapshot     BlocksFreezing
	Downloader   *downloadercfg.Cfg
	CaplinConfig clparams.CaplinConfig

	Dirs datadir.Dirs

	// Address to connect to external snapshot downloader
	// empty if you want to use internal bittorrent snapshot downloader
	ExternalSnapshotDownloaderAddr string

	// Whitelist of required block number -> hash values to accept
	Whitelist map[uint64]common.Hash `toml:"-"`

	// Mining options
	Miner params.MiningConfig

	// Ethash options
	Ethash ethashcfg.Config

	Clique params.ConsensusSnapshotConfig
	Aura   chain.AuRaConfig

	// Transaction pool options
	DeprecatedTxPool DeprecatedTxPoolConfig
	TxPool           txpoolcfg.Config

	// Gas Price Oracle options
	GPO gaspricecfg.Config

	// RPCGasCap is the global gas cap for eth-call variants.
	RPCGasCap uint64 `toml:",omitempty"`

	// RPCTxFeeCap is the global transaction fee(price * gaslimit) cap for
	// send-transction variants. The unit is ether.
	RPCTxFeeCap float64 `toml:",omitempty"`

	StateStream bool

	// URL to connect to Heimdall node
	HeimdallURL string
	// No heimdall service
	WithoutHeimdall bool
	// Heimdall services active
	WithHeimdallMilestones bool
	// Heimdall waypoint recording active
	WithHeimdallWaypointRecording bool
	// Use polygon checkpoint sync in preference to POW downloader
	PolygonSync      bool
	PolygonSyncStage bool

	// Ethstats service
	Ethstats string
	// Consensus layer
	InternalCL bool

	OverridePragueTime *big.Int `toml:",omitempty"`

	// Embedded Silkworm support
	SilkwormExecution            bool
	SilkwormRpcDaemon            bool
	SilkwormSentry               bool
	SilkwormVerbosity            string
	SilkwormNumContexts          uint32
	SilkwormRpcLogEnabled        bool
	SilkwormRpcLogDirPath        string
	SilkwormRpcLogMaxFileSize    uint16
	SilkwormRpcLogMaxFiles       uint16
	SilkwormRpcLogDumpResponse   bool
	SilkwormRpcNumWorkers        uint32
	SilkwormRpcJsonCompatibility bool

	DisableTxPoolGossip bool
}

Config contains configuration options for ETH protocol.

func (Config) MarshalTOML

func (c Config) MarshalTOML() (interface{}, error)

MarshalTOML marshals as TOML.

func (*Config) UnmarshalTOML

func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error

UnmarshalTOML unmarshals from TOML.

type DeprecatedTxPoolConfig

type DeprecatedTxPoolConfig struct {
	Disable  bool
	Locals   []common.Address // Addresses that should be treated by default as local
	NoLocals bool             // Whether local transaction handling should be disabled

	PriceLimit uint64 // Minimum gas price to enforce for acceptance into the pool
	PriceBump  uint64 // Minimum price bump percentage to replace an already existing transaction (nonce)

	AccountSlots uint64 // Number of executable transaction slots guaranteed per account
	GlobalSlots  uint64 // Maximum number of executable transaction slots for all accounts
	AccountQueue uint64 // Maximum number of non-executable transaction slots permitted per account
	GlobalQueue  uint64 // Maximum number of non-executable transaction slots for all accounts

	GlobalBaseFeeQueue uint64 // Maximum number of non-executable transaction slots for all accounts

	Lifetime      time.Duration // Maximum amount of time non-executable transaction are queued
	StartOnInit   bool
	TracedSenders []string // List of senders for which txn pool should print out debugging info
	CommitEvery   time.Duration
}

DeprecatedTxPoolConfig are the configuration parameters of the transaction pool.

type Sync

type Sync struct {
	// LoopThrottle sets a minimum time between staged loop iterations
	LoopThrottle     time.Duration
	ExecWorkerCount  int
	ReconWorkerCount int

	BodyCacheLimit             datasize.ByteSize
	BodyDownloadTimeoutSeconds int // TODO: change to duration
	BreakAfterStage            string
	LoopBlockLimit             uint
	ParallelStateFlushing      bool

	UploadLocation   string
	UploadFrom       rpc.BlockNumber
	FrozenBlockLimit uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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