-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile-time ChannelInterface
subscription check
#8207
Comments
Maybe some reflection stuff like we have for checking that channels have methods returning only void/Safefuture |
Another option could be
It could also check the order of subscriptions being before |
WRT the order, I think it might be a nice to have but the design of it explicitly allow late subscription (It is a feature, 'cose you may want to have different services in different modules initializing independently and async). |
Yeah, I understand that part of init is async, some things could be subscribed later etc, but for core startup subscriptions wrong order could lead to miss of events. Just thinking aloud as hit it today. |
When we introduce classes implementing a channel (ie
SlotEventsChannel
), we could forget to subscribe it during initialization (ie #8128)So we end up implementing and passing all the unit tests (ie
onSlot
) but at runtime the class will never receive the events.We should make sure (via an errorprone plugin or something) that the class instance get subscribed in production code (most of the time happens in
BeaconChainController
but is not always the case)The text was updated successfully, but these errors were encountered: