state

package
v0.0.0-...-7b0d77e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func (*API) Close

func (self *API) Close()

func (*API) DPOSDelayedReader

func (self *API) DPOSDelayedReader(blk_n types.BlockNum) dpos.Reader

func (*API) DPOSReader

func (self *API) DPOSReader(blk_n types.BlockNum) dpos.Reader

func (*API) DryRunTransaction

func (self *API) DryRunTransaction(blk *vm.Block, trx *vm.Transaction) vm.ExecutionResult

func (*API) GetCommittedStateDescriptor

func (self *API) GetCommittedStateDescriptor() state_db.StateDescriptor

func (*API) GetStateTransition

func (self *API) GetStateTransition() StateTransition

func (*API) Init

func (self *API) Init(db *state_db_rocksdb.DB, get_block_hash vm.GetHashFunc, chain_cfg *chain_config.ChainConfig, opts APIOpts) *API

func (*API) ReadBlock

func (self *API) ReadBlock(blk_n types.BlockNum) state_db.ExtendedReader

func (*API) SlashingReader

func (self *API) SlashingReader(blk_n types.BlockNum) slashing.Reader

func (*API) Trace

func (self *API) Trace(blk *vm.Block, trxs *[]vm.Transaction, conf *vm.TracingConfig) []byte

func (*API) UpdateConfig

func (self *API) UpdateConfig(chain_cfg *chain_config.ChainConfig)

type APIOpts

type APIOpts struct {
	// TODO have single "perm-gen size" config property to derive all preallocation sizes
	ExpectedMaxTrxPerBlock        uint64
	MainTrieFullNodeLevelsToCache byte
}

type StateTransition

type StateTransition interface {
	BeginBlock(*vm.BlockInfo)
	BlockNumber() types.BlockNum
	ExecuteTransaction(*vm.Transaction) vm.ExecutionResult
	AddTxFeeToBalance(account *common.Address, tx_fee *uint256.Int)
	GetChainConfig() *chain_config.ChainConfig
	GetEvmState() *state_evm.EVMState
	DistributeRewards(*rewards_stats.RewardsStats) *uint256.Int
	EndBlock()
	PrepareCommit() (state_root common.Hash)
	Commit() (state_root common.Hash)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL