Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define Go interface #10

Open
Tracked by #1802
tzdybal opened this issue Oct 25, 2024 · 0 comments
Open
Tracked by #1802

Define Go interface #10

tzdybal opened this issue Oct 25, 2024 · 0 comments
Labels
enhancement New feature or request needs-triage

Comments

@tzdybal
Copy link
Member

tzdybal commented Oct 25, 2024

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
@tzdybal tzdybal transferred this issue from rollkit/rollkit Oct 25, 2024
@tzdybal tzdybal added the enhancement New feature or request label Oct 25, 2024
@tzdybal tzdybal removed their assignment Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage
Projects
Status: No status
Development

No branches or pull requests

1 participant