-
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
Enforce accounts data size limit per block in ReplayStage #25524
Enforce accounts data size limit per block in ReplayStage #25524
Conversation
7a46f0e
to
224ac7b
Compare
Codecov Report
@@ Coverage Diff @@
## master #25524 +/- ##
=========================================
- Coverage 82.1% 82.1% -0.1%
=========================================
Files 628 631 +3
Lines 171471 173848 +2377
=========================================
+ Hits 140878 142804 +1926
- Misses 30593 31044 +451 |
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.
lgtm
} | ||
|
||
debug_assert!(MAX_ACCOUNT_DATA_BLOCK_LEN <= i64::MAX as u64); | ||
if bank.load_accounts_data_size_delta_on_chain() > MAX_ACCOUNT_DATA_BLOCK_LEN as i64 { |
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.
Not familiar with what bank.load_accounts_data_size_delta_on_chain()
, but the logic looks good. Will deep dive to that function late.
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.
The change in accounts data size from the bank processing transactions is tracked in Bank::accounts_data_size_delta_on_chain
, an AtomicI64
. So ReplyStage here will check to ensure the block hasn't allocated more accounts data this block that the max (MAX_ACCOUNT_DATA_BLOCK_LEN
), and only due to transactions.
This purposely ignores any other changes to the accounts data size, like reclaimed accounts due to rent collection (which are tracked in Bank::accounts_data_size_delta_off_chain
).
@sakridge Can you take a look too to make sure this is as-expected? |
224ac7b
to
58697db
Compare
58697db
to
f79078f
Compare
4888ef6
to
978f312
Compare
978f312
to
49d4357
Compare
@sakridge This PR is ready for another review. |
aca39a5
to
27ae751
Compare
Rebased and force-pushed to handle feature set conflicts. |
27ae751
to
f397e33
Compare
f397e33
to
2e246e9
Compare
Rebased and force-pushed to handle feature set conflicts. |
(cherry picked from commit b4b191e) # Conflicts: # ledger/src/blockstore_processor.rs
Problem
The per-block accounts data size limit is only part of BankingStage, and is not checked in ReplayStage.
Summary of Changes
Add checks to ReplayStage that will fail blocks that exceed the accounts data size per-block limit.
Feature Gate Issue: #25517