-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add SingleGossip commitment level to use for subscriptions #10147
Add SingleGossip commitment level to use for subscriptions #10147
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10147 +/- ##
=======================================
Coverage 81.4% 81.5%
=======================================
Files 288 283 -5
Lines 66211 66176 -35
=======================================
+ Hits 53938 53949 +11
+ Misses 12273 12227 -46 |
5722fb4
to
e5c44f1
Compare
e5c44f1
to
dc3fde2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is great that we are moving towards the direction of only checking subscriptions that need to be checked!
I think a more generalized solution could be implemented (now or later) where we track the last checked slot for a particular commitment level. Right now, it looks like Max
, Root
, and Single
could all be double checked in the current implementation. A nice side effect of tracking the last checked slot for each commitment level would be that we could use it to initialize last_notified_slot
for account subscriptions which seems kind of tricky for single gossip
@@ -491,7 +533,16 @@ impl RpcSubscriptions { | |||
|
|||
pub fn remove_program_subscription(&self, id: &SubscriptionId) -> bool { | |||
let mut subscriptions = self.subscriptions.program_subscriptions.write().unwrap(); | |||
remove_subscription(&mut subscriptions, id) | |||
if remove_subscription(&mut subscriptions, id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be time to add a subscription id lookup map, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on slack, agreed! Will file an issue for follow-up refactoring work.
Problem
#10137 investigates triggering bank-related notifications from gossip, but the notification thread will get bogged down if it has to check the entire notifications list twice per slot. It would be better to separate subscriptions that should be notified via gossip and those that should be notified vie replay stage, so they can be checked and notified separately.
Summary of Changes
Open Questions:
SingleGossip
commitment level in rpc.rs? If so, how will we get the most recent 2/3 slot from cluster_info_vote_listener?