Skip to content
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

Accounts db #416

Draft
wants to merge 11 commits into
base: 2_0_16
Choose a base branch
from
Prev Previous commit
Next Next commit
clippy+fmt
grooviegermanikus committed Dec 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 4b68f6b52cf55219046c87d5341777f5066d55b7
8 changes: 5 additions & 3 deletions accounts/src/inmemory_account_store.rs
Original file line number Diff line number Diff line change
@@ -92,10 +92,12 @@ impl AccountDataByCommitment {
.unwrap_or(true);

let mut updated = false;
if !self.processed_accounts.contains_key(&data.updated_slot) {

if let std::collections::btree_map::Entry::Vacant(e) =
self.processed_accounts.entry(data.updated_slot)
{
// processed not present for the slot
self.processed_accounts
.insert(data.updated_slot, data.clone());
e.insert(data.clone());
updated = true;
}

14 changes: 4 additions & 10 deletions address-lookup-tables/src/address_lookup_table_store.rs
Original file line number Diff line number Diff line change
@@ -170,17 +170,11 @@ impl AddressLookupTableStore {
}

pub async fn get_accounts(&self, alt: &Pubkey, accounts: &[u8]) -> Vec<Pubkey> {
match self
.get_accounts_in_address_lookup_table(alt, accounts)
self.get_accounts_in_address_lookup_table(alt, accounts)
.await
{
Some(x) => x,
None => {
// forget alt for now, start loading it for next blocks
// loading should be on its way
vec![]
}
}
// fallback to empty vec; forget alt for now, start loading it for next blocks
// loading should be on its way
.unwrap_or_default()
}

pub fn serialize_binary(&self) -> Vec<u8> {
2 changes: 1 addition & 1 deletion blockstore/examples/bench_postgres_simple_select.rs
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ pub async fn main() -> anyhow::Result<()> {
}

async fn parallel_queries(pg_session_config: PostgresSessionConfig) {
let many_sessions = vec![
let many_sessions = [
PostgresSession::new(pg_session_config.clone())
.await
.unwrap(),