Versions in this module Expand all Collapse all v1 v1.0.1 Jun 12, 2023 Changes in this version + const ErrDecode + const ErrEmptyMessage + const ErrExtraStatusMsg + const ErrGenesisMismatch + const ErrInvalidMsgCode + const ErrMsgTooLarge + const ErrNetworkIDMismatch + const ErrNoStatusMsg + const ErrProtocolVersionMismatch + const ErrSuspendedPeer + const EventsMsg + const EventsStreamResponse + const EvmTxsMsg + const GetEventsMsg + const GetEvmTxsMsg + const HandshakeMsg + const NewEventIDsMsg + const NewEvmTxHashesMsg + const ProgressMsg + const ProtocolName + const ProtocolVersion + const RequestEventsStream + var ProtocolVersions = []uint + func MakeProtocols(svc *Service, backend *ProtocolManager, network uint64, disc enode.Iterator) []p2p.Protocol + func NewGasPowerContext(s *Store, validators *pos.Validators, epoch idx.Epoch, ...) *gaspowercheck.ValidationContext + func NewPeer(version int, p *p2p.Peer, rw p2p.MsgReadWriter, cfg PeerCacheConfig) *peer + func SplitTransactions(txs types.Transactions, fn func(types.Transactions)) + func StartENRUpdater(svc *Service, ln *enode.LocalNode) + type BlockEpochState struct + BlockState *blockproc.BlockState + EpochState *blockproc.EpochState + type BlockProc struct + EVMModule blockproc.EVM + EventsModule blockproc.ConfirmedEventsModule + GenesisTxTransactor blockproc.TxTransactor + PostTxTransactor blockproc.TxTransactor + PreTxTransactor blockproc.TxTransactor + SealerModule blockproc.SealerModule + TxListenerModule blockproc.TxListenerModule + func DefaultBlockProc(g metatechchain.Genesis) BlockProc + type Config struct + AllowUnprotectedTxs bool + Emitter emitter.Config + ExtRPCEnabled bool + FilterAPI filters.Config + GPO gasprice.Config + HeavyCheck heavycheck.Config + Protocol ProtocolConfig + RPCGasCap uint64 + RPCLogsBloom bool + RPCTxFeeCap float64 + TxIndex bool + TxPool evmcore.TxPoolConfig + VersionWatcher verwatcher.Config + func DefaultConfig(scale cachescale.Func) Config + func FakeConfig(num int, scale cachescale.Func) Config + func (c *Config) Validate() error + type Enr struct + ForkID forkid.ID + Rest []rlp.RawValue + func (e Enr) ENRKey() string + type EthAPIBackend struct + func (b *EthAPIBackend) AccountManager() *accounts.Manager + func (b *EthAPIBackend) BlockByHash(ctx context.Context, h common.Hash) (*evmcore.EvmBlock, error) + func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*evmcore.EvmBlock, error) + func (b *EthAPIBackend) CalcLogsBloom() bool + func (b *EthAPIBackend) ChainConfig() *params.ChainConfig + func (b *EthAPIBackend) ChainDb() ethdb.Database + func (b *EthAPIBackend) CurrentBlock() *evmcore.EvmBlock + func (b *EthAPIBackend) CurrentEpoch(ctx context.Context) idx.Epoch + func (b *EthAPIBackend) EvmLogIndex() *topicsdb.Index + func (b *EthAPIBackend) ExtRPCEnabled() bool + func (b *EthAPIBackend) ForEachEpochEvent(ctx context.Context, epoch rpc.BlockNumber, ...) error + func (b *EthAPIBackend) GetDelegation(ctx context.Context, id sfcapi.DelegationID) (*sfcapi.SfcDelegation, error) + func (b *EthAPIBackend) GetDelegationClaimedRewards(ctx context.Context, id sfcapi.DelegationID) (*big.Int, error) + func (b *EthAPIBackend) GetDelegationsByAddress(ctx context.Context, addr common.Address) ([]sfcapi.SfcDelegationAndID, error) + func (b *EthAPIBackend) GetDelegationsOf(ctx context.Context, stakerID idx.ValidatorID) ([]sfcapi.SfcDelegationAndID, error) + func (b *EthAPIBackend) GetDowntime(ctx context.Context, stakerID idx.ValidatorID) (idx.Block, inter.Timestamp, error) + func (b *EthAPIBackend) GetEVM(ctx context.Context, msg evmcore.Message, state *state.StateDB, ...) (*vm.EVM, func() error, error) + func (b *EthAPIBackend) GetEvent(ctx context.Context, shortEventID string) (*inter.Event, error) + func (b *EthAPIBackend) GetEventPayload(ctx context.Context, shortEventID string) (*inter.EventPayload, error) + func (b *EthAPIBackend) GetFullEventID(shortEventID string) (hash.Event, error) + func (b *EthAPIBackend) GetHeads(ctx context.Context, epoch rpc.BlockNumber) (heads hash.Events, err error) + func (b *EthAPIBackend) GetLogs(ctx context.Context, block common.Hash) ([][]*types.Log, error) + func (b *EthAPIBackend) GetOriginatedFee(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error) + func (b *EthAPIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) + func (b *EthAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction + func (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, error) + func (b *EthAPIBackend) GetReceipts(ctx context.Context, block common.Hash) (types.Receipts, error) + func (b *EthAPIBackend) GetReceiptsByNumber(ctx context.Context, number rpc.BlockNumber) (types.Receipts, error) + func (b *EthAPIBackend) GetRewardWeights(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, *big.Int, error) + func (b *EthAPIBackend) GetStaker(ctx context.Context, stakerID idx.ValidatorID) (*sfcapi.SfcStaker, error) + func (b *EthAPIBackend) GetStakerClaimedRewards(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error) + func (b *EthAPIBackend) GetStakerDelegationsClaimedRewards(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error) + func (b *EthAPIBackend) GetStakerID(ctx context.Context, addr common.Address) (idx.ValidatorID, error) + func (b *EthAPIBackend) GetStakerPoI(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error) + func (b *EthAPIBackend) GetStakers(ctx context.Context) ([]sfcapi.SfcStakerAndID, error) + func (b *EthAPIBackend) GetTd(_ common.Hash) *big.Int + func (b *EthAPIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, uint64, uint64, error) + func (b *EthAPIBackend) GetUptime(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error) + func (b *EthAPIBackend) GetValidators(ctx context.Context) *pos.Validators + func (b *EthAPIBackend) HeaderByHash(ctx context.Context, h common.Hash) (*evmcore.EvmHeader, error) + func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*evmcore.EvmHeader, error) + func (b *EthAPIBackend) MaxGasLimit() uint64 + func (b *EthAPIBackend) MinGasPrice() *big.Int + func (b *EthAPIBackend) Progress() ethapi.PeerProgress + func (b *EthAPIBackend) RPCGasCap() uint64 + func (b *EthAPIBackend) RPCTxFeeCap() float64 + func (b *EthAPIBackend) SealedEpochTiming(ctx context.Context) (start inter.Timestamp, end inter.Timestamp) + func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error + func (b *EthAPIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *evmcore.EvmHeader, error) + func (b *EthAPIBackend) Stats() (pending int, queued int) + func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) notify.Subscription + func (b *EthAPIBackend) SubscribeNewBlockEvent(ch chan<- evmcore.ChainHeadNotify) notify.Subscription + func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) notify.Subscription + func (b *EthAPIBackend) SubscribeNewTxsNotify(ch chan<- evmcore.NewTxsNotify) notify.Subscription + func (b *EthAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, error) + func (b *EthAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) + func (b *EthAPIBackend) UnprotectedAllowed() bool + type EvmStateReader struct + func (r *EvmStateReader) Config() *params.ChainConfig + func (r *EvmStateReader) CurrentBlock() *evmcore.EvmBlock + func (r *EvmStateReader) CurrentHeader() *evmcore.EvmHeader + func (r *EvmStateReader) GetBlock(h common.Hash, n uint64) *evmcore.EvmBlock + func (r *EvmStateReader) GetHeader(h common.Hash, n uint64) *evmcore.EvmHeader + func (r *EvmStateReader) MaxGasLimit() uint64 + func (r *EvmStateReader) MinGasPrice() *big.Int + func (r *EvmStateReader) RecommendedMinGasPrice() *big.Int + func (r *EvmStateReader) StateAt(root common.Hash) (*state.StateDB, error) + func (r *EvmStateReader) TxExists(txid common.Hash) bool + type ExtendedTxPosition struct + EventCreator idx.ValidatorID + type GPOBackend struct + func (b *GPOBackend) GetLatestBlockIndex() idx.Block + func (b *GPOBackend) GetPendingRules() metatechchain.Rules + func (b *GPOBackend) GetRules() metatechchain.Rules + func (b *GPOBackend) TotalGasPowerLeft() uint64 + type GasPowerCheckReader struct + Ctx atomic.Value + func (r *GasPowerCheckReader) GetValidationContext() *gaspowercheck.ValidationContext + type HeavyCheckReader struct + Addrs atomic.Value + func (r *HeavyCheckReader) GetEpochPubKeys() (map[idx.ValidatorID]validatorpk.PubKey, idx.Epoch) + type NodeInfo struct + Epoch idx.Epoch + Genesis common.Hash + Network uint64 + NumOfBlocks idx.Block + type PeerCacheConfig struct + MaxKnownEvents int + MaxKnownTxs int + MaxQueuedItems idx.Event + MaxQueuedSize uint64 + func DefaultPeerCacheConfig(scale cachescale.Func) PeerCacheConfig + type PeerInfo struct + Epoch idx.Epoch + NumOfBlocks idx.Block + Version int + type PeerProgress struct + Epoch idx.Epoch + HighestLamport idx.Lamport + LastBlockAtropos hash.Event + LastBlockIdx idx.Block + func (a *PeerProgress) Less(b PeerProgress) bool + type ProtocolConfig struct + DagFetcher itemsfetcher.Config + EventsSemaphoreLimit dag.Metric + LatencyImportance int + MaxInitialTxHashesSend int + MaxRandomTxHashesSend int + MsgsSemaphoreLimit dag.Metric + MsgsSemaphoreTimeout time.Duration + PeerCache PeerCacheConfig + Processor dagprocessor.Config + ProgressBroadcastPeriod time.Duration + RandomTxHashesSendPeriod time.Duration + StreamLeecher streamleecher.Config + StreamSeeder streamseeder.Config + ThroughputImportance int + TxFetcher itemsfetcher.Config + type ProtocolManager struct + func (pm *ProtocolManager) BroadcastEvent(event *inter.EventPayload, passed time.Duration) int + func (pm *ProtocolManager) BroadcastTxs(txs types.Transactions) + func (pm *ProtocolManager) NodeInfo() *NodeInfo + func (pm *ProtocolManager) Start(maxPeers int) + func (pm *ProtocolManager) Stop() + type PublicEthereumAPI struct + func NewPublicEthereumAPI(s *Service) *PublicEthereumAPI + func (api *PublicEthereumAPI) ChainId() hexutil.Uint64 + func (api *PublicEthereumAPI) Coinbase() (common.Address, error) + func (api *PublicEthereumAPI) Etherbase() (common.Address, error) + func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64 + type Service struct + EthAPI *EthAPIBackend + Name string + func NewService(stack *node.Node, config Config, store *Store, signer valkeystore.SignerI, ...) (*Service, error) + func (s *Service) APIs() []rpc.API + func (s *Service) AccountManager() *accounts.Manager + func (s *Service) DagProcessor() *dagprocessor.Processor + func (s *Service) GetConsensusCallbacks() meta.ConsensusCallbacks + func (s *Service) GetEvmStateReader() *EvmStateReader + func (s *Service) Protocols() []p2p.Protocol + func (s *Service) Start() error + func (s *Service) Stop() error + func (s *Service) WaitBlockEnd() + type ServiceFeed struct + func (f *ServiceFeed) SubscribeNewBlock(ch chan<- evmcore.ChainHeadNotify) notify.Subscription + func (f *ServiceFeed) SubscribeNewEmitted(ch chan<- *inter.EventPayload) notify.Subscription + func (f *ServiceFeed) SubscribeNewEpoch(ch chan<- idx.Epoch) notify.Subscription + func (f *ServiceFeed) SubscribeNewLogs(ch chan<- []*types.Log) notify.Subscription + func (f *ServiceFeed) SubscribeNewTxs(ch chan<- core.NewTxsEvent) notify.Subscription + type Store struct + func NewMemStore() *Store + func NewStore(dbs kvdb.FlushableDBProducer, cfg StoreConfig) *Store + func (s *Store) ApplyGenesis(blockProc BlockProc, g metatechchain.Genesis) (genesisHash hash.Hash, err error) + func (s *Store) Close() + func (s *Store) Commit() error + func (s *Store) DelEvent(id hash.Event) + func (s *Store) EvmStore() *evmstore.Store + func (s *Store) FindEventHashes(epoch idx.Epoch, lamport idx.Lamport, hashPrefix []byte) hash.Events + func (s *Store) FlushBlockEpochState() + func (s *Store) FlushHighestLamport() + func (s *Store) ForEachBlock(fn func(index idx.Block, block *inter.Block)) + func (s *Store) ForEachEpochEvent(epoch idx.Epoch, onEvent func(event *inter.EventPayload) bool) + func (s *Store) ForEachEvent(start idx.Epoch, onEvent func(event *inter.EventPayload) bool) + func (s *Store) ForEachEventRLP(start []byte, onEvent func(key hash.Event, event rlp.RawValue) bool) + func (s *Store) GetBlock(n idx.Block) *inter.Block + func (s *Store) GetBlockEpochState() (blockproc.BlockState, blockproc.EpochState) + func (s *Store) GetBlockIndex(id hash.Event) *idx.Block + func (s *Store) GetBlockState() blockproc.BlockState + func (s *Store) GetEpoch() idx.Epoch + func (s *Store) GetEpochRules() (metatechchain.Rules, idx.Epoch) + func (s *Store) GetEpochState() blockproc.EpochState + func (s *Store) GetEpochValidators() (*pos.Validators, idx.Epoch) + func (s *Store) GetEvent(id hash.Event) *inter.Event + func (s *Store) GetEventPayload(id hash.Event) *inter.EventPayload + func (s *Store) GetEventPayloadRLP(id hash.Event) rlp.RawValue + func (s *Store) GetGenesisBlockIndex() *idx.Block + func (s *Store) GetGenesisHash() *hash.Hash + func (s *Store) GetGenesisTime() inter.Timestamp + func (s *Store) GetHeads(epoch idx.Epoch) *concurrent.EventsSet + func (s *Store) GetHeadsSlice(epoch idx.Epoch) hash.Events + func (s *Store) GetHighestLamport() idx.Lamport + func (s *Store) GetLastEvent(epoch idx.Epoch, vid idx.ValidatorID) *hash.Event + func (s *Store) GetLastEvents(epoch idx.Epoch) *concurrent.ValidatorEventsSet + func (s *Store) GetLatestBlockIndex() idx.Block + func (s *Store) GetRules() metatechchain.Rules + func (s *Store) GetValidators() *pos.Validators + func (s *Store) HasEvent(h hash.Event) bool + func (s *Store) Init() error + func (s *Store) IsCommitNeeded(epochSealing bool) bool + func (s *Store) SetBlock(n idx.Block, b *inter.Block) + func (s *Store) SetBlockEpochState(bs blockproc.BlockState, es blockproc.EpochState) + func (s *Store) SetBlockIndex(id hash.Event, n idx.Block) + func (s *Store) SetEvent(e *inter.EventPayload) + func (s *Store) SetGenesisBlockIndex(n idx.Block) + func (s *Store) SetGenesisHash(val hash.Hash) + func (s *Store) SetHeads(epoch idx.Epoch, ids *concurrent.EventsSet) + func (s *Store) SetHighestLamport(lamport idx.Lamport) + func (s *Store) SetLastEvents(epoch idx.Epoch, ids *concurrent.ValidatorEventsSet) + type StoreCacheConfig struct + BlocksNum int + BlocksSize uint + EventsNum int + EventsSize uint + type StoreConfig struct + Cache StoreCacheConfig + EVM evmstore.StoreConfig + MaxNonFlushedPeriod time.Duration + MaxNonFlushedSize int + func DefaultStoreConfig(scale cachescale.Func) StoreConfig + func LiteStoreConfig() StoreConfig + type ValidatorsPubKeys struct + Epoch idx.Epoch + PubKeys map[idx.ValidatorID]validatorpk.PubKey + func NewEpochPubKeys(s *Store, epoch idx.Epoch) *ValidatorsPubKeys