Documentation ¶
Overview ¶
Package executor is the executor agent.
Index ¶
- type Backend
- type ChainExecutor
- type Executor
- func (e Executor) BuildTreeFromDB(ctx context.Context, chainID uint32, destination uint32) error
- func (e Executor) GetLatestNonceProof(nonce, chainID, destination uint32) ([][]byte, error)
- func (e Executor) GetRoot(ctx context.Context, nonce uint32, chainID uint32, destination uint32) ([32]byte, error)
- func (e Executor) Listen(ctx context.Context, chainID uint32) error
- func (e Executor) Start(ctx context.Context) error
- func (e Executor) Stop(chainID uint32)
- func (e Executor) VerifyMessageNonce(ctx context.Context, nonce uint32, message types.Message, chainID uint32, ...) (bool, error)
- func (e Executor) VerifyOptimisticPeriod(ctx context.Context, message types.Message) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶ added in v0.0.63
type Backend interface { // HeaderByNumber returns the block header with the given block number. HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) }
Backend is the backend for the executor.
type ChainExecutor ¶ added in v0.0.49
type ChainExecutor struct {
// contains filtered or unexported fields
}
ChainExecutor is a struct that contains the necessary information for each chain level executor.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor is the executor agent.
func NewExecutor ¶
func NewExecutor(ctx context.Context, config config.Config, executorDB db.ExecutorDB, scribeClient client.ScribeClient, clients map[uint32]Backend) (*Executor, error)
NewExecutor creates a new executor agent.
func (Executor) BuildTreeFromDB ¶ added in v0.0.49
BuildTreeFromDB builds the merkle tree from the database's messages. This function will reset the current merkle tree and replace it with the one built from the database. This function should also not be called while Start or Listen are running.
func (Executor) GetLatestNonceProof ¶ added in v0.0.63
GetLatestNonceProof returns the merkle proof for a nonce, with a tree where that nonce is the last item added. This is done by copying the current merkle tree's items and generating a new tree with the items from the range [0, nonce).
func (Executor) GetRoot ¶ added in v0.0.45
func (e Executor) GetRoot(ctx context.Context, nonce uint32, chainID uint32, destination uint32) ([32]byte, error)
GetRoot returns the merkle root at the given nonce.
func (Executor) Listen ¶ added in v0.0.45
Listen listens to the log channel and processes the logs. Requires Start to be called first.
Directories ¶
Path | Synopsis |
---|---|
Package config defines the config for the Executor.
|
Package config defines the config for the Executor. |
Package db provides a database interface for the executor.
|
Package db provides a database interface for the executor. |
datastore/sql
Package sql provides a datastore implementation for the executor.
|
Package sql provides a datastore implementation for the executor. |
datastore/sql/base
Package base contains the base sql implementation
|
Package base contains the base sql implementation |
datastore/sql/mysql
Package mysql implements the mysql package
|
Package mysql implements the mysql package |
datastore/sql/sqlite
Package sqlite implements the sqlite package
|
Package sqlite implements the sqlite package |
Package types contains the database types for the Executor.
|
Package types contains the database types for the Executor. |