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

SIMD-0256: Raise block limit to 60M #5171

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bw-solana
Copy link

@bw-solana bw-solana commented Mar 6, 2025

Problem

Add feature gate and new block limits for solana-foundation/solana-improvement-documents#256

New block limit will apply during epoch transition after feature activation and during bank initialization.

Summary of Changes

  • Apply new block limit when feature is activated.
  • Extend unit test to ensure new block limits get applied.
  • Add unit test to ensure if SIMD-0207 and SIMD-0256 get activated, the 256 limits take precedent

Depends on anza-xyz/solana-sdk#72

/// (account_limit, block_limit, vote_limit)
// ^ Above order is used to be consistent with the order of
// `CostTracker::set_limits`.
pub const fn simd_0256_block_limits() -> (u64, u64, u64) {
Copy link
Author

Choose a reason for hiding this comment

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

@t-nelson - this probably makes your eyes bleed... mea culpa.

Given we're going to keep doing this several more times, what would you like this to look like?

Copy link

@apfitzge apfitzge Mar 6, 2025

Choose a reason for hiding this comment

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

Given we plan to continue this chain, maybe it's better to not use a tuple, and just define a new structure:

pub struct BlockLimits {
    account_cost_limit: u64,
    block_cost_limit: u64,
    vote_cost_limit: u64,
}

refactor CostTracker::set_limit to take this object and store it internally in the CostTracker as well.

edit: fields can be private as well...so then only constructors of this are guaranteed to be from one of our functions in block_cost_limit.rs 😄

Copy link

@apfitzge apfitzge Mar 6, 2025

Choose a reason for hiding this comment

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

if we plan to backport this, would prefer to keep the simple tuple. then do refactoring only on master

@@ -6525,6 +6540,15 @@ impl Bank {
);
}

if new_feature_activations.contains(&feature_set::raise_block_limits_to_60m::id()) {
Copy link
Author

Choose a reason for hiding this comment

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

not sure exactly how we want to handle this conditional logic.. E.g. what would we want to happen if both features were activated in the same epoch?

Currently, we will write the 207 limits then the 256 limits. That seems right to me. Practically speaking, we will activate these in separate epochs, of course.

same thing applies to fn finish_init above

Copy link

@apfitzge apfitzge Mar 6, 2025

Choose a reason for hiding this comment

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

intent is for 207, then 256. the ordering here to me makes sense; if 256 is active, we use 256 limits, regardless of the status of 207.

Copy link

Choose a reason for hiding this comment

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

we should have a test for that case as well? activate 256 first, then 207, make sure we have 256 limits.

Copy link
Author

Choose a reason for hiding this comment

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

test added

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