Documentation ¶
Index ¶
Constants ¶
const ( MainNetworkID uint64 = 0xfa TestNetworkID uint64 = 0xfa2 FakeNetworkID uint64 = 0xfa3 DefaultEventGas uint64 = 28000 )
Variables ¶
var DefaultVMConfig = vm.Config{ StatePrecompiles: map[common.Address]vm.PrecompiledStateContract{ evmwriter.ContractAddress: &evmwriter.PreCompiledContract{}, }, }
Functions ¶
This section is empty.
Types ¶
type BlocksMissed ¶
BlocksMissed is information about missed blocks from a staker
type BlocksRules ¶
type BlocksRules struct { MaxBlockGas uint64 // technical hard limit, gas is mostly governed by gas power allocation MaxEmptyBlockSkipPeriod inter.Timestamp }
BlocksRules contains blocks constants
type DagRules ¶
type DagRules struct { MaxParents idx.Event MaxFreeParents idx.Event // maximum number of parents with no gas cost MaxExtraData uint32 }
DagRules of Lachesis DAG (directed acyclic graph).
func DefaultDagRules ¶
func DefaultDagRules() DagRules
type EconomyRules ¶
type EconomyRules struct { BlockMissedSlack idx.Block Gas GasRules MinGasPrice *big.Int ShortGasPower GasPowerRules LongGasPower GasPowerRules }
EconomyRules contains economy constants
func DefaultEconomyRules ¶
func DefaultEconomyRules() EconomyRules
DefaultEconomyRules returns mainnet economy
func FakeEconomyRules ¶
func FakeEconomyRules() EconomyRules
FakeEconomyRules returns fakenet economy
type EpochsRules ¶
func DefaultEpochsRules ¶
func DefaultEpochsRules() EpochsRules
func FakeNetEpochsRules ¶
func FakeNetEpochsRules() EpochsRules
type GasPowerRules ¶
type GasPowerRules struct { AllocPerSec uint64 MaxAllocPeriod inter.Timestamp StartupAllocPeriod inter.Timestamp MinStartupGas uint64 }
GasPowerRules defines gas power rules in the consensus.
func DefaulLongGasPowerRules ¶
func DefaulLongGasPowerRules() GasPowerRules
DefaulLongGasPowerRules is long-window config
func DefaultShortGasPowerRules ¶
func DefaultShortGasPowerRules() GasPowerRules
DefaultShortGasPowerRules is short-window config
func FakeLongGasPowerRules ¶
func FakeLongGasPowerRules() GasPowerRules
FakeLongGasPowerRules is fake long-window config
func FakeShortGasPowerRules ¶
func FakeShortGasPowerRules() GasPowerRules
FakeShortGasPowerRules is fake short-window config
type GasRules ¶
type GasRules GasRulesRLPV1
func DefaultGasRules ¶
func DefaultGasRules() GasRules
type GasRulesRLPV0 ¶
type GasRulesRLPV1 ¶
type Genesis ¶
type Genesis struct { Accounts genesis.Accounts Storage genesis.Storage Delegations genesis.Delegations Blocks genesis.Blocks RawEvmItems genesis.RawEvmItems Validators gpos.Validators FirstEpoch idx.Epoch PrevEpochTime inter.Timestamp Time inter.Timestamp ExtraData []byte TotalSupply *big.Int DriverOwner common.Address Rules Rules Hash func() hash.Hash }
type Rules ¶
type Rules RulesRLP
Rules describes opera net. Note keep track of all the non-copiable variables in Copy()
func FakeNetRules ¶
func FakeNetRules() Rules
func MainNetRules ¶
func MainNetRules() Rules
func TestNetRules ¶
func TestNetRules() Rules
func (Rules) EvmChainConfig ¶
func (r Rules) EvmChainConfig() *ethparams.ChainConfig
EvmChainConfig returns ChainConfig for transactions signing and execution
type RulesRLP ¶
type RulesRLP struct { Name string NetworkID uint64 // Graph options Dag DagRules // Epochs options Epochs EpochsRules // Blockchain options Blocks BlocksRules // Economy options Economy EconomyRules Upgrades Upgrades `rlp:"-"` }