params

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: GPL-3.0, GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// These are the multipliers for ether denominations.
	// Example: To get the wei value of an amount in 'douglas', use
	//
	//    new(big.Int).Mul(value, big.NewInt(params.Douglas))
	//
	Wei      = 1
	Ada      = 1e3
	Babbage  = 1e6
	Shannon  = 1e9
	Szabo    = 1e12
	Finney   = 1e15
	Ether    = 1e18
	Einstein = 1e21
	Douglas  = 1e42
)
View Source
const (
	GasLimitBoundDivisor uint64 = 64       //1024    // The bound divisor of the gas limit, used in update calculations.
	MinGasLimit          uint64 = 500000   //5000    // Minimum the gas limit may ever be.
	GenesisGasLimit      uint64 = 50000000 //5000000 // Gas limit of the Genesis block.

	MaximumExtraDataSize  uint64 = 32    // Maximum size extra data may be after Genesis.
	ExpByteGas            uint64 = 10    // Times ceil(log256(exponent)) for the EXP instruction.
	SloadGas              uint64 = 50    // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added.
	CallValueTransferGas  uint64 = 9000  // Paid for CALL when the value transfer is non-zero.
	CallNewAccountGas     uint64 = 25000 // Paid for CALL when the destination address didn't exist prior.
	TxGas                 uint64 = 21000 // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions.
	TxGasContractCreation uint64 = 53000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions.
	TxDataZeroGas         uint64 = 4     // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions.
	QuadCoeffDiv          uint64 = 512   // Divisor for the quadratic particle of the memory cost equation.
	SstoreSetGas          uint64 = 20000 // Once per SLOAD operation.
	LogDataGas            uint64 = 8     // Per byte in a LOG* operation's data.
	CallStipend           uint64 = 2300  // Free gas given at beginning of call.

	Sha3Gas          uint64 = 30    // Once per SHA3 operation.
	Sha3WordGas      uint64 = 6     // Once per word of the SHA3 operation's data.
	SstoreResetGas   uint64 = 5000  // Once per SSTORE operation if the zeroness changes from zero.
	SstoreClearGas   uint64 = 5000  // Once per SSTORE operation if the zeroness doesn't change.
	SstoreRefundGas  uint64 = 15000 // Once per SSTORE operation if the zeroness changes to zero.
	JumpdestGas      uint64 = 1     // Refunded gas, once per SSTORE operation if the zeroness changes to zero.
	EpochDuration    uint64 = 30000 // Duration between proof-of-work epochs.
	CallGas          uint64 = 40    // Once per CALL operation & message call transaction.
	CreateDataGas    uint64 = 200   //
	CallCreateDepth  uint64 = 1024  // Maximum depth of call/create stack.
	ExpGas           uint64 = 10    // Once per EXP instruction
	LogGas           uint64 = 375   // Per LOG* operation.
	CopyGas          uint64 = 3     //
	StackLimit       uint64 = 1024  // Maximum size of VM stack allowed.
	TierStepGas      uint64 = 0     // Once per operation, for a selection of them.
	LogTopicGas      uint64 = 375   // Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas.
	CreateGas        uint64 = 32000 // Once per CREATE operation & contract-creation transaction.
	SuicideRefundGas uint64 = 24000 // Refunded following a suicide operation.
	MemoryGas        uint64 = 3     // Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL.
	TxDataNonZeroGas uint64 = 68    // Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions.

	MaxCodeSize = 24576 // Maximum bytecode to permit for a contract

	EcrecoverGas            uint64 = 3000   // Elliptic curve sender recovery gas price
	Sha256BaseGas           uint64 = 60     // Base price for a SHA256 operation
	Sha256PerWordGas        uint64 = 12     // Per-word price for a SHA256 operation
	Ripemd160BaseGas        uint64 = 600    // Base price for a RIPEMD160 operation
	Ripemd160PerWordGas     uint64 = 120    // Per-word price for a RIPEMD160 operation
	IdentityBaseGas         uint64 = 15     // Base price for a data copy operation
	IdentityPerWordGas      uint64 = 3      // Per-work price for a data copy operation
	ModExpQuadCoeffDiv      uint64 = 20     // Divisor for the quadratic particle of the big int modular exponentiation
	Bn256AddGas             uint64 = 500    // Gas needed for an elliptic curve addition
	Bn256ScalarMulGas       uint64 = 40000  // Gas needed for an elliptic curve scalar multiplication
	Bn256PairingBaseGas     uint64 = 100000 // Base price for an elliptic curve pairing check
	Bn256PairingPerPointGas uint64 = 80000  // Per-point price for an elliptic curve pairing check
)
View Source
const (
	VersionMajor = 0          // Major version component of the current release
	VersionMinor = 0          // Minor version component of the current release
	VersionPatch = 6          // Patch version component of the current release
	VersionMeta  = "unstable" // Version metadata to append to the version string
)
View Source
const (
	// BloomBitsBlocks is the number of blocks a single bloom bit section vector
	// contains.
	BloomBitsBlocks uint64 = 4096
)

Variables

View Source
var (
	SideNonce            uint64 = 66
	SideExtraData               = hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
	SideGasLimit         uint64 = 50000000
	SideDifficulty              = big.NewInt(17179869184)
	DefaultSelfVoteValue        = new(big.Int).Mul(big.NewInt(10), big.NewInt(1e+18))
	SideDefaultBalance          = new(big.Int).Mul(big.NewInt(2), DefaultSelfVoteValue)
)
View Source
var (
	MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") // Mainnet genesis hash to enforce below configs on
	TestnetGenesisHash = common.HexToHash("0x2ca8bccba480e6d6b261ef83a3ff871d3485f8afeaf930406a9f55079b7f2a89") // Testnet genesis hash to enforce below configs on
)
View Source
var (
	// MainnetChainConfig is the chain parameters to run a node on the main network.
	TestgiovChainConfig = &ChainConfig{
		ChainId:             big.NewInt(30632),
		HomesteadBlock:      big.NewInt(1),
		EIP150Block:         big.NewInt(2),
		EIP150Hash:          common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"),
		EIP155Block:         big.NewInt(3),
		EIP158Block:         big.NewInt(3),
		ByzantiumBlock:      big.NewInt(4),
		ConstantinopleBlock: nil,
		Alien: &AlienConfig{
			Period:           2,
			Freeze:           20,
			MaxSignerCount:   21,
			MinVoteValue:     new(big.Int).Mul(big.NewInt(1), big.NewInt(1e+18)),
			GenesisTimestamp: 1536136198,
			SelfVoteValue:    new(big.Int).Mul(big.NewInt(10), big.NewInt(1e+18)),
			SideChain:        false,
			MCRPCClient:      nil,
			AppId:            "",
			UnMine:           true,
		},
	}

	MainnetChainConfig = &ChainConfig{
		ChainId:             big.NewInt(30632),
		HomesteadBlock:      big.NewInt(1),
		EIP150Block:         big.NewInt(2),
		EIP150Hash:          common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"),
		EIP155Block:         big.NewInt(3),
		EIP158Block:         big.NewInt(3),
		ByzantiumBlock:      big.NewInt(4),
		ConstantinopleBlock: nil,
		Alien: &AlienConfig{
			Period:           5,
			Freeze:           604800,
			MaxSignerCount:   21,
			MinVoteValue:     new(big.Int).Mul(big.NewInt(100), big.NewInt(1e+18)),
			GenesisTimestamp: 1536136198,
			SelfVoteValue:    new(big.Int).Mul(big.NewInt(5000000), big.NewInt(1e+18)),
			SideChain:        false,
			MCRPCClient:      nil,
			AppId:            "",

			UnMine: true,
		},
	}

	// TestnetChainConfig contains the chain parameters to run a node on the Ropsten test network.
	TestnetChainConfig = &ChainConfig{
		ChainId:             big.NewInt(8434),
		HomesteadBlock:      big.NewInt(1),
		EIP150Block:         big.NewInt(2),
		EIP150Hash:          common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"),
		EIP155Block:         big.NewInt(3),
		EIP158Block:         big.NewInt(3),
		ByzantiumBlock:      big.NewInt(4),
		ConstantinopleBlock: nil,
		Alien: &AlienConfig{
			Period:           1,
			MaxSignerCount:   21,
			MinVoteValue:     new(big.Int).Mul(big.NewInt(100), big.NewInt(1e+18)),
			GenesisTimestamp: 1536136198,
			SelfVoteSigners: []common.Address{
				common.HexToAddress("0x393faea80893ba357db03c03ee73ad3e31257469"),
				common.HexToAddress("0x30d342865deef24ac6b3ec2f3f8dba5109351571"),
				common.HexToAddress("0xd410f95ede1d2da66b1870ac671cc18b66a97778"),
				common.HexToAddress("0xa25dc63609ea7ea999033e062f2ace42231c0b69"),
				common.HexToAddress("0xf392f41e14263330749b44edfdd6e286f8d5e4f2"),
				common.HexToAddress("0x56df54b4e9603a9ad094077b645f836602bdee4e"),
				common.HexToAddress("0x42eecb2947c05e031f183488cb51cde6132c8b93"),
				common.HexToAddress("0xf955da6fdf358eff8bf151e8549b7720d9a1781b"),
				common.HexToAddress("0x87aa4937c48cf1b152d451decfd29ead6547f3a0"),
				common.HexToAddress("0x7b1fbfe29a990dd19cf77deb2be6ae3bf9d96f89"),
				common.HexToAddress("0x6d5d0905ca8a3d2a2da3416be78dc1043c351493"),
				common.HexToAddress("0xd4a93c23439ca111f4099287fecb92f7c86674a4"),
				common.HexToAddress("0xa6ca9600357cbb06c6740b0b6d0e6a4027304b4d"),
				common.HexToAddress("0x5d1dad69c8cdc1e4837c8ded56c90e9caa2b7bd9"),
				common.HexToAddress("0x82cbed25c8cf0227a6dab6154f999adace2090c0"),
				common.HexToAddress("0x101f77ffbc00b2187baa790ccd00dd504e7341ec"),
				common.HexToAddress("0x10a516d26811c393511d782c5e695f52172fbb58"),
				common.HexToAddress("0x077451d856e45c96e59f25dd58b2b8318a6fe605"),
				common.HexToAddress("0xf2572a1b9d61493ce09d53777c4ca9bc0956eee8"),
				common.HexToAddress("0x2e867a39b139913c1f1d31c48a43492c19aa19d5"),
				common.HexToAddress("0x04ab5deebb6115a7915b395fec78047a9675814f"),
				common.HexToAddress("0x0b473b88e0e7dc8fc68fd07169f71c0394374c0d"),
				common.HexToAddress("0x21302441f9b0f3ca66d9b6d65ef95c1e79214c31"),
				common.HexToAddress("0x852a3c718117a7bb36f6f146fca5071824630df6"),
				common.HexToAddress("0x6629473f74062817358f9d59ac42b855b1de9097"),
				common.HexToAddress("0xc866a8357cd68f6b123530da8bb0e44403d8bab4"),
				common.HexToAddress("0x4cbca765bb93714cd328dd8799df7fc415348100"),
				common.HexToAddress("0x0f8ae8fb6a47c208103e75adc65a63fa24dd0ae5"),
				common.HexToAddress("0x87a4a6e44d749179374723ea5ebfbddc74bcd1bc"),
				common.HexToAddress("0xccd5cc1eca26f75ade6753439e2e94855ffefa9f"),
				common.HexToAddress("0xafd94afa2d9c991f4ac89ff3422324beefbfe034"),
				common.HexToAddress("0x6b57bd2b885282d33bcd6f0d550b6876f66772b0"),
				common.HexToAddress("0x8b237be168f7d74a27bfd4564c156546f5e0be25"),
				common.HexToAddress("0x3d2ce5022e3fef304ba0605bdb9b2e977e1f058c"),
				common.HexToAddress("0x1c3710e914ae548ac128a86ab1363f8ecab7ed78"),
				common.HexToAddress("0x1ac96e716a1b0636f93ec7b1eaa0becb3eeeaa60"),
			},
		},
	}

	// RinkebyChainConfig contains the chain parameters to run a node on the Rinkeby test network.
	RinkebyChainConfig = &ChainConfig{
		ChainId:             big.NewInt(4),
		HomesteadBlock:      big.NewInt(1),
		EIP150Block:         big.NewInt(2),
		EIP150Hash:          common.HexToHash("0x9b095b36c15eaf13044373aef8ee0bd3a382a5abb92e402afa44b8249c3a90e9"),
		EIP155Block:         big.NewInt(3),
		EIP158Block:         big.NewInt(3),
		ByzantiumBlock:      big.NewInt(1035301),
		ConstantinopleBlock: nil,
		Clique: &CliqueConfig{
			Period: 15,
			Epoch:  30000,
		},
	}

	// UFOChainConfig contains the chain parameters to run a node on the Rinkeby test network.
	UFOChainConfig = &ChainConfig{
		ChainId:             big.NewInt(4),
		HomesteadBlock:      big.NewInt(1),
		EIP150Block:         big.NewInt(2),
		EIP150Hash:          common.HexToHash("0x9b095b36c15eaf13044373aef8ee0bd3a382a5abb92e402afa44b8249c3a90e9"),
		EIP155Block:         big.NewInt(3),
		EIP158Block:         big.NewInt(3),
		ByzantiumBlock:      big.NewInt(1035301),
		ConstantinopleBlock: nil,
		Alien: &AlienConfig{
			Period:           3,
			MaxSignerCount:   21,
			MinVoteValue:     new(big.Int).Mul(big.NewInt(10000), big.NewInt(1000000000000000000)),
			GenesisTimestamp: 0,
			SelfVoteSigners:  []common.Address{},
		},
	}

	// AllEthashProtocolChanges contains every protocol change (EIPs) introduced
	// and accepted by the Ethereum core developers into the Ethash consensus.
	//
	// This configuration is intentionally not using keyed fields to force anyone
	// adding flags to the config to also have to set these fields.
	AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, nil, "", common.Hash{}, common.Address{}, common.Hash{}}

	// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
	// and accepted by the Ethereum core developers into the Clique consensus.
	//
	// This configuration is intentionally not using keyed fields to force anyone
	// adding flags to the config to also have to set these fields.
	AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil, "", common.Hash{}, common.Address{}, common.Hash{}}

	// AllAlienProtocolChanges contains every protocol change (EIPs) introduced
	// and accepted by the Ethereum core developers into the Alien consensus.
	//
	// This configuration is intentionally not using keyed fields to force anyone
	// adding flags to the config to also have to set these fields.
	AllAlienProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, &AlienConfig{Period: 3, MaxSignerCount: 21, MinVoteValue: new(big.Int).Mul(big.NewInt(10000), big.NewInt(1000000000000000000)), GenesisTimestamp: 0, SelfVoteSigners: []common.Address{}}, "", common.Hash{}, common.Address{}, common.Hash{}}

	TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, nil, "", common.Hash{}, common.Address{}, common.Hash{}}
	TestRules       = TestChainConfig.Rules(new(big.Int))
)
View Source
var (
	// GasTableHomestead contain the gas prices for
	// the homestead phase.
	GasTableHomestead = GasTable{
		ExtcodeSize: 20,
		ExtcodeCopy: 20,
		Balance:     20,
		SLoad:       50,
		Calls:       40,
		Suicide:     0,
		ExpByte:     10,
	}

	// GasTableHomestead contain the gas re-prices for
	// the homestead phase.
	GasTableEIP150 = GasTable{
		ExtcodeSize: 700,
		ExtcodeCopy: 700,
		Balance:     400,
		SLoad:       200,
		Calls:       700,
		Suicide:     5000,
		ExpByte:     10,

		CreateBySuicide: 25000,
	}

	GasTableEIP158 = GasTable{
		ExtcodeSize: 700,
		ExtcodeCopy: 700,
		Balance:     400,
		SLoad:       200,
		Calls:       700,
		Suicide:     5000,
		ExpByte:     50,

		CreateBySuicide: 25000,
	}
)
View Source
var (
	DifficultyBoundDivisor = big.NewInt(2048)   // The bound divisor of the difficulty, used in the update calculations.
	GenesisDifficulty      = big.NewInt(131072) // Difficulty of the Genesis block.
	MinimumDifficulty      = big.NewInt(131072) // The minimum that the difficulty may ever be.
	DurationLimit          = big.NewInt(13)     // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
)
View Source
var DiscoveryV5Bootnodes = []string{}

DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the experimental RLPx v5 topic-discovery network.

View Source
var MainnetBootnodes = []string{

	"enode://7fdb80ec20f78d1d6d5783c78a27474142e3a47f6ea64daab34f95b95c4abf4c5ebc0c9be2fab2654a72dd57387d9b1c5b7f37982e037142608f074e65fe519d@47.52.241.137:30303",
	"enode://68b9cafa324dd22c3f491bf34b262f47cdd4eef9b518024ffecf59462006c0ab60e5e5c770b128e43107ed845f7f31718be9cf594e79199023ec7d1dcebd372b@47.52.70.84:30303",
	"enode://e19aa9651a6db589c81c29db50c6f24de8375ff170bf14abdbcd7952c2814d948beff4746d1b3e27c262708b5432d0288ca549073e94bc091cdf4e07dbdc2c12@120.77.139.250:30303",
	"enode://7c65a6d77a4385499fd757104f62b343651786ad1b5aa7f6a04a2a475a0d98e6a98434bc20a39a210db93849057235990705a14a32bc3847bd6f393283198f07@47.245.30.101:30303",
}

MainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the main Ethereum network.

View Source
var RinkebyBootnodes = []string{}

RinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the Rinkeby test network.

View Source
var (
	TargetGasLimit uint64 = GenesisGasLimit // The artificial target
)
View Source
var TestnetBootnodes = []string{
	"enode://6bf3d26e4afcdf5373278bf1de89f1e8a6d16d0d80004cab38fa53af5bf4d4bcb717a383586e9451186464a1e01f7dca3d053ce4f9cb5c750779eec3311d9605@47.107.245.170:30000",
	"enode://1f246f5d3442592345bc0fc81f3c6818c6dd6f4f7989c6a49a45b37d95ac0f93fea70063e7d6732d1818641a850fac0f13f563a93cd61c268f4de8fcd53f608a@47.112.25.169:30000",
	"enode://0838e1c3b718edd2eb05290e3ad8eb27e70aee308e9334d07a885739451a59c8eee6e684ce318b7eb1ee18502c58f28d0727180b6231a9562c1ae72b63a1f9b3@47.112.25.169:30303",
	"enode://62774a32f314cfa9edefc9879c1ae696d045d67fbcc2c1cb8f0c42ca5dae7f76f85afef695a14415387ce984a0fe5cf6e3360c32a6e88551611e8e5d1c4628a9@47.107.245.170:30303",
}

TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the IOV test network.

View Source
var Version = func() string {
	v := fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
	if VersionMeta != "" {
		v += "-" + VersionMeta
	}
	return v
}()

Version holds the textual version string.

Functions

func VersionWithCommit

func VersionWithCommit(gitCommit string) string

Types

type AlienConfig

type AlienConfig struct {
	Period           uint64           `json:"period"`           // Number of seconds between blocks to enforce
	Freeze           uint64           `json:"freeze"`           // Number of days to freeze up voting after cancel vote
	MaxSignerCount   uint64           `json:"maxSignersCount"`  // Max count of signers
	MinVoteValue     *big.Int         `json:"minVoteValue"`     // Min vote value to valid this vote
	GenesisTimestamp uint64           `json:"genesisTimestamp"` // The LoopStartTime of first Block
	SelfVoteSigners  []common.Address `json:"signers"`          // Signers vote by themselves to seal the block, make sure the signer accounts are pre-funded
	SelfVoteValue    *big.Int         `json:"selfVoteValue"`    // value of self voter to valid this vote
	SideChain        bool             // If side chain or not
	MCRPCClient      *rpc.Client      // Main chain rpc client for side chain
	AppId            string
	UnMine           bool
}

AlienConfig is the consensus engine configs for delegated-proof-of-stake based sealing.

func (*AlienConfig) String

func (c *AlienConfig) String() string

String implements the stringer interface, returning the consensus engine details.

type ChainConfig

type ChainConfig struct {
	ChainId *big.Int `json:"chainId"` // Chain id identifies the current chain and is used for replay protection

	HomesteadBlock *big.Int `json:"homesteadBlock,omitempty"` // Homestead switch block (nil = no fork, 0 = already homestead)

	// EIP150 implements the Gas price changes (https://github.com/ethereum/EIPs/issues/150)
	EIP150Block *big.Int    `json:"eip150Block,omitempty"` // EIP150 HF block (nil = no fork)
	EIP150Hash  common.Hash `json:"eip150Hash,omitempty"`  // EIP150 HF hash (needed for header only clients as only gas pricing changed)

	EIP155Block *big.Int `json:"eip155Block,omitempty"` // EIP155 HF block
	EIP158Block *big.Int `json:"eip158Block,omitempty"` // EIP158 HF block

	ByzantiumBlock      *big.Int `json:"byzantiumBlock,omitempty"`      // Byzantium switch block (nil = no fork, 0 = already on byzantium)
	ConstantinopleBlock *big.Int `json:"constantinopleBlock,omitempty"` // Constantinople switch block (nil = no fork, 0 = already activated)

	// Various consensus engines
	Ethash *EthashConfig `json:"ethash,omitempty"`
	Clique *CliqueConfig `json:"clique,omitempty"`
	Alien  *AlienConfig  `json:"alien,omitempty"`

	AppId     string         `json:"appId,omitempty"`
	TxHash    common.Hash    `json:"txHash,omitempty"`
	Author    common.Address `json:"author,omitempty"`
	BlockHash common.Hash    `json:"blockHash,omitempty"` //防止可预测chainConfig
}

ChainConfig is the core config which determines the blockchain settings.

ChainConfig 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 (*ChainConfig) CheckCompatible

func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError

CheckCompatible checks whether scheduled fork transitions have been imported with a mismatching chain configuration.

func (*ChainConfig) GasTable

func (c *ChainConfig) GasTable(num *big.Int) GasTable

GasTable returns the gas table corresponding to the current phase (homestead or homestead reprice).

The returned GasTable's fields shouldn't, under any circumstances, be changed.

func (*ChainConfig) IsByzantium

func (c *ChainConfig) IsByzantium(num *big.Int) bool

func (*ChainConfig) IsConstantinople

func (c *ChainConfig) IsConstantinople(num *big.Int) bool

func (*ChainConfig) IsEIP150

func (c *ChainConfig) IsEIP150(num *big.Int) bool

func (*ChainConfig) IsEIP155

func (c *ChainConfig) IsEIP155(num *big.Int) bool

func (*ChainConfig) IsEIP158

func (c *ChainConfig) IsEIP158(num *big.Int) bool

func (*ChainConfig) IsHomestead

func (c *ChainConfig) IsHomestead(num *big.Int) bool

IsHomestead returns whether num is either equal to the homestead block or greater.

func (*ChainConfig) Rules

func (c *ChainConfig) Rules(num *big.Int) Rules

func (*ChainConfig) String

func (c *ChainConfig) String() string

String implements the fmt.Stringer interface.

type CliqueConfig

type CliqueConfig struct {
	Period uint64 `json:"period"` // Number of seconds between blocks to enforce
	Epoch  uint64 `json:"epoch"`  // Epoch length to reset votes and checkpoint
}

CliqueConfig is the consensus engine configs for proof-of-authority based sealing.

func (*CliqueConfig) String

func (c *CliqueConfig) String() string

String implements the stringer interface, returning the consensus engine details.

type ConfigCompatError

type ConfigCompatError struct {
	What string
	// block numbers of the stored and new configurations
	StoredConfig, NewConfig *big.Int
	// the block number to which the local chain must be rewound to correct the error
	RewindTo uint64
}

ConfigCompatError is raised if the locally-stored blockchain is initialised with a ChainConfig that would alter the past.

func (*ConfigCompatError) Error

func (err *ConfigCompatError) Error() string

type EthashConfig

type EthashConfig struct{}

EthashConfig is the consensus engine configs for proof-of-work based sealing.

func (*EthashConfig) String

func (c *EthashConfig) String() string

String implements the stringer interface, returning the consensus engine details.

type GasTable

type GasTable struct {
	ExtcodeSize uint64
	ExtcodeCopy uint64
	Balance     uint64
	SLoad       uint64
	Calls       uint64
	Suicide     uint64

	ExpByte uint64

	// CreateBySuicide occurs when the
	// refunded account is one that does
	// not exist. This logic is similar
	// to call. May be left nil. Nil means
	// not charged.
	CreateBySuicide uint64
}

type Rules

type Rules struct {
	ChainId                                   *big.Int
	IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool
	IsByzantium                               bool
}

Rules wraps ChainConfig and is merely syntatic sugar or 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.

Jump to

Keyboard shortcuts

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