-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[move] Rewrite verifier metering #19036
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
deae22e
cache typing
tnowacki 2c77e62
prog
tnowacki 1e230a7
ability cache
tnowacki 2320d7f
better charging
tnowacki 0e701d0
better charging
tnowacki d32b1d9
fix lifetimes
tnowacki 03390b0
ability_field_requirements
tnowacki 59a80f1
signatures
tnowacki 4157b63
locals_safety
tnowacki c3c13e7
massage constants
tnowacki 4034d76
metrics
tnowacki 5ed7f96
charge rework
tnowacki 48af8f0
fix tests
tnowacki 17ff017
adjust numbers
tnowacki 76648b2
fixed reference safety
tnowacki cd4790f
for signing
tnowacki 654b157
updated scaling
tnowacki 6e2cecd
calibrate
tnowacki f0dee4b
calibration
tnowacki 28d1842
limits
tnowacki b9d9d9a
small fixes
tnowacki 3b21072
nits
tnowacki 7cb4526
fix tests
tnowacki 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
locals_safety
- Loading branch information
commit 4157b635d17848dfa0969a082460980bfc4ebe35
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -26,6 +26,8 @@ pub(crate) enum LocalState { | |
} | ||
use LocalState::*; | ||
|
||
use crate::ability_cache::AbilityCache; | ||
|
||
pub(crate) const STEP_BASE_COST: u128 = 2; | ||
pub(crate) const RET_PER_LOCAL_COST: u128 = 5; | ||
pub(crate) const JOIN_BASE_COST: u128 = 2; | ||
|
@@ -41,8 +43,10 @@ pub(crate) struct AbstractState { | |
impl AbstractState { | ||
/// create a new abstract state | ||
pub fn new( | ||
module: &CompiledModule, | ||
_module: &CompiledModule, | ||
function_context: &FunctionContext, | ||
ability_ache: &mut AbilityCache, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: spelling |
||
meter: &mut (impl Meter + ?Sized), | ||
) -> PartialVMResult<Self> { | ||
let num_args = function_context.parameters().len(); | ||
let num_locals = num_args + function_context.locals().len(); | ||
|
@@ -55,7 +59,14 @@ impl AbstractState { | |
.0 | ||
.iter() | ||
.chain(function_context.locals().0.iter()) | ||
.map(|st| module.abilities(st, function_context.type_parameters())) | ||
.map(|st| { | ||
ability_ache.abilities( | ||
Scope::Function, | ||
meter, | ||
function_context.type_parameters(), | ||
st, | ||
) | ||
}) | ||
.collect::<PartialVMResult<Vec<_>>>()?; | ||
|
||
Ok(Self { | ||
|
This file contains 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
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.
nit: move
use
up to the other use statements?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.
Remember what we were discussing about autoimports in the IDE... yeah this is why its hard