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
19 changes: 15 additions & 4 deletions api/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,23 @@ type S3SnapshotDestination struct {
Region string `json:"region"`
}

// ResultExportConfig enables periodic export of block execution results.
// ResultExportConfig enables export of block execution results to S3.
// The sidecar queries the local RPC endpoint for block results and uploads
// them in compressed NDJSON pages to the platform S3 bucket, keyed by the
// node's chain ID. Its presence on a node spec is sufficient to enable
// export — no additional fields are required.
type ResultExportConfig struct{}
// node's chain ID.
//
// When CanonicalRPC is set, the sidecar additionally compares local results
// against the canonical chain and the task completes when app-hash divergence
// is detected (monitor mode). Without CanonicalRPC, results are exported
// periodically on a cron schedule (scheduled mode).
type ResultExportConfig struct {
// CanonicalRPC is the HTTP RPC endpoint of the canonical chain node
// to compare block execution results against. When set, the sidecar
// runs in comparison mode and the task completes when app-hash
// divergence is detected.
// +kubebuilder:validation:MinLength=1
CanonicalRPC string `json:"canonicalRpc"`
}

// GenesisConfiguration defines where genesis data is sourced.
// At most one of PVC or S3 may be set. When neither is set and the chain ID
Expand Down
40 changes: 34 additions & 6 deletions api/v1alpha1/seinode_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ const (
TaskPlanFailed TaskPlanPhase = "Failed"
)

// PlannedTaskStatus represents the state of an individual task within a plan.
// TaskStatus represents the lifecycle state of a task (plan, monitor, etc.).
// +kubebuilder:validation:Enum=Pending;Complete;Failed
type PlannedTaskStatus string
type TaskStatus string

const (
PlannedTaskPending PlannedTaskStatus = "Pending"
PlannedTaskComplete PlannedTaskStatus = "Complete"
PlannedTaskFailed PlannedTaskStatus = "Failed"
TaskPending TaskStatus = "Pending"
TaskComplete TaskStatus = "Complete"
TaskFailed TaskStatus = "Failed"
)

// PlannedTask is a single task within a TaskPlan. Each task carries its full
Expand All @@ -121,7 +121,7 @@ type PlannedTask struct {
ID string `json:"id"`

// Status is the current state of this task.
Status PlannedTaskStatus `json:"status"`
Status TaskStatus `json:"status"`

// Params is the opaque JSON payload for this task. Deserialized at
// execution time by task.Deserialize into the concrete task type.
Expand Down Expand Up @@ -165,6 +165,29 @@ const (
PhaseTerminating SeiNodePhase = "Terminating"
)

// MonitorTask tracks a long-running sidecar task that the controller
// actively polls for completion. Unlike ScheduledTasks (fire-and-forget),
// completing a monitor task triggers a controller response (Event + Condition).
// The map key in MonitorTasks serves as the task type identifier.
type MonitorTask struct {
// ID is the sidecar-assigned task UUID.
ID string `json:"id"`

// Status tracks lifecycle: Pending → Complete or Failed.
Status TaskStatus `json:"status"`

// SubmittedAt is the time the task was submitted to the sidecar.
SubmittedAt metav1.Time `json:"submittedAt"`

// CompletedAt is the time the task reached a terminal state.
// +optional
CompletedAt *metav1.Time `json:"completedAt,omitempty"`

// Error is set when the task fails.
// +optional
Error string `json:"error,omitempty"`
}

// SeiNodeStatus defines the observed state of a SeiNode.
type SeiNodeStatus struct {
// Phase is the high-level lifecycle state.
Expand All @@ -184,6 +207,11 @@ type SeiNodeStatus struct {
// +optional
ScheduledTasks map[string]string `json:"scheduledTasks,omitempty"`

// MonitorTasks tracks long-running sidecar tasks the controller polls
// for completion. Keyed by task type for idempotent submission.
// +optional
MonitorTasks map[string]MonitorTask `json:"monitorTasks,omitempty"`

// ConfigStatus reports the observed configuration state from the sidecar.
// +optional
ConfigStatus *ConfigStatus `json:"configStatus,omitempty"`
Expand Down
27 changes: 27 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions config/crd/sei.io_seinodegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,17 @@ spec:
The sidecar queries the local RPC for block_results and uploads compressed
NDJSON pages on a schedule. Useful for shadow replayers that need their
execution results compared against the canonical chain.
properties:
canonicalRpc:
description: |-
CanonicalRPC is the HTTP RPC endpoint of the canonical chain node
to compare block execution results against. When set, the sidecar
runs in comparison mode and the task completes when app-hash
divergence is detected.
minLength: 1
type: string
required:
- canonicalRpc
type: object
snapshot:
description: Snapshot identifies the snapshot to restore
Expand Down
52 changes: 52 additions & 0 deletions config/crd/sei.io_seinodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,17 @@ spec:
The sidecar queries the local RPC for block_results and uploads compressed
NDJSON pages on a schedule. Useful for shadow replayers that need their
execution results compared against the canonical chain.
properties:
canonicalRpc:
description: |-
CanonicalRPC is the HTTP RPC endpoint of the canonical chain node
to compare block execution results against. When set, the sidecar
runs in comparison mode and the task completes when app-hash
divergence is detected.
minLength: 1
type: string
required:
- canonicalRpc
type: object
snapshot:
description: Snapshot identifies the snapshot to restore from
Expand Down Expand Up @@ -898,6 +909,47 @@ spec:
- phase
- tasks
type: object
monitorTasks:
additionalProperties:
description: |-
MonitorTask tracks a long-running sidecar task that the controller
actively polls for completion. Unlike ScheduledTasks (fire-and-forget),
completing a monitor task triggers a controller response (Event + Condition).
The map key in MonitorTasks serves as the task type identifier.
properties:
completedAt:
description: CompletedAt is the time the task reached a terminal
state.
format: date-time
type: string
error:
description: Error is set when the task fails.
type: string
id:
description: ID is the sidecar-assigned task UUID.
type: string
status:
description: 'Status tracks lifecycle: Pending → Complete or
Failed.'
enum:
- Pending
- Complete
- Failed
type: string
submittedAt:
description: SubmittedAt is the time the task was submitted
to the sidecar.
format: date-time
type: string
required:
- id
- status
- submittedAt
type: object
description: |-
MonitorTasks tracks long-running sidecar tasks the controller polls
for completion. Keyed by task type for idempotent submission.
type: object
phase:
description: Phase is the high-level lifecycle state.
enum:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/onsi/gomega v1.38.2
github.com/prometheus/client_golang v1.23.2
github.com/sei-protocol/sei-config v0.0.9-0.20260327015454-7cf35ff77daa
github.com/sei-protocol/seictl v0.0.23
github.com/sei-protocol/seictl v0.0.24
k8s.io/api v0.35.0
k8s.io/apiextensions-apiserver v0.35.0
k8s.io/apimachinery v0.35.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sei-protocol/sei-config v0.0.9-0.20260327015454-7cf35ff77daa h1:bi0qHl2E8TxpOpBZZJmMl7eZc04sMJe5E11nC+uF7IM=
github.com/sei-protocol/sei-config v0.0.9-0.20260327015454-7cf35ff77daa/go.mod h1:IEAv5ynYw8Gu2F2qNfE4MQR0PPihAT6g7RWLpWdw5O0=
github.com/sei-protocol/seictl v0.0.23 h1:bDxzMeys7bkdfcHi2WFtMa/zVUxmu7w3yqYu1eCfsKY=
github.com/sei-protocol/seictl v0.0.23/go.mod h1:Q1YlXp1fUnJGLq5l1ORgpNsKNv+w/BaLBqDdv0pj/a0=
github.com/sei-protocol/seictl v0.0.24 h1:VmNg5A5tGhB/Z8Q0VN2MKsjodkSyqe69O+8pE3mhDrw=
github.com/sei-protocol/seictl v0.0.24/go.mod h1:0iI6V8BMOvchjjGSv1TQTUVxN4noUvIUdERmoegoavE=
github.com/sei-protocol/seilog v0.0.3 h1:Zi7oWXdX5jv92dY8n482xH032LtNebC89Y+qYZlBn0Y=
github.com/sei-protocol/seilog v0.0.3/go.mod h1:CKg58wraWnB3gRxWQ0v1rIVr0gmDHjkfP1bM2giKFFU=
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
Expand Down
Loading
Loading