Documentation
¶
Index ¶
- Constants
- func AggregatorNodeSignatureBytesProvider(adapter *Adapter) evtypes.AggregatorNodeSignatureBytesProvider
- func LoadGenesisDoc(cfg *cmtcfg.Config) (*cmttypes.GenesisDoc, error)
- func MakeABCIBlock(blockHeight uint64, cmtTxs cmttypes.Txs, currentState *cmtstate.State, ...) (*cmttypes.Block, *cmttypes.BlockID, error)
- func SyncNodeSignatureBytesProvider(adapter *Adapter) evtypes.SyncNodeSignatureBytesProvider
- func ToABCIBlock(header cmttypes.Header, lastCommit *cmttypes.Commit, data *evtypes.Data) (*cmttypes.Block, error)
- func ToABCIBlockMeta(abciBlock *cmttypes.Block) (*cmttypes.BlockMeta, error)
- func ToABCIHeader(header evtypes.Header, lastCommit *cmttypes.Commit) (cmttypes.Header, error)
- func ValidatorHasherFromStoreProvider(store StateStore) func(proposerAddress []byte, pubKey crypto.PubKey) (evtypes.Hash, error)
- func ValidatorHasherProvider() func(proposerAddress []byte, pubKey crypto.PubKey) (evtypes.Hash, error)
- func ValidatorsHasher(validators []crypto.PubKey, proposerAddress []byte) (evtypes.Hash, error)
- type Adapter
- func (a *Adapter) ExecuteTxs(ctx context.Context, txs [][]byte, blockHeight uint64, timestamp time.Time, ...) ([]byte, uint64, error)
- func (a *Adapter) GetLastCommit(ctx context.Context, blockHeight uint64) (*cmttypes.Commit, error)
- func (a *Adapter) GetTxs(ctx context.Context) ([][]byte, error)
- func (a *Adapter) InitChain(ctx context.Context, genesisTime time.Time, initialHeight uint64, ...) ([]byte, uint64, error)
- func (a *Adapter) SetFinal(ctx context.Context, blockHeight uint64) error
- func (a *Adapter) SetMempool(mempool mempool.Mempool)
- func (a *Adapter) Start(ctx context.Context) error
- type BlockFilter
- type BlockFilterFn
- type Metrics
- type Option
- type P2PClientInfo
- type StackedEvent
- type StateStore
Constants ¶
const (
// MetricsSubsystem is a subsystem shared by all metrics exposed by this package.
MetricsSubsystem = "adapter"
)
Variables ¶
This section is empty.
Functions ¶
func AggregatorNodeSignatureBytesProvider ¶
func AggregatorNodeSignatureBytesProvider(adapter *Adapter) evtypes.AggregatorNodeSignatureBytesProvider
func LoadGenesisDoc ¶
func LoadGenesisDoc(cfg *cmtcfg.Config) (*cmttypes.GenesisDoc, error)
LoadGenesisDoc returns the genesis document from the provided config file.
func MakeABCIBlock ¶
func MakeABCIBlock( blockHeight uint64, cmtTxs cmttypes.Txs, currentState *cmtstate.State, abciHeader cmttypes.Header, lastCommit *cmttypes.Commit, ) (*cmttypes.Block, *cmttypes.BlockID, error)
MakeABCIBlock makes an ABCI block and its block ID.
func SyncNodeSignatureBytesProvider ¶
func SyncNodeSignatureBytesProvider(adapter *Adapter) evtypes.SyncNodeSignatureBytesProvider
func ToABCIBlock ¶
func ToABCIBlock(header cmttypes.Header, lastCommit *cmttypes.Commit, data *evtypes.Data) (*cmttypes.Block, error)
ToABCIBlock converts rollit block into block format defined by ABCI.
func ToABCIBlockMeta ¶
ToABCIBlockMeta converts an ABCI block into a BlockMeta format.
func ToABCIHeader ¶
ToABCIHeader converts rollkit header format defined by ABCI.
func ValidatorHasherFromStoreProvider ¶
func ValidatorHasherFromStoreProvider(store StateStore) func(proposerAddress []byte, pubKey crypto.PubKey) (evtypes.Hash, error)
ValidatorHasherFromStoreProvider creates a ValidatorHasher that obtains validators from the ABCI store. This is useful for attester mode where validators are managed by the ABCI application.
func ValidatorHasherProvider ¶
func ValidatorHasherProvider() func(proposerAddress []byte, pubKey crypto.PubKey) (evtypes.Hash, error)
ValidatorHasherProvider returns a function that calculates the ValidatorHash compatible with CometBFT. This function is intended to be injected into ev-node's Manager.
func ValidatorsHasher ¶
ValidatorsHasher calculates the hash of a validator set, compatible with CometBFT. This unified implementation works for both single validator (sequencer) and multiple validators (attester) modes.
Types ¶
type Adapter ¶
type Adapter struct {
App servertypes.ABCI
Store *execstore.Store
RollkitStore rstore.Store
Mempool mempool.Mempool
MempoolIDs *mempoolIDs
P2PClient P2PClientInfo
TxGossiper *p2p.Gossiper
EventBus *cmttypes.EventBus
AppGenesis *genutiltypes.AppGenesis
Logger log.Logger
// contains filtered or unexported fields
}
Adapter is a struct that will contain an ABCI Application, and will implement the go-execution interface
func NewABCIExecutor ¶
func NewABCIExecutor( app servertypes.ABCI, store ds.Batching, p2pClient *rollkitp2p.Client, p2pMetrics *rollkitp2p.Metrics, logger log.Logger, _ *cmtcfg.Config, appGenesis *genutiltypes.AppGenesis, opts ...Option, ) *Adapter
NewABCIExecutor creates a new Adapter instance that implements the go-execution.Executor interface. The Adapter wraps the provided ABCI application and delegates execution-related operations to it.
func (*Adapter) ExecuteTxs ¶
func (a *Adapter) ExecuteTxs( ctx context.Context, txs [][]byte, blockHeight uint64, timestamp time.Time, _ []byte, ) ([]byte, uint64, error)
ExecuteTxs implements execution.Executor.
func (*Adapter) GetLastCommit ¶
GetLastCommit retrieves the last commit for the given block height.
func (*Adapter) GetTxs ¶
GetTxs calls PrepareProposal with the next height from the store and returns the transactions from the ABCI app
func (*Adapter) InitChain ¶
func (a *Adapter) InitChain(ctx context.Context, genesisTime time.Time, initialHeight uint64, chainID string) ([]byte, uint64, error)
InitChain implements execution.Executor.
func (*Adapter) SetFinal ¶
It publishes all queued events up to this height in the correct sequence, ensuring that events are only emitted after consensus is achieved.
func (*Adapter) SetMempool ¶
type BlockFilter ¶
BlockFilter decides if a block commit is build and published
type BlockFilterFn ¶
func (BlockFilterFn) IsPublishable ¶
func (b BlockFilterFn) IsPublishable(ctx context.Context, height int64) bool
type Metrics ¶
type Metrics struct {
// Tx Validation
TxValidationTotal metrics.Counter
TxValidationResultTotal metrics.Counter `metrics_labels:"result"`
CheckTxDurationSeconds metrics.Histogram
// InitChain
InitChainDurationSeconds metrics.Histogram
// Block Execution
BlockExecutionDurationSeconds metrics.Histogram
TxsExecutedPerBlock metrics.Histogram
BlockExecutionStepDurationSeconds metrics.Histogram `metrics_labels:"step"`
ValidatorUpdatesTotal metrics.Counter
ConsensusParamUpdatesTotal metrics.Counter
// Tx Retrieval
GetTxsDurationSeconds metrics.Histogram
TxsProposedTotal metrics.Counter
MempoolReapDurationSeconds metrics.Histogram
PrepareProposalDurationSeconds metrics.Histogram
}
Metrics contains metrics exposed by this package. Each metric is annotated with `metrics_labels` tag, which lists the labels used by the metric.
func PrometheusMetrics ¶
PrometheusMetrics returns Metrics build using Prometheus client library. Optionally, labels can be provided along with their values ("foo", "fooValue").
type Option ¶
type Option func(*Adapter)
Option is a functional option for configuring the Adapter.
func WithBlockFilter ¶
func WithBlockFilter(publisher BlockFilter) Option
WithBlockFilter sets a custom block publisher for the Adapter.
func WithMetrics ¶
WithMetrics sets custom metrics for the Adapter.
type P2PClientInfo ¶
type StackedEvent ¶
type StackedEvent struct {
// contains filtered or unexported fields
}