Skip to content

Commit bbefeba

Browse files
committed
fix build
1 parent c74e7f5 commit bbefeba

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

apps/evm/cmd/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var RunCmd = &cobra.Command{
7979

8080
// Attach store to the EVM engine client for ExecMeta tracking (idempotent execution)
8181
if ec, ok := executor.(*evm.EngineClient); ok {
82-
ec.SetStore(store.New(datastore))
82+
ec.SetStore(evm.NewEVMStore(datastore))
8383
}
8484

8585
genesisPath := filepath.Join(filepath.Dir(nodeConfig.ConfigPath()), "genesis.json")

execution/evm/execution.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
"github.com/ethereum/go-ethereum/core/types"
1919
"github.com/ethereum/go-ethereum/ethclient"
2020
"github.com/ethereum/go-ethereum/rpc"
21-
ds "github.com/ipfs/go-datastore"
2221
"github.com/golang-jwt/jwt/v5"
22+
ds "github.com/ipfs/go-datastore"
2323
"github.com/rs/zerolog"
2424

2525
"github.com/evstack/ev-node/core/execution"
@@ -144,7 +144,7 @@ type EngineClient struct {
144144
currentHeadHeight uint64 // Height of the current head block (for safe lag calculation)
145145
currentSafeBlockHash common.Hash // Store last non-finalized SafeBlockHash
146146
currentFinalizedBlockHash common.Hash // Store last finalized block hash
147-
blockHashCache map[uint64]common.Hash // height -> hash cache for safe block lookups
147+
blockHashCache map[uint64]common.Hash // height -> hash cache for safe block lookups
148148

149149
logger zerolog.Logger
150150
}
@@ -206,6 +206,12 @@ func (c *EngineClient) SetLogger(l zerolog.Logger) {
206206
c.logger = l
207207
}
208208

209+
// SetStore allows callers to attach a store for ExecMeta tracking.
210+
// This enables idempotent execution and crash recovery.
211+
func (c *EngineClient) SetStore(s *EVMStore) {
212+
c.store = s
213+
}
214+
209215
// InitChain initializes the blockchain with the given genesis parameters
210216
func (c *EngineClient) InitChain(ctx context.Context, genesisTime time.Time, initialHeight uint64, chainID string) ([]byte, uint64, error) {
211217
if initialHeight != 1 {

0 commit comments

Comments
 (0)