Versions in this module Expand all Collapse all v1 v1.0.0 Jul 13, 2019 Changes in this version + var DefaultTxPoolConfig = TxPoolConfig + var ErrBlacklistedHash = errors.New("blacklisted hash") + var ErrBranch = errors.New("branch not match") + var ErrCoinbaseAmount = errors.New("wrong coinbase amount") + var ErrDifficulty = errors.New("diff not match") + var ErrExtraLimit = errors.New("extra data exceeds limit") + var ErrFutureBlock = errors.New("block in the future") + var ErrGasLimit = errors.New("exceeds block gas limit") + var ErrGasLimitReached = errors.New("gas limit reached") + var ErrGasUsed = errors.New("gas used not match") + var ErrHeightMismatch = errors.New("block height not match") + var ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value") + var ErrIntrinsicGas = errors.New("intrinsic gas too low") + var ErrInvalidMinorBlock = errors.New("minor block is invalid") + var ErrInvalidNumber = errors.New("invalid block number") + var ErrInvalidSender = errors.New("invalid sender") + var ErrKnownBlock = errors.New("block already known") + var ErrMetaHash = errors.New("meta hash not match") + var ErrMinerFullShardKey = errors.New("coinbase full shard key not match") + var ErrMinorBlockIsNil = errors.New("minor block is nil") + var ErrNegativeValue = errors.New("negative value") + var ErrNetWorkID = errors.New("network id not match") + var ErrNoGenesis = errors.New("Genesis not found in chain") + var ErrNonceTooHigh = errors.New("nonce too high") + var ErrNonceTooLow = errors.New("nonce too low") + var ErrNotNeighbor = errors.New("is not a neighbor") + var ErrNotSameRootChain = errors.New("is not same root chain") + var ErrOversizedData = errors.New("oversized data") + var ErrPreBlockNotFound = errors.New("parent block not found") + var ErrPrevBlockMissing = errors.New("previous hash block mismatch") + var ErrPrunedAncestor = errors.New("pruned ancestor") + var ErrReplaceUnderpriced = errors.New("replacement transaction underpriced") + var ErrRootBlockIsNil = errors.New("root block is nil") + var ErrTime = errors.New("time not match") + var ErrTrackLimit = errors.New("track data exceeds limit") + var ErrTxHash = errors.New("tx hash not match") + var ErrUnderpriced = errors.New("transaction underpriced") + var ErrUnknownAncestor = errors.New("unknown ancestor") + var ErrXShardList = errors.New("xShardReceivedGasUsed not match") + var ErrorTxBreak = errors.New("apply tx break") + var ErrorTxContinue = errors.New("apply tx continue") + func ApplyMessage(evm *vm.EVM, msg Message, gp *GasPool, feeRate *big.Rat) ([]byte, uint64, bool, error) + func ApplyTransaction(config *params.ChainConfig, bc ChainContext, gp *GasPool, ...) ([]byte, *types.Receipt, uint64, error) + func CalculateRootBlockCoinbase(config *config.QuarkChainConfig, block *types.RootBlock) *big.Int + func CanTransfer(db vm.StateDB, addr common.Address, amount *big.Int) bool + func GenerateMinorBlockChain(config *params.ChainConfig, quarkChainConfig *config.QuarkChainConfig, ...) ([]*types.MinorBlock, []types.Receipts) + func GenerateRootBlockChain(parent *types.RootBlock, engine consensus.Engine, n int, ...) []*types.RootBlock + func GetHashFn(ref types.IHeader, chain ChainContext) func(n uint64) common.Hash + func IntrinsicGas(data []byte, contractCreation, isCrossShard bool) (uint64, error) + func NewEVMContext(msg types.Message, mheader types.IHeader, chain ChainContext) vm.Context + func SetReceiptsData(config *config.QuarkChainConfig, mBlock types.IBlock, receipts types.Receipts) error + func SetupGenesisMinorBlock(db ethdb.Database, genesis *Genesis, rootBlock *types.RootBlock, ...) (*config.QuarkChainConfig, common.Hash, error) + func SetupGenesisRootBlock(db ethdb.Database, genesis *Genesis) (*config.QuarkChainConfig, common.Hash, error) + func Transfer(db vm.StateDB, sender, recipient common.Address, amount *big.Int) + func ValidateTransaction(state vm.StateDB, tx *types.Transaction, fromAddress *account.Address) error + type Backend interface + CurrentBlock func() *types.MinorBlock + GetBlockByNumber func(number uint64) types.IBlock + GetLogs func(hash common.Hash) [][]*types.Log + GetReceiptsByHash func(hash common.Hash) types.Receipts + type CacheConfig struct + Disabled bool + TrieCleanLimit int + TrieDirtyLimit int + TrieTimeLimit time.Duration + type ChainContext interface + Config func() *config.QuarkChainConfig + Engine func() consensus.Engine + GetHeader func(common.Hash) types.IHeader + type DeleteCallback func(rawdb.DatabaseDeleter, common.Hash) + type Filter struct + func NewRangeFilter(backend Backend, begin, end uint64, addresses []common.Address, ...) *Filter + func (f *Filter) Logs() ([]*types.Log, error) + type GasPool uint64 + func (gp *GasPool) AddGas(amount uint64) *GasPool + func (gp *GasPool) Gas() uint64 + func (gp *GasPool) String() string + func (gp *GasPool) SubGas(amount uint64) error + type Genesis struct + func NewGenesis(config *config.QuarkChainConfig) *Genesis + func (g *Genesis) CommitMinorBlock(db ethdb.Database, rootBlock *types.RootBlock, fullShardId uint32) (*types.MinorBlock, error) + func (g *Genesis) CommitRootBlock(db ethdb.Database) (*types.RootBlock, error) + func (g *Genesis) CreateMinorBlock(rootBlock *types.RootBlock, fullShardId uint32, db ethdb.Database) (*types.MinorBlock, error) + func (g *Genesis) CreateRootBlock() *types.RootBlock + func (g *Genesis) MustCommitMinorBlock(db ethdb.Database, rootBlock *types.RootBlock, fullShardId uint32) *types.MinorBlock + func (g *Genesis) MustCommitRootBlock(db ethdb.Database) *types.RootBlock + type GenesisAccount struct + Balance *big.Int + Code []byte + Nonce uint64 + PrivateKey []byte + Storage map[common.Hash]common.Hash + type GenesisMismatchError struct + New common.Hash + Stored common.Hash + func (e *GenesisMismatchError) Error() string + type HeaderChain struct + func NewMinorHeaderChain(chainDb ethdb.Database, config *config.QuarkChainConfig, ...) (*HeaderChain, error) + func (hc *HeaderChain) Config() *config.QuarkChainConfig + func (hc *HeaderChain) CurrentHeader() types.IHeader + func (hc *HeaderChain) Engine() consensus.Engine + func (hc *HeaderChain) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) + func (hc *HeaderChain) GetBlock(hash common.Hash) types.IBlock + func (hc *HeaderChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash + func (hc *HeaderChain) GetBlockNumber(hash common.Hash) *uint64 + func (hc *HeaderChain) GetHeader(hash common.Hash) types.IHeader + func (hc *HeaderChain) GetHeaderByHash(hash common.Hash) types.IHeader + func (hc *HeaderChain) GetHeaderByNumber(number uint64) types.IHeader + func (hc *HeaderChain) GetTd(hash common.Hash, number uint64) *big.Int + func (hc *HeaderChain) GetTdByHash(hash common.Hash) *big.Int + func (hc *HeaderChain) HasHeader(hash common.Hash, number uint64) bool + func (hc *HeaderChain) InsertHeaderChain(chain []*types.MinorBlockHeader, writeHeader MinorWhCallback, start time.Time) (int, error) + func (hc *HeaderChain) SetCurrentHeader(head *types.MinorBlockHeader) + func (hc *HeaderChain) SetGenesis(head *types.MinorBlockHeader) + func (hc *HeaderChain) SetHead(head uint64, delFn DeleteCallback) + func (hc *HeaderChain) ValidateHeaderChain(chain []*types.MinorBlockHeader, checkFreq int) (int, error) + func (hc *HeaderChain) WriteHeader(header *types.MinorBlockHeader) (status WriteStatus, err error) + func (hc *HeaderChain) WriteTd(hash common.Hash, number uint64, td *big.Int) error + type Message interface + CheckNonce func() bool + Data func() []byte + From func() common.Address + FromFullShardKey func() uint32 + Gas func() uint64 + GasPrice func() *big.Int + IsCrossShard func() bool + Nonce func() uint64 + To func() *common.Address + ToFullShardKey func() uint32 + TxHash func() common.Hash + Value func() *big.Int + type MinorBlockChain struct + func NewMinorBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *params.ChainConfig, ...) (*MinorBlockChain, error) + func (m *MinorBlockChain) AddBlock(block types.IBlock) error + func (m *MinorBlockChain) AddCrossShardTxListByMinorBlockHash(h common.Hash, txList types.CrossShardTransactionDepositList) + func (m *MinorBlockChain) AddRootBlock(rBlock *types.RootBlock) (bool, error) + func (m *MinorBlockChain) AddTx(tx *types.Transaction) error + func (m *MinorBlockChain) Config() *config.QuarkChainConfig + func (m *MinorBlockChain) CreateBlockToMine(createTime *uint64, address *account.Address, gasLimit *big.Int) (*types.MinorBlock, error) + func (m *MinorBlockChain) CurrentBlock() *types.MinorBlock + func (m *MinorBlockChain) CurrentHeader() types.IHeader + func (m *MinorBlockChain) Engine() consensus.Engine + func (m *MinorBlockChain) EstimateGas(tx *types.Transaction, fromAddress account.Address) (uint32, error) + func (m *MinorBlockChain) ExecuteTx(tx *types.Transaction, fromAddress *account.Address, height *uint64) ([]byte, error) + func (m *MinorBlockChain) Export(w io.Writer) error + func (m *MinorBlockChain) ExportN(w io.Writer, first uint64, last uint64) error + func (m *MinorBlockChain) FinalizeAndAddBlock(block *types.MinorBlock) (*types.MinorBlock, types.Receipts, error) + func (m *MinorBlockChain) GasLimit() uint64 + func (m *MinorBlockChain) GasPrice() (uint64, error) + func (m *MinorBlockChain) Genesis() *types.MinorBlock + func (m *MinorBlockChain) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) + func (m *MinorBlockChain) GetBalance(recipient account.Recipient, height *uint64) (*big.Int, error) + func (m *MinorBlockChain) GetBlock(hash common.Hash) types.IBlock + func (m *MinorBlockChain) GetBlockByNumber(number uint64) types.IBlock + func (m *MinorBlockChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash + func (m *MinorBlockChain) GetBlocksFromHash(hash common.Hash, n int) (blocks []types.IBlock) + func (m *MinorBlockChain) GetBranch() account.Branch + func (m *MinorBlockChain) GetCode(recipient account.Recipient, height *uint64) ([]byte, error) + func (m *MinorBlockChain) GetHeader(hash common.Hash) types.IHeader + func (m *MinorBlockChain) GetHeaderByHash(hash common.Hash) types.IHeader + func (m *MinorBlockChain) GetHeaderByNumber(number uint64) types.IHeader + func (m *MinorBlockChain) GetLogs(hash common.Hash) [][]*types.Log + func (m *MinorBlockChain) GetLogsByAddressAndTopic(start uint64, end uint64, addresses []account.Address, topics [][]common.Hash) ([]*types.Log, error) + func (m *MinorBlockChain) GetMinorBlock(hash common.Hash) *types.MinorBlock + func (m *MinorBlockChain) GetPOSWCoinbaseBlockCnt(headerHash common.Hash, length *uint32) (map[account.Recipient]uint32, error) + func (m *MinorBlockChain) GetReceiptsByHash(hash common.Hash) types.Receipts + func (m *MinorBlockChain) GetRootBlockByHash(hash common.Hash) *types.RootBlock + func (m *MinorBlockChain) GetRootTip() *types.RootBlockHeader + func (m *MinorBlockChain) GetShardStatus() (*rpc.ShardStatus, error) + func (m *MinorBlockChain) GetStorageAt(recipient account.Recipient, key common.Hash, height *uint64) (common.Hash, error) + func (m *MinorBlockChain) GetTd(hash common.Hash, number uint64) *big.Int + func (m *MinorBlockChain) GetTdByHash(hash common.Hash) *big.Int + func (m *MinorBlockChain) GetTransactionByAddress(address account.Address, start []byte, limit uint32) ([]*rpc.TransactionDetail, []byte, error) + func (m *MinorBlockChain) GetTransactionByHash(hash common.Hash) (*types.MinorBlock, uint32) + func (m *MinorBlockChain) GetTransactionCount(recipient account.Recipient, height *uint64) (uint64, error) + func (m *MinorBlockChain) GetTransactionReceipt(hash common.Hash) (*types.MinorBlock, uint32, *types.Receipt) + func (m *MinorBlockChain) GetUnconfirmedHeaderList() []*types.MinorBlockHeader + func (m *MinorBlockChain) GetUnconfirmedHeadersCoinbaseAmount() uint64 + func (m *MinorBlockChain) GetVMConfig() *vm.Config + func (m *MinorBlockChain) HasBlock(hash common.Hash) bool + func (m *MinorBlockChain) HasBlockAndState(hash common.Hash) bool + func (m *MinorBlockChain) HasHeader(hash common.Hash, number uint64) bool + func (m *MinorBlockChain) HasState(hash common.Hash) bool + func (m *MinorBlockChain) InitFromRootBlock(rBlock *types.RootBlock) error + func (m *MinorBlockChain) InitGenesisState(rBlock *types.RootBlock) (*types.MinorBlock, error) + func (m *MinorBlockChain) InsertChain(chain []types.IBlock) (int, error) + func (m *MinorBlockChain) InsertChainForDeposits(chain []types.IBlock) (int, [][]*types.CrossShardTransactionDeposit, error) + func (m *MinorBlockChain) InsertHeaderChain(chain []types.IHeader, checkFreq int) (int, error) + func (m *MinorBlockChain) InsertReceiptChain(blockChain []types.IBlock, receiptChain []types.Receipts) (int, error) + func (m *MinorBlockChain) POSWDiffAdjust(block types.IBlock) (uint64, error) + func (m *MinorBlockChain) PostChainEvents(events []interface{}, logs []*types.Log) + func (m *MinorBlockChain) Processor() Processor + func (m *MinorBlockChain) ReadCrossShardTxList(hash common.Hash) *types.CrossShardTransactionDepositList + func (m *MinorBlockChain) ReadLastConfirmedMinorBlockHeaderAtRootBlock(hash common.Hash) common.Hash + func (m *MinorBlockChain) Reset() error + func (m *MinorBlockChain) ResetWithGenesisBlock(genesis *types.MinorBlock) error + func (m *MinorBlockChain) Rollback(chain []common.Hash) + func (m *MinorBlockChain) SetBroadcastMinorBlockFunc(f func(block *types.MinorBlock) error) + func (m *MinorBlockChain) SetHead(head uint64) error + func (m *MinorBlockChain) SetProcessor(processor Processor) + func (m *MinorBlockChain) SetValidator(validator Validator) + func (m *MinorBlockChain) State() (*state.StateDB, error) + func (m *MinorBlockChain) StateAt(root common.Hash) (*state.StateDB, error) + func (m *MinorBlockChain) StateCache() state.Database + func (m *MinorBlockChain) Stop() + func (m *MinorBlockChain) SubscribeChainEvent(ch chan<- MinorChainEvent) event.Subscription + func (m *MinorBlockChain) SubscribeChainHeadEvent(ch chan<- MinorChainHeadEvent) event.Subscription + func (m *MinorBlockChain) SubscribeChainSideEvent(ch chan<- MinorChainSideEvent) event.Subscription + func (m *MinorBlockChain) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription + func (m *MinorBlockChain) SubscribeRemovedLogsEvent(ch chan<- RemovedLogsEvent) event.Subscription + func (m *MinorBlockChain) TrieNode(hash common.Hash) ([]byte, error) + func (m *MinorBlockChain) Validator() Validator + func (m *MinorBlockChain) WriteBlockWithState(block *types.MinorBlock, receipts []*types.Receipt, state *state.StateDB, ...) (status WriteStatus, err error) + func (m *MinorBlockChain) WriteBlockWithoutState(block types.IBlock, td *big.Int) (err error) + type MinorBlockGen struct + func (b *MinorBlockGen) AddTx(quarkChainConfig *config.QuarkChainConfig, tx *types.Transaction) + func (b *MinorBlockGen) AddTxWithChain(quarkChainConfig *config.QuarkChainConfig, bc *MinorBlockChain, ...) + func (b *MinorBlockGen) Number() *big.Int + func (b *MinorBlockGen) PrevBlock(index int) *types.MinorBlock + func (b *MinorBlockGen) SetCoinbase(addr account.Address) + func (b *MinorBlockGen) SetDifficulty(value uint64) + func (b *MinorBlockGen) SetExtra(data []byte) + func (b *MinorBlockGen) SetNonce(nonce uint64) + func (b *MinorBlockGen) TxNonce(addr common.Address) uint64 + type MinorBlockValidator struct + func NewBlockValidator(quarkChainConfig *config.QuarkChainConfig, blockchain *MinorBlockChain, ...) *MinorBlockValidator + func (v *MinorBlockValidator) ValidateBlock(mBlock types.IBlock) error + func (v *MinorBlockValidator) ValidateHeader(header types.IHeader) error + func (v *MinorBlockValidator) ValidateState(mBlock, parent types.IBlock, statedb *state.StateDB, receipts types.Receipts, ...) error + func (v *MinorBlockValidator) ValidatorSeal(mHeader types.IHeader) error + type MinorChainEvent struct + Block *types.MinorBlock + Hash common.Hash + Logs []*types.Log + type MinorChainHeadEvent struct + Block *types.MinorBlock + type MinorChainSideEvent struct + Block types.IBlock + type MinorWhCallback func(header *types.MinorBlockHeader) error + type NewMinedBlockEvent struct + Block types.IBlock + type NewTxsEvent struct + Txs []*types.Transaction + type PendingLogsEvent struct + Logs []*types.Log + type Processor interface + Process func(block *types.MinorBlock, statedb *state.StateDB, cfg vm.Config, ...) (types.Receipts, []*types.Log, uint64, error) + type RemovedLogsEvent struct + Logs []*types.Log + type RootBlockChain struct + func NewRootBlockChain(db ethdb.Database, chainConfig *config.QuarkChainConfig, ...) (*RootBlockChain, error) + func (bc *RootBlockChain) AddBlock(block types.IBlock) error + func (bc *RootBlockChain) AddValidatedMinorBlockHeader(hash common.Hash) + func (bc *RootBlockChain) CalculateRootBlockCoinBase(rootBlock *types.RootBlock) *big.Int + func (bc *RootBlockChain) ClearCommittingHash() + func (bc *RootBlockChain) Config() *config.QuarkChainConfig + func (bc *RootBlockChain) CreateBlockToMine(mHeaderList []*types.MinorBlockHeader, address *account.Address, ...) (*types.RootBlock, error) + func (bc *RootBlockChain) CurrentBlock() *types.RootBlock + func (bc *RootBlockChain) CurrentHeader() types.IHeader + func (bc *RootBlockChain) Engine() consensus.Engine + func (bc *RootBlockChain) Export(w io.Writer) error + func (bc *RootBlockChain) ExportN(w io.Writer, first uint64, last uint64) error + func (bc *RootBlockChain) Genesis() *types.RootBlock + func (bc *RootBlockChain) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) + func (bc *RootBlockChain) GetBlock(hash common.Hash) types.IBlock + func (bc *RootBlockChain) GetBlockByNumber(number uint64) types.IBlock + func (bc *RootBlockChain) GetBlockCount(rootHeight uint32) (map[uint32]map[account.Recipient]uint32, error) + func (bc *RootBlockChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash + func (bc *RootBlockChain) GetCommittingBlockHash() common.Hash + func (bc *RootBlockChain) GetHeader(hash common.Hash) types.IHeader + func (bc *RootBlockChain) GetHeaderByNumber(number uint64) types.IHeader + func (bc *RootBlockChain) GetLatestMinorBlockHeaders(hash common.Hash) map[uint32]*types.MinorBlockHeader + func (bc *RootBlockChain) GetNextDifficulty(create *uint64) (*big.Int, error) + func (bc *RootBlockChain) GetTd(hash common.Hash) *big.Int + func (bc *RootBlockChain) HasBlock(hash common.Hash) bool + func (bc *RootBlockChain) HasHeader(hash common.Hash) bool + func (bc *RootBlockChain) InsertChain(chain []types.IBlock) (int, error) + func (bc *RootBlockChain) InsertHeaderChain(chain []*types.RootBlockHeader, checkFreq int) (int, error) + func (bc *RootBlockChain) IsMinorBlockValidated(hash common.Hash) bool + func (bc *RootBlockChain) PostChainEvents(events []interface{}) + func (bc *RootBlockChain) PutRootBlockIndex(block *types.RootBlock) error + func (bc *RootBlockChain) Reset() error + func (bc *RootBlockChain) ResetWithGenesisBlock(genesis *types.RootBlock) error + func (bc *RootBlockChain) Rollback(chain []common.Hash) + func (bc *RootBlockChain) SetBroadcastRootBlockFunc(f func(block *types.RootBlock) error) + func (bc *RootBlockChain) SetEnableCountMinorBlocks(flag bool) + func (bc *RootBlockChain) SetHead(head uint64) error + func (bc *RootBlockChain) SetLatestMinorBlockHeaders(hash common.Hash, headerMap map[uint32]*types.MinorBlockHeader) + func (bc *RootBlockChain) SetValidator(validator Validator) + func (bc *RootBlockChain) Stop() + func (bc *RootBlockChain) SubscribeChainEvent(ch chan<- RootChainEvent) event.Subscription + func (bc *RootBlockChain) SubscribeChainHeadEvent(ch chan<- RootChainHeadEvent) event.Subscription + func (bc *RootBlockChain) SubscribeChainSideEvent(ch chan<- RootChainSideEvent) event.Subscription + func (bc *RootBlockChain) SubscribeRemovedLogsEvent(ch chan<- RemovedLogsEvent) event.Subscription + func (bc *RootBlockChain) Validator() Validator + func (bc *RootBlockChain) WriteBlockWithState(block *types.RootBlock) (status WriteStatus, err error) + func (bc *RootBlockChain) WriteBlockWithoutState(block types.IBlock, td *big.Int) (err error) + func (bc *RootBlockChain) WriteCommittingHash(hash common.Hash) + type RootBlockGen struct + Headers types.MinorBlockHeaders + func (b *RootBlockGen) Number() uint64 + func (b *RootBlockGen) PrevBlock(index int) *types.RootBlock + func (b *RootBlockGen) SetCoinbase(addr account.Address) + func (b *RootBlockGen) SetDifficulty(value uint64) + func (b *RootBlockGen) SetExtra(data []byte) + func (b *RootBlockGen) SetNonce(nonce uint64) + func (b *RootBlockGen) SetTotalDifficulty(value *big.Int) + type RootBlockValidator struct + func NewRootBlockValidator(config *config.QuarkChainConfig, blockchain *RootBlockChain, ...) *RootBlockValidator + func (v *RootBlockValidator) ValidateBlock(block types.IBlock) error + func (v *RootBlockValidator) ValidateHeader(header types.IHeader) error + func (v *RootBlockValidator) ValidateState(block, parent types.IBlock, statedb *state.StateDB, receipts types.Receipts, ...) error + func (v *RootBlockValidator) ValidatorSeal(rHeader types.IHeader) error + type RootChainEvent struct + Block *types.RootBlock + Hash common.Hash + type RootChainHeadEvent struct + Block *types.RootBlock + type RootChainSideEvent struct + Block *types.RootBlock + type RootHeaderChain struct + func NewHeaderChain(chainDb ethdb.Database, config *config.QuarkChainConfig, ...) (*RootHeaderChain, error) + func (hc *RootHeaderChain) Config() *config.QuarkChainConfig + func (hc *RootHeaderChain) CurrentHeader() types.IHeader + func (hc *RootHeaderChain) Engine() consensus.Engine + func (hc *RootHeaderChain) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) + func (hc *RootHeaderChain) GetBlock(hash common.Hash) types.IBlock + func (hc *RootHeaderChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash + func (hc *RootHeaderChain) GetBlockNumber(hash common.Hash) *uint64 + func (hc *RootHeaderChain) GetHeader(hash common.Hash) types.IHeader + func (hc *RootHeaderChain) GetHeaderByNumber(number uint64) types.IHeader + func (hc *RootHeaderChain) GetTd(hash common.Hash) *big.Int + func (hc *RootHeaderChain) HasHeader(hash common.Hash) bool + func (hc *RootHeaderChain) InsertHeaderChain(chain []*types.RootBlockHeader, writeHeader WhCallback, start time.Time) (int, error) + func (hc *RootHeaderChain) SetCurrentHeader(head *types.RootBlockHeader) + func (hc *RootHeaderChain) SetGenesis(head *types.RootBlockHeader) + func (hc *RootHeaderChain) SetHead(head uint64, delFn DeleteCallback) + func (hc *RootHeaderChain) ValidateHeaderChain(chain []*types.RootBlockHeader, checkFreq int) (int, error) + func (hc *RootHeaderChain) WriteHeader(header *types.RootBlockHeader) (status WriteStatus, err error) + func (hc *RootHeaderChain) WriteTd(hash common.Hash, td *big.Int) error + type StateProcessor struct + func NewStateProcessor(config *params.ChainConfig, bc *MinorBlockChain, engine consensus.Engine) *StateProcessor + func (p *StateProcessor) Process(block *types.MinorBlock, statedb *state.StateDB, cfg vm.Config, ...) (types.Receipts, []*types.Log, uint64, error) + type StateTransition struct + func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool) *StateTransition + func (st *StateTransition) TransitionDb(feeRate *big.Rat) (ret []byte, usedGas uint64, failed bool, err error) + type TxPool struct + func NewTxPool(config TxPoolConfig, chain minorBlockChain) *TxPool + func (m *TxPool) CheckTxBeforeAdd(tx *types.Transaction) error + func (pool *TxPool) AddLocal(tx *types.Transaction) error + func (pool *TxPool) AddLocals(txs []*types.Transaction) []error + func (pool *TxPool) AddRemote(tx *types.Transaction) error + func (pool *TxPool) AddRemotes(txs []*types.Transaction) []error + func (pool *TxPool) Content() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) + func (pool *TxPool) GasPrice() *big.Int + func (pool *TxPool) Get(hash common.Hash) *types.Transaction + func (pool *TxPool) GetPendingTxsFromAddress(addr account.Recipient) types.Transactions + func (pool *TxPool) GetQueueTxsFromAddress(addr account.Recipient) types.Transactions + func (pool *TxPool) Locals() []common.Address + func (pool *TxPool) Pending() (map[common.Address]types.Transactions, error) + func (pool *TxPool) PendingCount() int + func (pool *TxPool) SetGasPrice(price *big.Int) + func (pool *TxPool) State() *state.ManagedState + func (pool *TxPool) Stats() (int, int) + func (pool *TxPool) Status(hashes []common.Hash) []TxStatus + func (pool *TxPool) Stop() + func (pool *TxPool) SubscribeNewTxsEvent(ch chan<- NewTxsEvent) event.Subscription + type TxPoolConfig struct + AccountQueue uint64 + AccountSlots uint64 + GlobalQueue uint64 + GlobalSlots uint64 + Lifetime time.Duration + Locals []common.Address + NetWorkID uint32 + NoLocals bool + PriceBump uint64 + PriceLimit uint64 + type TxStatus uint + const TxStatusIncluded + const TxStatusPending + const TxStatusQueued + const TxStatusUnknown + type Validator interface + ValidateBlock func(block types.IBlock) error + ValidateHeader func(header types.IHeader) error + ValidateState func(block, parent types.IBlock, state *state.StateDB, receipts types.Receipts, ...) error + ValidatorSeal func(rHeader types.IHeader) error + type WhCallback func(*types.RootBlockHeader) error + type WriteStatus byte + const CanonStatTy + const NonStatTy + const SideStatTy