Documentation
¶
Index ¶
- Constants
- Variables
- func EngineRegistrySlotKeyAuthorizedEngine(engine types.Address) types.Hash
- func EngineRegistrySlotKeyDonationAddress() types.Hash
- func EngineRegistrySlotKeyDonationPercent() types.Hash
- func EngineRegistrySlotKeyMinBaseFee() types.Hash
- func EngineRegistrySlotKeyPaused() types.Hash
- type AddressListConfig
- type Chain
- type Fork
- type Forks
- type ForksInTime
- type Genesis
- type GenesisAccount
- type Params
Constants ¶
const ( // GenesisBaseFeeEM is the initial base fee elasticity multiplier for EIP-1559 blocks. GenesisBaseFeeEM = 2 // GenesisGasLimit is the default gas limit of the Genesis block. GenesisGasLimit uint64 = 4712388 // GenesisDifficulty is the default difficulty of the Genesis block. GenesisDifficulty uint64 = 131072 // BaseFeeChangeDenom is the value to bound the amount the base fee can change between blocks BaseFeeChangeDenom = uint64(8) )
const ( // MinBaseFee is the static fallback floor, if no dynamic minBaseFee is available via registry. MinBaseFee uint64 = 100_000_000_000 // CriticalGasThresholdPct is the "kink" point: below this, baseFee is kept at minBaseFee. CriticalGasThresholdPct uint64 = 80 // EmergencyBaseFeeChangeDenom controls the max ramp at 100% load: +baseFee/denom per block. // 4 => max +25%/block at full blocks (strong, but not insane). EmergencyBaseFeeChangeDenom uint64 = 4 )
const ( Homestead = "homestead" Byzantium = "byzantium" Constantinople = "constantinople" Petersburg = "petersburg" Istanbul = "istanbul" London = "london" EIP150 = "EIP150" EIP158 = "EIP158" EIP155 = "EIP155" QuorumCalcAlignment = "quorumcalcalignment" TxHashWithType = "txHashWithType" LondonFix = "londonfix" EIP3860 = "EIP3860" EIP2929 = "EIP2929" EIP2930 = "EIP2930" EIP3651 = "EIP3651" )
predefined forks
const DefaultDonationPercent uint64 = 15
DefaultDonationPercent is the fallback donation fee percent (0-100).
Variables ¶
var AllForksEnabled = &Forks{ Homestead: NewFork(0), EIP150: NewFork(0), EIP155: NewFork(0), EIP158: NewFork(0), Byzantium: NewFork(0), Constantinople: NewFork(0), Petersburg: NewFork(0), Istanbul: NewFork(0), London: NewFork(0), QuorumCalcAlignment: NewFork(0), TxHashWithType: NewFork(0), LondonFix: NewFork(0), EIP3860: NewFork(0), EIP2929: NewFork(0), EIP2930: NewFork(0), EIP3651: NewFork(0), }
AllForksEnabled should contain all supported forks by current edge version
var BootstrapEngineEOA = types.Address{} // SET BEFORE LAUNCH (or keep zero to deny-all)
BootstrapEngineEOA is used only while EngineRegistryAddress is unset or the registry is not deployed yet (code-size == 0). It must be identical across all nodes.
If left as zero, no engine caller will be authorized during bootstrap.
var DefaultBurnedAddress = types.StringToAddress("0x0000000000000000000000000000000000000666")
DefaultBurnedAddress is used für default burn of 1000 Gwei
var DefaultDonationAddress = DefaultBurnedAddress //types.StringToAddress("0xCfD008a1de815f402aD8E7e6F8461d3a878DEF59")
DefaultDonationAddress is used when no on-chain donation recipient is available.
var EngineRegistryAddress = types.Address{}
- EngineRegistryAddress is sourced from genesis.json (params.engineRegistryAddress). - If unset or not deployed yet (code-size == 0), chain code falls back to defaults.
var ( // ErrBurnContractAddressMissing is the error when a contract address is not provided ErrBurnContractAddressMissing = errors.New("burn contract address missing") )
var ( // GenesisBaseFee is the initial base fee for EIP-1559 blocks. GenesisBaseFee = ethgo.Gwei(1).Uint64() )
Functions ¶
func EngineRegistrySlotKeyAuthorizedEngine ¶
EngineRegistrySlotKeyAuthorizedEngine returns the mapping slot key for authorizedEngines[engine].
func EngineRegistrySlotKeyDonationAddress ¶
EngineRegistrySlotKeyDonationAddress returns the storage slot key for donationAddress.
func EngineRegistrySlotKeyDonationPercent ¶
EngineRegistrySlotKeyDonationPercent returns the storage slot key for donationPercent.
func EngineRegistrySlotKeyMinBaseFee ¶
EngineRegistrySlotKeyMinBaseFee returns the storage slot key for minBaseFee.
func EngineRegistrySlotKeyPaused ¶
EngineRegistrySlotKeyPaused returns the storage slot key for paused.
Types ¶
type AddressListConfig ¶
type Chain ¶
type Chain struct {
Name string `json:"name"`
Genesis *Genesis `json:"genesis"`
Params *Params `json:"params"`
Bootnodes []string `json:"bootnodes,omitempty"`
}
Chain is the blockchain chain configuration
func ImportFromFile ¶
ImportFromFile imports a chain from a filepath
type Fork ¶
type Fork struct {
Block uint64 `json:"block"`
Params *forkmanager.ForkParams `json:"params,omitempty"`
}
type Forks ¶
Forks is map which contains all forks and their starting blocks from genesis
func (*Forks) At ¶
func (f *Forks) At(block uint64) ForksInTime
At returns ForksInTime instance that shows which supported forks are enabled for the block
func (*Forks) IsActive ¶
IsActive returns true if fork defined by name exists and defined for the block
func (*Forks) RemoveFork ¶
type ForksInTime ¶
type ForksInTime struct {
Homestead,
Byzantium,
Constantinople,
Petersburg,
Istanbul,
London,
EIP150,
EIP158,
EIP155,
QuorumCalcAlignment,
TxHashWithType,
LondonFix, EIP3860, EIP2929, EIP2930, EIP3651 bool
}
ForksInTime should contain all supported forks by current edge version
type Genesis ¶
type Genesis struct {
Nonce [8]byte `json:"nonce"`
Timestamp uint64 `json:"timestamp"`
ExtraData []byte `json:"extraData,omitempty"`
GasLimit uint64 `json:"gasLimit"`
Difficulty uint64 `json:"difficulty"`
Mixhash types.Hash `json:"mixHash"`
Coinbase types.Address `json:"coinbase"`
Alloc map[types.Address]*GenesisAccount `json:"alloc,omitempty"`
BaseFee uint64 `json:"baseFee"`
BaseFeeEM uint64 `json:"baseFeeEM"`
// BaseFeeChangeDenom is the value to bound the amount the base fee can change between blocks
BaseFeeChangeDenom uint64 `json:"baseFeeChangeDenom,omitempty"`
// Override
StateRoot types.Hash
// Only for testing
Number uint64 `json:"number"`
GasUsed uint64 `json:"gasUsed"`
ParentHash types.Hash `json:"parentHash"`
}
Genesis specifies the header fields, state of a genesis block
func (*Genesis) GenesisHeader ¶
GenesisHeader converts the initially defined genesis struct to a header
func (*Genesis) MarshalJSON ¶
MarshalJSON implements the json interface
func (*Genesis) UnmarshalJSON ¶
UnmarshalJSON implements the json interface
type GenesisAccount ¶
type GenesisAccount struct {
Code []byte `json:"code,omitempty"`
Storage map[types.Hash]types.Hash `json:"storage,omitempty"`
Balance *big.Int `json:"balance,omitempty"`
Nonce uint64 `json:"nonce,omitempty"`
PrivateKey []byte `json:"secretKey,omitempty"` // for tests
}
GenesisAccount is an account in the state of the genesis block.
func (*GenesisAccount) MarshalJSON ¶
func (g *GenesisAccount) MarshalJSON() ([]byte, error)
func (*GenesisAccount) UnmarshalJSON ¶
func (g *GenesisAccount) UnmarshalJSON(data []byte) error
type Params ¶
type Params struct {
Forks *Forks `json:"forks"`
ChainID int64 `json:"chainID"`
Engine map[string]interface{} `json:"engine"`
BlockGasTarget uint64 `json:"blockGasTarget"`
// XGR: On-chain config registry (loaded from genesis.json -> params.*)
EngineRegistryAddress types.Address `json:"engineRegistryAddress,omitempty"`
BootstrapEngineEOA types.Address `json:"bootstrapEngineEOA,omitempty"`
// Access control configuration
ContractDeployerAllowList *AddressListConfig `json:"contractDeployerAllowList,omitempty"`
ContractDeployerBlockList *AddressListConfig `json:"contractDeployerBlockList,omitempty"`
TransactionsAllowList *AddressListConfig `json:"transactionsAllowList,omitempty"`
TransactionsBlockList *AddressListConfig `json:"transactionsBlockList,omitempty"`
BridgeAllowList *AddressListConfig `json:"bridgeAllowList,omitempty"`
BridgeBlockList *AddressListConfig `json:"bridgeBlockList,omitempty"`
// Governance contract where the token will be sent to and burn in london fork
BurnContract map[uint64]types.Address `json:"burnContract"`
// Destination address to initialize default burn contract with
BurnContractDestinationAddress types.Address `json:"burnContractDestinationAddress,omitempty"`
}
Params are all the set of params for the chain
func (*Params) CalculateBurnContract ¶
CalculateBurnContract calculates burn contract address for the given block number