Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Define Go interface #10

@tzdybal

Description

@tzdybal

Proposed initial version of API:

// InitChain is used by the consensus client and execution client to sync
// genesisTime is the genesis time for the chain
// initialHeight is the initial height of the chain
// chainId is the chain id
// stateRoot is the genesis state root
// maxBytes is the maximum bytes that the execution client can allow
InitChain(
     genesisTime time.Time, 
     initialHeight uint, 
     chainId []byte
) (
     stateRoot Hash, 
     maxBytes uint, 
     err error
)

// GetTxs is used by the consensus client (rollkit) to fetch all available transactions from the execution client's mempool.
GetTxs() []Tx

// ExecuteTxs informs the execution client to execute transactions
// blockHeight is the height to be used to produce block/header
// timestamp is the timestamp to be used in the block/header
// prevStateRoot is the previous block hash to create the next block/header
// updatedStateRoot is the updated state root hash
// maxBytes is the maximum bytes that the execution client can allow
ExecuteTxs(
     txs []Tx, 
     blockHeight int, 
     timestamp time.Time, 
     prevStateRoot Hash
) (
     updatedStateRoot Hash, 
     maxBytes uint, 
     err error
)

// SetFinal marks a block as final
SetFinal(
     blockHeight uint
) error

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions