Documentation ¶
Index ¶
- Constants
- Variables
- func MakeProtocols(svc *Service, backend *handler, disc enode.Iterator) []p2p.Protocol
- func NewGasPowerContext(s *Store, validators *pos.Validators, epoch idx.Epoch, cfg opera.EconomyRules) *gaspowercheck.ValidationContext
- func SplitTransactions(txs types.Transactions, fn func(types.Transactions))
- func StartENRUpdater(svc *Service, ln *enode.LocalNode)
- type BlockEpochState
- type BlockEpochStateV0
- type BlockProc
- type BlockStateV0
- 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) CalcBlockExtApi() 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) EffectiveMinGasPrice(ctx context.Context) *big.Int
- 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) GetDowntime(ctx context.Context, vid 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) GetEpochBlockState(ctx context.Context, epoch rpc.BlockNumber) (*iblockproc.BlockState, *iblockproc.EpochState, 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, vid 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) GetTd(_ common.Hash) *big.Int
- func (b *EthAPIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, uint64, uint64, error)
- func (b *EthAPIBackend) GetTxPosition(txHash common.Hash) *evmstore.TxPosition
- func (b *EthAPIBackend) GetUptime(ctx context.Context, vid idx.ValidatorID) (*big.Int, error)
- 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) ResolveRpcBlockNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (idx.Block, error)
- 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) SubscribeLogsNotify(ch chan<- []*types.Log) notify.Subscription
- func (b *EthAPIBackend) SubscribeNewBlockNotify(ch chan<- evmcore.ChainHeadNotify) notify.Subscription
- func (b *EthAPIBackend) SubscribeNewTxsNotify(ch chan<- evmcore.NewTxsNotify) notify.Subscription
- func (b *EthAPIBackend) SuggestGasTipCap(ctx context.Context, certainty uint64) *big.Int
- func (b *EthAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)
- func (b *EthAPIBackend) TxPoolContentFrom(addr common.Address) (types.Transactions, 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) EffectiveMinTip() *big.Int
- 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) StateAt(root common.Hash) (*state.StateDB, error)
- type ExtendedTxPosition
- type GPOBackend
- type GasPowerCheckReader
- type HeavyCheckReader
- type LlrEpochPackRLP
- type LlrFullBlockRecordRLP
- type LlrIdxFullBlockRecordRLP
- type LlrIdxFullEpochRecordRLP
- type LlrState
- type NodeInfo
- type PeerCacheConfig
- type PeerInfo
- type PeerProgress
- type PeriodicFlusher
- type PeriodicFlusherCallaback
- type ProtocolConfig
- 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) EmitterWorld(signer valkeystore.SignerI) emitter.World
- func (s *Service) EvmSnapshotGeneration() bool
- func (s *Service) GetConsensusCallbacks() lachesis.ConsensusCallbacks
- func (s *Service) GetEvmStateReader() *EvmStateReader
- func (s *Service) PauseEvmSnapshot()
- func (s *Service) ProcessBlockVotes(bvs inter.LlrSignedBlockVotes) error
- func (s *Service) ProcessEpochVote(ev inter.LlrSignedEpochVote) error
- func (s *Service) ProcessFullBlockRecord(br ibr.LlrIdxFullBlockRecord) error
- func (s *Service) ProcessFullEpochRecord(er ier.LlrIdxFullEpochRecord) error
- func (s *Service) Protocols() []p2p.Protocol
- func (s *Service) RegisterEmitter(em *emitter.Emitter)
- func (s *Service) Start() error
- func (s *Service) Stop() error
- func (s *Service) SwitchEpochTo(newEpoch idx.Epoch) 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
- type Store
- func (s *Store) AddLlrBlockVoteWeight(block idx.Block, epoch idx.Epoch, bv hash.Hash, val idx.Validator, ...) pos.Weight
- func (s *Store) AddLlrEpochVoteWeight(epoch idx.Epoch, ev hash.Hash, val idx.Validator, vals idx.Validator, ...) pos.Weight
- func (s *Store) ApplyGenesis(g genesis.Genesis) (genesisHash hash.Hash, err error)
- func (s *Store) CaptureEvmKvdbSnapshot()
- 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) FindBlockEpoch(b idx.Block) idx.Epoch
- 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) FlushLastBVs()
- func (s *Store) FlushLastEV()
- func (s *Store) FlushLlrState()
- 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) GenerateSnapshotAt(root common.Hash, async bool) (err error)
- func (s *Store) GetBlock(n idx.Block) *inter.Block
- func (s *Store) GetBlockEpochState() (iblockproc.BlockState, iblockproc.EpochState)
- func (s *Store) GetBlockIndex(id hash.Event) *idx.Block
- func (s *Store) GetBlockState() iblockproc.BlockState
- func (s *Store) GetBlockTxs(n idx.Block, block *inter.Block) types.Transactions
- func (s *Store) GetEpoch() idx.Epoch
- func (s *Store) GetEpochRules() (opera.Rules, idx.Epoch)
- func (s *Store) GetEpochState() iblockproc.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) GetFullBlockRecord(n idx.Block) *ibr.LlrFullBlockRecord
- func (s *Store) GetFullEpochRecord(epoch idx.Epoch) *ier.LlrFullEpochRecord
- func (s *Store) GetGenesisBlockIndex() *idx.Block
- func (s *Store) GetGenesisID() *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) GetHistoryBlockEpochState(epoch idx.Epoch) (*iblockproc.BlockState, *iblockproc.EpochState)
- func (s *Store) GetHistoryEpochState(epoch idx.Epoch) *iblockproc.EpochState
- func (s *Store) GetLastBV(vid idx.ValidatorID) *idx.Block
- func (s *Store) GetLastBVs() *concurrent.ValidatorBlocksSet
- func (s *Store) GetLastEV(vid idx.ValidatorID) *idx.Epoch
- func (s *Store) GetLastEVs() *concurrent.ValidatorEpochsSet
- 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) GetLlrBlockResult(block idx.Block) *hash.Hash
- func (s *Store) GetLlrEpochResult(epoch idx.Epoch) *hash.Hash
- func (s *Store) GetLlrState() LlrState
- func (s *Store) GetRules() opera.Rules
- func (s *Store) GetValidators() *pos.Validators
- func (s *Store) HasBlock(n idx.Block) bool
- func (s *Store) HasBlockEpochState() bool
- func (s *Store) HasBlockVotes(epoch idx.Epoch, lastBlock idx.Block, id hash.Event) bool
- func (s *Store) HasEpochVote(epoch idx.Epoch, id hash.Event) bool
- func (s *Store) HasEvent(h hash.Event) bool
- func (s *Store) HasHistoryBlockEpochState(epoch idx.Epoch) bool
- func (s *Store) IsCommitNeeded() bool
- func (s *Store) IterateEpochPacksRLP(start idx.Epoch, f func(epoch idx.Epoch, ep rlp.RawValue) bool)
- func (s *Store) IterateFullBlockRecordsRLP(start idx.Block, f func(b idx.Block, br rlp.RawValue) bool)
- func (s *Store) IterateOverlappingBlockVotesRLP(start []byte, f func(key []byte, bvs rlp.RawValue) bool)
- func (s *Store) LastKvdbEvmSnapshot() *evmstore.Store
- func (s *Store) ModifyLlrState(f func(*LlrState))
- func (s *Store) SetBlock(n idx.Block, b *inter.Block)
- func (s *Store) SetBlockEpochState(bs iblockproc.BlockState, es iblockproc.EpochState)
- func (s *Store) SetBlockIndex(id hash.Event, n idx.Block)
- func (s *Store) SetBlockVotes(bvs inter.LlrSignedBlockVotes)
- func (s *Store) SetEpochBlock(b idx.Block, e idx.Epoch)
- func (s *Store) SetEpochVote(ev inter.LlrSignedEpochVote)
- func (s *Store) SetEvent(e *inter.EventPayload)
- func (s *Store) SetGenesisBlockIndex(n idx.Block)
- func (s *Store) SetGenesisID(val hash.Hash)
- func (s *Store) SetHeads(epoch idx.Epoch, ids *concurrent.EventsSet)
- func (s *Store) SetHighestLamport(lamport idx.Lamport)
- func (s *Store) SetHistoryBlockEpochState(epoch idx.Epoch, bs iblockproc.BlockState, es iblockproc.EpochState)
- func (s *Store) SetLastBVs(ids *concurrent.ValidatorBlocksSet)
- func (s *Store) SetLastEVs(ids *concurrent.ValidatorEpochsSet)
- func (s *Store) SetLastEvents(epoch idx.Epoch, ids *concurrent.ValidatorEventsSet)
- func (s *Store) SetLlrBlockResult(block idx.Block, bv hash.Hash)
- func (s *Store) SetLlrEpochResult(epoch idx.Epoch, ev hash.Hash)
- func (s *Store) WriteFullBlockRecord(br ibr.LlrIdxFullBlockRecord)
- func (s *Store) WriteFullEpochRecord(er ier.LlrIdxFullEpochRecord)
- type StoreCacheConfig
- type StoreConfig
- type TxPool
- type ValidatorBlockStateV0
- type ValidatorsPubKeys
Constants ¶
const ( VLRY62 = 62 VLRY63 = 63 ProtocolVersion = VLRY63 )
Constants to match up protocol versions and messages
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 RequestBVsStream = 10 BVsStreamResponse = 11 RequestBRsStream = 12 BRsStreamResponse = 13 RequestEPsStream = 14 EPsStreamResponse = 15 )
protocol message codes
const ( ErrMsgTooLarge = iota ErrDecode ErrInvalidMsgCode ErrProtocolVersionMismatch ErrNetworkIDMismatch ErrGenesisMismatch ErrNoStatusMsg ErrExtraStatusMsg ErrSuspendedPeer ErrEmptyMessage = 0xf00 )
const ProtocolName = "opera"
ProtocolName is the official short name of the protocol used during capability negotiation.
Variables ¶
var ProtocolVersions = []uint{VLRY62, VLRY63}
ProtocolVersions are the supported versions of the protocol (first is primary).
Functions ¶
func MakeProtocols ¶
MakeProtocols constructs the P2P protocol definitions for `opera`.
func NewGasPowerContext ¶
func NewGasPowerContext(s *Store, validators *pos.Validators, epoch idx.Epoch, cfg opera.EconomyRules) *gaspowercheck.ValidationContext
NewGasPowerContext reads current validation context for gaspowercheck
func SplitTransactions ¶
func SplitTransactions(txs types.Transactions, fn func(types.Transactions))
func StartENRUpdater ¶
StartENRUpdater starts the `opera` 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 *iblockproc.BlockState EpochState *iblockproc.EpochState }
type BlockEpochStateV0 ¶
type BlockEpochStateV0 struct { BlockState *BlockStateV0 EpochState *iblockproc.EpochStateV0 }
type BlockProc ¶
type BlockProc struct { SealerModule blockproc.SealerModule TxListenerModule blockproc.TxListenerModule PreTxTransactor blockproc.TxTransactor PostTxTransactor blockproc.TxTransactor EventsModule blockproc.ConfirmedEventsModule EVMModule blockproc.EVM }
func DefaultBlockProc ¶
func DefaultBlockProc() BlockProc
type BlockStateV0 ¶
type BlockStateV0 struct { LastBlock iblockproc.BlockCtx FinalizedStateRoot hash.Hash EpochGas uint64 EpochCheaters lachesis.Cheaters ValidatorStates []ValidatorBlockStateV0 NextValidatorProfiles iblockproc.ValidatorProfiles DirtyRules opera.Rules AdvanceEpochs idx.Epoch }
type Config ¶
type Config struct { FilterAPI filters.Config // This can be set to list of enrtree:// URLs which will be queried for // for nodes to connect to. OperaDiscoveryURLs []string SnapDiscoveryURLs []string AllowSnapsync bool 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 // 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 RPCBlockExt bool }
Config for the gossip service.
func DefaultConfig ¶
func DefaultConfig(scale cachescale.Func) Config
DefaultConfig returns the default configurations for the gossip service.
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 evm block by its number, or nil if not exists.
func (*EthAPIBackend) CalcBlockExtApi ¶
func (b *EthAPIBackend) CalcBlockExtApi() 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) EffectiveMinGasPrice ¶
func (b *EthAPIBackend) EffectiveMinGasPrice(ctx context.Context) *big.Int
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) GetDowntime ¶
func (b *EthAPIBackend) GetDowntime(ctx context.Context, vid idx.ValidatorID) (idx.Block, inter.Timestamp, error)
func (*EthAPIBackend) GetEpochBlockState ¶
func (b *EthAPIBackend) GetEpochBlockState(ctx context.Context, epoch rpc.BlockNumber) (*iblockproc.BlockState, *iblockproc.EpochState, error)
func (*EthAPIBackend) GetEventPayload ¶
func (b *EthAPIBackend) GetEventPayload(ctx context.Context, shortEventID string) (*inter.EventPayload, error)
GetEventPayload returns Lachesis 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, vid 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) GetTransaction ¶
func (b *EthAPIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, uint64, uint64, error)
func (*EthAPIBackend) GetTxPosition ¶
func (b *EthAPIBackend) GetTxPosition(txHash common.Hash) *evmstore.TxPosition
func (*EthAPIBackend) GetUptime ¶
func (b *EthAPIBackend) GetUptime(ctx context.Context, vid idx.ValidatorID) (*big.Int, error)
func (*EthAPIBackend) HeaderByHash ¶
func (b *EthAPIBackend) HeaderByHash(ctx context.Context, h common.Hash) (*evmcore.EvmHeader, error)
HeaderByHash returns evm block header by its (atropos) hash, or nil if not exists.
func (*EthAPIBackend) HeaderByNumber ¶
func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*evmcore.EvmHeader, error)
HeaderByNumber returns evm block header by its number, or nil if not exists.
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) ResolveRpcBlockNumberOrHash ¶
func (b *EthAPIBackend) ResolveRpcBlockNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (idx.Block, error)
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)
StateAndHeaderByNumberOrHash returns evm state and block header by block number or block hash, err if not exists.
func (*EthAPIBackend) Stats ¶
func (b *EthAPIBackend) Stats() (pending int, queued int)
func (*EthAPIBackend) SubscribeLogsNotify ¶
func (b *EthAPIBackend) SubscribeLogsNotify(ch chan<- []*types.Log) notify.Subscription
func (*EthAPIBackend) SubscribeNewBlockNotify ¶
func (b *EthAPIBackend) SubscribeNewBlockNotify(ch chan<- evmcore.ChainHeadNotify) notify.Subscription
func (*EthAPIBackend) SubscribeNewTxsNotify ¶
func (b *EthAPIBackend) SubscribeNewTxsNotify(ch chan<- evmcore.NewTxsNotify) notify.Subscription
func (*EthAPIBackend) SuggestGasTipCap ¶
func (*EthAPIBackend) TxPoolContent ¶
func (b *EthAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)
func (*EthAPIBackend) TxPoolContentFrom ¶
func (b *EthAPIBackend) TxPoolContentFrom(addr common.Address) (types.Transactions, types.Transactions)
func (*EthAPIBackend) UnprotectedAllowed ¶
func (b *EthAPIBackend) UnprotectedAllowed() bool
type EvmStateReader ¶
type EvmStateReader struct { *ServiceFeed // contains filtered or unexported fields }
func NewEvmStateReader ¶
func NewEvmStateReader(s *Store) *EvmStateReader
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) EffectiveMinTip ¶
func (r *EvmStateReader) EffectiveMinTip() *big.Int
EffectiveMinTip returns current soft lower bound for gas tip
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
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() opera.Rules
func (*GPOBackend) GetRules ¶
func (b *GPOBackend) GetRules() opera.Rules
func (*GPOBackend) PendingTxs ¶
func (b *GPOBackend) PendingTxs() types.Transactions
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) GetEpochBlockStart ¶
func (r *HeavyCheckReader) GetEpochBlockStart(epoch idx.Epoch) idx.Block
GetEpochBlockStart is safe for concurrent use
func (*HeavyCheckReader) GetEpochPubKeys ¶
func (r *HeavyCheckReader) GetEpochPubKeys() (map[idx.ValidatorID]validatorpk.PubKey, idx.Epoch)
GetEpochPubKeys is safe for concurrent use
func (*HeavyCheckReader) GetEpochPubKeysOf ¶
func (r *HeavyCheckReader) GetEpochPubKeysOf(epoch idx.Epoch) map[idx.ValidatorID]validatorpk.PubKey
GetEpochPubKeysOf is safe for concurrent use
type LlrEpochPackRLP ¶
type LlrEpochPackRLP struct { VotesRLP []rlp.RawValue Record LlrIdxFullEpochRecordRLP }
type LlrFullBlockRecordRLP ¶
type LlrIdxFullBlockRecordRLP ¶
type LlrIdxFullBlockRecordRLP struct { LlrFullBlockRecordRLP Idx idx.Block }
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 uint `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 PeriodicFlusher ¶
type PeriodicFlusher struct {
// contains filtered or unexported fields
}
PeriodicFlusher periodically commits the Store if isCommitNeeded returns true
func (*PeriodicFlusher) Start ¶
func (c *PeriodicFlusher) Start()
func (*PeriodicFlusher) Stop ¶
func (c *PeriodicFlusher) Stop()
type PeriodicFlusherCallaback ¶
type PeriodicFlusherCallaback struct {
// contains filtered or unexported fields
}
type ProtocolConfig ¶
type ProtocolConfig struct { LatencyImportance int ThroughputImportance int EventsSemaphoreLimit dag.Metric BVsSemaphoreLimit dag.Metric MsgsSemaphoreLimit dag.Metric MsgsSemaphoreTimeout time.Duration ProgressBroadcastPeriod time.Duration DagProcessor dagprocessor.Config BvProcessor bvprocessor.Config BrProcessor brprocessor.Config EpProcessor epprocessor.Config DagFetcher itemsfetcher.Config TxFetcher itemsfetcher.Config DagStreamLeecher dagstreamleecher.Config DagStreamSeeder dagstreamseeder.Config BvStreamLeecher bvstreamleecher.Config BvStreamSeeder bvstreamseeder.Config BrStreamLeecher brstreamleecher.Config BrStreamSeeder brstreamseeder.Config EpStreamLeecher epstreamleecher.Config EpStreamSeeder epstreamseeder.Config MaxInitialTxHashesSend int MaxRandomTxHashesSend int RandomTxHashesSendPeriod time.Duration PeerCache PeerCacheConfig }
ProtocolConfig is config for p2p protocol
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) EmitterWorld ¶
func (s *Service) EmitterWorld(signer valkeystore.SignerI) emitter.World
func (*Service) EvmSnapshotGeneration ¶
func (*Service) GetConsensusCallbacks ¶
func (s *Service) GetConsensusCallbacks() lachesis.ConsensusCallbacks
GetConsensusCallbacks returns single (for Service) callback instance.
func (*Service) GetEvmStateReader ¶
func (s *Service) GetEvmStateReader() *EvmStateReader
func (*Service) PauseEvmSnapshot ¶
func (s *Service) PauseEvmSnapshot()
func (*Service) ProcessBlockVotes ¶
func (s *Service) ProcessBlockVotes(bvs inter.LlrSignedBlockVotes) error
func (*Service) ProcessEpochVote ¶
func (s *Service) ProcessEpochVote(ev inter.LlrSignedEpochVote) error
func (*Service) ProcessFullBlockRecord ¶
func (s *Service) ProcessFullBlockRecord(br ibr.LlrIdxFullBlockRecord) error
func (*Service) ProcessFullEpochRecord ¶
func (s *Service) ProcessFullEpochRecord(er ier.LlrIdxFullEpochRecord) error
func (*Service) RegisterEmitter ¶
RegisterEmitter must be called before service is started
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
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) AddLlrBlockVoteWeight ¶
func (*Store) AddLlrEpochVoteWeight ¶
func (*Store) ApplyGenesis ¶
ApplyGenesis writes initial state.
func (*Store) CaptureEvmKvdbSnapshot ¶
func (s *Store) CaptureEvmKvdbSnapshot()
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) FlushLastBVs ¶
func (s *Store) FlushLastBVs()
func (*Store) FlushLastEV ¶
func (s *Store) FlushLastEV()
func (*Store) FlushLlrState ¶
func (s *Store) FlushLlrState()
FlushLlrState stores the LLR state in DB
func (*Store) ForEachBlock ¶
func (*Store) ForEachEpochEvent ¶
func (*Store) ForEachEvent ¶
func (*Store) ForEachEventRLP ¶
func (*Store) GenerateSnapshotAt ¶
func (*Store) GetBlockEpochState ¶
func (s *Store) GetBlockEpochState() (iblockproc.BlockState, iblockproc.EpochState)
func (*Store) GetBlockIndex ¶
GetBlockIndex returns stored block index.
func (*Store) GetBlockState ¶
func (s *Store) GetBlockState() iblockproc.BlockState
GetBlockState retrieves the latest block state
func (*Store) GetBlockTxs ¶
func (*Store) GetEpochRules ¶
GetEpochRules retrieves current network rules and epoch atomically
func (*Store) GetEpochState ¶
func (s *Store) GetEpochState() iblockproc.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) GetFullBlockRecord ¶
func (s *Store) GetFullBlockRecord(n idx.Block) *ibr.LlrFullBlockRecord
func (*Store) GetFullEpochRecord ¶
func (s *Store) GetFullEpochRecord(epoch idx.Epoch) *ier.LlrFullEpochRecord
func (*Store) GetGenesisBlockIndex ¶
GetGenesisBlockIndex returns stored genesis block index.
func (*Store) GetGenesisID ¶
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) GetHistoryBlockEpochState ¶
func (s *Store) GetHistoryBlockEpochState(epoch idx.Epoch) (*iblockproc.BlockState, *iblockproc.EpochState)
func (*Store) GetHistoryEpochState ¶
func (s *Store) GetHistoryEpochState(epoch idx.Epoch) *iblockproc.EpochState
func (*Store) GetLastBV ¶
func (s *Store) GetLastBV(vid idx.ValidatorID) *idx.Block
GetLastBV returns latest connected LLR block votes from specified validator
func (*Store) GetLastBVs ¶
func (s *Store) GetLastBVs() *concurrent.ValidatorBlocksSet
func (*Store) GetLastEV ¶
func (s *Store) GetLastEV(vid idx.ValidatorID) *idx.Epoch
GetLastEV returns latest connected LLR epoch vote from specified validator
func (*Store) GetLastEVs ¶
func (s *Store) GetLastEVs() *concurrent.ValidatorEpochsSet
func (*Store) GetLastEvent ¶
GetLastEvent 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) GetLlrState ¶
func (*Store) GetValidators ¶
func (s *Store) GetValidators() *pos.Validators
GetValidators retrieves current validators
func (*Store) HasBlockEpochState ¶
func (*Store) HasBlockVotes ¶
func (*Store) HasHistoryBlockEpochState ¶
func (*Store) IsCommitNeeded ¶
func (*Store) IterateEpochPacksRLP ¶
func (*Store) IterateFullBlockRecordsRLP ¶
func (*Store) IterateOverlappingBlockVotesRLP ¶
func (*Store) LastKvdbEvmSnapshot ¶
func (*Store) ModifyLlrState ¶
func (*Store) SetBlockEpochState ¶
func (s *Store) SetBlockEpochState(bs iblockproc.BlockState, es iblockproc.EpochState)
SetBlockEpochState stores the latest block and epoch state in memory
func (*Store) SetBlockIndex ¶
SetBlockIndex stores chain block index.
func (*Store) SetBlockVotes ¶
func (s *Store) SetBlockVotes(bvs inter.LlrSignedBlockVotes)
func (*Store) SetEpochVote ¶
func (s *Store) SetEpochVote(ev inter.LlrSignedEpochVote)
func (*Store) SetGenesisBlockIndex ¶
SetGenesisBlockIndex stores genesis block index.
func (*Store) SetGenesisID ¶
func (*Store) SetHighestLamport ¶
func (*Store) SetHistoryBlockEpochState ¶
func (s *Store) SetHistoryBlockEpochState(epoch idx.Epoch, bs iblockproc.BlockState, es iblockproc.EpochState)
TODO propose to pass bs, es arguments by pointer
func (*Store) SetLastBVs ¶
func (s *Store) SetLastBVs(ids *concurrent.ValidatorBlocksSet)
func (*Store) SetLastEVs ¶
func (s *Store) SetLastEVs(ids *concurrent.ValidatorEpochsSet)
func (*Store) SetLastEvents ¶
func (s *Store) SetLastEvents(epoch idx.Epoch, ids *concurrent.ValidatorEventsSet)
func (*Store) WriteFullBlockRecord ¶
func (s *Store) WriteFullBlockRecord(br ibr.LlrIdxFullBlockRecord)
func (*Store) WriteFullEpochRecord ¶
func (s *Store) WriteFullEpochRecord(er ier.LlrIdxFullEpochRecord)
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 TxPool ¶
type TxPool interface { emitter.TxPool // AddRemotes should add the given transactions to the pool. AddRemotes([]*types.Transaction) []error AddLocals(txs []*types.Transaction) []error AddLocal(tx *types.Transaction) error Get(common.Hash) *types.Transaction OnlyNotExisting(hashes []common.Hash) []common.Hash SampleHashes(max int) []common.Hash Nonce(addr common.Address) uint64 Stats() (int, int) Content() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) ContentFrom(addr common.Address) (types.Transactions, types.Transactions) PendingSlice() types.Transactions }
type ValidatorBlockStateV0 ¶
type ValidatorsPubKeys ¶
type ValidatorsPubKeys struct { Epoch idx.Epoch PubKeys map[idx.ValidatorID]validatorpk.PubKey }
ValidatorsPubKeys stores info to authenticate validators
Source Files ¶
- api.go
- apply_genesis.go
- c_block_callbacks.go
- c_event_callbacks.go
- c_llr_callbacks.go
- checker_helpers.go
- config.go
- discover.go
- dummy_tx_pool.go
- emitter_world.go
- enr_entry.go
- eth_state_adapter.go
- ethapi_backend.go
- evm_state_reader.go
- execqueue.go
- gpo_backend.go
- handler.go
- handler_snap.go
- peer.go
- peerset.go
- protocol.go
- randselect.go
- service.go
- store.go
- store_block.go
- store_decided_state.go
- store_epoch.go
- store_event.go
- store_heads.go
- store_last_bv.go
- store_last_ev.go
- store_last_events.go
- store_llr_block.go
- store_llr_epoch.go
- store_llr_state.go
- store_migration.go
- sync.go
- tflusher.go
Directories ¶
Path | Synopsis |
---|---|
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. |
protocols
|
|