Skip to content

Conversation

Sobeston
Copy link
Contributor

Main objective: add an allocator parameter to account gets - call sites currently rely on using the accountsdb allocator, which is pointless

@Sobeston Sobeston self-assigned this Sep 25, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in Sig Sep 25, 2025
@Sobeston Sobeston force-pushed the sobe/accountsdb/cleanup branch 4 times, most recently from 50f0eec to 322364a Compare September 26, 2025 03:09
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 92.08633% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/consensus/tower.zig 20.00% 4 Missing ⚠️
src/consensus/replay_tower.zig 40.00% 3 Missing ⚠️
src/accountsdb/fuzz.zig 0.00% 2 Missing ⚠️
src/accountsdb/db.zig 96.55% 1 Missing ⚠️
src/runtime/account_loader.zig 66.66% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/accountsdb/account_store.zig 96.65% <100.00%> (+0.56%) ⬆️
src/accountsdb/manager.zig 97.09% <100.00%> (ø)
src/replay/freeze.zig 95.70% <100.00%> (-0.30%) ⬇️
src/replay/resolve_lookup.zig 94.71% <100.00%> (+0.08%) ⬆️
src/replay/service.zig 94.36% <100.00%> (ø)
src/replay/update_sysvar.zig 95.48% <100.00%> (ø)
src/runtime/program/address_lookup_table/state.zig 93.33% <100.00%> (+1.02%) ⬆️
src/accountsdb/db.zig 89.23% <96.55%> (+0.32%) ⬆️
src/runtime/account_loader.zig 97.32% <66.66%> (ø)
src/accountsdb/fuzz.zig 0.00% <0.00%> (ø)
... and 2 more

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sobeston Sobeston marked this pull request as ready for review September 26, 2025 13:58
@dnut dnut changed the title feat(accountsdb): cleanup feat(accountsdb): add allocator param to get methods Sep 29, 2025
Copy link
Contributor

@dnut dnut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great. i just have one small request and a question

@github-project-automation github-project-automation bot moved this from 🏗 In progress to 👀 In review in Sig Sep 29, 2025
@Sobeston Sobeston force-pushed the sobe/accountsdb/cleanup branch from 322364a to 1c81af9 Compare September 29, 2025 17:50
@Sobeston Sobeston requested review from dnut and InKryption September 29, 2025 17:53
Copy link
Contributor

@InKryption InKryption left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment, otherwise love this

return .{
.lamports = account.lamports,
.data = .{ .owned_allocation = data },
.data = .{ .unowned_allocation = account.data },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not also just duplicate this data? This seems like it would be unsound in the event that we implement "cleaning logic" on this impl which runs while a caller is still holding onto their reference to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We clone accounts on put, meaning that the ThreadSafeAccountMap itself owns all the account datas by this point already. If the caller calls .deinit() on the accounts they get from .get(), that's a no-op.

in the event that we implement "cleaning logic" on this impl which runs while a caller is still holding onto their reference to it.

I think we'd need to refcount the accounts in this case (or something equivalent), so that's out of scope

@Sobeston Sobeston force-pushed the sobe/accountsdb/cleanup branch from 1c81af9 to 2750563 Compare October 2, 2025 18:52
@Sobeston Sobeston requested a review from InKryption October 2, 2025 18:52
dnut
dnut previously approved these changes Oct 2, 2025
dnut
dnut previously approved these changes Oct 3, 2025
@Sobeston Sobeston enabled auto-merge October 3, 2025 20:06
InKryption
InKryption previously approved these changes Oct 3, 2025
@Sobeston Sobeston dismissed stale reviews from InKryption and dnut via 87c0c63 October 3, 2025 22:46
@Sobeston Sobeston force-pushed the sobe/accountsdb/cleanup branch from 83dbabd to 87c0c63 Compare October 3, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

3 participants