This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Add AccountsDataMeter to InvokeContext#21813
Merged
brooksprumo merged 8 commits intosolana-labs:masterfrom Dec 28, 2021
Merged
Conversation
2037e5e to
3393d2e
Compare
3393d2e to
5293b1b
Compare
Contributor
Author
|
|
04c2aa0 to
ad161a7
Compare
brooksprumo
commented
Dec 16, 2021
Codecov Report
@@ Coverage Diff @@
## master #21813 +/- ##
========================================
Coverage 81.2% 81.2%
========================================
Files 519 520 +1
Lines 145754 145865 +111
========================================
+ Hits 118466 118564 +98
- Misses 27288 27301 +13 |
jackcmay
reviewed
Dec 16, 2021
jackcmay
reviewed
Dec 16, 2021
jackcmay
reviewed
Dec 16, 2021
jackcmay
reviewed
Dec 16, 2021
jackcmay
reviewed
Dec 16, 2021
brooksprumo
commented
Dec 16, 2021
f166d72 to
819ef4d
Compare
jackcmay
reviewed
Dec 22, 2021
1ef0a17 to
c543da6
Compare
e540ff3 to
ea3c53a
Compare
ea3c53a to
f672328
Compare
Lichtso
reviewed
Dec 27, 2021
| } | ||
| self.current = self.current.saturating_add(amount); | ||
| } else { | ||
| let amount = amount.abs() as u64; |
Contributor
There was a problem hiding this comment.
Edge case (with potential panic) which is not covered?
Contributor
Author
There was a problem hiding this comment.
Fair point! I figure since we'll never be able to deallocate more than the maximum that can be allocated, amount should never be less than -MAX_ACCOUNTS_DATA_LEN, which means .abs() here will be safe. Is that sufficient? Would you like a comment and/or a debug_assert!()?
Contributor
There was a problem hiding this comment.
No, makes sense. There should be an implicit debug_assert!() in .abs() already.
Contributor
Author
Lichtso
approved these changes
Dec 28, 2021
mergify Bot
pushed a commit
that referenced
this pull request
Jan 5, 2022
(cherry picked from commit 800472d) # Conflicts: # runtime/src/bank.rs # sdk/src/feature_set.rs
brooksprumo
added a commit
that referenced
this pull request
Jan 5, 2022
(cherry picked from commit 800472d)
brooksprumo
added a commit
that referenced
this pull request
Jan 5, 2022
(cherry picked from commit 800472d)
29 tasks
brooksprumo
added a commit
that referenced
this pull request
Jan 5, 2022
(cherry picked from commit 800472d)
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
Bank does not know how much the accounts data len changes after processing messages.
For more context see the main issue #21604
Summary of Changes
Add AccountsDataMeter to InvokeContext, and return the new accounts_data_len from MessageProcessor::process_message() so that Bank can update its accounts_data_len.
Does not track accounts_data_len yet. That will be part of a subsequent PR.
(Subsequent PR will likely be—or look like—this one: #21994)