-
Notifications
You must be signed in to change notification settings - Fork 664
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
Safe math vm logic #2013
Safe math vm logic #2013
Conversation
Codecov Report
@@ Coverage Diff @@
## staging #2013 +/- ##
==========================================
Coverage ? 87.37%
==========================================
Files ? 169
Lines ? 33289
Branches ? 0
==========================================
Hits ? 29085
Misses ? 4204
Partials ? 0
Continue to review full report at Codecov.
|
StorageError(Vec<u8>), | ||
FunctionCallError(FunctionCallError), | ||
/// Serialized external error from External trait implementation. | ||
ExternalError(Vec<u8>), |
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 is the reason we are serializing error here (CC @fckt )?
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.
The serialized error is part of RuntimeExt which comes from primitives
. Either near-vm-logic has to depend on it, or we have to replicate the error. Right now the plan is to allow any error here but in serialized form.
Later we deserialize it back in the Runtime and get the original error type.
result.gas_burnt = safe_add_gas(result.gas_burnt, outcome.burnt_gas)?; | ||
result.gas_burnt_for_function_call = | ||
safe_add_gas(result.gas_burnt_for_function_call, outcome.burnt_gas)?; | ||
// Runtime in `generate_refund_receipts` takes care of using proper value for refunds. |
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.
Thank you for adding this explanation here.
Ref #1461