-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Set cap for total accounts data size #21604
Comments
@CriesofCarrots @t-nelson @sakridge @carllin @jackcmay @jeffwashington Per our call earlier, does this look right for what to do? |
|
@brooksprumo well, if |
i know. i'm very late to comment at this moment... could you polish up your (already well-written) issue description a bit, regarding the following questions?
so, if the cluster reaches to the 128GB of account data size as a whole, the cluster basically bricked? i think on-chain data only does increase over time like with other online platforms. it might be preferable more nuanced preventive measures are taken like setting-up alerts, increase rent exponentially to the 128GB hard cap, pre-allocating the 128GB on disk or implementing stale account data eviction mechanism? |
This was suggested by @sakridge to store the
No. Only transactions that increase accounts data size with fail, but all other transactions will be unaffected.
I agree. I'll make the issue more clear that this is a stop-gap for the better preventative measures that you've outlined. Dynamic rent (#21348) is another issue I'm looking at. I like the ideal of setting up alerts; I'll look into adding that. Same with pre-allocating.
My understanding is that this is what Rent is for. I'm not sure there's an acceptable way to evict rent-exempt account data, right? Happy to hear about use-cases for this though! |
More info: I just ran some builds on my GCE validator against mnb to see if the computed accounts data size from loading a snapshot matched regular replay for a bank at the same slot. The two values were different. I'm not sure yet why, but that is the reason why having the accounts data size in the snapshot would be needed. |
thanks for more details.
yeah, but not strong opinion. the role of accounts_data_len would be like the snapshot hash. ideally, this should be able to calculate for any root. i'm a bit worried about silently introducing some discrepancy bug. as you just observed (#21604 (comment)) i think bank (snapshot) field should be avoided if possible. also, a small sysvar might be desired if unavoidable for the ultimate safe snapshot thing (pending for toooo long....) #6936 |
Closing this PR as it cannot be merged. It would introduce potential non-determinism. For more information, please refer to #27029 |
Overview
The data for accounts is currently unbounded and validators store this on disk (or in tempfs). The Solana minimum validator specs should factor in for the maximum amount of account data allowed.
Note, this work is a stop-gap to ensure the network doesn't fall over under extreme accounts data size usage. There is on-going work to tackle this in a long-term way, likely based on economics. Please refer to code/issues/PRs about the compute budget, and dynamic rent.
Design
Set a new constant for the maximum accounts data size
Make transactions fail if they exceed the max accounts data size
If a transaction attempts to allocate more data such that it would exceed the maximum allowed accounts data size, then the transaction shall fail. As far as I know, this only affects creating accounts, and reallocating accounts.
InvokeContext
Track total account data size in Bank
InvokeContext
with the values for Accounts Data Budget, and probably Bank is the right spotaccounts_data_len
field to BankCompute total account data size when loading from a snapshot
accounts_data_len
in the snapshot, and then that'll be used when loading from the snapshot.Feature gate
Questions
Should this be feature-gated?Deterministic seed/starting value. When this feature is enabled, we need to ensure that the whole cluster has the same value for the total accounts data size in the current bank. How should that be done?accounts_data_len
already doesn't track everything that a validator holds on disk, this is used as an approximation. So I'd say that using a value that's close should also work.Tasks
The text was updated successfully, but these errors were encountered: