forked from rollkit/go-execution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
execution.go
23 lines (17 loc) · 915 Bytes
/
execution.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package execution
import (
"context"
"time"
"github.com/rollkit/go-execution/types"
)
// Executor defines a common interface for interacting with the execution client.
type Executor interface {
// InitChain initializes the blockchain with genesis information.
InitChain(ctx context.Context, genesisTime time.Time, initialHeight uint64, chainID string) (stateRoot types.Hash, maxBytes uint64, err error)
// GetTxs retrieves all available transactions from the execution client's mempool.
GetTxs(ctx context.Context) ([]types.Tx, error)
// ExecuteTxs executes a set of transactions to produce a new block header.
ExecuteTxs(ctx context.Context, txs []types.Tx, blockHeight uint64, timestamp time.Time, prevStateRoot types.Hash) (updatedStateRoot types.Hash, maxBytes uint64, err error)
// SetFinal marks a block at the given height as final.
SetFinal(ctx context.Context, blockHeight uint64) error
}