Versions in this module Expand all Collapse all v1 v1.10.3 Dec 16, 2024 v1.10.2 Dec 15, 2024 Changes in this version + const BlockChainVersion + const ContractDeployerInitFund + const CxPoolSize + const GenesisEpoch + const GenesisONEToken + const InitFreeFund + var DefaultTxPoolConfig = TxPoolConfig + var ErrAllowedTxs = errors.New("transaction allowed whitelist check failed.") + var ErrBlacklistFrom = errors.New("`from` address of transaction in blacklist and not in allowlist") + var ErrBlacklistTo = errors.New("`to` address of transaction in blacklist") + var ErrBlacklistedHash = errors.New("blacklisted hash") + var ErrEmptyChain = errors.New("empty chain") + var ErrGasLimit = errors.New("exceeds block gas limit") + var ErrGasLimitReached = errors.New("gas limit reached") + var ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value") + var ErrIntrinsicGas = errors.New("intrinsic gas too low") + var ErrInvalidMsgForStakingDirective = errors.New("staking message does not match directive message") + var ErrInvalidSender = errors.New("invalid sender") + var ErrInvalidShard = errors.New("invalid shard") + var ErrKnownBlock = errors.New("block already known") + var ErrKnownTransaction = errors.New("known transaction") + var ErrNegativeValue = errors.New("negative value") + var ErrNoGenesis = errors.New("Genesis not found in chain") + var ErrNoMigrationPossible = errors.New("No balance migration possible") + var ErrNoMigrationRequired = errors.New("No balance migration required") + var ErrNonceTooHigh = errors.New("nonce too high") + var ErrNonceTooLow = errors.New("nonce too low") + var ErrNotLastBlockInEpoch = errors.New("not last block in epoch") + var ErrOversizedData = errors.New("oversized data") + var ErrReplaceUnderpriced = errors.New("replacement transaction underpriced") + var ErrShardStateNotMatch = errors.New("shard state root hash not match") + var ErrUnderpriced = errors.New("transaction underpriced") + var GenesisFund = new(big.Int).Mul(big.NewInt(GenesisONEToken), big.NewInt(denominations.One)) + func ApplyIncomingReceipt(config *params.ChainConfig, db *state.DB, header *block.Header, ...) error + func ApplyStakingMessage(evm *vm.EVM, msg Message, gp *GasPool) (uint64, error) + func ApplyStakingTransaction(bc ChainContext, author *common.Address, gp *GasPool, statedb *state.DB, ...) (receipt *types.Receipt, gas uint64, err error) + func ApplyTransaction(bc ChainContext, author *common.Address, gp *GasPool, statedb *state.DB, ...) (*types.Receipt, *types.CXReceipt, []staking.StakeMsg, uint64, error) + func CalcGasLimit(parent *block.Header, gasFloor, gasCeil uint64) uint64 + func CalculateMigrationGasFn(chain ChainContext) vm.CalculateMigrationGasFunc + func CanTransfer(db vm.StateDB, addr common.Address, amount *big.Int) bool + func CollectRewardsFn(ref *block.Header, chain ChainContext) vm.CollectRewardsFunc + func CreateValidatorFn(ref *block.Header, chain ChainContext) vm.CreateValidatorFunc + func DelegateFn(ref *block.Header, chain ChainContext) vm.DelegateFunc + func EditValidatorFn(ref *block.Header, chain ChainContext) vm.EditValidatorFunc + func EncodeGenesisConfig(fileName string) string + func ExportPreimages(chain BlockChain, path string) error + func FindMissingRange(imported, start, end, current uint64) (uint64, uint64) + func GeneratePreimages(chain BlockChain, start, end uint64) error + func GetHashFn(ref *block.Header, chain ChainContext) func(n uint64) common.Hash + func GetInitialFunds(shardID uint32) *big.Int + func GetVRFFn(ref *block.Header, chain ChainContext) func(n uint64) common.Hash + func ImportPreimages(chain BlockChain, path string) error + func IsEpochBlock(block *types.Block) bool + func IsValidator(db vm.StateDB, addr common.Address) bool + func MayBalanceMigration(gasPool *GasPool, header *block.Header, db *state.DB, chain BlockChain) (*types.CXReceipt, error) + func MayShardReduction(bc ChainContext, statedb *state.DB, header *block.Header) error + func NewEVMContext(msg Message, header *block.Header, chain ChainContext, author *common.Address) vm.Context + func SetReceiptsData(config *params.ChainConfig, block *types.Block, receipts types.Receipts) error + func StakingToMessage(tx *staking.StakingTransaction, blockNum *big.Int) (types.Message, error) + func StringToBigInt(s string, base int) *big.Int + func Transfer(db vm.StateDB, sender, recipient common.Address, amount *big.Int, ...) + func UndelegateFn(ref *block.Header, chain ChainContext) vm.UndelegateFunc + func UpdateValidatorVotingPower(bc BlockChain, block *types.Block, ...) (map[common.Address]*staking.ValidatorStats, error) + func VerifyAndCollectRewardsFromDelegation(stateDB vm.StateDB, delegations []staking.DelegationIndex) ([]*staking.ValidatorWrapper, *big.Int, error) + func VerifyAndCreateValidatorFromMsg(stateDB vm.StateDB, chainContext ChainContext, epoch *big.Int, ...) (*staking.ValidatorWrapper, error) + func VerifyAndDelegateFromMsg(stateDB vm.StateDB, epoch *big.Int, msg *staking.Delegate, ...) ([]*staking.ValidatorWrapper, *big.Int, map[common.Address]*big.Int, error) + func VerifyAndEditValidatorFromMsg(stateDB vm.StateDB, chainContext ChainContext, epoch, blockNum *big.Int, ...) (*staking.ValidatorWrapper, error) + func VerifyAndMigrateFromMsg(stateDB vm.StateDB, msg *staking.MigrationMsg, ...) ([]*staking.ValidatorWrapper, []interface{}, error) + func VerifyAndUndelegateFromMsg(stateDB vm.StateDB, epoch *big.Int, msg *staking.Undelegate) (*staking.ValidatorWrapper, error) + func VerifyBlockCrossLinks(blockchain BlockChain, block *types.Block) error + func VerifyCrossLink(blockchain BlockChain, cl types.CrossLink) error + func VerifyIncomingReceipts(blockchain BlockChain, block *types.Block) error + func VerifyPreimages(header *block.Header, chain BlockChain) (uint64, error) + func WritePreimagesMetricsIntoPrometheus(chain BlockChain, ...) + type AllowedTxData struct + Data []byte + To common.Address + type BadBlock struct + Block *types.Block + Reason error + func (b BadBlock) MarshalJSON() ([]byte, error) + type BlockChain interface + AddPendingCrossLinks func(pendingCLs []types.CrossLink) (int, error) + AddPendingSlashingCandidates func(candidates slash.Records) error + BadBlocks func() []BadBlock + CXMerkleProof func(toShardID uint32, block *block.Header) (*types.CXMerkleProof, error) + CachePendingCrossLinks func(crossLinks []types.CrossLink) error + ChainDb func() ethdb.Database + CommitOffChainData func(batch rawdb.DatabaseWriter, block *types.Block, receipts []*types.Receipt, ...) (status WriteStatus, err error) + CommitPreimages func() error + ComputeAndUpdateAPR func(block *types.Block, now *big.Int, wrapper *types2.ValidatorWrapper, ...) error + Config func() *params.ChainConfig + ContractCode func(hash common.Hash) ([]byte, error) + CurrentBlock func() *types.Block + CurrentFastBlock func() *types.Block + CurrentHeader func() *block.Header + DelegatorsInformation func(addr common.Address) []*types2.Delegation + DeleteCrossLinks func(cls []types.CrossLink) error + DeleteFromPendingCrossLinks func(crossLinks []types.CrossLink) (int, error) + DeleteFromPendingSlashingCandidates func(processed slash.Records) error + EnablePruneBeaconChainFeature func() + Engine func() engine.Engine + GetBlock func(hash common.Hash, number uint64) *types.Block + GetBlockByHash func(hash common.Hash) *types.Block + GetBlockByNumber func(number uint64) *types.Block + GetCanonicalHash func(number uint64) common.Hash + GetECDSAFromCoinbase func(header *block.Header) (common.Address, error) + GetHeader func(hash common.Hash, number uint64) *block.Header + GetHeaderByHash func(hash common.Hash) *block.Header + GetHeaderByNumber func(number uint64) *block.Header + GetLeaderPubKeyFromCoinbase func(h *block.Header) (*bls.PublicKeyWrapper, error) + GetMaxGarbageCollectedBlockNumber func() int64 + GetReceiptsByHash func(hash common.Hash) types.Receipts + GetSnapshotTrie func() *snapshot.Tree + GetStateCache func() state.Database + GetVMConfig func() *vm.Config + GetVdfByNumber func(number uint64) []byte + GetVrfByNumber func(number uint64) []byte + HasBlock func(hash common.Hash, number uint64) bool + HasBlockAndState func(hash common.Hash, number uint64) bool + HasState func(hash common.Hash) bool + InitTiKV func(conf *intelchainconfig.TiKVConfig) + InsertChain func(chain types.Blocks, verifyHeaders bool) (int, error) + InsertReceiptChain func(blockChain types.Blocks, receiptChain []types.Receipts) (int, error) + IsEnablePruneBeaconChainFeature func() bool + IsSameLeaderAsPreviousBlock func(block *types.Block) bool + IsSpent func(cxp *types.CXReceiptsProof) bool + IsTikvWriterMaster func() bool + LastContinuousCrossLink func(batch rawdb.DatabaseWriter, shardID uint32) error + LeaderRotationMeta func() LeaderRotationMeta + Processor func() Processor + ReadBlockRewardAccumulator func(number uint64) (*big.Int, error) + ReadCXReceipts func(shardID uint32, blockNum uint64, blockHash common.Hash) (types.CXReceipts, error) + ReadCommitSig func(blockNum uint64) ([]byte, error) + ReadCrossLink func(shardID uint32, blockNum uint64) (*types.CrossLink, error) + ReadDelegationsByDelegator func(delegator common.Address) (m types2.DelegationIndexes, err error) + ReadDelegationsByDelegatorAt func(delegator common.Address, blockNum *big.Int) (m types2.DelegationIndexes, err error) + ReadEpochVrfBlockNums func(epoch *big.Int) ([]uint64, error) + ReadPendingCrossLinks func() ([]types.CrossLink, error) + ReadPendingSlashingCandidates func() slash.Records + ReadShardLastCrossLink func(shardID uint32) (*types.CrossLink, error) + ReadShardState func(epoch *big.Int) (*shard.State, error) + ReadTxLookupEntry func(txID common.Hash) (common.Hash, uint64, uint64) + ReadValidatorInformation func(addr common.Address) (*types2.ValidatorWrapper, error) + ReadValidatorInformationAtRoot func(addr common.Address, root common.Hash) (*types2.ValidatorWrapper, error) + ReadValidatorInformationAtState func(addr common.Address, state *state.DB) (*types2.ValidatorWrapper, error) + ReadValidatorList func() ([]common.Address, error) + ReadValidatorSnapshot func(addr common.Address) (*types2.ValidatorSnapshot, error) + ReadValidatorSnapshotAtEpoch func(epoch *big.Int, addr common.Address) (*types2.ValidatorSnapshot, error) + ReadValidatorStats func(addr common.Address) (*types2.ValidatorStats, error) + RedisPreempt func() *redis_helper.RedisPreempt + Rollback func(chain []common.Hash) error + SavePendingCrossLinks func() error + ShardID func() uint32 + Snapshots func() *snapshot.Tree + State func() (*state.DB, error) + StateAt func(root common.Hash) (*state.DB, error) + Stop func() + SubscribeChainEvent func(ch chan<- ChainEvent) event.Subscription + SubscribeChainHeadEvent func(ch chan<- ChainHeadEvent) event.Subscription + SubscribeChainSideEvent func(ch chan<- ChainSideEvent) event.Subscription + SubscribeLogsEvent func(ch chan<- []*types.Log) event.Subscription + SubscribeRemovedLogsEvent func(ch chan<- RemovedLogsEvent) event.Subscription + SubscribeTraceEvent func(ch chan<- TraceEvent) event.Subscription + SuperCommitteeForNextEpoch func(beacon engine.ChainReader, header *block.Header, isVerify bool) (*shard.State, error) + SyncFromTiKVWriter func(newBlkNum uint64, logs []*types.Log) error + TrieDB func() *trie.Database + TrieNode func(hash common.Hash) ([]byte, error) + UpdateBlockRewardAccumulator func(batch rawdb.DatabaseWriter, diff *big.Int, number uint64) error + UpdateStakingMetaData func(batch rawdb.DatabaseWriter, block *types.Block, stakeMsgs []types2.StakeMsg, ...) (newValidators []common.Address, err error) + UpdateValidatorSnapshots func(batch rawdb.DatabaseWriter, epoch *big.Int, state *state.DB, ...) error + ValidateNewBlock func(block *types.Block, beaconChain BlockChain) error + Validator func() Validator + ValidatorCandidates func() []common.Address + ValidatorCode func(hash common.Hash) ([]byte, error) + WriteBlockRewardAccumulator func(batch rawdb.DatabaseWriter, reward *big.Int, number uint64) error + WriteBlockWithState func(block *types.Block, receipts []*types.Receipt, cxReceipts []*types.CXReceipt, ...) (status WriteStatus, err error) + WriteBlockWithoutState func(block *types.Block) (err error) + WriteCXReceiptsProofSpent func(db rawdb.DatabaseWriter, cxps []*types.CXReceiptsProof) error + WriteCommitSig func(blockNum uint64, lastCommits []byte) error + WriteCrossLinks func(batch rawdb.DatabaseWriter, cls []types.CrossLink) error + WriteHeadBlock func(block *types.Block) error + WriteShardStateBytes func(db rawdb.DatabaseWriter, epoch *big.Int, shardState []byte) (*shard.State, error) + WriteValidatorList func(db rawdb.DatabaseWriter, addrs []common.Address) error + WriteValidatorSnapshot func(batch rawdb.DatabaseWriter, snapshot *types2.ValidatorSnapshot) error + type BlockChainImpl struct + func NewBlockChain(db ethdb.Database, stateCache state.Database, beaconChain BlockChain, ...) (*BlockChainImpl, error) + func NewBlockChainWithOptions(db ethdb.Database, stateCache state.Database, beaconChain BlockChain, ...) (*BlockChainImpl, error) + func (bc *BlockChainImpl) AddPendingCrossLinks(pendingCLs []types.CrossLink) (int, error) + func (bc *BlockChainImpl) AddPendingSlashingCandidates(candidates slash.Records) error + func (bc *BlockChainImpl) BadBlocks() []BadBlock + func (bc *BlockChainImpl) CXMerkleProof(toShardID uint32, block *block.Header) (*types.CXMerkleProof, error) + func (bc *BlockChainImpl) CachePendingCrossLinks(crossLinks []types.CrossLink) error + func (bc *BlockChainImpl) ChainDb() ethdb.Database + func (bc *BlockChainImpl) CommitOffChainData(batch rawdb.DatabaseWriter, block *types.Block, receipts []*types.Receipt, ...) (status WriteStatus, err error) + func (bc *BlockChainImpl) CommitPreimages() error + func (bc *BlockChainImpl) ComputeAndUpdateAPR(block *types.Block, now *big.Int, wrapper *staking.ValidatorWrapper, ...) error + func (bc *BlockChainImpl) Config() *params.ChainConfig + func (bc *BlockChainImpl) ContractCode(hash common.Hash) ([]byte, error) + func (bc *BlockChainImpl) CurrentBlock() *types.Block + func (bc *BlockChainImpl) CurrentFastBlock() *types.Block + func (bc *BlockChainImpl) CurrentHeader() *block.Header + func (bc *BlockChainImpl) DelegatorsInformation(addr common.Address) []*staking.Delegation + func (bc *BlockChainImpl) DeleteCrossLinks(cls []types.CrossLink) error + func (bc *BlockChainImpl) DeleteFromPendingCrossLinks(crossLinks []types.CrossLink) (int, error) + func (bc *BlockChainImpl) DeleteFromPendingSlashingCandidates(processed slash.Records) error + func (bc *BlockChainImpl) EnablePruneBeaconChainFeature() + func (bc *BlockChainImpl) Engine() consensus_engine.Engine + func (bc *BlockChainImpl) Export(w io.Writer) error + func (bc *BlockChainImpl) ExportN(w io.Writer, first uint64, last uint64) error + func (bc *BlockChainImpl) Genesis() *types.Block + func (bc *BlockChainImpl) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) + func (bc *BlockChainImpl) GetBlock(hash common.Hash, number uint64) *types.Block + func (bc *BlockChainImpl) GetBlockByHash(hash common.Hash) *types.Block + func (bc *BlockChainImpl) GetBlockByNumber(number uint64) *types.Block + func (bc *BlockChainImpl) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash + func (bc *BlockChainImpl) GetBlocksFromHash(hash common.Hash, n int) (blocks []*types.Block) + func (bc *BlockChainImpl) GetBody(hash common.Hash) *types.Body + func (bc *BlockChainImpl) GetBodyRLP(hash common.Hash) rlp.RawValue + func (bc *BlockChainImpl) GetCanonicalHash(number uint64) common.Hash + func (bc *BlockChainImpl) GetECDSAFromCoinbase(header *block.Header) (common.Address, error) + func (bc *BlockChainImpl) GetEpochBlockNumber(epoch *big.Int) (*big.Int, error) + func (bc *BlockChainImpl) GetHeader(hash common.Hash, number uint64) *block.Header + func (bc *BlockChainImpl) GetHeaderByHash(hash common.Hash) *block.Header + func (bc *BlockChainImpl) GetHeaderByNumber(number uint64) *block.Header + func (bc *BlockChainImpl) GetLeaderPubKeyFromCoinbase(h *block.Header) (*bls.PublicKeyWrapper, error) + func (bc *BlockChainImpl) GetMaxGarbageCollectedBlockNumber() int64 + func (bc *BlockChainImpl) GetReceiptsByHash(hash common.Hash) types.Receipts + func (bc *BlockChainImpl) GetSnapshotTrie() *snapshot.Tree + func (bc *BlockChainImpl) GetStateCache() state.Database + func (bc *BlockChainImpl) GetTd(hash common.Hash, number uint64) *big.Int + func (bc *BlockChainImpl) GetTdByHash(hash common.Hash) *big.Int + func (bc *BlockChainImpl) GetUnclesInChain(b *types.Block, length int) []*block.Header + func (bc *BlockChainImpl) GetVMConfig() *vm.Config + func (bc *BlockChainImpl) GetVdfByNumber(number uint64) []byte + func (bc *BlockChainImpl) GetVrfByNumber(number uint64) []byte + func (bc *BlockChainImpl) HasBlock(hash common.Hash, number uint64) bool + func (bc *BlockChainImpl) HasBlockAndState(hash common.Hash, number uint64) bool + func (bc *BlockChainImpl) HasHeader(hash common.Hash, number uint64) bool + func (bc *BlockChainImpl) HasState(hash common.Hash) bool + func (bc *BlockChainImpl) InitTiKV(conf *intelchainconfig.TiKVConfig) + func (bc *BlockChainImpl) InsertChain(chain types.Blocks, verifyHeaders bool) (int, error) + func (bc *BlockChainImpl) InsertReceiptChain(blockChain types.Blocks, receiptChain []types.Receipts) (int, error) + func (bc *BlockChainImpl) IsEnablePruneBeaconChainFeature() bool + func (bc *BlockChainImpl) IsSameLeaderAsPreviousBlock(block *types.Block) bool + func (bc *BlockChainImpl) IsSpent(cxp *types.CXReceiptsProof) bool + func (bc *BlockChainImpl) IsTikvWriterMaster() bool + func (bc *BlockChainImpl) LastContinuousCrossLink(batch rawdb.DatabaseWriter, shardID uint32) error + func (bc *BlockChainImpl) LeaderRotationMeta() LeaderRotationMeta + func (bc *BlockChainImpl) PostChainEvents(events []interface{}, logs []*types.Log) + func (bc *BlockChainImpl) Processor() Processor + func (bc *BlockChainImpl) ReadBlockRewardAccumulator(number uint64) (*big.Int, error) + func (bc *BlockChainImpl) ReadCXReceipts(shardID uint32, blockNum uint64, blockHash common.Hash) (types.CXReceipts, error) + func (bc *BlockChainImpl) ReadCommitSig(blockNum uint64) ([]byte, error) + func (bc *BlockChainImpl) ReadCrossLink(shardID uint32, blockNum uint64) (*types.CrossLink, error) + func (bc *BlockChainImpl) ReadDelegationsByDelegator(delegator common.Address) (m staking.DelegationIndexes, err error) + func (bc *BlockChainImpl) ReadDelegationsByDelegatorAt(delegator common.Address, blockNum *big.Int) (m staking.DelegationIndexes, err error) + func (bc *BlockChainImpl) ReadEpochVdfBlockNum(epoch *big.Int) (*big.Int, error) + func (bc *BlockChainImpl) ReadEpochVrfBlockNums(epoch *big.Int) ([]uint64, error) + func (bc *BlockChainImpl) ReadPendingCrossLinks() ([]types.CrossLink, error) + func (bc *BlockChainImpl) ReadPendingSlashingCandidates() slash.Records + func (bc *BlockChainImpl) ReadShardLastCrossLink(shardID uint32) (*types.CrossLink, error) + func (bc *BlockChainImpl) ReadShardState(epoch *big.Int) (*shard.State, error) + func (bc *BlockChainImpl) ReadTxLookupEntry(txID common.Hash) (common.Hash, uint64, uint64) + func (bc *BlockChainImpl) ReadValidatorInformation(addr common.Address) (*staking.ValidatorWrapper, error) + func (bc *BlockChainImpl) ReadValidatorInformationAtRoot(addr common.Address, root common.Hash) (*staking.ValidatorWrapper, error) + func (bc *BlockChainImpl) ReadValidatorInformationAtState(addr common.Address, state *state.DB) (*staking.ValidatorWrapper, error) + func (bc *BlockChainImpl) ReadValidatorList() ([]common.Address, error) + func (bc *BlockChainImpl) ReadValidatorSnapshot(addr common.Address) (*staking.ValidatorSnapshot, error) + func (bc *BlockChainImpl) ReadValidatorSnapshotAtEpoch(epoch *big.Int, addr common.Address) (*staking.ValidatorSnapshot, error) + func (bc *BlockChainImpl) ReadValidatorStats(addr common.Address) (*staking.ValidatorStats, error) + func (bc *BlockChainImpl) RedisPreempt() *redis_helper.RedisPreempt + func (bc *BlockChainImpl) Rollback(chain []common.Hash) error + func (bc *BlockChainImpl) SavePendingCrossLinks() error + func (bc *BlockChainImpl) ShardID() uint32 + func (bc *BlockChainImpl) Snapshots() *snapshot.Tree + func (bc *BlockChainImpl) State() (*state.DB, error) + func (bc *BlockChainImpl) StateAt(root common.Hash) (*state.DB, error) + func (bc *BlockChainImpl) Stop() + func (bc *BlockChainImpl) StoreEpochBlockNumber(epoch *big.Int, blockNum *big.Int) error + func (bc *BlockChainImpl) SubscribeChainEvent(ch chan<- ChainEvent) event.Subscription + func (bc *BlockChainImpl) SubscribeChainHeadEvent(ch chan<- ChainHeadEvent) event.Subscription + func (bc *BlockChainImpl) SubscribeChainSideEvent(ch chan<- ChainSideEvent) event.Subscription + func (bc *BlockChainImpl) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription + func (bc *BlockChainImpl) SubscribeRemovedLogsEvent(ch chan<- RemovedLogsEvent) event.Subscription + func (bc *BlockChainImpl) SubscribeTraceEvent(ch chan<- TraceEvent) event.Subscription + func (bc *BlockChainImpl) SuperCommitteeForNextEpoch(beacon consensus_engine.ChainReader, header *block.Header, isVerify bool) (*shard.State, error) + func (bc *BlockChainImpl) SyncFromTiKVWriter(newBlkNum uint64, logs []*types.Log) error + func (bc *BlockChainImpl) TrieDB() *trie.Database + func (bc *BlockChainImpl) TrieNode(hash common.Hash) ([]byte, error) + func (bc *BlockChainImpl) UpdateBlockRewardAccumulator(batch rawdb.DatabaseWriter, diff *big.Int, number uint64) error + func (bc *BlockChainImpl) UpdateStakingMetaData(batch rawdb.DatabaseWriter, block *types.Block, stakeMsgs []staking.StakeMsg, ...) (newValidators []common.Address, err error) + func (bc *BlockChainImpl) UpdateValidatorSnapshots(batch rawdb.DatabaseWriter, epoch *big.Int, state *state.DB, ...) error + func (bc *BlockChainImpl) ValidateNewBlock(block *types.Block, beaconChain BlockChain) error + func (bc *BlockChainImpl) Validator() Validator + func (bc *BlockChainImpl) ValidatorCandidates() []common.Address + func (bc *BlockChainImpl) ValidatorCode(hash common.Hash) ([]byte, error) + func (bc *BlockChainImpl) WriteBlockRewardAccumulator(batch rawdb.DatabaseWriter, reward *big.Int, number uint64) error + func (bc *BlockChainImpl) WriteBlockWithState(block *types.Block, receipts []*types.Receipt, cxReceipts []*types.CXReceipt, ...) (status WriteStatus, err error) + func (bc *BlockChainImpl) WriteBlockWithoutState(block *types.Block) (err error) + func (bc *BlockChainImpl) WriteCXReceiptsProofSpent(db rawdb.DatabaseWriter, cxps []*types.CXReceiptsProof) error + func (bc *BlockChainImpl) WriteCommitSig(blockNum uint64, lastCommits []byte) error + func (bc *BlockChainImpl) WriteCrossLinks(batch rawdb.DatabaseWriter, cls []types.CrossLink) error + func (bc *BlockChainImpl) WriteEpochVdfBlockNum(epoch *big.Int, blockNum *big.Int) error + func (bc *BlockChainImpl) WriteEpochVrfBlockNums(epoch *big.Int, vrfNumbers []uint64) error + func (bc *BlockChainImpl) WriteHeadBlock(block *types.Block) error + func (bc *BlockChainImpl) WriteShardStateBytes(db rawdb.DatabaseWriter, epoch *big.Int, shardState []byte) (*shard.State, error) + func (bc *BlockChainImpl) WriteValidatorList(db rawdb.DatabaseWriter, addrs []common.Address) error + func (bc *BlockChainImpl) WriteValidatorSnapshot(batch rawdb.DatabaseWriter, snapshot *staking.ValidatorSnapshot) error + type BlockValidator struct + func NewBlockValidator(blockchain BlockChain) *BlockValidator + func (v *BlockValidator) ValidateBody(block *types.Block) error + func (v *BlockValidator) ValidateCXReceiptsProof(cxp *types.CXReceiptsProof) error + func (v *BlockValidator) ValidateHeader(block *types.Block, seal bool) error + func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.DB, receipts types.Receipts, ...) error + type CacheConfig struct + Disabled bool + Preimages bool + SnapshotLimit int + SnapshotNoBuild bool + SnapshotWait bool + TrieCleanJournal string + TrieCleanLimit int + TrieDirtyDisabled bool + TrieDirtyLimit int + TrieNodeLimit int + TrieTimeLimit time.Duration + TriesInMemory uint64 + type Chain interface + ChainDb func() ethdb.Database + GetCanonicalHash func(number uint64) common.Hash + GetHeader func(hash common.Hash, number uint64) *block.Header + type ChainContext interface + Config func() *params.ChainConfig + GetHeader func(common.Hash, uint64) *block.Header + ReadDelegationsByDelegator func(common.Address) (stakingTypes.DelegationIndexes, error) + ReadDelegationsByDelegatorAt func(delegator common.Address, blockNum *big.Int) (m stakingTypes.DelegationIndexes, err error) + ReadValidatorList func() ([]common.Address, error) + ReadValidatorSnapshot func(common.Address) (*stakingTypes.ValidatorSnapshot, error) + ShardID func() uint32 + type ChainEvent struct + Block *types.Block + Hash common.Hash + Logs []*types.Log + type ChainHeadEvent struct + Block *types.Block + type ChainIndexer struct + func NewChainIndexer(chainDb Chain, indexDb ethdb.Database, backend ChainIndexerBackend, ...) *ChainIndexer + func (c *ChainIndexer) AddCheckpoint(section uint64, shead common.Hash) + func (c *ChainIndexer) AddChildIndexer(indexer *ChainIndexer) + func (c *ChainIndexer) Close() error + func (c *ChainIndexer) SectionHead(section uint64) common.Hash + func (c *ChainIndexer) Sections() (uint64, uint64, common.Hash) + func (c *ChainIndexer) Start(chain ChainIndexerChain) + type ChainIndexerBackend interface + Commit func() error + Process func(ctx context.Context, header *block.Header) error + Reset func(ctx context.Context, section uint64, prevHead common.Hash) error + type ChainIndexerChain interface + CurrentHeader func() *block.Header + SubscribeChainHeadEvent func(ch chan<- ChainHeadEvent) event.Subscription + type ChainSideEvent struct + Block *types.Block + type CxEntry struct + BlockHash common.Hash + ToShardID uint32 + type CxPool struct + func NewCxPool(limit int) *CxPool + func (cxPool *CxPool) Add(entry CxEntry) bool + func (cxPool *CxPool) Clear() + func (cxPool *CxPool) Pool() mapset.Set + func (cxPool *CxPool) Size() int + type DeleteCallback func(rawdb.DatabaseDeleter, common.Hash, uint64) error + type EpochChain struct + func NewEpochChain(db ethdb.Database, chainConfig *params.ChainConfig, ...) (*EpochChain, error) + func (bc *EpochChain) CommitPreimages() error + func (bc *EpochChain) Config() *params.ChainConfig + func (bc *EpochChain) CurrentBlock() *types.Block + func (bc *EpochChain) CurrentHeader() *block.Header + func (bc *EpochChain) Engine() engine.Engine + func (bc *EpochChain) GetBlockNumber(hash common.Hash) *uint64 + func (bc *EpochChain) GetCanonicalHash(number uint64) common.Hash + func (bc *EpochChain) GetHeader(hash common.Hash, number uint64) *block.Header + func (bc *EpochChain) GetHeaderByHash(hash common.Hash) *block.Header + func (bc *EpochChain) GetHeaderByNumber(number uint64) *block.Header + func (bc *EpochChain) GetVMConfig() *vm.Config + func (bc *EpochChain) InsertChain(blocks types.Blocks, _ bool) (int, error) + func (bc *EpochChain) IsSameLeaderAsPreviousBlock(block *types.Block) bool + func (bc *EpochChain) ReadShardState(epoch *big.Int) (*shard.State, error) + func (bc *EpochChain) ShardID() uint32 + func (bc *EpochChain) Stop() + func (bc *EpochChain) WriteHeadBlock(block *types.Block) error + type ExecutionResult struct + ReturnData []byte + UsedGas uint64 + VMErr error + func ApplyMessage(evm *vm.EVM, msg Message, gp *GasPool) (ExecutionResult, error) + func (result *ExecutionResult) Failed() bool + func (result *ExecutionResult) Return() []byte + func (result *ExecutionResult) Revert() []byte + func (result *ExecutionResult) Unwrap() 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 + Alloc GenesisAlloc + Coinbase common.Address + Config *params.ChainConfig + ExtraData []byte + Factory blockfactory.Factory + GasLimit uint64 + GasUsed uint64 + Mixhash common.Hash + Nonce uint64 + Number uint64 + ParentHash common.Hash + ShardID uint32 + ShardState shard.State + ShardStateHash common.Hash + Timestamp uint64 + func GetGenesisSpec(shardID uint32) *Genesis + func NewGenesisSpec(netType nodeconfig.NetworkType, shardID uint32) *Genesis + func (g *Genesis) Commit(db ethdb.Database) (*types.Block, error) + func (g *Genesis) MustCommit(db ethdb.Database) *types.Block + func (g *Genesis) ToBlock(db ethdb.Database) *types.Block + func (g *Genesis) UnmarshalJSON(input []byte) error + func (g Genesis) MarshalJSON() ([]byte, error) + type GenesisAccount struct + Balance *big.Int + Code []byte + Nonce uint64 + PrivateKey []byte + Storage map[common.Hash]common.Hash + func (g *GenesisAccount) UnmarshalJSON(input []byte) error + func (g GenesisAccount) MarshalJSON() ([]byte, error) + type GenesisAlloc map[common.Address]GenesisAccount + func (ga *GenesisAlloc) UnmarshalJSON(data []byte) error + type GenesisInitializer struct + NetworkType nodeconfig.NetworkType + func (gi *GenesisInitializer) InitChainDB(db ethdb.Database, shardID uint32) error + type GenesisItem struct + Addr *big.Int + Balance *big.Int + type GenesisMismatchError struct + New common.Hash + Stored common.Hash + func (e *GenesisMismatchError) Error() string + type HeaderChain struct + func NewHeaderChain(chainDb ethdb.Database, config *params.ChainConfig, ...) (*HeaderChain, error) + func (hc *HeaderChain) Config() *params.ChainConfig + func (hc *HeaderChain) CurrentHeader() *block.Header + func (hc *HeaderChain) Engine() consensus_engine.Engine + func (hc *HeaderChain) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) + func (hc *HeaderChain) GetBlock(hash common.Hash, number uint64) *types.Block + func (hc *HeaderChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash + func (hc *HeaderChain) GetBlockNumber(hash common.Hash) *uint64 + func (hc *HeaderChain) GetCanonicalHash(number uint64) common.Hash + func (hc *HeaderChain) GetHeader(hash common.Hash, number uint64) *block.Header + func (hc *HeaderChain) GetHeaderByHash(hash common.Hash) *block.Header + func (hc *HeaderChain) GetHeaderByNumber(number uint64) *block.Header + 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) SetCurrentHeader(head *block.Header) error + func (hc *HeaderChain) SetGenesis(head *block.Header) + func (hc *HeaderChain) SetHead(head uint64, delFn DeleteCallback) error + func (hc *HeaderChain) ValidateHeaderChain(chain []*block.Header, checkFreq int) (int, error) + func (hc *HeaderChain) WriteHeader(header *block.Header) (status WriteStatus, err error) + func (hc *HeaderChain) WriteTd(hash common.Hash, number uint64, td *big.Int) error + type LeaderRotationMeta struct + Count uint64 + Epoch uint64 + Pub []byte + Shifts uint64 + func (a LeaderRotationMeta) Clone() LeaderRotationMeta + func (a LeaderRotationMeta) Hash() []byte + func (a LeaderRotationMeta) ShortString() string + type Message interface + BlockNum func() *big.Int + CheckNonce func() bool + Data func() []byte + From func() common.Address + Gas func() uint64 + GasPrice func() *big.Int + Nonce func() uint64 + To func() *common.Address + Type func() types.TransactionType + Value func() *big.Int + type NewMinedBlockEvent struct + Block *types.Block + type NewTxsEvent struct + Txs []types.PoolTransaction + type Options struct + EpochChain bool + type PendingLogsEvent struct + Logs []*types.Log + type Processor interface + CacheProcessorResult func(cacheKey interface{}, result *ProcessorResult) + Process func(block *types.Block, statedb *state.DB, cfg vm.Config, readCache bool) (types.Receipts, types.CXReceipts, []stakingTypes.StakeMsg, []*types.Log, ...) + type ProcessorResult struct + CxReceipts types.CXReceipts + Logs []*types.Log + Receipts types.Receipts + Reward reward.Reader + StakeMsgs []staking.StakeMsg + State *state.DB + UsedGas uint64 + type RemovedLogsEvent struct + Logs []*types.Log + type SideEffect func() + type StateProcessor struct + func NewStateProcessor(bc BlockChain, beacon BlockChain) *StateProcessor + func (p *StateProcessor) CacheProcessorResult(cacheKey interface{}, result *ProcessorResult) + func (p *StateProcessor) Process(block *types.Block, statedb *state.DB, cfg vm.Config, readCache bool) (types.Receipts, types.CXReceipts, []staking.StakeMsg, []*types.Log, UsedGas, ...) + type StateTransition struct + func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool) *StateTransition + func (st *StateTransition) StakingTransitionDb() (usedGas uint64, err error) + func (st *StateTransition) TransitionDb() (ExecutionResult, error) + type Stub struct + Name string + func (a Stub) AddPendingCrossLinks(pendingCLs []types.CrossLink) (int, error) + func (a Stub) AddPendingSlashingCandidates(candidates slash.Records) error + func (a Stub) BadBlocks() []BadBlock + func (a Stub) CXMerkleProof(toShardID uint32, block *block.Header) (*types.CXMerkleProof, error) + func (a Stub) CachePendingCrossLinks(crossLinks []types.CrossLink) error + func (a Stub) ChainDb() ethdb.Database + func (a Stub) CommitOffChainData(batch rawdb.DatabaseWriter, block *types.Block, receipts []*types.Receipt, ...) (status WriteStatus, err error) + func (a Stub) CommitPreimages() error + func (a Stub) ComputeAndUpdateAPR(block *types.Block, now *big.Int, wrapper *staking.ValidatorWrapper, ...) error + func (a Stub) Config() *params.ChainConfig + func (a Stub) ContractCode(hash common.Hash) ([]byte, error) + func (a Stub) CurrentBlock() *types.Block + func (a Stub) CurrentFastBlock() *types.Block + func (a Stub) CurrentHeader() *block.Header + func (a Stub) DelegatorsInformation(addr common.Address) []*staking.Delegation + func (a Stub) DeleteCrossLinks(cls []types.CrossLink) error + func (a Stub) DeleteFromPendingCrossLinks(crossLinks []types.CrossLink) (int, error) + func (a Stub) DeleteFromPendingSlashingCandidates(processed slash.Records) error + func (a Stub) EnablePruneBeaconChainFeature() + func (a Stub) Engine() engine.Engine + func (a Stub) GetBlock(hash common.Hash, number uint64) *types.Block + func (a Stub) GetBlockByHash(hash common.Hash) *types.Block + func (a Stub) GetBlockByNumber(number uint64) *types.Block + func (a Stub) GetCanonicalHash(number uint64) common.Hash + func (a Stub) GetECDSAFromCoinbase(header *block.Header) (common.Address, error) + func (a Stub) GetEpochBlockNumber(epoch *big.Int) (*big.Int, error) + func (a Stub) GetHeader(hash common.Hash, number uint64) *block.Header + func (a Stub) GetHeaderByHash(hash common.Hash) *block.Header + func (a Stub) GetHeaderByNumber(number uint64) *block.Header + func (a Stub) GetLeaderPubKeyFromCoinbase(h *block.Header) (*bls.PublicKeyWrapper, error) + func (a Stub) GetMaxGarbageCollectedBlockNumber() int64 + func (a Stub) GetReceiptsByHash(hash common.Hash) types.Receipts + func (a Stub) GetSnapshotTrie() *snapshot.Tree + func (a Stub) GetStateCache() state.Database + func (a Stub) GetVMConfig() *vm.Config + func (a Stub) GetVdfByNumber(number uint64) []byte + func (a Stub) GetVrfByNumber(number uint64) []byte + func (a Stub) HasBlock(hash common.Hash, number uint64) bool + func (a Stub) HasBlockAndState(hash common.Hash, number uint64) bool + func (a Stub) HasState(hash common.Hash) bool + func (a Stub) InitTiKV(conf *intelchainconfig.TiKVConfig) + func (a Stub) InsertChain(chain types.Blocks, verifyHeaders bool) (int, error) + func (a Stub) InsertReceiptChain(blockChain types.Blocks, receiptChain []types.Receipts) (int, error) + func (a Stub) IsEnablePruneBeaconChainFeature() bool + func (a Stub) IsSameLeaderAsPreviousBlock(block *types.Block) bool + func (a Stub) IsSpent(cxp *types.CXReceiptsProof) bool + func (a Stub) IsTikvWriterMaster() bool + func (a Stub) LastContinuousCrossLink(batch rawdb.DatabaseWriter, shardID uint32) error + func (a Stub) LeaderRotationMeta() LeaderRotationMeta + func (a Stub) Processor() Processor + func (a Stub) ReadBlockRewardAccumulator(number uint64) (*big.Int, error) + func (a Stub) ReadCXReceipts(shardID uint32, blockNum uint64, blockHash common.Hash) (types.CXReceipts, error) + func (a Stub) ReadCommitSig(blockNum uint64) ([]byte, error) + func (a Stub) ReadCrossLink(shardID uint32, blockNum uint64) (*types.CrossLink, error) + func (a Stub) ReadDelegationsByDelegator(delegator common.Address) (m staking.DelegationIndexes, err error) + func (a Stub) ReadDelegationsByDelegatorAt(delegator common.Address, blockNum *big.Int) (m staking.DelegationIndexes, err error) + func (a Stub) ReadEpochVdfBlockNum(epoch *big.Int) (*big.Int, error) + func (a Stub) ReadEpochVrfBlockNums(epoch *big.Int) ([]uint64, error) + func (a Stub) ReadPendingCrossLinks() ([]types.CrossLink, error) + func (a Stub) ReadPendingSlashingCandidates() slash.Records + func (a Stub) ReadShardLastCrossLink(shardID uint32) (*types.CrossLink, error) + func (a Stub) ReadShardState(epoch *big.Int) (*shard.State, error) + func (a Stub) ReadTxLookupEntry(txID common.Hash) (common.Hash, uint64, uint64) + func (a Stub) ReadValidatorInformation(addr common.Address) (*staking.ValidatorWrapper, error) + func (a Stub) ReadValidatorInformationAtRoot(addr common.Address, root common.Hash) (*staking.ValidatorWrapper, error) + func (a Stub) ReadValidatorInformationAtState(addr common.Address, state *state.DB) (*staking.ValidatorWrapper, error) + func (a Stub) ReadValidatorList() ([]common.Address, error) + func (a Stub) ReadValidatorSnapshot(addr common.Address) (*staking.ValidatorSnapshot, error) + func (a Stub) ReadValidatorSnapshotAtEpoch(epoch *big.Int, addr common.Address) (*staking.ValidatorSnapshot, error) + func (a Stub) ReadValidatorStats(addr common.Address) (*staking.ValidatorStats, error) + func (a Stub) RedisPreempt() *redis_helper.RedisPreempt + func (a Stub) Rollback(chain []common.Hash) error + func (a Stub) SavePendingCrossLinks() error + func (a Stub) SetHead(head uint64) error + func (a Stub) ShardID() uint32 + func (a Stub) Snapshots() *snapshot.Tree + func (a Stub) State() (*state.DB, error) + func (a Stub) StateAt(common.Hash) (*state.DB, error) + func (a Stub) Stop() + func (a Stub) StoreEpochBlockNumber(epoch *big.Int, blockNum *big.Int) error + func (a Stub) SubscribeChainEvent(ch chan<- ChainEvent) event.Subscription + func (a Stub) SubscribeChainHeadEvent(ch chan<- ChainHeadEvent) event.Subscription + func (a Stub) SubscribeChainSideEvent(ch chan<- ChainSideEvent) event.Subscription + func (a Stub) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription + func (a Stub) SubscribeRemovedLogsEvent(ch chan<- RemovedLogsEvent) event.Subscription + func (a Stub) SubscribeTraceEvent(ch chan<- TraceEvent) event.Subscription + func (a Stub) SuperCommitteeForNextEpoch(beacon engine.ChainReader, header *block.Header, isVerify bool) (*shard.State, error) + func (a Stub) SyncFromTiKVWriter(newBlkNum uint64, logs []*types.Log) error + func (a Stub) TrieDB() *trie.Database + func (a Stub) TrieNode(hash common.Hash) ([]byte, error) + func (a Stub) UpdateBlockRewardAccumulator(batch rawdb.DatabaseWriter, diff *big.Int, number uint64) error + func (a Stub) UpdateStakingMetaData(batch rawdb.DatabaseWriter, block *types.Block, stakeMsgs []staking.StakeMsg, ...) (newValidators []common.Address, err error) + func (a Stub) UpdateValidatorSnapshots(batch rawdb.DatabaseWriter, epoch *big.Int, state *state.DB, ...) error + func (a Stub) UpdateValidatorVotingPower(batch rawdb.DatabaseWriter, block *types.Block, ...) (map[common.Address]*staking.ValidatorStats, error) + func (a Stub) ValidateNewBlock(block *types.Block, beaconChain BlockChain) error + func (a Stub) Validator() Validator + func (a Stub) ValidatorCandidates() []common.Address + func (a Stub) ValidatorCode(hash common.Hash) ([]byte, error) + func (a Stub) WriteBlockRewardAccumulator(batch rawdb.DatabaseWriter, reward *big.Int, number uint64) error + func (a Stub) WriteBlockWithState(block *types.Block, receipts []*types.Receipt, cxReceipts []*types.CXReceipt, ...) (status WriteStatus, err error) + func (a Stub) WriteBlockWithoutState(block *types.Block) (err error) + func (a Stub) WriteCXReceiptsProofSpent(db rawdb.DatabaseWriter, cxps []*types.CXReceiptsProof) error + func (a Stub) WriteCommitSig(blockNum uint64, lastCommits []byte) error + func (a Stub) WriteCrossLinks(batch rawdb.DatabaseWriter, cls []types.CrossLink) error + func (a Stub) WriteEpochVdfBlockNum(epoch *big.Int, blockNum *big.Int) error + func (a Stub) WriteEpochVrfBlockNums(epoch *big.Int, vrfNumbers []uint64) error + func (a Stub) WriteHeadBlock(block *types.Block) error + func (a Stub) WriteShardStateBytes(db rawdb.DatabaseWriter, epoch *big.Int, shardState []byte) (*shard.State, error) + func (a Stub) WriteValidatorList(db rawdb.DatabaseWriter, addrs []common.Address) error + func (a Stub) WriteValidatorSnapshot(batch rawdb.DatabaseWriter, snapshot *staking.ValidatorSnapshot) error + type TraceEvent struct + Tracer *tracers.ParityBlockTracer + type TxPool struct + func NewTxPool(config TxPoolConfig, chainconfig *params.ChainConfig, chain blockChain, ...) *TxPool + func (pool *TxPool) AddLocal(tx types.PoolTransaction) error + func (pool *TxPool) AddLocals(txs types.PoolTransactions) []error + func (pool *TxPool) AddRemote(tx types.PoolTransaction) error + func (pool *TxPool) AddRemotes(txs types.PoolTransactions) []error + func (pool *TxPool) Content() (map[common.Address]types.PoolTransactions, ...) + func (pool *TxPool) GasPrice() *big.Int + func (pool *TxPool) Get(hash common.Hash) types.PoolTransaction + func (pool *TxPool) GetTxPoolSize() uint64 + func (pool *TxPool) Locals() []common.Address + func (pool *TxPool) Pending() (map[common.Address]types.PoolTransactions, error) + func (pool *TxPool) Queued() (map[common.Address]types.PoolTransactions, error) + 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 + AddEvent func(tx types.PoolTransaction, local bool) + AllowedTxs map[common.Address]AllowedTxData + Blacklist map[common.Address]struct{} + GlobalQueue uint64 + GlobalSlots uint64 + Journal string + Lifetime time.Duration + Locals []common.Address + NoLocals bool + PriceBump uint64 + PriceLimit uint64 + Rejournal time.Duration + type TxStatus uint + const TxStatusIncluded + const TxStatusPending + const TxStatusQueued + const TxStatusUnknown + type UsedGas = uint64 + type Validator interface + ValidateBody func(block *types.Block) error + ValidateCXReceiptsProof func(cxp *types.CXReceiptsProof) error + ValidateHeader func(block *types.Block, seal bool) error + ValidateState func(block *types.Block, state *state.DB, receipts types.Receipts, ...) error + type WhCallback func(*block.Header) error + type WriteStatus byte + const CanonStatTy + const NonStatTy + const SideStatTy