Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct {
// MineDuration tracks the duration of each mine() cycle, including empty runs.
MineDuration prometheus.Histogram
// BlocksMined counts successfully finalized synthetic EVM blocks.
BlocksMined prometheus.Counter
// TransactionsMined counts total transactions committed across all mined blocks.
TransactionsMined prometheus.Counter
// ErrorsTotal counts mine() cycles that returned an error.
ErrorsTotal prometheus.Counter
// LatestBlock tracks the block number of the most recently finalized synthetic EVM block.
LatestBlock prometheus.Gauge
}
Metrics holds Prometheus collectors for the ethrpc miner.
func NewMetrics ¶
func NewMetrics(reg sharedmetrics.NamespacedRegisterer) *Metrics
NewMetrics registers ethrpc miner metrics against the given registerer.
func NewNopMetrics ¶
func NewNopMetrics() *Metrics
NewNopMetrics returns a Metrics instance backed by a throwaway registry. Use in tests where metric values are not asserted.
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
Miner periodically claims completed mempool entries and commits them as a synthetic EVM block. Business logic for EVM data construction lives here; the Store only performs raw SQL operations.
type Store ¶
type Store interface {
// NewBlock opens a DB transaction and acquires an exclusive lock on the
// evm_state row, serializing concurrent miners. The lock is held until
// Finalize or Abort is called on the returned PendingBlock.
NewBlock(ctx context.Context, chainID uint64) (ethrpc.PendingBlock, error)
}
Store is the narrow data-access interface the miner needs.
Click to show internal directories.
Click to hide internal directories.