Documentation ¶
Index ¶
Constants ¶
const ( BlockInterval uint64 = 10 // time interval between two consecutive blocks. TxGas uint64 = 5000 ClauseGas uint64 = params.TxGas - TxGas ClauseGasContractCreation uint64 = params.TxGasContractCreation - TxGas MinGasLimit uint64 = 1000 * 1000 InitialGasLimit uint64 = 10 * 1000 * 1000 // InitialGasLimit gas limit value int genesis block. GasLimitBoundDivisor uint64 = 1024 // from ethereum GetBalanceGas uint64 = 400 //EIP158 gas table SloadGas uint64 = 200 // EIP158 gas table SstoreSetGas uint64 = params.SstoreSetGas SstoreResetGas uint64 = params.SstoreResetGas MaxTxWorkDelay uint32 = 30 // (unit: block) if tx delay exceeds this value, no energy can be exchanged. MaxBlockProposers uint64 = 101 TolerableBlockPackingTime = 500 * time.Millisecond // the indicator to adjust target block gas limit MaxStateHistory = 65535 // max guaranteed state history allowed to be accessed in EVM, presented in block number EpochInterval = 8640 // blocks between two epochs. )
Constants of block chain.
const ( // AddressLength length of address in bytes. AddressLength = common.AddressLength )
Variables ¶
var ( KeyExecutorAddress = BytesToBytes32([]byte("executor")) KeyRewardRatio = BytesToBytes32([]byte("reward-ratio")) KeyBaseGasPrice = BytesToBytes32([]byte("base-gas-price")) KeyProposerEndorsement = BytesToBytes32([]byte("proposer-endorsement")) InitialRewardRatio = big.NewInt(3e17) // 30% InitialBaseGasPrice = big.NewInt(1e15) InitialProposerEndorsement = new(big.Int).Mul(big.NewInt(1e18), big.NewInt(25000000)) EnergyGrowthRate = big.NewInt(5000000000) // WEI THOR per token(VET) per second. about 0.000432 THOR per token per day. )
Keys of governance params.
var NoFork = ForkConfig{ VIP191: math.MaxUint32, ETH_CONST: math.MaxUint32, BLOCKLIST: math.MaxUint32, ETH_IST: math.MaxUint32, VIP214: math.MaxUint32, }
NoFork a special config without any forks.
Functions ¶
func IsOriginBlocked ¶ added in v1.2.0
IsOriginBlocked returns true if the address is in the blocklist
func LoadCorrectReceiptsRoots ¶ added in v1.1.1
LoadCorrectReceiptsRoots load a map from block ID to correct receipts root.
func MockBlocklist ¶ added in v1.2.0
func MockBlocklist(list []string)
MockBlocklist mock the blocklist
Types ¶
type Address ¶
Address address of account.
func BytesToAddress ¶
BytesToAddress converts bytes slice into address. If b is larger than address legnth, b will be cropped (from the left). If b is smaller than address length, b will be extended (from the left).
func CreateContractAddress ¶
CreateContractAddress to generate contract address according to tx id, clause index and contract creation count.
func MustParseAddress ¶ added in v1.0.4
MustParseAddress convert string presented address into Address type, panic on error.
func ParseAddress ¶
ParseAddress convert string presented address into Address type.
func (*Address) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Address) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Bytes32 ¶
type Bytes32 [32]byte
Bytes32 array of 32 bytes.
func BytesToBytes32 ¶
BytesToBytes32 converts bytes slice into Bytes32. If b is larger than Bytes32 legnth, b will be cropped (from the left). If b is smaller than Bytes32 length, b will be extended (from the left).
func MustParseBytes32 ¶ added in v1.0.4
MustParseBytes32 convert string presented into Bytes32 type, panic on error.
func ParseBytes32 ¶
ParseBytes32 convert string presented into Bytes32 type
func (Bytes32) AbbrevString ¶
AbbrevString returns abbrev string presentation.
func (*Bytes32) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Bytes32) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ForkConfig ¶ added in v1.0.3
type ForkConfig struct { VIP191 uint32 ETH_CONST uint32 BLOCKLIST uint32 ETH_IST uint32 VIP214 uint32 }
ForkConfig config for a fork.
func GetForkConfig ¶ added in v1.0.4
func GetForkConfig(genesisID Bytes32) ForkConfig
GetForkConfig get fork config for given genesis ID.
func (ForkConfig) String ¶ added in v1.0.4
func (fc ForkConfig) String() string