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 )
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 SHARE per token(SHET) per second. about 0.000432 SHARE per token per day. )
Keys of governance params.
var NoFork = ForkConfig{ VIP191: math.MaxUint32, ETH_CONST: math.MaxUint32, BLOCKLIST: math.MaxUint32, }
NoFork a special config without any forks.
Functions ¶
func IsOriginBlocked ¶
IsOriginBlocked returns true if the address is in the blocklist
func LoadCorrectReceiptsRoots ¶
LoadCorrectReceiptsRoots load a map from block ID to correct receipts root.
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 ¶
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 ¶
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 ¶
ForkConfig config for a fork.
func GetForkConfig ¶
func GetForkConfig(genesisID Bytes32) ForkConfig
GetForkConfig get fork config for given genesis ID.
func (ForkConfig) String ¶
func (fc ForkConfig) String() string