refactor(op-devstack): add capability interfaces for polymorphic lookups (Phase 3)#18874
Merged
refactor(op-devstack): add capability interfaces for polymorphic lookups (Phase 3)#18874
Conversation
cad37f6 to
eb6a9ec
Compare
8 tasks
pcw109550
approved these changes
Feb 3, 2026
Member
There was a problem hiding this comment.
The entire files that is added in this PR is dropped at the last PR (phase 6 #18877), and also not used in phase 4, 5. Is this intended, or this specific polymorphic lookup will be addressed in the follow up PR after phase 6?
According to the design doc, FindL2ELCapableByKey should be used at the orchestrator like
func (o *Orchestrator) FindL2EL(key string, chainID eth.ChainID) (L2ELCapable, bool) {
return stack.FindL2ELCapableByKey(o.registry, key, chainID)
}Still approving this PR because this comment may be addressed at phase 6, the last PR.
This was referenced Feb 3, 2026
26da050 to
a1d12d8
Compare
eb6a9ec to
b22581a
Compare
Contributor
|
This pr has been automatically marked as stale and will be closed in 5 days if no updates |
c001e43 to
aecfdc2
Compare
aecfdc2 to
82e1be7
Compare
Introduce L2ELCapable interface that captures shared behavior across
L2ELNode, RollupBoostNode, and OPRBuilderNode without requiring them to
share an ID() method signature.
This enables polymorphic lookups where code can find any L2 EL-capable
component by key+chainID, regardless of concrete type:
sequencer, ok := FindL2ELCapableByKey(registry, "sequencer", chainID)
Previously this required manual multi-registry lookups checking each
type separately.
b22581a to
6c7c339
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 capability interfaces for op-devstack that enable polymorphic lookups across component types with different ID signatures. This is Phase 3 of the ID type system refactor.
Problem
Components like
RollupBoostNodeandOPRBuilderNodeprovide L2 EL functionality but can't implementL2ELNodebecause theirID()methods return different types:This forced manual multi-registry lookups:
Solution
Capability interfaces capture shared behavior without the incompatible
ID()method:Polymorphic lookup by key:
Changes
stack/capabilities.gostack/capabilities_test.goTest Plan
L2ELCapableKinds()returns expected kindsRegistryFindByCapabilityfinds all implementing componentsRegistryFindByCapabilityOnChainfilters by chainFindL2ELCapableByKeypolymorphic lookup worksFindL2ELCapableByKeyprefers L2ELNode when multiple types share a key