Documentation ¶
Index ¶
- Constants
- Variables
- func ArchiveVersion(gitCommit string) string
- func DAODrainList() []common.Address
- func VersionWithCommit(gitCommit string) string
- type AiConsensusConfig
- type ChainConfig
- func (c *ChainConfig) AitNeedForMinerAccount() *big.Int
- func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError
- func (c *ChainConfig) CheckMinerAccountAit(num *big.Int) bool
- func (c *ChainConfig) DefaultCoinbase() string
- func (c *ChainConfig) DefaultDifficaulty() *big.Int
- func (c *ChainConfig) DefaultMaxDifficaulty() *big.Int
- func (c *ChainConfig) GasTable(num *big.Int) GasTable
- func (c *ChainConfig) IsByzantium(num *big.Int) bool
- func (c *ChainConfig) IsCoinDelieverDone(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) IsEWASM(num *big.Int) bool
- func (c *ChainConfig) IsHomestead(num *big.Int) bool
- func (c *ChainConfig) Rules(num *big.Int) Rules
- func (c *ChainConfig) String() string
- type CliqueConfig
- type ConfigCompatError
- type EthashConfig
- type GasTable
- type Rules
- type TrustedCheckpoint
Constants ¶
const ( Wei = 1 GWei = 1e9 Ether = 1e18 )
These are the multipliers for ether denominations. Example: To get the wei value of an amount in 'gwei', use
new(big.Int).Mul(value, big.NewInt(params.GWei))
const ( // BloomBitsBlocks is the number of blocks a single bloom bit section vector // contains on the server side. 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 // CHTFrequencyClient is the block frequency for creating CHTs on the client side. CHTFrequencyClient = 32768 // CHTFrequencyServer is the block frequency for creating CHTs on the server side. // Eventually this can be merged back with the client version, but that requires a // full database upgrade, so that should be left for a suitable moment. CHTFrequencyServer = 4096 // 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 )
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. ForkGenesisGasLimit uint64 = (4712388 * 10) // Gas limit of the Genesis block. MaximumGasLimit uint64 = (4712388 * 50) // Minimum gas limit of block. MaximumExtraDataSize uint64 = 32 // Maximum size extra data may be after Genesis. MaximumSigDataSize uint64 = 128 // Maximum size sig 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. 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. SstoreSetGas uint64 = 20000 // Once per SLOAD operation. 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. NetSstoreNoopGas uint64 = 200 // Once per SSTORE operation if the value doesn't change. NetSstoreInitGas uint64 = 20000 // Once per SSTORE operation from clean zero. NetSstoreCleanGas uint64 = 5000 // Once per SSTORE operation from clean non-zero. NetSstoreDirtyGas uint64 = 200 // Once per SSTORE operation from dirty. NetSstoreClearRefund uint64 = 15000 // Once per SSTORE operation for clearing an originally existing storage slot NetSstoreResetRefund uint64 = 4800 // Once per SSTORE operation for resetting to the original non-zero value NetSstoreResetClearRefund uint64 = 19800 // Once per SSTORE operation for resetting to the original zero value 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. Create2Gas uint64 = 32000 // Once per CREATE2 operation 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 = 0 // Minor version component of the current release VersionPatch = 7 // Patch version component of the current release VersionMeta = "stable" // Version metadata to append to the version string )
Variables ¶
var ( MainnetGenesisHash = common.HexToHash("0x84ba29088566df091e2e7214ca338b4c6f7fda8a52c0454fd134b0e485da1d3a") // Mainnet genesis hash to enforce below configs on TestnetGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") // Testnet genesis hash to enforce below configs on )
var ( // MainnetChainConfig is the chain parameters to run a node on the main network. MainnetChainConfig = &ChainConfig{ ChainID: big.NewInt(0x4149434e), TotalRewardBlockNum: big.NewInt(1250000000), HomesteadBlock: big.NewInt(0), DAOForkBlock: big.NewInt(0), DAOForkSupport: false, EIP150Block: nil, EIP150Hash: common.Hash{}, EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: nil, Ethash: new(EthashConfig), AiConsensus: &AiConsensusConfig{ MaxValidatorNumber: 10, MaxPooledMinerNumber: 10, Period: 1, BlockValidNumber: 12, Epoch: 1200, VoteEpoch: 30000, EthashDifficulty: big.NewInt(10000000), ExtraData: hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000000a9bcaccef0d131b37e51c8ffcf5bb1651ecc405f6cc874e476c25c1fdc4c601829f17c8b3b06cbd773cf4f94d5062c590bceecfd0d446114e09a86b4441ae7572a2a94111403167bb4a2d4f4ed3e74cfebf670c598ca813d4888b7585db462391614b07256086cf6486057b33d9f23626076becd26034362e1762aeb5f01166b2f694f4fb19fb272377e38ab5f714bd29a48423ea8e96ef7e35df8e6876aabc0487e85216ea4365634b7ac29b70ea8baeeadc52e73f0eee87efb2d3583210ecf42a03d5bead8cb7300a58971525fb7c8ef19b3faa18c6156ec5ae4a3f705c8e6238575ba6d99ae608e93c5a4894bba336e568fca5fae3784df77b91be85ab990179936f3037f2e66315410d58d278124918f79914d9e4b497287fd48fff8f6feae623a26c49e08a871defe4f774dcdcc10dab8f45643a44070a3f0cb2e89d48aee35cec145d3ce061dc99fe2fae8aad527fefdabccb01855499673b57592322621904c51c31a84bd7be6d7e39c74c74710e25cee1931d2fed7ab0f20266f6361f6d336218a52698ab48ab21ec9b239319820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), ForkBlockNumber: 328800, GasLimitSoftForkBlockNumber: 5204928, ExtraPeriod: 4, ExtraPeriodForkBlockNumber: 8145252, FixExtraPeriodForkBlockNumber: 8258532, }, } // MainnetTrustedCheckpoint contains the light client trusted checkpoint for the main network. MainnetTrustedCheckpoint = &TrustedCheckpoint{ Name: "mainnet", SectionIndex: 195, SectionHead: common.HexToHash("0x1cdd2a84cf6c1261ffccc88f6bcefb513abd7934a96c1e909fbf74767560f16b"), CHTRoot: common.HexToHash("0xe453333c20391d16b91b6fe11c104704f62c8dba15f69db73b4cdf7e100105eb"), BloomRoot: common.HexToHash("0x47f30069473072e00d2cdca146dce40f0aad243dfc8221bf810822c091674efe"), } // TestnetChainConfig contains the chain parameters to run a node on the Ropsten test network. TestnetChainConfig = &ChainConfig{ ChainID: big.NewInt(0x41495454), TotalRewardBlockNum: big.NewInt(1250000000), HomesteadBlock: big.NewInt(0), DAOForkBlock: nil, DAOForkSupport: false, EIP150Block: nil, EIP150Hash: common.Hash{}, EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: nil, Ethash: new(EthashConfig), AiConsensus: &AiConsensusConfig{ MaxValidatorNumber: 4, MaxPooledMinerNumber: 4, Period: 1, BlockValidNumber: 12, Epoch: 120, VoteEpoch: 30000, EthashDifficulty: big.NewInt(10000), ExtraData: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000000043fa63f6e587975e93670ace6ab5a71061c1dafa47acbcffa2cccf1ce3e8631e7620a94823605e4f34eae4b8e5d2bed9cddfd6b309f965a27759bad96c40cee6c6692307dda2ff1a33860855fc3b39f1004beb845896ae589fbee97f37e3bff49cb68a3aa6cae15f60311b0990bd3e8545d1b19431094001948e0c1c6aaa39a5cf563e09e941e9c262c87b624007a7500fbb6a7c86fd3c272c77e6cf849af65d5ce0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), ForkBlockNumber: 360000, GasLimitSoftForkBlockNumber: 5204928, ExtraPeriod: 4, ExtraPeriodForkBlockNumber: 8145252, FixExtraPeriodForkBlockNumber: 8258532, }, } // TestnetTrustedCheckpoint contains the light client trusted checkpoint for the Ropsten test network. TestnetTrustedCheckpoint = &TrustedCheckpoint{ Name: "testnet", SectionIndex: 126, SectionHead: common.HexToHash("0x48f7dd4c9c60be04bf15fd4d0bcac46ddd8caf6b01d6fb8f8e1f7955cdd1337a"), CHTRoot: common.HexToHash("0x6e54cb80a1884881ea1a114243af9012c95e0296b47f103b5ab124313968508e"), BloomRoot: common.HexToHash("0xb55accf6dce6455b47db8510d15eff38d0ed7378829f3036d26b48e7d15da3f6"), } // RinkebyChainConfig contains the chain parameters to run a node on the Rinkeby test network. RinkebyChainConfig = &ChainConfig{ ChainID: big.NewInt(4), TotalRewardBlockNum: big.NewInt(1250000000), HomesteadBlock: big.NewInt(1), DAOForkBlock: nil, DAOForkSupport: false, EIP150Block: nil, EIP150Hash: common.Hash{}, EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: nil, Clique: &CliqueConfig{ Period: 15, Epoch: 30000, }, } // RinkebyTrustedCheckpoint contains the light client trusted checkpoint for the Rinkeby test network. RinkebyTrustedCheckpoint = &TrustedCheckpoint{ Name: "rinkeby", SectionIndex: 93, SectionHead: common.HexToHash("0xdefb94aa217ab38f2919f7318d1d5476bd2aabf1ec9148047fe03e555615e0b4"), CHTRoot: common.HexToHash("0x52c98c2fe508a8332c27dc10538f3fead43306e2b22b597587763c2fe6586da6"), BloomRoot: common.HexToHash("0x93d83be0c1b12f732b1a027ecdfb16f39b0d020b8c10bfb90e76f3b01adfc5b6"), } // AiConsensusChainConfig contains the chain parameters to run a node on the Ai consensus network. AiConsensusChainConfig = &ChainConfig{ ChainID: big.NewInt(4), TotalRewardBlockNum: big.NewInt(1250000000), HomesteadBlock: big.NewInt(1), DAOForkBlock: nil, DAOForkSupport: false, EIP150Block: nil, EIP150Hash: common.Hash{}, EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: nil, EWASMBlock: nil, AiConsensus: &AiConsensusConfig{ MaxValidatorNumber: 4, MaxPooledMinerNumber: 4, Period: 1, BlockValidNumber: 12, Epoch: 120, VoteEpoch: 30000, EthashDifficulty: big.NewInt(10000), ExtraData: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000000043fa63f6e587975e93670ace6ab5a71061c1dafa47acbcffa2cccf1ce3e8631e7620a94823605e4f34eae4b8e5d2bed9cddfd6b309f965a27759bad96c40cee6c6692307dda2ff1a33860855fc3b39f1004beb845896ae589fbee97f37e3bff49cb68a3aa6cae15f60311b0990bd3e8545d1b19431094001948e0c1c6aaa39a5cf563e09e941e9c262c87b624007a7500fbb6a7c86fd3c272c77e6cf849af65d5ce0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), ForkBlockNumber: 328800, GasLimitSoftForkBlockNumber: 5204928, ExtraPeriod: 4, ExtraPeriodForkBlockNumber: 8145252, FixExtraPeriodForkBlockNumber: 8258532, }, } // AllEthashProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the AICHAIN 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(1250000000), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, &AiConsensusConfig{ MaxValidatorNumber: 10, MaxPooledMinerNumber: 10, Period: 1, BlockValidNumber: 12, Epoch: 1200, VoteEpoch: 30000, EthashDifficulty: big.NewInt(10000000), ExtraData: hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000000a9bcaccef0d131b37e51c8ffcf5bb1651ecc405f6cc874e476c25c1fdc4c601829f17c8b3b06cbd773cf4f94d5062c590bceecfd0d446114e09a86b4441ae7572a2a94111403167bb4a2d4f4ed3e74cfebf670c598ca813d4888b7585db462391614b07256086cf6486057b33d9f23626076becd26034362e1762aeb5f01166b2f694f4fb19fb272377e38ab5f714bd29a48423ea8e96ef7e35df8e6876aabc0487e85216ea4365634b7ac29b70ea8baeeadc52e73f0eee87efb2d3583210ecf42a03d5bead8cb7300a58971525fb7c8ef19b3faa18c6156ec5ae4a3f705c8e6238575ba6d99ae608e93c5a4894bba336e568fca5fae3784df77b91be85ab990179936f3037f2e66315410d58d278124918f79914d9e4b497287fd48fff8f6feae623a26c49e08a871defe4f774dcdcc10dab8f45643a44070a3f0cb2e89d48aee35cec145d3ce061dc99fe2fae8aad527fefdabccb01855499673b57592322621904c51c31a84bd7be6d7e39c74c74710e25cee1931d2fed7ab0f20266f6361f6d336218a52698ab48ab21ec9b239319820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), ForkBlockNumber: 328800, GasLimitSoftForkBlockNumber: 5204928, ExtraPeriod: 4, ExtraPeriodForkBlockNumber: 8137200, FixExtraPeriodForkBlockNumber: 8258532, }} // AllCliqueProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the AICHAIN 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(1250000000), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil} // AllAiConsensusProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the AICHAIN core developers into the AiConsensus consensus. // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. AllAiConsensusProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(1250000000), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, &AiConsensusConfig{ MaxValidatorNumber: 4, MaxPooledMinerNumber: 4, Period: 1, BlockValidNumber: 12, Epoch: 120, VoteEpoch: 30000, EthashDifficulty: big.NewInt(10000), ExtraData: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000000043fa63f6e587975e93670ace6ab5a71061c1dafa47acbcffa2cccf1ce3e8631e7620a94823605e4f34eae4b8e5d2bed9cddfd6b309f965a27759bad96c40cee6c6692307dda2ff1a33860855fc3b39f1004beb845896ae589fbee97f37e3bff49cb68a3aa6cae15f60311b0990bd3e8545d1b19431094001948e0c1c6aaa39a5cf563e09e941e9c262c87b624007a7500fbb6a7c86fd3c272c77e6cf849af65d5ce0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), ForkBlockNumber: 328800, GasLimitSoftForkBlockNumber: 5204928, ExtraPeriod: 4, ExtraPeriodForkBlockNumber: 8145252, FixExtraPeriodForkBlockNumber: 8258532, }} //TestChainConfig TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(1250000000), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, &AiConsensusConfig{ MaxValidatorNumber: 4, MaxPooledMinerNumber: 4, Period: 1, BlockValidNumber: 12, Epoch: 120, VoteEpoch: 30000, EthashDifficulty: big.NewInt(10000), ExtraData: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000000023fa63f6e587975e93670ace6ab5a71061c1dafa47acbcffa2cccf1ce3e8631e7620a94823605e4f304beb845896ae589fbee97f37e3bff49cb68a3aa6cae15f60311b0990bd3e8545d1b19431094001948e0c1c6aaa39a5cf563e09e941e9c262c87b624007a7500fbb6a7c86fd3c272c77e6cf849af65d5ce0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), ForkBlockNumber: 360000, GasLimitSoftForkBlockNumber: 5204928, ExtraPeriod: 4, ExtraPeriodForkBlockNumber: 8145252, FixExtraPeriodForkBlockNumber: 8258532, }} TestRules = TestChainConfig.Rules(new(big.Int)) )
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, } // GasTableEIP150 contain the gas re-prices for // the EIP150 phase. GasTableEIP150 = GasTable{ ExtcodeSize: 700, ExtcodeCopy: 700, Balance: 400, SLoad: 200, Calls: 700, Suicide: 5000, ExpByte: 10, CreateBySuicide: 25000, } // GasTableEIP158 contain the gas re-prices for // the EIP155/EIP158 phase. GasTableEIP158 = GasTable{ ExtcodeSize: 700, ExtcodeCopy: 700, Balance: 400, SLoad: 200, Calls: 700, Suicide: 5000, ExpByte: 50, CreateBySuicide: 25000, } // GasTableConstantinople contain the gas re-prices for // the constantinople phase. GasTableConstantinople = GasTable{ ExtcodeSize: 700, ExtcodeCopy: 700, ExtcodeHash: 400, Balance: 400, SLoad: 200, Calls: 700, Suicide: 5000, ExpByte: 50, CreateBySuicide: 25000, } )
Variables containing gas prices for different aichain phases.
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. )
var DAOForkBlockExtra = common.FromHex("0x64616f2d686172642d666f726b")
DAOForkBlockExtra is the block header extra-data field to set for the DAO fork point and a number of consecutive blocks to allow fast/light syncers to correctly pick the side they want ("dao-hard-fork").
var DAOForkExtraRange = big.NewInt(10)
DAOForkExtraRange is the number of consecutive blocks from the DAO fork point to override the extra-data in to prevent no-fork attacks.
var DAORefundContract = common.HexToAddress("0xbf4ed7b27f1d666546e30d74d50d173d20bca754")
DAORefundContract is the address of the refund contract to send DAO balances to.
var DiscoveryV5Bootnodes = []string{
"enode://06051a5573c81934c9554ef2898eb13b33a34b94cf36b202b69fde139ca17a85051979867720d4bdae4323d4943ddf9aeeb6643633aa656e0be843659795007a@35.177.226.168:30323",
"enode://0cc5f5ffb5d9098c8b8c62325f3797f56509bff942704687b6530992ac706e2cb946b90a34f1f19548cd3c7baccbcaea354531e5983c7d1bc0dee16ce4b6440b@40.118.3.223:30324",
"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.
var MainnetBootnodes = []string{
"enode://077818b75daece3ec171c96f58f273df27d9835fb47b7b7e28687ee76a5db8af3569256cb93c445a0e51ab6117086396d5da2242f85badd2daedc3b83b1ce9bc@47.96.70.105:30323",
"enode://f752913f37fec36a59c94459ceb73bc70dc4729a7491406e90fe35163462b88b83a03d7174958d0d62441483ccc03be107ed70fc4306ccd618ae63b4b8905be5@39.104.101.184:30323",
"enode://32af4ffeef3018493008ba43cf3a20200ea05a1b6f453a33ef2bbcdd11efe0a8eea8976904fb4d4851888c2a91bb82ac792790fe79c6832a741d12a148df8865@47.91.22.112:30323",
"enode://1279b4272a25d7caa8295252402e483398d0aaab03ffb3a06d8ad1d348d92bb8bf700a90e462e716ed076871fedb810ff0e1dbce98957c87811625f550bd0287@47.92.38.40:30323",
"enode://2181fe015ebb5c0932728326420a4c2e8f0650d0e15884212c346a29c577fe9a5c1618f8852ab26a1267f13a42f0c8049e0d276be616c23595c2744f9d5e91af@47.98.243.21:30323",
"enode://cb97406cfd07f479c1595adf83f5f738fdd6a2a7e740255bd8ae9003f2f2f21d52236655e1d8a3c3a4900042c7a28f11655b094150c692d19551e465e29a3a5f@39.105.62.237:30323",
"enode://22ee22d9fd54e61949b8c066f1b1fc9dc568115ee8bb43360224d45525d5108446f57b54aeef5963b50beb54c1035decff2c9b3c1a5dd732328d7f63d2ea2209@101.132.185.167:30323",
"enode://472c1d4be77b502c50f601120d3b4e1efe8f8bd2fadc129cf25aa059ca71639a6a3338a978fbc18e150441984a78ea27f54e4b5e7b1c176d7e0f3bf9acc43b0e@120.79.230.10:30323",
"enode://49ac218c7f169d5192c3672bb6c139978206b210ed6f736aba05e921c271d5207902d287f3055c7f355690406ec30bf8152a58ab12a33bc86fdd42cc1efec467@123.56.13.71:30323",
"enode://7f052e88cda4183110f3d84f7316d1ae9ea550230da2d003870e7311fa66d612fb44d183a56042fc8015ab1142ca9af7a12cd3471df497b5518c0b481cdac3e5@47.75.160.56:30323",
"enode://c32a8b9c7aa465eb9e41fa579ed879dd8dd3fafe7f99aba14de6894a2c31f305336783509f3e41e60b9f4f379ee13c300192fe9500653ab866eebab309f11a9b@47.254.42.75:30323",
"enode://deb075af14dfece02fbfa7400fe72e864f332c79de42b6bacb215d9bf79ca9385fcaf11af2564590645351b0a8841ae32193d92608ac29ac8538019dadb5d019@47.74.253.244:30323",
"enode://5bdeccad956b9011549938bc632941537c01e93ba5c1bd29a4dbeb607448eeba965b4541cc7161466affb3e620115250d3435fa609644ce30e7d9a0f5722996f@47.254.132.79:30323",
}
MainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the main AICHAIN network.
var RinkebyBootnodes = []string{
"enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30323",
"enode://343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8@52.3.158.184:30323",
"enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30323",
}
RinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the Rinkeby test network.
var (
TargetGasLimit uint64 = ForkGenesisGasLimit // The artificial target
)
var TestnetBootnodes = []string{
"enode://f0a39e8b88288c574265e65fc95c73bacafc8b9f5855f464849ca70b28dfb06888bd9a3edf9a4297eecce0b0e35bcdb5aa506bb6f78857d62528ebe7c4d87c1c@39.104.19.99:30323",
"enode://f060e5443f662a0f6f2fdcefcd9083c4cac06a5b777e8df2f8e975c8b7a46666b352d38204c4216a3b9e797013aea069f90d4f6d3b5419ada128fbe67901f611@39.104.67.231:30323",
"enode://de569c767b4b270c62eeb67836ede217acc739e842bcfbfb42107f52053837683fdb2bba07cc58f0531a8ff5b2f796792133c161762011e72ce43875f5a81fe4@39.104.166.199:30323",
"enode://ea97071020079f0a06d0936d514979496ff9b240d808a846ca160157343604c7a3234ac0cf732617f3fb6667df16fe8ebe0892e10469c34f333eef5deb0e0384@47.96.69.66:30323",
}
TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the Ropsten test network.
var Version = func() string { return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch) }()
Version holds the textual version string.
var VersionWithMeta = func() string { v := Version if VersionMeta != "" { v += "-" + VersionMeta } return v }()
VersionWithMeta holds the textual version string including the metadata.
Functions ¶
func ArchiveVersion ¶
ArchiveVersion holds the textual version string used for Gait archives. e.g. "1.8.11-dea1ce05" for stable releases, or
"1.8.13-unstable-21c059b6" for unstable releases
func DAODrainList ¶
DAODrainList is the list of accounts whose full balances will be moved into a refund contract at the beginning of the dao-fork block.
func VersionWithCommit ¶
Types ¶
type AiConsensusConfig ¶
type AiConsensusConfig struct { MaxValidatorNumber int `json:"max-validator-number"` // Max number of Validator allowed MaxPooledMinerNumber int `json:"max-pooledminer-number"` // Max number of Pooled miner allowed Period uint64 `json:"period"` // Number of seconds between blocks to enforce ExtraPeriod uint64 `json:"extra-period"` // Extra Number of seconds between blocks to enforce, if there is no tx in blocks. BlockValidNumber uint64 `json:"block-valid-number"` // Number of block to verify Epoch uint64 `json:"epoch"` // Epoch length to reset checkpoint VoteEpoch uint64 `json:"vote-epoch"` // Epoch length to reset votes EthashDifficulty *big.Int `json:"ethash-difficulty"` // Difficulty to ethash mine ExtraData []byte `json:"extra-data"` //Extra data for genesis ForkBlockNumber uint64 `json:"fork-blockNumber"` //Block number to start engine fork GasLimitSoftForkBlockNumber uint64 `json:"gaslimit-fork-blockNumber"` //Block number to gas limit fork ExtraPeriodForkBlockNumber uint64 `json:"extra-period-fork-blockNumber"` //Block number to extra period FixExtraPeriodForkBlockNumber uint64 `json:"fix-extra-period-fork-blockNumber"` //Block number to fix extra period Standalone bool `json:"standalone"` //If the engine is standalone }
AiConsensusConfig is the consensus engine configs for proof-of-authority based sealing.
func (*AiConsensusConfig) String ¶
func (c *AiConsensusConfig) String() string
String implements the stringer interface, returning the consensus engine details.
type ChainConfig ¶
type ChainConfig struct { ChainID *big.Int `json:"chainId"` // chainId identifies the current chain and is used for replay protection TotalRewardBlockNum *big.Int `json:"totalRewardBlockNum,omitempty"` HomesteadBlock *big.Int `json:"homesteadBlock,omitempty"` // Homestead switch block (nil = no fork, 0 = already homestead) 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/AICHAIN-CORE/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) EWASMBlock *big.Int `json:"ewasmBlock,omitempty"` // EWASM switch block (nil = no fork, 0 = already activated) // Various consensus engines Ethash *EthashConfig `json:"ethash,omitempty"` Clique *CliqueConfig `json:"clique,omitempty"` AiConsensus *AiConsensusConfig `json:"aiconsensus,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) AitNeedForMinerAccount ¶
func (c *ChainConfig) AitNeedForMinerAccount() *big.Int
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) CheckMinerAccountAit ¶
func (c *ChainConfig) CheckMinerAccountAit(num *big.Int) bool
func (*ChainConfig) DefaultCoinbase ¶
func (c *ChainConfig) DefaultCoinbase() string
func (*ChainConfig) DefaultDifficaulty ¶
func (c *ChainConfig) DefaultDifficaulty() *big.Int
func (*ChainConfig) DefaultMaxDifficaulty ¶
func (c *ChainConfig) DefaultMaxDifficaulty() *big.Int
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
IsByzantium returns whether num is either equal to the Byzantium fork block or greater.
func (*ChainConfig) IsCoinDelieverDone ¶
func (c *ChainConfig) IsCoinDelieverDone(num *big.Int) bool
func (*ChainConfig) IsConstantinople ¶
func (c *ChainConfig) IsConstantinople(num *big.Int) bool
IsConstantinople returns whether num is either equal to the Constantinople fork block or greater.
func (*ChainConfig) IsDAOFork ¶
func (c *ChainConfig) IsDAOFork(num *big.Int) bool
IsDAOFork returns whether num is either equal to the DAO fork block or greater.
func (*ChainConfig) IsEIP150 ¶
func (c *ChainConfig) IsEIP150(num *big.Int) bool
IsEIP150 returns whether num is either equal to the EIP150 fork block or greater.
func (*ChainConfig) IsEIP155 ¶
func (c *ChainConfig) IsEIP155(num *big.Int) bool
IsEIP155 returns whether num is either equal to the EIP155 fork block or greater.
func (*ChainConfig) IsEIP158 ¶
func (c *ChainConfig) IsEIP158(num *big.Int) bool
IsEIP158 returns whether num is either equal to the EIP158 fork block or greater.
func (*ChainConfig) IsEWASM ¶ added in v1.0.6
func (c *ChainConfig) IsEWASM(num *big.Int) bool
IsEWASM returns whether num represents a block number after the EWASM fork
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
Rules ensures c's ChainID is not nil.
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 ExtcodeHash 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 }
GasTable organizes gas prices for different aichain phases.
type Rules ¶
type Rules struct { ChainID *big.Int IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool IsByzantium, IsConstantinople bool }
Rules wraps ChainConfig and is merely syntactic 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.
type TrustedCheckpoint ¶ added in v1.0.6
type TrustedCheckpoint struct { Name string `json:"-"` SectionIndex uint64 `json:"sectionIndex"` SectionHead common.Hash `json:"sectionHead"` CHTRoot common.Hash `json:"chtRoot"` BloomRoot common.Hash `json:"bloomRoot"` }
TrustedCheckpoint represents a set of post-processed trie roots (CHT and BloomTrie) associated with the appropriate section index and head hash. It is used to start light syncing from this checkpoint and avoid downloading the entire header chain while still being able to securely access old headers/logs.