Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1654323
genesis implementation poc
randygrok Mar 19, 2025
c095c58
use genesis interface
randygrok Mar 19, 2025
64d7ce7
temp commit
randygrok Mar 19, 2025
9f54416
more changes
randygrok Mar 19, 2025
cb8451b
make tests pass
randygrok Mar 19, 2025
6ac0053
fix lint
randygrok Mar 20, 2025
973c3ad
Merge remote-tracking branch 'origin/feature/exec_api' into feat/gene…
randygrok Mar 20, 2025
a6e16b7
Merge branch 'feature/exec_api' into feat/genesis-clean
randygrok Mar 20, 2025
1fcd875
temp commit
randygrok Mar 24, 2025
95cfadd
fix tests
randygrok Mar 24, 2025
54db65e
rename fields in config
randygrok Mar 24, 2025
cc57479
add ExtraData
randygrok Mar 24, 2025
00c4281
genesis load
randygrok Mar 24, 2025
2f4a20d
move genesis file to pkg
randygrok Mar 24, 2025
6667115
load genesis file
randygrok Mar 24, 2025
4038f62
add io test
randygrok Mar 24, 2025
8175afd
update block manager cmd
randygrok Mar 24, 2025
795bcd3
add message into execution core
randygrok Mar 24, 2025
af5ee7b
remove go.sum
randygrok Mar 24, 2025
e874a21
Merge remote-tracking branch 'origin/feature/exec_api' into feat/gene…
randygrok Mar 24, 2025
d561021
Fix lint problems
randygrok Mar 24, 2025
55c543e
use default genesis
randygrok Mar 24, 2025
66d60b3
clean markdown lint
randygrok Mar 24, 2025
dc510ad
bring back creation of genesis
randygrok Mar 24, 2025
3e5476e
revert
randygrok Mar 24, 2025
d342066
fix markdown lint
randygrok Mar 24, 2025
96afdf6
fix errors with markdown
randygrok Mar 24, 2025
a9ddcd4
fix markdown lint
randygrok Mar 24, 2025
8acbfb4
review changes
randygrok Mar 24, 2025
dd18f2d
remove commented code
randygrok Mar 24, 2025
4f1d4f2
fix md
randygrok Mar 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use genesis interface
  • Loading branch information
randygrok committed Mar 19, 2025
commit c095c584e279959d463f2afe14d621579215b1c7
5 changes: 5 additions & 0 deletions core/execution/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ type dummyExecutor struct {
injectedTxs [][]byte
}

// BuildGenesis implements Executor.
func (e *dummyExecutor) BuildGenesis() (Genesis, error) {
panic("unimplemented")
}

// NewDummyExecutor creates a new dummy DummyExecutor instance
func NewDummyExecutor() *dummyExecutor {
return &dummyExecutor{
Expand Down
36 changes: 8 additions & 28 deletions core/execution/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,20 @@ import (
"time"
)

// Genesis defines an interface for types that represent genesis state
type Genesis interface {
// Bytes returns the genesis state as bytes
Bytes() []byte
// Validate validates the genesis state for correctness
Validate() error
}

// CommonPreGenesis defines the common interface that all PreGenesis types must implement
type CommonPreGenesis interface {
// ChainID returns the chain identifier
ChainID() string
}

type GenesisProvider[P CommonPreGenesis, G Genesis] interface {
// BuildGenesis creates a new Genesis state from PreGenesis data.
// Executor defines the interface that execution clients must implement to be compatible with Rollkit.
// This interface enables the separation between consensus and execution layers, allowing for modular
// and pluggable execution environments.
type Executor interface {
// BuildGenesis creates a new Genesis state.
// Requirements:
// - Must validate PreGenesis data for correctness
// - Must be deterministic (same input always produces same output)
// - Must return error if PreGenesis data is invalid
//
// Parameters:
// - preGenesis: Initial data needed to build the genesis state
// - Must be deterministic (same call always produces same output)
// - Must return error if genesis creation fails
//
// Returns:
// - Genesis: The constructed genesis state
// - error: Any errors during genesis creation
BuildGenesis(preGenesis P) (G, error)
}
BuildGenesis() (Genesis, error)

// Executor defines the interface that execution clients must implement to be compatible with Rollkit.
// This interface enables the separation between consensus and execution layers, allowing for modular
// and pluggable execution environments.
type Executor interface {
// InitChain initializes a new blockchain instance with genesis parameters.
// Requirements:
// - Must generate initial state root representing empty/genesis state
Expand Down
307 changes: 0 additions & 307 deletions core/execution/execution_test.go

This file was deleted.

Loading