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

Runtime: add RentCollectorWithMetrics wrapper type for SVM #29

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ee0667d
ledger-tool: Make blockstore slot functional with no tx metadata (#2423)
steviez Aug 21, 2024
053faa6
Check poh_recorder.start_slot() hasn't been dumped previously before …
wen-coding Aug 22, 2024
0da63a3
cli: Simulate for compute units consumed during transfer (#1923)
joncinque Aug 22, 2024
8ae52fb
accounts-db: reopen mmap as file-backed storage after shrink_progress…
HaoranYi Aug 22, 2024
530e9c3
feat: support committing fee-only transactions (#2425)
jstarry Aug 22, 2024
4cf51ba
TransactionMeta - unsafe documentation (#2685)
apfitzge Aug 22, 2024
35051c7
Replace unbounded with bounded as single channel is used (#2646)
ksolana Aug 22, 2024
ff87ed9
gossip: ignore retransmitter signatures when comparing duplicate shre…
AshwinSekar Aug 22, 2024
e429384
add index stat accounts_not_found_in_index (#2686)
jeffwashington Aug 22, 2024
5e9710a
move to fork choice (#2698)
bw-solana Aug 22, 2024
22eec1c
sdk: refactor: clean up entrypoint (#2635)
andreisilviudragnea Aug 22, 2024
1444baa
replay: do not early return when marking slots duplicate confirmed (#…
AshwinSekar Aug 22, 2024
2ff3814
build(deps): bump quote from 1.0.36 to 1.0.37 (#2712)
dependabot[bot] Aug 23, 2024
93341c6
cli: Use a better amount during transaction simulation (#2709)
joncinque Aug 23, 2024
9483006
TransactionView: Address Table Lookup Iterator (#2639)
apfitzge Aug 23, 2024
c6703cb
Program Test: clean up invoke_builtin_function (#2694)
andreisilviudragnea Aug 23, 2024
0ad9fe1
ci: only upload the integer part for the benchmark (#2713)
yihau Aug 23, 2024
09f5f5b
adds test coverage for Shred::is_shred_duplicate (#2723)
behzadnouri Aug 23, 2024
fc84a52
add stats on clean (#2703)
jeffwashington Aug 23, 2024
2bdabfa
Checks ref count and slot list again before flushing index entry (#2722)
brooksprumo Aug 23, 2024
acf5baf
[zk-sdk] Instantiate `From<u8; LEN>` for elgamal pod types (#2711)
samkim-crypto Aug 23, 2024
1588bca
ff cleanup: remove enable_gossip_duplicate_proof_ingestion (#2707)
wen-coding Aug 23, 2024
52e7329
Program Test: Fix invoke_builtin_function unwinding (#2632)
andreisilviudragnea Aug 23, 2024
106d4cf
Remove `slot_epoch` from SVM (#2720)
LucasSte Aug 23, 2024
d109065
SVM: add new `solana-svm-rent-collector` crate (#2688)
buffalojoec Aug 23, 2024
e421201
Runtime: add `RentCollectorWithMetrics` wrapper type for SVM
buffalojoec Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ members = [
"streamer",
"svm",
"svm-conformance",
"svm-rent-collector",
"svm-transaction",
"svm/examples/paytube",
"test-validator",
Expand Down Expand Up @@ -434,6 +435,7 @@ solana-streamer = { path = "streamer", version = "=2.1.0" }
solana-svm = { path = "svm", version = "=2.1.0" }
solana-svm-conformance = { path = "svm-conformance", version = "=2.1.0" }
solana-svm-example-paytube = { path = "svm/examples/paytube", version = "=2.1.0" }
solana-svm-rent-collector = { path = "svm-rent-collector", version = "=2.1.0" }
solana-svm-transaction = { path = "svm-transaction", version = "=2.1.0" }
solana-system-program = { path = "programs/system", version = "=2.1.0" }
solana-test-validator = { path = "test-validator", version = "=2.1.0" }
Expand Down
63 changes: 49 additions & 14 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,7 @@ struct CleanAccountsStats {
remove_dead_accounts_shrink_us: AtomicU64,
clean_stored_dead_slots_us: AtomicU64,
uncleaned_roots_slot_list_1: AtomicU64,
get_account_sizes_us: AtomicU64,
}

impl CleanAccountsStats {
Expand Down Expand Up @@ -2030,6 +2031,7 @@ pub struct ShrinkStats {
alive_accounts: AtomicU64,
accounts_loaded: AtomicU64,
purged_zero_lamports: AtomicU64,
accounts_not_found_in_index: AtomicU64,
}

impl ShrinkStats {
Expand Down Expand Up @@ -2133,6 +2135,11 @@ impl ShrinkStats {
self.purged_zero_lamports.swap(0, Ordering::Relaxed),
i64
),
(
"accounts_not_found_in_index",
self.accounts_not_found_in_index.swap(0, Ordering::Relaxed),
i64
),
);
}
}
Expand Down Expand Up @@ -2340,6 +2347,13 @@ impl ShrinkAncientStats {
.swap(0, Ordering::Relaxed),
i64
),
(
"accounts_not_found_in_index",
self.shrink_stats
.accounts_not_found_in_index
.swap(0, Ordering::Relaxed),
i64
),
);
}
}
Expand Down Expand Up @@ -3580,6 +3594,13 @@ impl AccountsDb {
.swap(0, Ordering::Relaxed),
i64
),
(
"get_account_sizes_us",
self.clean_accounts_stats
.get_account_sizes_us
.swap(0, Ordering::Relaxed),
i64
),
(
"clean_old_root_us",
self.clean_accounts_stats
Expand Down Expand Up @@ -3928,6 +3949,10 @@ impl AccountsDb {
alive_accounts.add(ref_count, stored_account, slot_list);
alive += 1;
}
} else {
stats
.accounts_not_found_in_index
.fetch_add(1, Ordering::Relaxed);
}
index += 1;
result
Expand Down Expand Up @@ -3979,6 +4004,11 @@ impl AccountsDb {
}
}

#[cfg(feature = "dev-context-only-utils")]
pub fn set_storage_access(&mut self, storage_access: StorageAccess) {
self.storage_access = storage_access;
}

/// Sort `accounts` by pubkey and removes all but the *last* of consecutive
/// accounts in the vector with the same pubkey.
///
Expand Down Expand Up @@ -8021,20 +8051,25 @@ impl AccountsDb {
dead_slots.insert(*slot);
}
else {
let mut offsets = offsets.iter().cloned().collect::<Vec<_>>();
// sort so offsets are in order. This improves efficiency of loading the accounts.
offsets.sort_unstable();
let dead_bytes = store.accounts.get_account_sizes(&offsets).iter().sum();
store.remove_accounts(dead_bytes, reset_accounts, offsets.len());
if Self::is_shrinking_productive(*slot, &store)
&& self.is_candidate_for_shrink(&store)
{
// Checking that this single storage entry is ready for shrinking,
// should be a sufficient indication that the slot is ready to be shrunk
// because slots should only have one storage entry, namely the one that was
// created by `flush_slot_cache()`.
new_shrink_candidates.insert(*slot);
}
let (_, us) = measure_us!({
let mut offsets = offsets.iter().cloned().collect::<Vec<_>>();
// sort so offsets are in order. This improves efficiency of loading the accounts.
offsets.sort_unstable();
let dead_bytes = store.accounts.get_account_sizes(&offsets).iter().sum();
store.remove_accounts(dead_bytes, reset_accounts, offsets.len());
if Self::is_shrinking_productive(*slot, &store)
&& self.is_candidate_for_shrink(&store)
{
// Checking that this single storage entry is ready for shrinking,
// should be a sufficient indication that the slot is ready to be shrunk
// because slots should only have one storage entry, namely the one that was
// created by `flush_slot_cache()`.
new_shrink_candidates.insert(*slot);
}
});
self.clean_accounts_stats
.get_account_sizes_us
.fetch_add(us, Ordering::Relaxed);
}
}
});
Expand Down
12 changes: 11 additions & 1 deletion accounts-db/src/accounts_index/in_mem_accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,14 +1255,24 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> InMemAccountsIndex<T,
let slot_list = slot_list
.take()
.unwrap_or_else(|| v.slot_list.read().unwrap());
// Check the ref count and slot list one more time before flushing.
// It is possible the foreground has updated this entry since
// we last checked above in `should_evict_from_mem()`.
// If the entry *was* updated, re-mark it as dirty then
// skip to the next pubkey/entry.
let ref_count = v.ref_count();
if ref_count != 1 || slot_list.len() != 1 {
v.set_dirty(true);
break;
}
disk.try_write(
&k,
(
&slot_list
.iter()
.map(|(slot, info)| (*slot, (*info).into()))
.collect::<Vec<_>>(),
v.ref_count(),
ref_count,
),
)
};
Expand Down
Loading