Documentation
¶
Index ¶
- Constants
- Variables
- func BuildTags() string
- func VersionWithCommit(gitCommit string) string
- type AquahashConfig
- type ChainConfig
- func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError
- func (c *ChainConfig) GasTable(num *big.Int) GasTable
- func (c *ChainConfig) GetBlockVersion(height *big.Int) HeaderVersion
- func (c *ChainConfig) GetHF(hf int) *big.Int
- func (c *ChainConfig) IsByzantium(num *big.Int) bool
- func (c *ChainConfig) IsConstantinople(num *big.Int) bool
- func (c *ChainConfig) IsDAOFork(num *big.Int) bool
- func (c *ChainConfig) IsEIP150(num *big.Int) bool
- func (c *ChainConfig) IsEIP155(num *big.Int) bool
- func (c *ChainConfig) IsEIP158(num *big.Int) bool
- func (c *ChainConfig) IsHF(hf int, num *big.Int) bool
- func (c *ChainConfig) IsHomestead(num *big.Int) bool
- func (c *ChainConfig) NextHF(cur *big.Int) *big.Int
- func (c *ChainConfig) Rules(num *big.Int) Rules
- func (c *ChainConfig) String() string
- func (c *ChainConfig) UseHF(height *big.Int) int
- type ConfigCompatError
- type ForkMap
- type GasTable
- type HeaderVersion
- type Rules
Constants ¶
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 Aquaer = 1e18 Aqua = 1e18 Einstein = 1e21 Douglas = 1e42 )
const ( // BloomBitsBlocks is the number of blocks a single bloom bit section vector // contains. BloomBitsBlocks uint64 = 4096 // BloomBitsBlocksClient is the number of blocks a single bloom bit section vector // contains on the light client side BloomBitsBlocksClient uint64 = 32768 // BloomConfirms is the number of confirmation blocks before a bloom section is // considered probably final and its rotated bits are calculated. BloomConfirms = 256 // BloomTrieFrequency is the block frequency for creating BloomTrie on both // server/client sides. BloomTrieFrequency = 32768 // HelperTrieConfirmations is the number of confirmations before a client is expected // to have the given HelperTrie available. HelperTrieConfirmations = 2048 // HelperTrieProcessConfirmations is the number of confirmations before a HelperTrie // is generated HelperTrieProcessConfirmations = 256 // ImmutabilityThreshold is the number of blocks after which a chain segment is // considered immutable (i.e. soft finality). It is used by the downloader as a // hard limit against deep ancestors, by the blockchain against deep reorgs. ImmutabilityThreshold uint64 = 900 )
const ( GasLimitBoundDivisor uint64 = 1024 // The bound divisor of the gas limit, used in update calculations. MinGasLimit uint64 = 5000 // Minimum the gas limit may ever be. GenesisGasLimit uint64 = 4712388 // 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 )
const ( VersionMajor = 1 // Major version component of the current release VersionMinor = 7 // Minor version component of the current release VersionPatch = 15 // Patch version component of the current release )
const KnownHF = 9
KnownHF is the highest hard fork that is known by this version of Aquachain.
Variables ¶
var ( MainnetGenesisHash = common.HexToHash("0x381c8d2c3e3bc702533ee504d7621d510339cafd830028337a4b532ff27cd505") // Mainnet genesis hash to enforce below configs on TestnetGenesisHash = common.HexToHash("0xa8773cb7d32b8f7e1b32b0c2c8b735c293b8936dd3760c15afc291a23eb0cf88") // Testnet genesis hash to enforce below configs on Testnet2GenesisHash = common.HexToHash("0xde434983d3ada19cd43c44d8ad5511bad01ed12b3cc9a99b1717449a245120df") // Testnet2 genesis hash to enforce below configs on EthnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") )
var ( // AquachainHF is the map of hard forks (mainnet) AquachainHF = ForkMap{ 1: big.NewInt(3600), 2: big.NewInt(7200), 3: big.NewInt(13026), 4: big.NewInt(21800), 5: big.NewInt(22800), 6: big.NewInt(36000), 7: big.NewInt(36050), 8: nil, } // TestnetHF is the map of hard forks (testnet) TestnetHF = ForkMap{ 1: big.NewInt(1), 2: big.NewInt(2), 3: big.NewInt(3), 4: big.NewInt(4), 5: big.NewInt(5), 6: big.NewInt(6), 7: big.NewInt(25), 8: big.NewInt(650), } // Testnet2HF is the map of hard forks (testnet2 private network Testnet2HF = ForkMap{ 5: big.NewInt(0), 6: big.NewInt(0), 7: big.NewInt(0), 8: big.NewInt(8), 9: big.NewInt(19), } // Testnet3HF is the map of hard forks (testnet2 private network Testnet3HF = ForkMap{ 5: big.NewInt(1), 6: big.NewInt(0), 7: big.NewInt(0), 8: nil, 9: nil, } // TestHF is the map of hard forks (for testing suite) TestHF = ForkMap{ 4: big.NewInt(12), 5: big.NewInt(13), 7: big.NewInt(30), } NoHF = ForkMap{} )
var ( // MainnetChainConfig is the chain parameters to run a node on the main network. MainnetChainConfig = &ChainConfig{ ChainId: big.NewInt(61717561), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: AquachainHF[7], EIP158Block: AquachainHF[7], ByzantiumBlock: AquachainHF[7], Aquahash: new(AquahashConfig), HF: AquachainHF, } // TestnetChainConfig contains the chain parameters to run a node on the Aquachain test network. TestnetChainConfig = &ChainConfig{ ChainId: big.NewInt(3), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: TestnetHF[7], EIP158Block: TestnetHF[7], ByzantiumBlock: TestnetHF[7], Aquahash: new(AquahashConfig), HF: TestnetHF, } // Testnet2ChainConfig contains the chain parameters to run a node on the Testnet2 test network. Testnet2ChainConfig = &ChainConfig{ ChainId: big.NewInt(4096), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: Testnet2HF[7], EIP158Block: Testnet2HF[7], ByzantiumBlock: Testnet2HF[7], Aquahash: new(AquahashConfig), HF: Testnet2HF, } // Testnet3ChainConfig contains the chain parameters to run a node on the Testnet2 test network. Testnet3ChainConfig = &ChainConfig{ ChainId: big.NewInt(11110), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), EIP155Block: Testnet3HF[7], EIP158Block: Testnet3HF[7], ByzantiumBlock: Testnet3HF[7], Aquahash: new(AquahashConfig), HF: Testnet3HF, } EthnetChainConfig = &ChainConfig{ ChainId: big.NewInt(1), HomesteadBlock: big.NewInt(1150000), DAOForkBlock: big.NewInt(1920000), DAOForkSupport: true, EIP150Block: big.NewInt(2463000), EIP150Hash: common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"), EIP155Block: big.NewInt(2675000), EIP158Block: big.NewInt(2675000), ByzantiumBlock: big.NewInt(4370000), ConstantinopleBlock: nil, Aquahash: new(AquahashConfig), HF: NoHF, } // AllAquahashProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Aquachain core developers into the Aquahash consensus. // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. AllAquahashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(AquahashConfig), TestHF} TestChainConfig = &ChainConfig{big.NewInt(3), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(AquahashConfig), TestHF} TestRules = TestChainConfig.Rules(new(big.Int)) )
var ( // GasTableHomestead contain the gas prices for // the homestead phase. GasTableHomestead = GasTable{ ExtcodeSize: 700, ExtcodeCopy: 700, Balance: 400, SLoad: 200, Calls: 700, Suicide: 5000, ExpByte: 10, CreateBySuicide: 25000, } // GasTableHF1 contain the gas re-prices for // the HF1 phase. GasTableHF1 = GasTable{ ExtcodeSize: 700, ExtcodeCopy: 700, Balance: 400, SLoad: 200, Calls: 700, Suicide: 5000, ExpByte: 50, CreateBySuicide: 25000, } )
var ( MaxMoney = big.NewInt(42000000) // At block 42mil rewards will be fees-only BlockReward *big.Int = big.NewInt(1e+18) // Block reward in wei for successfully mining a block EthBlockReward *big.Int = big.NewInt(5e+18) // Block reward in wei for successfully mining a block EthBlockReward2 *big.Int = big.NewInt(3e+18) // Block reward in wei for successfully mining a block )
var ( GenesisDifficultyEth = big.NewInt(131072) // Difficulty of the Ethereum Genesis block. MinimumDifficultyEth = big.NewInt(131072) // The minimum that the Ethereum difficulty may ever be )
var ( GenesisDifficulty = big.NewInt(99999999) // Difficulty of the Genesis block. MinimumDifficultyGenesis = big.NewInt(99999999) // The minimum that the difficulty may ever be MinimumDifficultyHF1 = big.NewInt(100001792) // The minimum that the difficulty may ever be (changed to a nice multiple of 2048). MinimumDifficultyHF3 = big.NewInt(3095918580 * 10) // GPU Announcement MinimumDifficultyHF8Testnet = big.NewInt(64) // Argon2id Announcement MinimumDifficultyHF5Testnet = big.NewInt(4096) // Argon2id Announcement MinimumDifficultyHF5 = big.NewInt(46039386) // Argon2id Announcement MinimumDifficultyTestnet = big.NewInt(4096) // Argon2id Testnet )
var ( DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations. DifficultyBoundDivisorHF5 = big.NewInt(16) // The bound divisor of the difficulty, used in the update calculations. DifficultyBoundDivisorHF6 = big.NewInt(128) // The bound divisor of the difficulty, used in the update calculations. DifficultyBoundDivisorHF8 = big.NewInt(1024) // The bound divisor of the difficulty, used in the update calculations. DifficultyBoundDivisorHF8Testnet = big.NewInt(8) // The bound divisor of the difficulty, used in the update calculations. DifficultyBoundDivisorHF9 = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations. )
var ( DurationLimit = big.NewInt(240) // The decision boundary on the blocktime duration used to determine difficulty direction. DurationLimitHF6 = big.NewInt(180) // DurationLimitHF6 lowers the duration limit, keeping 240 second target )
set with -X linker flag
var DiscoveryV5Bootnodes = []string{
"enode://7f636b8198a41abb10c1a571992335b8cb760d6ef973efc5f3ff613dda7acbe9e6d6b27254e076ef7b684ac7ea09a27bd05a37844cd8ad242199593bdd8cec21@107.161.24.142:21001",
"enode://6227ff2948ff51ee4f09e5f1df2c1270c47b753718d406605787326341de6ff8e7cb6a5f01a4deed5437dcdd7b9fb8e656f0ad6a08c1f677c2ca5d0e666a92fc@168.235.78.103:21001",
}
DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the experimental RLPx v5 topic-discovery network. (port 21001)
var EthnetBootnodes = []string{
"enode://d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666@18.138.108.67:30303",
"enode://22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de@3.209.45.79:30303",
"enode://ca6de62fce278f96aea6ec5a2daadb877e51651247cb96ee310a318def462913b653963c155a0ef6c7d50048bba6e6cea881130857413d9f50a621546b590758@34.255.23.113:30303",
"enode://279944d8dcd428dffaa7436f25ca0ca43ae19e7bcf94a8fb7d1641651f92d121e972ac2e8f381414b80cc8e5555811c2ec6e1a99bb009b3f53c4c69923e11bd8@35.158.244.151:30303",
"enode://8499da03c47d637b20eee24eec3c356c9a2e6148d6fe25ca195c7949ab8ec2c03e3556126b0d7ed644675e78c4318b08691b7b57de10e5f0d40d05b09238fa0a@52.187.207.27:30303",
"enode://103858bdb88756c71f15e9b5e09b56dc1be52f0a5021d46301dbbfb7e130029cc9d0d6f73f693bc29b665770fff7da4d34f3c6379fe12721b5d7a0bcb5ca1fc1@191.234.162.198:30303",
"enode://715171f50508aba88aecd1250af392a45a330af91d7b90701c436b618c86aaa1589c9184561907bebbb56439b8f8787bc01f49a7c77276c58c1b09822d75e8e8@52.231.165.108:30303",
"enode://5d6d7cd20d6da4bb83a1d28cadb5d409b64edf314c0335df658c1a54e32c7c4a7ab7823d57c39b6a757556e68ff1df17c748b698544a55cb488b52479a92b60f@104.42.217.25:30303",
"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",
}
var MainnetBootnodes = []string{
"enode://ef5a7f89789f9150e282c4a37d317596c1f29e0b51748269472395c45790784d585b253089ef87e579408de88961f1e43f15d5dbc271d612b676f1961792814f@168.235.107.40:21000",
"enode://7f636b8198a41abb10c1a571992335b8cb760d6ef973efc5f3ff613dda7acbe9e6d6b27254e076ef7b684ac7ea09a27bd05a37844cd8ad242199593bdd8cec21@107.161.24.142:21000",
"enode://6227ff2948ff51ee4f09e5f1df2c1270c47b753718d406605787326341de6ff8e7cb6a5f01a4deed5437dcdd7b9fb8e656f0ad6a08c1f677c2ca5d0e666a92fc@168.235.78.103:21000",
"enode://1a6b78cf626540d1eecfeba1f364e72bf92847561b9344403ac7010b2be184cfc760b5bcd21402b19713deebef256dcdfc5af67487554650bf07807737a36203@23.94.123.137:21303",
"enode://a341920437d7141e4355ed1f298fd2415cbec781c8b4fedd943eac37fd0c835375718085b1a65208c0a06af10c388d452a4148b8430da93bd0b75100b2315f3c@107.161.24.142:21303",
"enode://fa2ad4aba184e5c7cbcdc613dcfb70ecd7ebd77fcef1b9b1b468476a7f043f7d0fe8befb7c2ace319b0c2316a94d743c3a5ca401ef5d35c897c5a8af65d1badd@140.82.42.96:21000",
"enode://f413c22f83972c7736668fc5f3b6b1eaccb9a59da9ed75538ff3ea85a842b76f680aac72fcd3549d153f2886e6231595ab0d2f1c5cc657318f2752ad46bd0cca@93.171.216.173:21000",
"enode://f6a307137829a32941249d8bf2bfa9e365735a120b3acaeff339af6ee4111f81bae48812671bfff26e98c851d8c3a2e51c32a32b264b94f29715c619b098053c@173.212.244.109:21000",
"enode://9b18e3f7540f314c64c9e4e83b678020030c194e61f607581a0eb8de2fa1204c07f9c593042b3ec706493acc191d53d0e8516e4e283fe5d7329f76e79859fb10@35.204.163.184:21000",
"enode://ed34ed3655326e9bdb1cd3ac8af35dc4c5c100fc617c256e988f14241343fda70e1d42a94002e70bc755f7f3cbcc310115075da786a0096c70d07b7abf87b109@3.137.155.72:21000",
"enode://fd9ad9c0115f59cfeed9470c4771f6fe3cbe6097801773881b69e6e8a7810d339a3dc3876bd5e4dd854c75b8cafa3fdbdee21ab4f9d78ddde0228146a89a7983@195.46.0.106:21303",
"enode://e536bf190db04c3cd7dc644a642a647577366bb646ee3606e9aebb0dce65545628c1b80b7e1fde49fbe8f0719847172068d3c007b5f5af001b2ba8262b589ea5@168.235.111.37:21000",
}
MainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the main Aquachain network.
var (
TargetGasLimit uint64 = GenesisGasLimit // The artificial gas limit target
)
var Testnet2Bootnodes = []string{}
Testnet2Bootnodes are the enode URLs of the P2P bootstrap nodes running on the Testnet2 test network.
var TestnetBootnodes = []string{
"enode://6227ff2948ff51ee4f09e5f1df2c1270c47b753718d406605787326341de6ff8e7cb6a5f01a4deed5437dcdd7b9fb8e656f0ad6a08c1f677c2ca5d0e666a92fc@168.235.78.103:21002",
}
TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the test network. (port 21002)
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.
var (
VersionMeta = "dev" // Version metadata to append to the version string
)
Functions ¶
func VersionWithCommit ¶
Types ¶
type AquahashConfig ¶
type AquahashConfig struct{}
AquahashConfig is the consensus engine configs for proof-of-work based sealing.
func (*AquahashConfig) String ¶
func (c *AquahashConfig) 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) // et junk to remove DAOForkBlock *big.Int `json:"daoForkBlock,omitempty"` // TheDAO hard-fork switch block (nil = no fork) DAOForkSupport bool `json:"daoForkSupport,omitempty"` // Whether the nodes supports or opposes the DAO hard-fork // EIP150 implements the Gas price changes (https://github.com/aquanetwork/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 Aquahash *AquahashConfig `json:"aquahash,omitempty"` // HF Scheduled Maintenance Hardforks HF ForkMap `json:"hf,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 GetChainConfig ¶ added in v1.7.13
func GetChainConfig(name string) *ChainConfig
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.
The returned GasTable's fields shouldn't, under any circumstances, be changed.
func (*ChainConfig) GetBlockVersion ¶ added in v1.5.1
func (c *ChainConfig) GetBlockVersion(height *big.Int) HeaderVersion
func (*ChainConfig) GetHF ¶ added in v1.5.1
func (c *ChainConfig) GetHF(hf int) *big.Int
GetHF returns the height of input hf, can be nil.
func (*ChainConfig) IsByzantium ¶
func (c *ChainConfig) IsByzantium(num *big.Int) bool
func (*ChainConfig) IsConstantinople ¶
func (c *ChainConfig) IsConstantinople(num *big.Int) bool
func (*ChainConfig) IsDAOFork ¶
func (c *ChainConfig) IsDAOFork(num *big.Int) bool
IsDAO returns whether num is either equal to the DAO fork block or greater.
func (*ChainConfig) IsHF ¶
func (c *ChainConfig) IsHF(hf int, num *big.Int) bool
IsHF returns whether num is either equal to the hf block or greater.
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) NextHF ¶
func (c *ChainConfig) NextHF(cur *big.Int) *big.Int
NextHF returns the next scheduled hard fork block number
func (*ChainConfig) String ¶
func (c *ChainConfig) String() string
String implements the fmt.Stringer interface.
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 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 HeaderVersion ¶ added in v1.5.1
type HeaderVersion byte
HeaderVersion is not stored in db, or rlp encoded, or sent over the network.
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.