Skip to content

Commit 4df8169

Browse files
committed
skip node initialization
1 parent 10d110d commit 4df8169

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

x/registration/internal/keeper/keeper.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"encoding/binary"
55
"encoding/hex"
66
"encoding/json"
7+
"fmt"
8+
"os"
79
"path/filepath"
810

911
"cosmossdk.io/core/store"
@@ -23,10 +25,20 @@ type Keeper struct {
2325
router baseapp.MessageRouter
2426
}
2527

28+
// isNonSGXReplayMode returns true if running in non-SGX replay mode
29+
func isNonSGXReplayMode() bool {
30+
return os.Getenv("SECRET_NODE_MODE") == "replay"
31+
}
32+
2633
// NewKeeper creates a new contract Keeper instance
2734
func NewKeeper(cdc codec.Codec, storeService store.KVStoreService, router baseapp.MessageRouter, enclave EnclaveInterface, homeDir string, bootstrap bool) Keeper {
2835
if !bootstrap {
29-
InitializeNode(homeDir, enclave)
36+
// Skip seed initialization in non-SGX replay mode - there's no enclave to load seeds into
37+
if isNonSGXReplayMode() {
38+
fmt.Println("[Registration] Non-SGX replay mode: skipping seed initialization (no enclave)")
39+
} else {
40+
InitializeNode(homeDir, enclave)
41+
}
3042
}
3143

3244
return Keeper{

0 commit comments

Comments
 (0)