-
Notifications
You must be signed in to change notification settings - Fork 296
SIMD-0289: propose to reduce load data size limit to zero by default #289
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
Closed
tao-stones
wants to merge
2
commits into
solana-foundation:main
from
tao-stones:default-loaded-accounts-data-size-to-zero
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
proposals/0289-default-loaded-accounts-data-size-to-zero.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| simd: '0289' | ||
| title: Set default loaded_accounts_bytes to zero | ||
| authors: Tao Zhu (Anza) | ||
| category: Standard | ||
| type: Core | ||
| status: Review | ||
| created: 2025-05-27 | ||
| feature: | ||
| supersedes: | ||
| superseded-by: | ||
| extends: | ||
| --- | ||
|
|
||
| ## Summary | ||
|
|
||
| This SIMD proposes setting the default value for loaded accounts data size to | ||
| **zero bytes** in the Solana runtime, replacing the current implicit default of | ||
| `MAX_LOADED_ACCOUNTS_DATA_SIZE_BYTES` (64MB). | ||
|
|
||
| ## Motivation | ||
|
|
||
| Currently, the Solana runtime allows transactions to implicitly load up to 64MB | ||
| of account data, [code](https://github.com/anza-xyz/agave/blob/e9389a091f679c9e4595e4286091d1092f58f5dc/program-runtime/src/execution_budget.rs#L27-L30). | ||
|
|
||
| This generous default was intended to avoid accidental transaction failures | ||
| during development or early deployment phases. However, it introduces several | ||
| downsides: | ||
|
|
||
| - Reduces transparency in runtime constraints. | ||
|
|
||
| - Enables unintentional or excessive resource usage. | ||
|
|
||
| - Increases the risk of performance degradation or abuse. | ||
|
|
||
| By reducing the default to zero, developers and operators are required to | ||
| explicitly configure this budget, leading to safer, more predictable, and | ||
| better-controlled execution environments. | ||
|
|
||
| This aligns with broader Solana design goals to ensure deterministic resource | ||
| consumption and to encourage clear contract behavior. | ||
|
|
||
| ## Alternatives Considered | ||
|
|
||
| - Reduce the default to a arbitrary value (e.g., 8MB or 16MB) instead of 0. | ||
|
|
||
| ## New Terminology | ||
|
|
||
| None | ||
|
|
||
| ## Detailed Design | ||
|
|
||
| 1. Introduce a New Default Constant: | ||
| Add a new constant: | ||
| `pub const DEFAULT_LOADED_ACCOUNTS_DATA_SIZE_BYTES: usize = 0` | ||
| Use this wherever a default loaded account data size is required. | ||
|
|
||
| 2. Preserve the Current Maximum: | ||
| Continue to enforce `MAX_LOADED_ACCOUNTS_DATA_SIZE_BYTES` (64MB) as the upper | ||
| bound for explicitly configured limits. | ||
|
|
||
| 3. Gradual Ramp-Down Strategy: | ||
| Implement a phased reduction toward zero. For example, decrease | ||
| `DEFAULT_LOADED_ACCOUNTS_DATA_SIZE_BYTES` by fixed increments (e.g., 8MB per | ||
| epoch). This gives developers time to adapt. | ||
|
|
||
| 4. Final Enforcement: | ||
| Once the target default of zero is reached, completely remove the default. | ||
| All accounts data size limits must then be explicitly defined by the | ||
| transaction or runtime. | ||
|
|
||
| ## Impact | ||
|
|
||
| This change is not backward-compatible by default. Workloads or tests that | ||
| rely on the implicit 64MB limit may break. | ||
|
|
||
| To mitigate the impact: | ||
|
|
||
| - Issue deprecation warnings during the ramp-down phase. | ||
|
|
||
| - Provide guidance and tools for setting explicit limits using the | ||
| set_loaded_accounts_data_size_limit instruction. | ||
|
|
||
| - Use feature gating to manage rollout and allow clusters to opt in progressively. | ||
|
|
||
|
|
||
| ## Security Considerations | ||
|
|
||
| To maintain consensus integrity, both Agave and Firedancer clients must adopt | ||
| this change in a coordinated fashion. | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we specify the exact schedule for this? What increments over what time period?