params

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: GPL-3.0, GPL-3.0 Imports: 4 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 = 1          // Minor version component of the current release
	VersionPatch = 3          // 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 (
	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.
	MainnetChainConfig = &ChainConfig{
		ChainId:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(1150000),
		EIP150Block:         big.NewInt(2463000),
		EIP150Hash:          common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"),
		EIP155Block:         big.NewInt(2675000),
		EIP158Block:         big.NewInt(2675000),
		ByzantiumBlock:      big.NewInt(4370000),
		ConstantinopleBlock: nil,
		Ethash:              new(EthashConfig),
	}

	// 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,
			Epoch:            300,
			MaxSignerCount:   21,
			MinVoterBalance:  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,
		},
	}

	// 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}

	// 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}

	// 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, Epoch: 30000, MaxSignerCount: 21, MinVoterBalance: new(big.Int).Mul(big.NewInt(10000), big.NewInt(1000000000000000000)), GenesisTimestamp: 0, SelfVoteSigners: []common.Address{}}}

	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}
	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{
	"enode://06051a5573c81934c9554ef2898eb13b33a34b94cf36b202b69fde139ca17a85051979867720d4bdae4323d4943ddf9aeeb6643633aa656e0be843659795007a@35.177.226.168:30303",
	"enode://0cc5f5ffb5d9098c8b8c62325f3797f56509bff942704687b6530992ac706e2cb946b90a34f1f19548cd3c7baccbcaea354531e5983c7d1bc0dee16ce4b6440b@40.118.3.223:30304",
	"enode://1c7a64d76c0334b0418c004af2f67c50e36a3be60b5e4790bdac0439d21603469a85fad36f2473c9a80eb043ae60936df905fa28f1ff614c3e5dc34f15dcd2dc@40.118.3.223:30306",
	"enode://85c85d7143ae8bb96924f2b54f1b3e70d8c4d367af305325d30a61385a432f247d2c75c45c6b4a60335060d072d7f5b35dd1d4c45f76941f62a4f83b6e75daaf@40.118.3.223:30307",
}

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

View Source
var MainnetBootnodes = []string{

	"enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303",
	"enode://3f1d12044546b76342d59d4a05532c14b85aa669704bfe1f864fe079415aa2c02d743e03218e57a33fb94523adb54032871a6c51b2cc5514cb7c7e35b3ed0a99@13.93.211.84:30303",
	"enode://78de8a0916848093c73790ead81d1928bec737d565119932b98c6b100d944b7a95e94f847f689fc723399d2e31129d182f7ef3863f2b4c820abbf3ab2722344d@191.235.84.50:30303",
	"enode://158f8aab45f6d19c6cbf4a089c2670541a8da11978a2f90dbf6a502a4a3bab80d288afdbeb7ec0ef6d92de563767f3b1ea9e8e334ca711e9f8e2df5a0385e8e6@13.75.154.138:30303",
	"enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303",

	"enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303",
}

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

View Source
var RinkebyBootnodes = []string{
	"enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303",
	"enode://343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8@52.3.158.184:30303",
	"enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303",
}

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://b50b114ddebcccf0f452b433eed1ceaca49d1bc8075b89ccc627b110ad5e30d1a8d4f7eb5f936c17f0b8ee9a751879336b806f8c5d66e64b0191a24d879deaf8@172.31.241.251:30342",
	"enode://a990d36e7f9e647d0249b329dca164a20482310d6959b549d664eaf865ad249bcc2f45b07c6123aedbbe2316a02e9dbe7ff408c5677dbccf1329f276e7079fc9@47.105.86.215:30344",
	"enode://7798a1ff0e7352cbca47146f3b6b0d767ca7623d4902fda53b24d28fdd1422fa8a0c2f45d6c60d530b249c0189a055425d8258052de54ef5a9a04e281a9dd876@172.31.241.249:30330",
	"enode://cd426aab26e25b80d119861dbfdd800a44c066c87e7bdf3bae89b966d16b1cfce96ec559f870ee0113b8085636636d4b6c719ef975a81ebc98ee9b6d5bf541ae@47.105.140.129:30332",
	"enode://7b23c59907c0a3913d43f752d233019ee8113c7b50e1629cddfa001e6490d3a9fa695c76d503765c8104ccde398be7d9d87237e604eacaa83a214d2ba991341c@172.31.241.252:30312",
	"enode://5b6186b6b489af740db39035aa8bf29aec7b7aa8d4eee826f58e5f647a6188c12451b14dd4fc3055692b56d8daaec4f8bf2a46b879788caf90e1ac85b01cc6fb@47.105.97.19:30314",
	"enode://7ea312f4093e54a488ac53ea32c1a956885ffa4450fbc7e7d96768268ec5d35d0a17e2de8ce8a80d1ef41d79d423be6f95e7d5bb7351adcd33cd954a5cbf4c6d@172.31.241.253:30336",
	"enode://7323f49f6e4ef9c1f26430daebb82bce0c2c0bb0cb29d70b032ff4f6c473320cb4627cda4916cc950730d95580f571ca5c395d96a7d55b53e339a959e49237bc@47.105.142.208:30338",
	"enode://b61f14fe23d58692aad392511c8fabe89beeb564c925eea4480c540d23b45333437d90e3fb8ab554b237e2338adcd609da62130835b9028129d385c1ce426be4@47.105.142.208:30340",
	"enode://18f5e0481f49102ec63313b8bffb1d459b4dbbd863fed51b3f4dac9545e739ebab738e9304eaed03c06b12d3d3a88be6bcf0933978640cf7425630b1d9b2034e@172.31.241.248:30324",
	"enode://a9e82a3f8a45b537376c9444548e52bf60cd120bb5cb5df3f4497462dce61760a5b3a6d24f97d4bfaa57d161750b4b8bcf04e4a1b7fc2618df69e82a6b903a01@47.105.131.192:30326",
	"enode://382761b8c39e6565c445a0d696abbf5e9f1372f7db32d08b28c83c102112938c9980170c0e04f208fc25320aa6742c7530ee7ab99b1a535d68dd07c8415ac6d7@47.105.131.192:30328",
	"enode://cb60856cea1bd459f9fe6669eac7075e86e9f0ff5cf31c54dc26df84fa47ecdaa2c1aae0b0f274c45b8a585a8d532e2552e9ed3a82b1e8a067c929c26dfeaf66@172.31.241.250:30320",
	"enode://1462d1ee968baac8e8278624263e40e9864ca8b3193ca32b6c6df28f718c57b0d3f9b277ec628a341e848f486481aac5b1200d0718a11ce9c2e40688ef2017e8@47.105.78.210:30322",
	"enode://03116ab2a06a74449a4aa621b9a59aaf05ffef4a6541abe3617ba70622a2c063d424ac41a9af1c21ba396c81a191c1da341d3957b5a9802e2567b050bf016ad1@47.105.78.210:30318",
}

TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the TTC 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
	Epoch            uint64           `json:"epoch"`            // Epoch length to reset votes and checkpoint
	MaxSignerCount   uint64           `json:"maxSignersCount"`  // Max count of signers
	MinVoterBalance  *big.Int         `json:"minVoterBalance"`  // Min voter balance 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
	SideChain        bool             `json:"sideChain"`        // If side chain or not
	MCRPCClient      *rpc.Client      // Main chain rpc client for side chain
	PBFTEnable       bool             `json:"pbft"` //

	TrantorBlock  *big.Int          `json:"trantorBlock,omitempty"`  // Trantor switch block (nil = no fork)
	TerminusBlock *big.Int          `json:"terminusBlock,omitempty"` // Terminus switch block (nil = no fork)
	LightConfig   *AlienLightConfig `json:"lightConfig,omitempty"`
}

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

func (*AlienConfig) IsTerminus added in v0.0.7

func (a *AlienConfig) IsTerminus(num *big.Int) bool

IsTerminus returns whether num is either equal to the Terminus block or greater.

func (*AlienConfig) IsTrantor added in v0.0.7

func (a *AlienConfig) IsTrantor(num *big.Int) bool

IsTrantor returns whether num is either equal to the Trantor block or greater.

func (*AlienConfig) String

func (a *AlienConfig) String() string

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

type AlienLightConfig added in v0.1.1

type AlienLightConfig struct {
	Alloc map[common.UnprefixedAddress]GenesisAccount `json:"alloc"`
}

AlienLightConfig is the config for light node of alien

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"`
}

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 GenesisAccount added in v0.1.1

type GenesisAccount struct {
	Balance string `json:"balance"`
}

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