Documentation ¶
Index ¶
- type Config
- func (c *Config) CheckCompatible(newcfg *Config, height uint64) *chain.ConfigCompatError
- func (c *Config) CheckConfigForkOrder() error
- func (c *Config) IsArrowGlacier(num uint64) bool
- func (c *Config) IsBerlin(num uint64) bool
- func (c *Config) IsByzantium(num uint64) bool
- func (c *Config) IsCancun(time uint64) bool
- func (c *Config) IsConstantinople(num uint64) bool
- func (c *Config) IsDAOFork(num uint64) bool
- func (c *Config) IsEip1559FeeCollector(num uint64) bool
- func (c *Config) IsGrayGlacier(num uint64) bool
- func (c *Config) IsHomestead(num uint64) bool
- func (c *Config) IsIstanbul(num uint64) bool
- func (c *Config) IsLondon(num uint64) bool
- func (c *Config) IsMordor(num uint64) bool
- func (c *Config) IsMuirGlacier(num uint64) bool
- func (c *Config) IsPetersburg(num uint64) bool
- func (c *Config) IsPrague(time uint64) bool
- func (c *Config) IsShanghai(time uint64) bool
- func (c *Config) IsSpuriousDragon(num uint64) bool
- func (c *Config) IsTangerineWhistle(num uint64) bool
- func (c *Config) Rules(num uint64, time uint64) *Rules
- func (c *Config) String() string
- type Rules
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ChainName string ChainID *big.Int `json:"chainId"` // chainId identifies the current chain and is used for replay protection Consensus chain.ConsensusName `json:"consensus,omitempty"` // aura, ethash or clique // ETH mainnet upgrades // See https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades HomesteadBlock *big.Int `json:"homesteadBlock,omitempty"` DAOForkBlock *big.Int `json:"daoForkBlock,omitempty"` TangerineWhistleBlock *big.Int `json:"eip150Block,omitempty"` SpuriousDragonBlock *big.Int `json:"eip155Block,omitempty"` ByzantiumBlock *big.Int `json:"byzantiumBlock,omitempty"` ConstantinopleBlock *big.Int `json:"constantinopleBlock,omitempty"` PetersburgBlock *big.Int `json:"petersburgBlock,omitempty"` IstanbulBlock *big.Int `json:"istanbulBlock,omitempty"` MuirGlacierBlock *big.Int `json:"muirGlacierBlock,omitempty"` BerlinBlock *big.Int `json:"berlinBlock,omitempty"` LondonBlock *big.Int `json:"londonBlock,omitempty"` ArrowGlacierBlock *big.Int `json:"arrowGlacierBlock,omitempty"` GrayGlacierBlock *big.Int `json:"grayGlacierBlock,omitempty"` // EIP-3675: Upgrade consensus to Proof-of-Stake (a.k.a. "Paris", "The Merge") TerminalTotalDifficulty *big.Int `json:"terminalTotalDifficulty,omitempty"` // The merge happens when terminal total difficulty is reached TerminalTotalDifficultyPassed bool `json:"terminalTotalDifficultyPassed,omitempty"` // Disable PoW sync for networks that have already passed through the Merge MergeNetsplitBlock *big.Int `json:"mergeNetsplitBlock,omitempty"` // Virtual fork after The Merge to use as a network splitter; see FORK_NEXT_VALUE in EIP-3675 // Mainnet fork scheduling switched from block numbers to timestamps after The Merge ShanghaiTime *big.Int `json:"shanghaiTime,omitempty"` CancunTime *big.Int `json:"cancunTime,omitempty"` PragueTime *big.Int `json:"pragueTime,omitempty"` Eip1559FeeCollector *common.Address `json:"eip1559FeeCollector,omitempty"` // (Optional) Address where burnt EIP-1559 fees go to Eip1559FeeCollectorTransition *big.Int `json:"eip1559FeeCollectorTransition,omitempty"` // (Optional) Block from which burnt EIP-1559 fees go to the Eip1559FeeCollector // Various consensus engines Ethash *chain.EthashConfig `json:"ethash,omitempty"` Clique *chain.CliqueConfig `json:"clique,omitempty"` Aura *chain.AuRaConfig `json:"aura,omitempty"` Bor *chain.BorConfig `json:"bor,omitempty"` //zkEVM updates MordorBlock *big.Int `json:"mordorBlock,omitempty"` }
Config is the core config which determines the blockchain settings.
Config is stored in the database on a per block basis. This means that any network, identified by its genesis block, can have its own set of configuration options.
func (*Config) CheckCompatible ¶
func (c *Config) CheckCompatible(newcfg *Config, height uint64) *chain.ConfigCompatError
CheckCompatible checks whether scheduled fork transitions have been imported with a mismatching chain configuration.
func (*Config) CheckConfigForkOrder ¶
CheckConfigForkOrder checks that we don't "skip" any forks
func (*Config) IsArrowGlacier ¶
IsArrowGlacier returns whether num is either equal to the Arrow Glacier (EIP-4345) fork block or greater.
func (*Config) IsBerlin ¶
IsBerlin returns whether num is either equal to the Berlin fork block or greater.
func (*Config) IsByzantium ¶
IsByzantium returns whether num is either equal to the Byzantium fork block or greater.
func (*Config) IsCancun ¶
IsCancun returns whether time is either equal to the Cancun fork time or greater.
func (*Config) IsConstantinople ¶
IsConstantinople returns whether num is either equal to the Constantinople fork block or greater.
func (*Config) IsDAOFork ¶
IsDAOFork returns whether num is either equal to the DAO fork block or greater.
func (*Config) IsEip1559FeeCollector ¶
func (*Config) IsGrayGlacier ¶
IsGrayGlacier returns whether num is either equal to the Gray Glacier (EIP-5133) fork block or greater.
func (*Config) IsHomestead ¶
IsHomestead returns whether num is either equal to the homestead block or greater.
func (*Config) IsIstanbul ¶
IsIstanbul returns whether num is either equal to the Istanbul fork block or greater.
func (*Config) IsLondon ¶
IsLondon returns whether num is either equal to the London fork block or greater.
func (*Config) IsMuirGlacier ¶
IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
func (*Config) IsPetersburg ¶
IsPetersburg returns whether num is either - equal to or greater than the PetersburgBlock fork block, - OR is nil, and Constantinople is active
func (*Config) IsPrague ¶
IsPrague returns whether time is either equal to the Prague fork time or greater.
func (*Config) IsShanghai ¶
IsShanghai returns whether time is either equal to the Shanghai fork time or greater.
func (*Config) IsSpuriousDragon ¶
IsSpuriousDragon returns whether num is either equal to the Spurious Dragon fork block or greater.
func (*Config) IsTangerineWhistle ¶
IsTangerineWhistle returns whether num is either equal to the Tangerine Whistle (EIP150) fork block or greater.
type Rules ¶
type Rules struct { ChainID *big.Int IsHomestead, IsTangerineWhistle, IsSpuriousDragon bool IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool IsBerlin, IsLondon, IsShanghai, IsCancun, IsPrague bool IsEip1559FeeCollector, IsAura, IsMordor bool }
Rules is syntactic sugar over Config. It can be used for functions that do not have or require information about the block.
Rules is a one time interface meaning that it shouldn't be used in between transition phases.