Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 11 additions & 10 deletions apps/evm/cmd/run.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,17 +43,23 @@ var RunCmd = &cobra.Command{
Aliases: []string{"node", "run"},
Short: "Run the evolve node with EVM execution client",
RunE: func(cmd *cobra.Command, args []string) error {
executor, err := createExecutionClient(cmd)
nodeConfig, err := rollcmd.ParseConfig(cmd)
if err != nil {
return err
}

nodeConfig, err := rollcmd.ParseConfig(cmd)
logger := rollcmd.SetupLogger(nodeConfig.Log)

// Create datastore first - needed by execution client for ExecMeta tracking
datastore, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, evmDbName)
if err != nil {
return err
}

logger := rollcmd.SetupLogger(nodeConfig.Log)
executor, err := createExecutionClient(cmd, datastore)
if err != nil {
return err
}

blobClient, err := blobrpc.NewClient(context.Background(), nodeConfig.DA.Address, nodeConfig.DA.AuthToken, "")
if err != nil {
Expand All@@ -72,11 +78,6 @@ var RunCmd = &cobra.Command{

logger.Info().Str("headerNamespace", headerNamespace.HexString()).Str("dataNamespace", dataNamespace.HexString()).Msg("namespaces")

datastore, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, evmDbName)
if err != nil {
return err
}

genesisPath := filepath.Join(filepath.Dir(nodeConfig.ConfigPath()), "genesis.json")
genesis, err := genesispkg.LoadGenesis(genesisPath)
if err != nil {
Expand DownExpand Up@@ -200,7 +201,7 @@ func createSequencer(
return sequencer, nil
}

func createExecutionClient(cmd *cobra.Command) (execution.Executor, error) {
func createExecutionClient(cmd *cobra.Command, db datastore.Batching) (execution.Executor, error) {
// Read execution client parameters from flags
ethURL, err := cmd.Flags().GetString(evm.FlagEvmEthURL)
if err != nil {
Expand DownExpand Up@@ -245,7 +246,7 @@ func createExecutionClient(cmd *cobra.Command) (execution.Executor, error) {
genesisHash := common.HexToHash(genesisHashStr)
feeRecipient := common.HexToAddress(feeRecipientStr)

return evm.NewEngineExecutionClient(ethURL, engineURL, jwtSecret, genesisHash, feeRecipient)
return evm.NewEngineExecutionClient(ethURL, engineURL, jwtSecret, genesisHash, feeRecipient, db)
}

// addFlags adds flags related to the EVM execution client
Expand Down
11 changes: 11 additions & 0 deletions buf.gen.evm.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
version: v2

plugins:
- remote: buf.build/protocolbuffers/go
out: execution/evm/types/pb
opt: paths=source_relative
- remote: buf.build/connectrpc/go
out: execution/evm/types/pb
opt: paths=source_relative
inputs:
- directory: proto
1 change: 0 additions & 1 deletion buf.gen.yaml
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
version: v2
clean: true

plugins:
- remote: buf.build/protocolbuffers/go
Expand Down
Loading
Loading