-
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
Put accounts data len updates behind feature gate #22918
Put accounts data len updates behind feature gate #22918
Conversation
4d515f5
to
43cd01a
Compare
Codecov Report
@@ Coverage Diff @@
## master #22918 +/- ##
=======================================
Coverage 81.3% 81.3%
=======================================
Files 560 560
Lines 152043 152045 +2
=======================================
+ Hits 123623 123625 +2
Misses 28420 28420 |
@brooksprumo I was surprised that updating the accounts data len with a delta is only done for rent collection. Could it be used for transaction execution as well so that the feature switch can be moved inside there? Also, since transactions can be executed in parallel, isn't it possible that there is a data race when two txs load the account data len independently before storing it? |
So here's where the accounts data len is tracked/used within the invoke context: solana/program-runtime/src/invoke_context.rs Lines 494 to 499 in 28442aa
It has a feature gate around it there, and that cannot be removed since it could cause instructions to fail that exceed the accounts data budget. Yes, I could move this PR's feature gate into
This is good to know! Hah! I was observing discrepancies in the accounts_data_len vs the value computed during generate_index() (Discord link), so maybe this is the reason why. |
PR is here: #22986 |
Sweet, sounds good! |
(cherry picked from commit f0f4042)
(cherry picked from commit f0f4042) Co-authored-by: Brooks Prumo <[email protected]>
Problem
Updates to the Bank's
accounts_data_len
when collecting rent is not feature gated behindcap_accounts_data_len
. This should've been feature-gated when it was first merged in #22412.See here and here for existing usage of the feature.
Summary of Changes
Put the update behind the feature gate.
Related to #21604