-
Notifications
You must be signed in to change notification settings - Fork 162
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
Gas Calculation per function #116
Comments
The docs on metering are very sparse. The implementation in Rust is here: https://github.com/wasmerio/wasmer/blob/master/lib/middleware-common/src/metering.rs That is some middleware that injects metering code at module compilation. This functionality is not exposed in either the Go or C APIs in the main release of wasmer and this library, unfortunately. It's not impossible to get it working though. A number of branches that are a little stale now, but work, are out there that implement the necessary APIs in the Rust -> C bridge and C -> Go bridge. Another thing to be aware of is that the metering as currently implemented is buggy and can miss some functions that exceed the set limit. See wasmerio/wasmer#999 |
We can make it a higher priority. As @AdamSLevy said, we must first support middleware in the C API, then in Go. |
@Hywan Tell me, is there a plan to add this functionality? |
@Hywan adding this to C runtime is a great idea. one can look at this issue as an important enhancement to the security model currently offered. hosts can prevent some attack vectors through this feature imo. |
Any update on this? |
Can we calculate Cost for each function using go-wasmer?( something like ethereum is doing)
Ex: if we are executing simple rust code to add two numbers, need to know the cost for
+
operator.I see there are implementation in wasmer/pull/450
But didn't get how exactly cost is calculating. where is cost table here?
Is there any doc to understand this?
Thanks
The text was updated successfully, but these errors were encountered: