-
Notifications
You must be signed in to change notification settings - Fork 7
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
Deferred_calls #335
base: next_breaking_update
Are you sure you want to change the base?
Deferred_calls #335
Conversation
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.
Besides the two comments I made, don't we want to implement these for wasmv1 ABIs too?
.get_interface() | ||
.deferred_call_quote(asc_slot, max_gas as u64)?; | ||
if !available { | ||
price = 0; |
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.
If !available, why don't we abi_bail!() instead?
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.
because it's a quote, not a reservation attempt
Cargo.toml
Outdated
@@ -11,6 +11,7 @@ chrono = { version = "=0.4", features = ["clock"], default-features = false } | |||
displaydoc = "0.2" | |||
function_name = "0.3" | |||
loupe = "0.1" | |||
#massa-proto-rs = { git = "https://github.com/massalabs/massa-proto-rs.git", rev = "426fd325a55dfcc4033920bed2de075a7e7ad4b7" } |
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.
what happened here ?
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.
update of massa-proto-rs :
src/as_execution/abi.rs
Outdated
(Err(_), _) => abi_bail!("negative validity end period"), | ||
(_, Err(_)) => abi_bail!("invalid validity end thread"), | ||
}; | ||
if max_gas.is_negative() { |
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.
best practice: better do a try_into u64 directly since below we convert using "as u64"
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.
done
src/as_execution/abi.rs
Outdated
(Err(_), _) => abi_bail!("negative validity end period"), | ||
(_, Err(_)) => abi_bail!("invalid validity end thread"), | ||
}; | ||
if max_gas.is_negative() { |
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.
try_into u64
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.
done
src/as_execution/abi.rs
Outdated
if max_gas.is_negative() { | ||
abi_bail!("negative max gas"); | ||
} | ||
if raw_coins.is_negative() { |
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.
try into u64
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.
done
src/types.rs
Outdated
abi_costs.insert(String::from("assembly_script_get_deferred_call_quote"), 11); | ||
abi_costs.insert(String::from("assembly_script_deferred_call_register"), 11); | ||
abi_costs.insert(String::from("assembly_script_deferred_call_exists"), 11); | ||
abi_costs.insert(String::from("assembly_script_deferred_call_cancel"), 11); |
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.
TODO calibrate
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.
Very good start!
TODOs:
- solve all comments
- calibrate gas
- add the WASMV1 version
No description provided.