-
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
Conversation
@tnowacki is attempting to deploy a commit to the Mysten Labs Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
d7f3e52
to
383823b
Compare
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.
Overall looks good to me, just a couple (mainly smaller) comments.
@@ -161,8 +161,10 @@ macro_rules! safe_unwrap { | |||
match $e { | |||
Some(x) => x, | |||
None => { | |||
let err = PartialVMError::new(StatusCode::UNKNOWN_INVARIANT_VIOLATION_ERROR) | |||
.with_message(format!("{}:{} (none)", file!(), line!())); | |||
let err = move_binary_format::errors::PartialVMError::new( |
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: consider importing these modules instead of fully qualifying them.
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.
This is in a macro declaration. I feel like maybe the fully qualified paths are more clear?
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.
ah! didn't realize that. Makes sense to keep as-is then.
pub(crate) const RET_PER_LOCAL_COST: u128 = 30; | ||
pub(crate) const JOIN_BASE_COST: u128 = 10; | ||
pub(crate) const JOIN_PER_LOCAL_COST: u128 = 5; | ||
use crate::ability_cache::AbilityCache; |
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
function_context: &FunctionContext, | ||
ability_ache: &mut AbilityCache, |
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: spelling
external-crates/move/crates/move-bytecode-verifier/src/reference_safety/abstract_state.rs
Show resolved
Hide resolved
external-crates/move/crates/move-bytecode-verifier/src/reference_safety/abstract_state.rs
Show resolved
Hide resolved
module_ability_cache: RefCell<&'a mut AbilityCache<'env>>, | ||
meter: RefCell<&'b mut M>, |
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.
Is there a particular reason for these RefCell
s? Would be nice if they weren't needed.
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.
laziness, fixed
383823b
to
b9d9d9a
Compare
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.
Looks great!
## Description - Added ability cache for verifier ability queries - Redid metering for typing, local safety, and reference safety ## Test plan - calibrated constants --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
## Description - Added ability cache for verifier ability queries - Redid metering for typing, local safety, and reference safety ## Test plan - calibrated constants --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
Description
Test plan
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.