From 695ed21b56a612299e8244c4073aa64b53373439 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Fri, 2 Apr 2021 19:24:56 +0300 Subject: [PATCH] Add comments about gas metering --- platforms/app/main.c | 6 +++++- platforms/python/examples/02-metered.py | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/platforms/app/main.c b/platforms/app/main.c index 73aaf31..64fdf08 100644 --- a/platforms/app/main.c +++ b/platforms/app/main.c @@ -16,7 +16,11 @@ #include "m3_api_libc.h" #include "m3_api_tracer.h" -// Gas metering/limit only applies to pre-instrumented modules +/* + * NOTE: Gas metering/limit only applies to pre-instrumented modules. + * You can generate a metered version from any wasm file automatically, using + * https://github.com/ewasm/wasm-metering + */ #define GAS_LIMIT 2000000000000 #define MAX_MODULES 16 diff --git a/platforms/python/examples/02-metered.py b/platforms/python/examples/02-metered.py index 0621c92..7213d14 100755 --- a/platforms/python/examples/02-metered.py +++ b/platforms/python/examples/02-metered.py @@ -3,6 +3,12 @@ import wasm3 import os, time +""" + NOTE: Gas metering/limit only applies to pre-instrumented modules. + You can generate a metered version from any wasm file automatically, using + https://github.com/ewasm/wasm-metering +""" + scriptpath = os.path.dirname(os.path.realpath(__file__)) wasm_fn = os.path.join(scriptpath, "./wasm/coremark-metered.wasm")