refactor(op-devstack): add unified Registry for component storage (Phase 2)#18873
Merged
refactor(op-devstack): add unified Registry for component storage (Phase 2)#18873
Conversation
pcw109550
approved these changes
Feb 3, 2026
6c97f16 to
e52819a
Compare
26da050 to
a1d12d8
Compare
a1d12d8 to
9d4e7af
Compare
c001e43 to
aecfdc2
Compare
Introduce a unified Registry type that can replace the 14+ separate
locks.RWMap instances in the Orchestrator. The Registry provides:
- Single map storage keyed by ComponentID (from Phase 1)
- Secondary indexes by ComponentKind and ChainID for efficient queries
- Type-safe generic accessor functions (RegistryGet, RegistryGetByKind, etc.)
- Thread-safe concurrent access via sync.RWMutex
- Registrable interface for self-registering components
Also adds HasChainID() helper to ComponentID to reduce code duplication.
This is Phase 2 of the ID type system refactor. The Registry is designed
to coexist with existing RWMap fields during incremental migration.
Amendments:
* op-devstack: avoid calling range callbacks under lock
aecfdc2 to
82e1be7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a unified
Registrytype for op-devstack that can replace the 14+ separatelocks.RWMapinstances currently used in the Orchestrator. This is Phase 2 of the ID type system refactor.Problem
The current Orchestrator maintains separate registries for each component type:
This leads to:
Solution
A single
Registrywith secondary indexes:Type-safe access via generic functions:
Changes
stack/registry.gostack/registry_test.gostack/component_id.goHasChainID()helperTest Plan
Migration Path
This is non-breaking. The Registry can coexist with existing
locks.RWMapfields: