-
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
add_recursion_counter #333
base: next_breaking_update
Are you sure you want to change the base?
Conversation
@@ -38,6 +38,8 @@ pub(crate) fn call_module( | |||
))) | |||
})?; | |||
|
|||
interface.increment_recursion_counter()?; |
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.
doesn't that double-count with the increment that happens also in init_call
?
@@ -49,6 +51,8 @@ pub(crate) fn call_module( | |||
if cfg!(not(feature = "gas_calibration")) { | |||
set_remaining_points(&env, ctx, resp.remaining_gas)?; | |||
} | |||
|
|||
interface.decrement_recursion_counter()?; |
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.
doesn't this double-decrement with the decrement in finish_call ?
@@ -152,6 +152,9 @@ fn abi_call(store_env: FunctionEnvMut<ABIEnv>, arg_offset: i32) -> Result<i32, W | |||
let remaining_gas = handler.get_remaining_gas(); | |||
let interface = handler.exec_env.get_interface(); | |||
let module = helper_get_module(interface, bytecode, remaining_gas)?; | |||
interface.increment_recursion_counter().map_err(|e| { |
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.
double-counts with the init_call_wasmv1
@@ -161,6 +164,9 @@ fn abi_call(store_env: FunctionEnvMut<ABIEnv>, arg_offset: i32) -> Result<i32, W | |||
handler.get_gas_costs().clone(), | |||
) | |||
.map_err(|err| WasmV1Error::RuntimeError(format!("Could not run function: {}", err)))?; | |||
interface.decrement_recursion_counter().map_err(|e| { |
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.
double-decrements with the finish_call below
No description provided.