Documentation ¶
Index ¶
- Variables
- type CachedBlock
- type Executor
- func (e *Executor) Commit(state *types.State, block *types.Block, resp *tmstate.ABCIResponses) (int64, error)
- func (e *Executor) CreateBlock(height uint64, lastCommit *types.Commit, lastHeaderHash [32]byte, ...) *types.Block
- func (e *Executor) ExecuteBlock(state types.State, block *types.Block) (*tmstate.ABCIResponses, error)
- func (e *Executor) GetAppInfo() (*abci.ResponseInfo, error)
- func (e *Executor) InitChain(genesis *tmtypes.GenesisDoc, validators []*tmtypes.Validator) (*abci.ResponseInitChain, error)
- func (e *Executor) UpdateMempoolAfterInitChain(s *types.State)
- func (e *Executor) UpdateStateAfterInitChain(s *types.State, res *abci.ResponseInitChain, validators []*tmtypes.Validator)
- func (e *Executor) UpdateStateFromResponses(resp *tmstate.ABCIResponses, state types.State, block *types.Block) (types.State, error)
- type Manager
- func (m *Manager) CreateNextDABatch(startHeight uint64, endHeight uint64) (*types.Batch, error)
- func (m *Manager) HandleSubmissionTrigger(ctx context.Context) error
- func (m *Manager) ProcessNextDABatch(daMetaData *da.DASubmitMetaData) error
- func (m *Manager) ProduceAndGossipBlock(ctx context.Context, allowEmpty bool) error
- func (m *Manager) ProduceBlockLoop(ctx context.Context)
- func (m *Manager) RetrieveLoop(ctx context.Context)
- func (m *Manager) RunInitChain(ctx context.Context) error
- func (m *Manager) Start(ctx context.Context, isAggregator bool) error
- func (m *Manager) SubmitLoop(ctx context.Context)
- func (m *Manager) SyncTargetLoop(ctx context.Context)
- func (m *Manager) UpdateStateFromApp() error
- func (m *Manager) UpdateSyncParams(endHeight uint64)
- func (m *Manager) ValidateBatch(batch *types.Batch) error
- type PendingBatch
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CachedBlock ¶ added in v1.1.0
type Executor ¶ added in v1.1.0
type Executor struct {
// contains filtered or unexported fields
}
Executor creates and applies blocks and maintains state.
func NewExecutor ¶ added in v1.1.0
func NewExecutor(proposerAddress []byte, namespaceID string, chainID string, mempool mempool.Mempool, proxyApp proxy.AppConns, eventBus *tmtypes.EventBus, logger types.Logger) (*Executor, error)
NewExecutor creates new instance of BlockExecutor. Proposer address and namespace ID will be used in all newly created blocks.
func (*Executor) Commit ¶ added in v1.1.0
func (e *Executor) Commit(state *types.State, block *types.Block, resp *tmstate.ABCIResponses) (int64, error)
Commit commits the block
func (*Executor) CreateBlock ¶ added in v1.1.0
func (e *Executor) CreateBlock(height uint64, lastCommit *types.Commit, lastHeaderHash [32]byte, state types.State, maxBytes uint64) *types.Block
CreateBlock reaps transactions from mempool and builds a block.
func (*Executor) ExecuteBlock ¶ added in v1.1.0
func (e *Executor) ExecuteBlock(state types.State, block *types.Block) (*tmstate.ABCIResponses, error)
ExecuteBlock executes the block and returns the ABCIResponses. Block should be valid (passed validation checks).
func (*Executor) GetAppInfo ¶ added in v1.1.0
func (e *Executor) GetAppInfo() (*abci.ResponseInfo, error)
GetAppInfo returns the latest AppInfo from the proxyApp.
func (*Executor) InitChain ¶ added in v1.1.0
func (e *Executor) InitChain(genesis *tmtypes.GenesisDoc, validators []*tmtypes.Validator) (*abci.ResponseInitChain, error)
InitChain calls InitChainSync using consensus connection to app.
func (*Executor) UpdateMempoolAfterInitChain ¶ added in v1.1.0
func (*Executor) UpdateStateAfterInitChain ¶ added in v1.1.0
type Manager ¶
type Manager struct { // Configuration Conf config.BlockManagerConfig Genesis *tmtypes.GenesisDoc ProposerKey crypto.PrivKey // Store and execution Store store.Store LastState types.State Executor *Executor // Clients and servers Pubsub *pubsub.Server DAClient da.DataAvailabilityLayerClient SLClient settlement.LayerI // Data retrieval Retriever da.BatchRetriever SyncTargetDiode diodes.Diode SyncTarget atomic.Uint64 // contains filtered or unexported fields }
Manager is responsible for aggregating transactions into blocks.
func NewManager ¶
func NewManager( proposerKey crypto.PrivKey, conf config.BlockManagerConfig, genesis *tmtypes.GenesisDoc, store store.Store, mempool mempool.Mempool, proxyApp proxy.AppConns, dalc da.DataAvailabilityLayerClient, settlementClient settlement.LayerI, eventBus *tmtypes.EventBus, pubsub *pubsub.Server, p2pClient *p2p.Client, logger types.Logger, ) (*Manager, error)
NewManager creates new block Manager.
func (*Manager) CreateNextDABatch ¶ added in v1.1.0
func (*Manager) HandleSubmissionTrigger ¶ added in v1.1.0
HandleSubmissionTrigger processes the submission trigger event. It checks if there are new blocks produced since the last submission. If there are, it attempts to submit a batch of blocks. It then attempts to produce an empty block to ensure IBC messages pass through during the batch submission process due to proofs requires for ibc messages only exist on the next block. Finally, it submits the next batch of blocks and updates the sync target to the height of the last block in the submitted batch.
func (*Manager) ProcessNextDABatch ¶ added in v1.1.0
func (m *Manager) ProcessNextDABatch(daMetaData *da.DASubmitMetaData) error
func (*Manager) ProduceAndGossipBlock ¶ added in v1.1.0
func (*Manager) ProduceBlockLoop ¶
ProduceBlockLoop is calling publishBlock in a loop as long as we're synced.
func (*Manager) RetrieveLoop ¶ added in v1.1.0
RetrieveLoop listens for new sync messages written to a ring buffer and in turn runs syncUntilTarget on the latest message in the ring buffer.
func (*Manager) RunInitChain ¶ added in v1.1.0
func (*Manager) SubmitLoop ¶ added in v1.1.0
func (*Manager) SyncTargetLoop ¶
SyncTargetLoop is responsible for getting real time updates about batches submission. for non aggregator: updating the sync target which will be used by retrieveLoop to sync until this target.
func (*Manager) UpdateStateFromApp ¶ added in v1.1.0
UpdateStateFromApp is responsible for aligning the state of the store from the abci app
func (*Manager) UpdateSyncParams ¶ added in v1.1.0
UpdateSyncParams updates the sync target and state index if necessary
type PendingBatch ¶ added in v1.1.0
type PendingBatch struct {
// contains filtered or unexported fields
}