-
Notifications
You must be signed in to change notification settings - Fork 1k
Write default hash to account storage #469
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,11 +4,13 @@ use { | |
| rayon::prelude::*, | ||
| solana_accounts_db::{ | ||
| accounts_db::{AccountsDb, LoadHint}, | ||
| accounts_hash::AccountHash, | ||
| ancestors::Ancestors, | ||
| }, | ||
| solana_sdk::{ | ||
| account::{AccountSharedData, ReadableAccount, WritableAccount}, | ||
| clock::Slot, | ||
| hash::Hash, | ||
| pubkey::Pubkey, | ||
| sysvar::epoch_schedule::EpochSchedule, | ||
| }, | ||
|
|
@@ -128,11 +130,29 @@ fn test_bad_bank_hash() { | |
| db.store_cached((some_slot, &account_refs[..]), None); | ||
| for pass in 0..2 { | ||
| for (key, account) in &account_refs { | ||
| assert_eq!( | ||
| db.load_account_hash(&ancestors, key, Some(some_slot), LoadHint::Unspecified) | ||
| if pass == 1 { | ||
| assert_eq!( | ||
| db.load_account_hash( | ||
| &ancestors, | ||
| key, | ||
| Some(some_slot), | ||
| LoadHint::Unspecified | ||
| ) | ||
| .unwrap(), | ||
| AccountsDb::hash_account(*account, key) | ||
| ); | ||
| AccountHash(Hash::default()) | ||
| ); | ||
| } else { | ||
| assert_eq!( | ||
| db.load_account_hash( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we ever be saving/loading a hash now? not sure about this test.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the intention of this test is to test load hash from cache vs storage. |
||
| &ancestors, | ||
| key, | ||
| Some(some_slot), | ||
| LoadHint::Unspecified | ||
| ) | ||
| .unwrap(), | ||
| AccountsDb::hash_account(*account, key) | ||
| ); | ||
| } | ||
| } | ||
| if pass == 0 { | ||
| // flush the write cache so we're reading from append vecs on the next iteration | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.