feat(observer): backward compatible observer groups#65
Open
feat(observer): backward compatible observer groups#65
Conversation
Add support for overriding the observer set on a per-RPC-provider basis.
Each provider can now define its own observers group in config; providers
without one fall back to the global observers.rpc set. Non-RPC providers
(exchange_rates, system, hash_divergence, etc.) use a separate
observers.system set on their own EventBus.
- Add GlobalObservers{RPC, System} config struct; observers.rpc becomes
the fallback for all RPC providers, observers.system for non-RPC
- Add optional observers field on RPC provider config; when set, a
dedicated EventBus is created for that provider
- Rename GetEnabledObserverSet → GetObserverSetFrom(cfg Observers) to
accept an explicit config instead of reading global state
- Replace promauto with manual Register + registerOrExisting helper to
prevent duplicate-registration panics on repeated Init calls
- Fix Publish to only warn on empty subscriber sets for topics that were
explicitly subscribed (avoids false warnings for unregistered topics)
Reverts the breaking config schema change from PR #62 while keeping per-provider observer override capability. Changes: - Remove GlobalObservers struct, revert to flat Observers config - Add GetEnabledObserverSet() for global observer config access - Use single global EventBus for all providers by default - Create per-provider EventBus only when provider has custom observers - Update config.yml with original schema and YAML anchor examples Existing configs continue to work unchanged. Per-provider overrides are opt-in via the observers field on individual RPC providers.
|
|
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.





Description
Reverts the breaking config schema change from PR #62 while keeping per-provider observer override capability.
Changes:
GlobalObserversstruct, revert to flatObserversconfigGetEnabledObserverSet()for global observer config accessBackward Compatibility:
observers.enabledcontinue to work unchangedobserversfield use the global observer setobserversoverride is opt-inJira / Linear Tickets
Testing
Tested with
config.dev.ymlusing 4 RPC providers with different observer configurations:Results:
Metrics confirmed per-provider observer filtering works correctly:
base_fee_per_gasblock_intervalgas_limitfinalized_heightblockgo build ./...go test ./...