This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Purge accounts with lamports=0 on rooted forks#6315
Merged
sakridge merged 1 commit intosolana-labs:masterfrom Oct 23, 2019
Merged
Purge accounts with lamports=0 on rooted forks#6315sakridge merged 1 commit intosolana-labs:masterfrom
sakridge merged 1 commit intosolana-labs:masterfrom
Conversation
Contributor
Author
|
@rob-solana this is WIP, but I think this is what you meant? |
Codecov Report
@@ Coverage Diff @@
## master #6315 +/- ##
========================================
+ Coverage 78.7% 78.8% +0.1%
========================================
Files 217 217
Lines 41184 41276 +92
========================================
+ Hits 32424 32564 +140
+ Misses 8760 8712 -48 |
rob-solana
previously approved these changes
Oct 10, 2019
Contributor
Author
Yea that's not a bad idea, cleaning up makes sense before the snapshot and that's already async. I thought of that but thought they didn't really fit together, but as a cleanup to make the snapshot size smaller makes sense. |
1b09cb7 to
4bd6db3
Compare
Pull request has been modified.
d82b25c to
05cb78e
Compare
05cb78e to
fc4c8fb
Compare
fc4c8fb to
67f08c3
Compare
rob-solana
reviewed
Oct 23, 2019
| } | ||
|
|
||
| pub fn hash_account_data(fork: Fork, lamports: u64, data: &[u8], pubkey: &Pubkey) -> Hash { | ||
| if lamports == 0 { |
Contributor
There was a problem hiding this comment.
this one's interesting, how come?
Contributor
Author
There was a problem hiding this comment.
Because if we purge, we would not maintain the correct bank hash value.
rob-solana
approved these changes
Oct 23, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Accounts with 0 lamports could never be purged from accounts_db, thus causing potential for resource exhaustion attacks.
Summary of Changes
Add a function to purge accounts with 0 lamports on rooted forks.
TODO:
hash_internal_stateFixes #6299