-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Accountsdb plugin transaction part 3: Transaction Notifier #21374
Accountsdb plugin transaction part 3: Transaction Notifier #21374
Conversation
Changes to transaction_status_service to notify the notifier of the transaction data. Interface to query the plugin's interest in transaction data
4b354e9
to
fa7cda8
Compare
Codecov Report
@@ Coverage Diff @@
## master #21374 +/- ##
=========================================
Coverage 81.5% 81.5%
=========================================
Files 500 505 +5
Lines 140604 141639 +1035
=========================================
+ Hits 114704 115549 +845
- Misses 25900 26090 +190 |
Might be good to include a comment describing the high level flow for the components/logic in this notification model. From what I gather it looks something like:
|
/// Check if the plugin is interested in transaction data | ||
/// Default is false -- if the plugin is not interested in | ||
/// transaction data, please return false. | ||
fn to_notify_transaction_data(&self) -> bool { |
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.
nit:
to_notify_transaction_data
-> transaction_notifications_enabled
to_notify_account_data
-> account_data_notifications_enabled
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.
done
let transaction_log_info = | ||
Self::build_replica_transaction_info(signature, transaction_status_meta, transaction); |
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.
can move this outside of the self.plugin_manager.write().unwrap();
lock above
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.
done
transaction_status_meta: &TransactionStatusMeta, | ||
transaction: &SanitizedTransaction, | ||
) { | ||
self.notify_transaction_info(slot, signature, transaction_status_meta, transaction); |
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.
seems like we could just move the body of notify_transaction_info
inside here, the function signatures look exactly the same
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.
done
); | ||
} | ||
|
||
pub type TransactionNotifier = Arc<RwLock<dyn TransactionNotifierInterface + Sync + Send>>; |
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 I prefer to be more explicit:
- TransactionNotifierInterface -> TransactinNotifier
- TransactionNotifier -> TransactionNotifierLock
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.
done
…bs#21374) The TransactionNotifierInterface interface for notifying transactions. Changes to transaction_status_service to notify the notifier of the transaction data. Interface to query the plugin's interest in transaction data
…olana-labs#21374)" This reverts commit 53ea9b8.
Problem
This enables transaction data to be notified through the plugin framework.
Summary of Changes
Fixes #
This is the 3rd part of original PR #21247