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

Wallet cleanup should use an iter to load records #5098

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

NullSoldier
Copy link
Contributor

Summary

In the case that the records to cleanup is very high, we shouldn't load all of them in memory before cleaning up. We should only load 1 leveldb memory block at most. This will ensure if there is a bad feedback loop this list won't permanently grow and continue to use more memory as it tries to clean up accounts.

This also ensures that the account record deletion is considered a record so deleting thousands of empty account cleanup records doesn't run forever.

Testing Plan

Running this with a lot of wallets and using the reset command.

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

In the case that the records to cleanup is very high, we shouldn't load
all of them in memory before cleaning up. We should only load 1 leveldb
memory block at most. This will ensure if there is a bad feedback loop
this list won't permanently grow and continue to use more memory as it
tries to clean up accounts.

This also ensures that the account record deletion is considered a
record so deleting thousands of empty account cleanup records doesn't
run forever.
@NullSoldier NullSoldier marked this pull request as ready for review July 1, 2024 23:30
@NullSoldier NullSoldier requested a review from a team as a code owner July 1, 2024 23:30
@NullSoldier NullSoldier merged commit e22b3b8 into staging Jul 2, 2024
11 checks passed
@NullSoldier NullSoldier deleted the jason/cleanup-iter branch July 2, 2024 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants