1
1
use {
2
- crate :: { account_storage :: meta :: StoredAccountMeta , accounts_db :: AccountsDb } ,
2
+ crate :: { accounts_db :: AccountsDb , accounts_update_notifier_interface :: AccountForGeyser } ,
3
3
solana_account:: AccountSharedData ,
4
4
solana_clock:: Slot ,
5
5
solana_measure:: measure:: Measure ,
@@ -92,7 +92,7 @@ impl AccountsDb {
92
92
let mut pubkeys = HashSet :: new ( ) ;
93
93
94
94
// populate `accounts_duplicate` for any pubkeys that are in this storage twice.
95
- // Storages cannot return `StoredAccountMeta<'_> ` for more than 1 account at a time, so we have to do 2 passes to make sure
95
+ // Storages cannot return `AccountForGeyser ` for more than 1 account at a time, so we have to do 2 passes to make sure
96
96
// we don't have duplicate pubkeys.
97
97
let mut i = 0 ;
98
98
storage_entry. accounts . scan_pubkeys ( |pubkey| {
@@ -104,14 +104,14 @@ impl AccountsDb {
104
104
105
105
// now, actually notify geyser
106
106
let mut i = 0 ;
107
- storage_entry. accounts . scan_accounts ( |account| {
107
+ storage_entry. accounts . scan_accounts_for_geyser ( |account| {
108
108
i += 1 ;
109
109
account_len += 1 ;
110
- if notified_accounts. contains ( account. pubkey ( ) ) {
110
+ if notified_accounts. contains ( account. pubkey ) {
111
111
notify_stats. skipped_accounts += 1 ;
112
112
return ;
113
113
}
114
- if let Some ( highest_i) = accounts_duplicate. get ( account. pubkey ( ) ) {
114
+ if let Some ( highest_i) = accounts_duplicate. get ( account. pubkey ) {
115
115
if highest_i != & i {
116
116
// this pubkey is in this storage twice and the current instance is not the last one, so we skip it.
117
117
// We only send unique accounts in this slot to `notify_filtered_accounts`
@@ -140,7 +140,7 @@ impl AccountsDb {
140
140
slot : Slot ,
141
141
write_version : u64 ,
142
142
notified_accounts : & mut HashSet < Pubkey > ,
143
- accounts_to_stream : impl Iterator < Item = StoredAccountMeta < ' a > > ,
143
+ accounts_to_stream : impl Iterator < Item = AccountForGeyser < ' a > > ,
144
144
notify_stats : & mut GeyserPluginNotifyAtSnapshotRestoreStats ,
145
145
) {
146
146
let notifier = self . accounts_update_notifier . as_ref ( ) . unwrap ( ) ;
@@ -153,7 +153,7 @@ impl AccountsDb {
153
153
notify_stats. total_pure_notify += measure_pure_notify. as_us ( ) as usize ;
154
154
155
155
let mut measure_bookkeep = Measure :: start ( "accountsdb-plugin-notifying-bookeeeping" ) ;
156
- notified_accounts. insert ( * account. pubkey ( ) ) ;
156
+ notified_accounts. insert ( * account. pubkey ) ;
157
157
measure_bookkeep. stop ( ) ;
158
158
notify_stats. total_pure_bookeeping += measure_bookkeep. as_us ( ) as usize ;
159
159
@@ -167,18 +167,12 @@ impl AccountsDb {
167
167
#[ cfg( test) ]
168
168
pub mod tests {
169
169
use {
170
- crate :: {
171
- account_storage:: meta:: StoredAccountMeta ,
172
- accounts_db:: AccountsDb ,
173
- accounts_update_notifier_interface:: {
174
- AccountsUpdateNotifier , AccountsUpdateNotifierInterface ,
175
- } ,
170
+ super :: * ,
171
+ crate :: accounts_update_notifier_interface:: {
172
+ AccountsUpdateNotifier , AccountsUpdateNotifierInterface ,
176
173
} ,
177
174
dashmap:: DashMap ,
178
- solana_account:: { AccountSharedData , ReadableAccount } ,
179
- solana_clock:: Slot ,
180
- solana_pubkey:: Pubkey ,
181
- solana_transaction:: sanitized:: SanitizedTransaction ,
175
+ solana_account:: ReadableAccount as _,
182
176
std:: sync:: {
183
177
atomic:: { AtomicBool , Ordering } ,
184
178
Arc ,
@@ -223,10 +217,10 @@ pub mod tests {
223
217
& self ,
224
218
slot : Slot ,
225
219
_write_version : u64 ,
226
- account : & StoredAccountMeta ,
220
+ account : & AccountForGeyser < ' _ > ,
227
221
) {
228
222
self . accounts_notified
229
- . entry ( * account. pubkey ( ) )
223
+ . entry ( * account. pubkey )
230
224
. or_default ( )
231
225
. push ( ( slot, account. to_account_shared_data ( ) ) ) ;
232
226
}
0 commit comments