hashgraph / hashgraph/solo-weaver

Story 5.0 — Implement execute-phase orchestration skeleton in daemon handleExecute

Open
#706 0 comments 0 reactions 1 assignee Claimed by @leninmehedy View on GitHub
order: core
Dominant language
Go
Stars
3
Forks
0
Avg merge
3d 2h
Merged PRs (30d)
46

Description

**Epic:** #502 — Network Upgrade Workflow (Execute Phase)

Implement the execute-phase orchestration skeleton inside the daemon's `handleExecute`
(`internal/daemon/consensus/upgrade_monitor.go`), which is currently a stub. This is the spine
that wires together stories 5.1–5.8; it should land first.

**Acceptance criteria:**
- Replace the `handleExecute` stub with an automa workflow that invokes the execute-phase steps in order: external-files verify/install (5.1/5.2), infra-versions placement (5.3), safety-gate, infra detection (5.4a), ConsensusConfig CR creation (5.5/5.6), wait-for-reconciliation, then the DaemonResult handshake (5.7).
- Each step runs under a context derived from the parent with an explicit `context.WithTimeout`; no step may block indefinitely (a hung step would leave `activeOpID` set and silently reject all future upgrades).
- Open a per-operation `EventLogger` (`pkg/eventlog`) at workflow start and close it at the end; after closing, prune old `consensus-upgrade-*.jsonl` files from `paths.DaemonConsensusUpgradeEventsDir` (FilenameTimestampStrategy, maxAge=365d, keep=50).
- **Durable resume point:** before performing any infra-mutating work, persist the durable CR phase `PendingInfraUpgrade` (it lives in etcd and survives a daemon crash/restart). On restart the daemon re-reads CR status, sees `PendingInfraUpgrade`, and resumes the infra upgrade from there. This is the single crash-recovery anchor consumed by execute-phase resume (#709) and operator `consensus node upgrade-recover` (#717). The daemon writes phase transitions only up to `PendingInfraUpgrade`/`PendingNodeUpgrade`; it never writes a progress phase like `InProgress`.
- Terminal outcome ALWAYS routes through the DaemonResult handshake (5.7): set the `DaemonResult` condition True/False, then transition the CR to `PendingNodeUpgrade`. The daemon NEVER writes `Succeeded`/`Failed` — the reconciler is the sole writer of the terminal phase. There is no `InProgress` phase.
- Panics in any step are recovered and converted to a `DaemonResult=False` outcome.

**Notes:**
- The current `handleExecute` doc comment carries pre-handshake stub guidance ("patch CR to InProgress", "patch to Succeeded or Failed"). Both contradict the finalized handshake model and must be **replaced** (not merely deleted) with the positive contract, so the original crash-recovery intent behind them is preserved rather than dropped:

> Before infra-mutating work, persist CR phase `PendingInfraUpgrade` (durable resume point). On completion, set the `DaemonResult` condition and transition to `PendingNodeUpgrade`. The daemon never writes `InProgress`/`Succeeded`/`Failed` — the reconciler owns terminal phases.

- Rationale: the durability those stub notes were trying to provide is now expressed as a durable *phase write before mutation* (`PendingInfraUpgrade`), not as an `InProgress`/terminal patch by the daemon. The resume guarantee is intact; only the writer and phase name change.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.