fix: break import cycle by defining State locally in interfaces

Remove dependency on github.com/luxfi/vm to break the cycle:
- consensus/engine/interfaces -> vm -> consensus/engine/chain/block
- Define State type and constants directly in interfaces package
This commit is contained in:
2026-01-26 08:06:40 -08:00
parent 1a6ad51015
commit 760ee74a7b
+11 -13
View File
@@ -7,23 +7,21 @@ package interfaces
import (
"context"
"net/http"
"github.com/luxfi/vm"
)
// State is an alias to vm.State
type State = vm.State
// State represents the operational state of a VM or consensus engine.
type State uint8
// Re-export State constants from vm package
// State constants for VM lifecycle
const (
Unknown = vm.Unknown
Starting = vm.Starting
Syncing = vm.Syncing
Bootstrapping = vm.Bootstrapping
Ready = vm.Ready
Degraded = vm.Degraded
Stopping = vm.Stopping
Stopped = vm.Stopped
Unknown State = iota // Unknown state
Starting // VM is starting up
Syncing // VM is syncing state
Bootstrapping // VM is bootstrapping
Ready // VM is ready for normal operation
Degraded // VM is degraded but operational
Stopping // VM is shutting down
Stopped // VM has stopped
)
// Engine defines the consensus engine interface