Documentation ¶
Index ¶
- Constants
- Variables
- 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
- type BlockProc
- type Config
- type Enr
- type EthAPIBackend
- 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
- 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
- type GPOBackend
- type GasPowerCheckReader
- type HeavyCheckReader
- type NodeInfo
- type PeerCacheConfig
- type PeerInfo
- type PeerProgress
- type ProtocolConfig
- type ProtocolManager
- type PublicEthereumAPI
- type Service
- func (s *Service) APIs() []rpc.API
- func (s *Service) AccountManager() *accounts.Manager
- func (s *Service) DagProcessor() *dagprocessor.Processor
- func (s *Service) GetConsensusCallbacks() mugambobft.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
- 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
- func (s *Store) ApplyGenesis(blockProc BlockProc, g mugambo.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() (mugambo.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() mugambo.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
- type StoreConfig
- type ValidatorsPubKeys
Constants ¶
const ( HandshakeMsg = 0 // Signals about the current synchronization status. // The current peer's status is used during packs downloading, // and to estimate may peer be interested in the new event or not // (based on peer's epoch). ProgressMsg = 1 EvmTxsMsg = 2 NewEvmTxHashesMsg = 3 GetEvmTxsMsg = 4 // Non-aggressive events propagation. Signals about newly-connected // batch of events, sending only their IDs. NewEventIDsMsg = 5 // Request the batch of events by IDs GetEventsMsg = 6 // Contains the batch of events. // May be an answer to GetEventsMsg, or be sent during aggressive events propagation. EventsMsg = 7 // Request a range of events by a selector RequestEventsStream = 8 // Contains the requested events by RequestEventsStream EventsStreamResponse = 9 )
protocol message codes
const ( ErrMsgTooLarge = iota ErrDecode ErrInvalidMsgCode ErrProtocolVersionMismatch ErrNetworkIDMismatch ErrGenesisMismatch ErrNoStatusMsg ErrExtraStatusMsg ErrSuspendedPeer ErrEmptyMessage = 0xf00 )
const ProtocolName = "mugambo"
ProtocolName is the official short name of the protocol used during capability negotiation.
const (
ProtocolVersion = 62 // derived from eth62
)
Constants to match up protocol versions and messages
Variables ¶
var ProtocolVersions = []uint{ProtocolVersion}
ProtocolVersions are the supported versions of the protocol (first is primary).
Functions ¶
func MakeProtocols ¶
func MakeProtocols(svc *Service, backend *ProtocolManager, network uint64, disc enode.Iterator) []p2p.Protocol
MakeProtocols constructs the P2P protocol definitions for `mugambo`.
func NewGasPowerContext ¶
func NewGasPowerContext(s *Store, validators *pos.Validators, epoch idx.Epoch, cfg mugambo.EconomyRules) *gaspowercheck.ValidationContext
NewGasPowerContext reads current validation context for gaspowercheck
func NewPeer ¶
func NewPeer(version int, p *p2p.Peer, rw p2p.MsgReadWriter, cfg PeerCacheConfig) *peer
func SplitTransactions ¶
func SplitTransactions(txs types.Transactions, fn func(types.Transactions))
func StartENRUpdater ¶
StartENRUpdater starts the `mugambo` ENR updater loop, which listens for chain head events and updates the requested node record whenever a fork is passed.
Types ¶
type BlockEpochState ¶
type BlockEpochState struct { BlockState *blockproc.BlockState EpochState *blockproc.EpochState }
type BlockProc ¶
type BlockProc struct { SealerModule blockproc.SealerModule TxListenerModule blockproc.TxListenerModule GenesisTxTransactor blockproc.TxTransactor PreTxTransactor blockproc.TxTransactor PostTxTransactor blockproc.TxTransactor EventsModule blockproc.ConfirmedEventsModule EVMModule blockproc.EVM }
func DefaultBlockProc ¶
type Config ¶
type Config struct { Emitter emitter.Config TxPool evmcore.TxPoolConfig FilterAPI filters.Config TxIndex bool // Whether to enable indexing transactions and receipts or not // Protocol options Protocol ProtocolConfig HeavyCheck heavycheck.Config // Gas Price Oracle options GPO gasprice.Config VersionWatcher verwatcher.Config // RPCGasCap is the global gas cap for eth-call variants. RPCGasCap uint64 `toml:",omitempty"` // RPCTxFeeCap is the global transaction fee(price * gaslimit) cap for // send-transction variants. The unit is ether. RPCTxFeeCap float64 `toml:",omitempty"` // allows only for EIP155 transactions. AllowUnprotectedTxs bool ExtRPCEnabled bool RPCLogsBloom bool }
Config for the gossip service.
func DefaultConfig ¶
func DefaultConfig(scale cachescale.Func) Config
DefaultConfig returns the default configurations for the gossip service.
func FakeConfig ¶
func FakeConfig(num int, scale cachescale.Func) Config
FakeConfig returns the default configurations for the gossip service in fakenet.
type Enr ¶
type Enr struct { ForkID forkid.ID // Ignore additional fields (for forward compatibility). Rest []rlp.RawValue `rlp:"tail"` }
Enr is ENR entry which advertises eth protocol on the discovery network.
type EthAPIBackend ¶
type EthAPIBackend struct {
// contains filtered or unexported fields
}
EthAPIBackend implements ethapi.Backend.
func (*EthAPIBackend) AccountManager ¶
func (b *EthAPIBackend) AccountManager() *accounts.Manager
func (*EthAPIBackend) BlockByHash ¶
func (*EthAPIBackend) BlockByNumber ¶
func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*evmcore.EvmBlock, error)
BlockByNumber returns block by its number.
func (*EthAPIBackend) CalcLogsBloom ¶
func (b *EthAPIBackend) CalcLogsBloom() bool
func (*EthAPIBackend) ChainConfig ¶
func (b *EthAPIBackend) ChainConfig() *params.ChainConfig
ChainConfig returns the active chain configuration.
func (*EthAPIBackend) ChainDb ¶
func (b *EthAPIBackend) ChainDb() ethdb.Database
func (*EthAPIBackend) CurrentBlock ¶
func (b *EthAPIBackend) CurrentBlock() *evmcore.EvmBlock
func (*EthAPIBackend) CurrentEpoch ¶
func (b *EthAPIBackend) CurrentEpoch(ctx context.Context) idx.Epoch
CurrentEpoch returns current epoch number.
func (*EthAPIBackend) EvmLogIndex ¶
func (b *EthAPIBackend) EvmLogIndex() *topicsdb.Index
func (*EthAPIBackend) ExtRPCEnabled ¶
func (b *EthAPIBackend) ExtRPCEnabled() bool
func (*EthAPIBackend) ForEachEpochEvent ¶
func (b *EthAPIBackend) ForEachEpochEvent(ctx context.Context, epoch rpc.BlockNumber, onEvent func(event *inter.EventPayload) bool) error
ForEachEpochEvent iterates all the events which are observed by head, and accepted by a filter. filter CANNOT called twice for the same event.
func (*EthAPIBackend) GetDelegation ¶
func (b *EthAPIBackend) GetDelegation(ctx context.Context, id sfcapi.DelegationID) (*sfcapi.SfcDelegation, error)
func (*EthAPIBackend) GetDelegationClaimedRewards ¶
func (b *EthAPIBackend) GetDelegationClaimedRewards(ctx context.Context, id sfcapi.DelegationID) (*big.Int, error)
func (*EthAPIBackend) GetDelegationsByAddress ¶
func (b *EthAPIBackend) GetDelegationsByAddress(ctx context.Context, addr common.Address) ([]sfcapi.SfcDelegationAndID, error)
func (*EthAPIBackend) GetDelegationsOf ¶
func (b *EthAPIBackend) GetDelegationsOf(ctx context.Context, stakerID idx.ValidatorID) ([]sfcapi.SfcDelegationAndID, error)
func (*EthAPIBackend) GetDowntime ¶
func (b *EthAPIBackend) GetDowntime(ctx context.Context, stakerID idx.ValidatorID) (idx.Block, inter.Timestamp, error)
func (*EthAPIBackend) GetEventPayload ¶
func (b *EthAPIBackend) GetEventPayload(ctx context.Context, shortEventID string) (*inter.EventPayload, error)
GetEventPayload returns MugamboBFT event by hash or short ID.
func (*EthAPIBackend) GetFullEventID ¶
func (b *EthAPIBackend) GetFullEventID(shortEventID string) (hash.Event, error)
GetFullEventID "converts" ShortID to full event's hash, by searching in events DB.
func (*EthAPIBackend) GetHeads ¶
func (b *EthAPIBackend) GetHeads(ctx context.Context, epoch rpc.BlockNumber) (heads hash.Events, err error)
GetHeads returns IDs of all the epoch events with no descendants. * When epoch is -2 the heads for latest epoch are returned. * When epoch is -1 the heads for latest sealed epoch are returned.
func (*EthAPIBackend) GetOriginatedFee ¶
func (b *EthAPIBackend) GetOriginatedFee(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error)
func (*EthAPIBackend) GetPoolNonce ¶
func (*EthAPIBackend) GetPoolTransaction ¶
func (b *EthAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction
func (*EthAPIBackend) GetPoolTransactions ¶
func (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, error)
func (*EthAPIBackend) GetReceipts ¶
GetReceipts retrieves the receipts for all transactions in a given block.
func (*EthAPIBackend) GetReceiptsByNumber ¶
func (b *EthAPIBackend) GetReceiptsByNumber(ctx context.Context, number rpc.BlockNumber) (types.Receipts, error)
GetReceiptsByNumber returns receipts by block number.
func (*EthAPIBackend) GetRewardWeights ¶
func (b *EthAPIBackend) GetRewardWeights(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, *big.Int, error)
func (*EthAPIBackend) GetStaker ¶
func (b *EthAPIBackend) GetStaker(ctx context.Context, stakerID idx.ValidatorID) (*sfcapi.SfcStaker, error)
func (*EthAPIBackend) GetStakerClaimedRewards ¶
func (b *EthAPIBackend) GetStakerClaimedRewards(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error)
func (*EthAPIBackend) GetStakerDelegationsClaimedRewards ¶
func (b *EthAPIBackend) GetStakerDelegationsClaimedRewards(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error)
func (*EthAPIBackend) GetStakerID ¶
func (b *EthAPIBackend) GetStakerID(ctx context.Context, addr common.Address) (idx.ValidatorID, error)
func (*EthAPIBackend) GetStakerPoI ¶
func (b *EthAPIBackend) GetStakerPoI(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error)
func (*EthAPIBackend) GetStakers ¶
func (b *EthAPIBackend) GetStakers(ctx context.Context) ([]sfcapi.SfcStakerAndID, error)
func (*EthAPIBackend) GetTransaction ¶
func (b *EthAPIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, uint64, uint64, error)
func (*EthAPIBackend) GetUptime ¶
func (b *EthAPIBackend) GetUptime(ctx context.Context, stakerID idx.ValidatorID) (*big.Int, error)
func (*EthAPIBackend) GetValidators ¶
func (b *EthAPIBackend) GetValidators(ctx context.Context) *pos.Validators
func (*EthAPIBackend) HeaderByHash ¶
func (b *EthAPIBackend) HeaderByHash(ctx context.Context, h common.Hash) (*evmcore.EvmHeader, error)
HeaderByHash returns evm header by its (atropos) hash.
func (*EthAPIBackend) HeaderByNumber ¶
func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*evmcore.EvmHeader, error)
func (*EthAPIBackend) MaxGasLimit ¶
func (b *EthAPIBackend) MaxGasLimit() uint64
func (*EthAPIBackend) MinGasPrice ¶
func (b *EthAPIBackend) MinGasPrice() *big.Int
func (*EthAPIBackend) Progress ¶
func (b *EthAPIBackend) Progress() ethapi.PeerProgress
Progress returns current synchronization status of this node
func (*EthAPIBackend) RPCGasCap ¶
func (b *EthAPIBackend) RPCGasCap() uint64
func (*EthAPIBackend) RPCTxFeeCap ¶
func (b *EthAPIBackend) RPCTxFeeCap() float64
func (*EthAPIBackend) SealedEpochTiming ¶
func (*EthAPIBackend) SendTx ¶
func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error
func (*EthAPIBackend) StateAndHeaderByNumberOrHash ¶
func (b *EthAPIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *evmcore.EvmHeader, error)
func (*EthAPIBackend) Stats ¶
func (b *EthAPIBackend) Stats() (pending int, queued int)
func (*EthAPIBackend) SubscribeLogsEvent ¶
func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) notify.Subscription
func (*EthAPIBackend) SubscribeNewBlockEvent ¶
func (b *EthAPIBackend) SubscribeNewBlockEvent(ch chan<- evmcore.ChainHeadNotify) notify.Subscription
func (*EthAPIBackend) SubscribeNewTxsEvent ¶
func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) notify.Subscription
func (*EthAPIBackend) SubscribeNewTxsNotify ¶
func (b *EthAPIBackend) SubscribeNewTxsNotify(ch chan<- evmcore.NewTxsNotify) notify.Subscription
func (*EthAPIBackend) SuggestPrice ¶
func (*EthAPIBackend) TxPoolContent ¶
func (b *EthAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)
func (*EthAPIBackend) UnprotectedAllowed ¶
func (b *EthAPIBackend) UnprotectedAllowed() bool
type EvmStateReader ¶
type EvmStateReader struct { *ServiceFeed // contains filtered or unexported fields }
func (*EvmStateReader) Config ¶
func (r *EvmStateReader) Config() *params.ChainConfig
func (*EvmStateReader) CurrentBlock ¶
func (r *EvmStateReader) CurrentBlock() *evmcore.EvmBlock
func (*EvmStateReader) CurrentHeader ¶
func (r *EvmStateReader) CurrentHeader() *evmcore.EvmHeader
func (*EvmStateReader) MaxGasLimit ¶
func (r *EvmStateReader) MaxGasLimit() uint64
func (*EvmStateReader) MinGasPrice ¶
func (r *EvmStateReader) MinGasPrice() *big.Int
MinGasPrice returns current hard lower bound for gas price
func (*EvmStateReader) RecommendedMinGasPrice ¶
func (r *EvmStateReader) RecommendedMinGasPrice() *big.Int
RecommendedMinGasPrice returns current soft lower bound for gas price
type ExtendedTxPosition ¶
type ExtendedTxPosition struct { evmstore.TxPosition EventCreator idx.ValidatorID }
type GPOBackend ¶
type GPOBackend struct {
// contains filtered or unexported fields
}
func (*GPOBackend) GetLatestBlockIndex ¶
func (b *GPOBackend) GetLatestBlockIndex() idx.Block
func (*GPOBackend) GetPendingRules ¶
func (b *GPOBackend) GetPendingRules() mugambo.Rules
func (*GPOBackend) GetRules ¶
func (b *GPOBackend) GetRules() mugambo.Rules
func (*GPOBackend) TotalGasPowerLeft ¶
func (b *GPOBackend) TotalGasPowerLeft() uint64
TotalGasPowerLeft returns a total amount of obtained gas power by the validators, according to the latest events from each validator
type GasPowerCheckReader ¶
GasPowerCheckReader is a helper to run gas power check
func (*GasPowerCheckReader) GetValidationContext ¶
func (r *GasPowerCheckReader) GetValidationContext() *gaspowercheck.ValidationContext
GetValidationContext returns current validation context for gaspowercheck
type HeavyCheckReader ¶
HeavyCheckReader is a helper to run heavy power checks
func (*HeavyCheckReader) GetEpochPubKeys ¶
func (r *HeavyCheckReader) GetEpochPubKeys() (map[idx.ValidatorID]validatorpk.PubKey, idx.Epoch)
GetEpochPubKeys is safe for concurrent use
type NodeInfo ¶
type NodeInfo struct { Network uint64 `json:"network"` // network ID Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis object Epoch idx.Epoch `json:"epoch"` NumOfBlocks idx.Block `json:"blocks"` }
NodeInfo represents a short summary of the sub-protocol metadata known about the host peer.
type PeerCacheConfig ¶
type PeerCacheConfig struct { MaxKnownTxs int // Maximum transactions hashes to keep in the known list (prevent DOS) MaxKnownEvents int // Maximum event hashes to keep in the known list (prevent DOS) // MaxQueuedItems is the maximum number of items to queue up before // dropping broadcasts. This is a sensitive number as a transaction list might // contain a single transaction, or thousands. MaxQueuedItems idx.Event MaxQueuedSize uint64 }
func DefaultPeerCacheConfig ¶
func DefaultPeerCacheConfig(scale cachescale.Func) PeerCacheConfig
type PeerInfo ¶
type PeerInfo struct { Version int `json:"version"` // protocol version negotiated Epoch idx.Epoch `json:"epoch"` NumOfBlocks idx.Block `json:"blocks"` }
PeerInfo represents a short summary of the sub-protocol metadata known about a connected peer.
type PeerProgress ¶
type PeerProgress struct { Epoch idx.Epoch LastBlockIdx idx.Block LastBlockAtropos hash.Event // Currently unused HighestLamport idx.Lamport }
PeerProgress is synchronization status of a peer
func (*PeerProgress) Less ¶
func (a *PeerProgress) Less(b PeerProgress) bool
type ProtocolConfig ¶
type ProtocolConfig struct { LatencyImportance int ThroughputImportance int EventsSemaphoreLimit dag.Metric MsgsSemaphoreLimit dag.Metric MsgsSemaphoreTimeout time.Duration ProgressBroadcastPeriod time.Duration Processor dagprocessor.Config DagFetcher itemsfetcher.Config TxFetcher itemsfetcher.Config StreamLeecher streamleecher.Config StreamSeeder streamseeder.Config MaxInitialTxHashesSend int MaxRandomTxHashesSend int RandomTxHashesSendPeriod time.Duration PeerCache PeerCacheConfig }
ProtocolConfig is config for p2p protocol
type ProtocolManager ¶
func (*ProtocolManager) BroadcastEvent ¶
func (pm *ProtocolManager) BroadcastEvent(event *inter.EventPayload, passed time.Duration) int
BroadcastEvent will either propagate a event to a subset of it's peers, or will only announce it's availability (depending what's requested).
func (*ProtocolManager) BroadcastTxs ¶
func (pm *ProtocolManager) BroadcastTxs(txs types.Transactions)
BroadcastTxs will propagate a batch of transactions to all peers which are not known to already have the given transaction.
func (*ProtocolManager) NodeInfo ¶
func (pm *ProtocolManager) NodeInfo() *NodeInfo
NodeInfo retrieves some protocol metadata about the running host node.
func (*ProtocolManager) Start ¶
func (pm *ProtocolManager) Start(maxPeers int)
func (*ProtocolManager) Stop ¶
func (pm *ProtocolManager) Stop()
type PublicEthereumAPI ¶
type PublicEthereumAPI struct {
// contains filtered or unexported fields
}
PublicEthereumAPI provides an API to access Ethereum-like information. It is a github.com/ethereum/go-ethereum/eth simulation for console.
func NewPublicEthereumAPI ¶
func NewPublicEthereumAPI(s *Service) *PublicEthereumAPI
NewPublicEthereumAPI creates a new Ethereum protocol API for gossip.
func (*PublicEthereumAPI) ChainId ¶
func (api *PublicEthereumAPI) ChainId() hexutil.Uint64
ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
func (*PublicEthereumAPI) Coinbase ¶
func (api *PublicEthereumAPI) Coinbase() (common.Address, error)
Coinbase returns the zero address for web3 compatibility
func (*PublicEthereumAPI) Etherbase ¶
func (api *PublicEthereumAPI) Etherbase() (common.Address, error)
Etherbase returns the zero address for web3 compatibility
func (*PublicEthereumAPI) Hashrate ¶
func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64
Hashrate returns the zero POW hashrate for web3 compatibility
type Service ¶
type Service struct { Name string EthAPI *EthAPIBackend logger.Instance // contains filtered or unexported fields }
Service implements go-ethereum/node.Service interface.
func NewService ¶
func (*Service) AccountManager ¶
AccountManager return node's account manager
func (*Service) DagProcessor ¶
func (s *Service) DagProcessor() *dagprocessor.Processor
func (*Service) GetConsensusCallbacks ¶
func (s *Service) GetConsensusCallbacks() mugambobft.ConsensusCallbacks
GetConsensusCallbacks returns single (for Service) callback instance.
func (*Service) GetEvmStateReader ¶
func (s *Service) GetEvmStateReader() *EvmStateReader
func (*Service) WaitBlockEnd ¶
func (s *Service) WaitBlockEnd()
WaitBlockEnd waits until parallel block processing is complete (if any)
type ServiceFeed ¶
type ServiceFeed struct {
// contains filtered or unexported fields
}
func (*ServiceFeed) SubscribeNewBlock ¶
func (f *ServiceFeed) SubscribeNewBlock(ch chan<- evmcore.ChainHeadNotify) notify.Subscription
func (*ServiceFeed) SubscribeNewEmitted ¶
func (f *ServiceFeed) SubscribeNewEmitted(ch chan<- *inter.EventPayload) notify.Subscription
func (*ServiceFeed) SubscribeNewEpoch ¶
func (f *ServiceFeed) SubscribeNewEpoch(ch chan<- idx.Epoch) notify.Subscription
func (*ServiceFeed) SubscribeNewLogs ¶
func (f *ServiceFeed) SubscribeNewLogs(ch chan<- []*types.Log) notify.Subscription
func (*ServiceFeed) SubscribeNewTxs ¶
func (f *ServiceFeed) SubscribeNewTxs(ch chan<- core.NewTxsEvent) notify.Subscription
type Store ¶
Store is a node persistent storage working over physical key-value database.
func NewStore ¶
func NewStore(dbs kvdb.FlushableDBProducer, cfg StoreConfig) *Store
NewStore creates store over key-value db.
func (*Store) ApplyGenesis ¶
func (s *Store) ApplyGenesis(blockProc BlockProc, g mugambo.Genesis) (genesisHash hash.Hash, err error)
ApplyGenesis writes initial state.
func (*Store) FindEventHashes ¶
func (*Store) FlushBlockEpochState ¶
func (s *Store) FlushBlockEpochState()
FlushBlockEpochState stores the latest epoch and block state in DB
func (*Store) FlushHighestLamport ¶
func (s *Store) FlushHighestLamport()
func (*Store) ForEachBlock ¶
func (*Store) ForEachEpochEvent ¶
func (*Store) ForEachEvent ¶
func (*Store) ForEachEventRLP ¶
func (*Store) GetBlockEpochState ¶
func (s *Store) GetBlockEpochState() (blockproc.BlockState, blockproc.EpochState)
func (*Store) GetBlockIndex ¶
GetBlockIndex returns stored block index.
func (*Store) GetBlockState ¶
func (s *Store) GetBlockState() blockproc.BlockState
GetBlockState retrieves the latest block state
func (*Store) GetEpochRules ¶
GetEpochRules retrieves current network rules and epoch atomically
func (*Store) GetEpochState ¶
func (s *Store) GetEpochState() blockproc.EpochState
GetEpochState retrieves the latest epoch state
func (*Store) GetEpochValidators ¶
func (s *Store) GetEpochValidators() (*pos.Validators, idx.Epoch)
GetEpochValidators retrieves the current epoch and validators atomically
func (*Store) GetEventPayload ¶
func (s *Store) GetEventPayload(id hash.Event) *inter.EventPayload
GetEventPayload returns stored event.
func (*Store) GetEventPayloadRLP ¶
GetEventPayloadRLP returns stored event. Serialized.
func (*Store) GetGenesisBlockIndex ¶
GetGenesisBlockIndex returns stored genesis block index.
func (*Store) GetGenesisHash ¶
func (*Store) GetGenesisTime ¶
func (*Store) GetHeads ¶
func (s *Store) GetHeads(epoch idx.Epoch) *concurrent.EventsSet
GetHeads returns set of all the epoch event IDs with no descendants
func (*Store) GetHeadsSlice ¶
GetHeadsSlice returns IDs of all the epoch events with no descendants
func (*Store) GetHighestLamport ¶
func (*Store) GetLastEvent ¶
GetLastEvents returns latest connected epoch event from specified validator
func (*Store) GetLastEvents ¶
func (s *Store) GetLastEvents(epoch idx.Epoch) *concurrent.ValidatorEventsSet
GetLastEvents returns latest connected epoch events from each validator
func (*Store) GetLatestBlockIndex ¶
GetLatestBlockIndex retrieves the current block number
func (*Store) GetValidators ¶
func (s *Store) GetValidators() *pos.Validators
GetValidators retrieves current validators
func (*Store) IsCommitNeeded ¶
func (*Store) SetBlockEpochState ¶
func (s *Store) SetBlockEpochState(bs blockproc.BlockState, es blockproc.EpochState)
SetBlockEpochState stores the latest block and epoch state in memory
func (*Store) SetBlockIndex ¶
SetBlockIndex stores chain block index.
func (*Store) SetGenesisBlockIndex ¶
SetGenesisBlockIndex stores genesis block index.
func (*Store) SetGenesisHash ¶
func (*Store) SetHighestLamport ¶
func (*Store) SetLastEvents ¶
func (s *Store) SetLastEvents(epoch idx.Epoch, ids *concurrent.ValidatorEventsSet)
type StoreCacheConfig ¶
type StoreConfig ¶
type StoreConfig struct { Cache StoreCacheConfig // EVM is EVM store config EVM evmstore.StoreConfig MaxNonFlushedSize int MaxNonFlushedPeriod time.Duration }
StoreConfig is a config for store db.
func DefaultStoreConfig ¶
func DefaultStoreConfig(scale cachescale.Func) StoreConfig
DefaultStoreConfig for product.
type ValidatorsPubKeys ¶
type ValidatorsPubKeys struct { Epoch idx.Epoch PubKeys map[idx.ValidatorID]validatorpk.PubKey }
ValidatorsPubKeys stores info to authenticate validators
func NewEpochPubKeys ¶
func NewEpochPubKeys(s *Store, epoch idx.Epoch) *ValidatorsPubKeys
NewEpochPubKeys is the same as GetEpochValidators, but returns only addresses
Source Files ¶
- api.go
- apply_genesis.go
- c_block_callbacks.go
- c_event_callbacks.go
- checker_helpers.go
- config.go
- discover.go
- dummy_tx_pool.go
- emitter_world.go
- enr_entry.go
- ethapi_backend.go
- evm_state_reader.go
- execqueue.go
- gpo_backend.go
- handler.go
- peer.go
- protocol.go
- randselect.go
- service.go
- store.go
- store_async.go
- store_block.go
- store_decided_state.go
- store_epoch.go
- store_event.go
- store_heads.go
- store_last_events.go
- store_migration.go
- sync.go
Directories ¶
Path | Synopsis |
---|---|
contract
|
|
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Package filters implements an ethereum filtering system for block, transactions and log events.
|
Package filters implements an ethereum filtering system for block, transactions and log events. |