hashgraph / hashgraph/solo-weaver
feat(consensus): discover ConsensusCapsules not present in persisted state
- Dominant language
- Go
- Stars
- 3
- Forks
- 0
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 47
Description
## Summary
`consensusChecker.RefreshState` (`internal/reality/consensus_checker.go`)
iterates only the **persisted** node scopes and refines each from the cluster. A
`ConsensusCapsule` that exists in the cluster but is absent from `state.yaml`
(installed by another tool, or state file lost/rebuilt) is never discovered —
reality can refine known nodes but cannot find unknown ones.
For a single block node this is acceptable; for multi-node consensus recovery it
is a real limitation.
## Trigger
Revisit when multi-node recovery or "adopt an existing cluster" becomes a
supported flow. Not needed for the current single-install path.
## Proposed solution
- List `ConsensusCapsule` CRs in the target namespace(s) and reconcile against
persisted scopes, adding discovered nodes to the reality map.
- Derive the scope key from the capsule via the shared
`models.ConsensusCapsuleName` / `ConsensusNodeScope` helpers so discovery and
creation stay in lockstep.
## Scope
- [ ] List capsules instead of iterating persisted scopes only
- [ ] Reconcile discovered vs. persisted nodes
- [ ] Unit tests: discover a capsule absent from persisted state
Context: raised during the consensus-node BLL right-sizing review (epic #713).
Contributor guide
Research direction
Start in internal/reality/consensus_checker.go at consensusChecker.RefreshState and trace the shared models.ConsensusCapsuleName and ConsensusNodeScope helpers. Add unit coverage for a ConsensusCapsule absent from persisted state, and verify that listing capsules reconciles discovered nodes into the reality map without breaking persisted scopes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100