* Return error for excluded secondary-index keys (#17193)
* Add runtime helpers to check secondary indexes for key
* Add custom rpc error
* Check secondary-index key inclusion in rpc
* Clone complete AccountSecondaryIndexes into rpc to avoid bank query
(cherry picked from commit 27004f1b76
)
# Conflicts:
# core/src/rpc.rs
* Fix conflicts
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
@@ -693,6 +693,10 @@ impl Accounts {
|
||||
.0
|
||||
}
|
||||
|
||||
pub fn account_indexes_include_key(&self, key: &Pubkey) -> bool {
|
||||
self.accounts_db.account_indexes.include_key(key)
|
||||
}
|
||||
|
||||
pub fn load_all(&self, ancestors: &Ancestors) -> Vec<(Pubkey, AccountSharedData, Slot)> {
|
||||
self.accounts_db.scan_accounts(
|
||||
ancestors,
|
||||
|
@@ -4144,6 +4144,10 @@ impl Bank {
|
||||
.load_by_index_key_with_filter(&self.ancestors, index_key, filter)
|
||||
}
|
||||
|
||||
pub fn account_indexes_include_key(&self, key: &Pubkey) -> bool {
|
||||
self.rc.accounts.account_indexes_include_key(key)
|
||||
}
|
||||
|
||||
pub fn get_all_accounts_with_modified_slots(&self) -> Vec<(Pubkey, AccountSharedData, Slot)> {
|
||||
self.rc.accounts.load_all(&self.ancestors)
|
||||
}
|
||||
|
Reference in New Issue
Block a user