Documentation ¶
Index ¶
- Constants
- Variables
- func NeedChangeEpoch(height uint64, epochInfo *rbft.EpochInfo) bool
- type AccountMeta
- type BatchSimpleInfo
- type CommitEvent
- type Config
- type Logger
- type Meta
- type Option
- func WithApplied(height uint64) Option
- func WithBlockSync(blockSync block_sync.Sync) Option
- func WithConfig(repoRoot string, cfg *repo.ConsensusConfig) Option
- func WithConsensusStorageType(consensusStorageType string) Option
- func WithConsensusType(typ string) Option
- func WithDigest(digest string) Option
- func WithEVMConfig(c repo.EVM) Option
- func WithGenesisDigest(digest string) Option
- func WithGenesisEpochInfo(genesisEpochInfo *rbft.EpochInfo) Option
- func WithGetAccountBalanceFunc(f func(address *types.Address) *big.Int) Option
- func WithGetAccountNonceFunc(f func(address *types.Address) uint64) Option
- func WithGetBlockFunc(f func(height uint64) (*types.Block, error)) Option
- func WithGetChainMetaFunc(f func() *types.ChainMeta) Option
- func WithGetCurrentEpochInfoFromEpochMgrContractFunc(f func() (*rbft.EpochInfo, error)) Option
- func WithGetEpochInfoFromEpochMgrContractFunc(f func(epoch uint64) (*rbft.EpochInfo, error)) Option
- func WithLogger(logger logrus.FieldLogger) Option
- func WithNetwork(net network.Network) Option
- func WithPrivKey(privKey *ecdsa.PrivateKey) Option
- func WithSelfAccountAddress(selfAccountAddress string) Option
- func WithTxPool(tp txpool.TxPool[types.Transaction, *types.Transaction]) Option
- type TxInfo
- type TxResp
- type TxSimpleInfo
- type TxWithResp
- type UncheckedTxEvent
Constants ¶
View Source
const ( LocalTxEvent = iota RemoteTxEvent )
Variables ¶
View Source
var ( ErrorPreCheck = errors.New("precheck failed") ErrorAddTxPool = errors.New("add txpool failed") )
Functions ¶
Types ¶
type AccountMeta ¶
type AccountMeta struct { CommitNonce uint64 PendingNonce uint64 TxCount uint64 Txs []*TxInfo SimpleTxs []*TxSimpleInfo }
func AccountMetaFromTxpool ¶
func AccountMetaFromTxpool(res *txpool.AccountMeta[types.Transaction, *types.Transaction]) *AccountMeta
type BatchSimpleInfo ¶
type BatchSimpleInfo struct { TxCount uint64 Txs []*TxSimpleInfo Timestamp int64 }
type CommitEvent ¶
type CommitEvent struct { Block *types.Block StateUpdatedCheckpoint *consensus.Checkpoint }
type Config ¶
type Config struct { RepoRoot string EVMConfig repo.EVM Config *repo.ConsensusConfig Logger logrus.FieldLogger ConsensusType string ConsensusStorageType string PrivKey *ecdsa.PrivateKey SelfAccountAddress string GenesisEpochInfo *rbft.EpochInfo Network network.Network BlockSync block_sync.Sync TxPool txpool.TxPool[types.Transaction, *types.Transaction] Applied uint64 Digest string GenesisDigest string GetCurrentEpochInfoFromEpochMgrContractFunc func() (*rbft.EpochInfo, error) GetEpochInfoFromEpochMgrContractFunc func(epoch uint64) (*rbft.EpochInfo, error) GetChainMetaFunc func() *types.ChainMeta GetBlockFunc func(height uint64) (*types.Block, error) GetAccountBalance func(address *types.Address) *big.Int GetAccountNonce func(address *types.Address) uint64 }
func GenerateConfig ¶
type Logger ¶
type Logger struct {
logrus.FieldLogger
}
type Meta ¶
type Meta struct { TxCountLimit uint64 TxCount uint64 ReadyTxCount uint64 Batches map[string]*BatchSimpleInfo MissingBatchTxs map[string]map[uint64]string Accounts map[string]*AccountMeta }
func MetaFromTxpool ¶
func MetaFromTxpool(res *txpool.Meta[types.Transaction, *types.Transaction]) *Meta
type Option ¶
type Option func(*Config)
func WithApplied ¶
func WithBlockSync ¶
func WithBlockSync(blockSync block_sync.Sync) Option
func WithConfig ¶
func WithConfig(repoRoot string, cfg *repo.ConsensusConfig) Option
func WithConsensusType ¶
func WithDigest ¶
func WithEVMConfig ¶
func WithGenesisDigest ¶
func WithGenesisEpochInfo ¶
func WithGetAccountNonceFunc ¶
func WithGetChainMetaFunc ¶
func WithLogger ¶
func WithLogger(logger logrus.FieldLogger) Option
func WithNetwork ¶
func WithPrivKey ¶
func WithPrivKey(privKey *ecdsa.PrivateKey) Option
func WithSelfAccountAddress ¶
func WithTxPool ¶
func WithTxPool(tp txpool.TxPool[types.Transaction, *types.Transaction]) Option
type TxInfo ¶
type TxInfo struct { Tx *types.Transaction Local bool LifeTime int64 ArrivedTime int64 }
type TxSimpleInfo ¶
type TxWithResp ¶
type TxWithResp struct { Tx *types.Transaction CheckCh chan *TxResp PoolCh chan *TxResp }
type UncheckedTxEvent ¶
UncheckedTxEvent represents misc event sent by local modules
Click to show internal directories.
Click to hide internal directories.