Skip to content
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

Inline metering with injected gas function #9

Open
wants to merge 2 commits into
base: superblock-metering
Choose a base branch
from

Conversation

cdetrio
Copy link
Contributor

@cdetrio cdetrio commented Mar 16, 2019

Implements the concepts from ewasm/design#182.

@cdetrio
Copy link
Contributor Author

cdetrio commented Mar 16, 2019

Injected stuff looks like this:

  (func $useGas (export "useGas") (type $t8) (param $p0 i32)
    (local $l1 i32)
    global.get $gas_global
    local.get $p0
    i32.sub
    local.tee $l1
    i32.const 0
    i32.lt_s
    if $I0
      unreachable
    end
    local.get $l1
    global.set $gas_global)

  (global $gas_global (export "gas_global") (mut i32) (i32.const 2000000000))

@axic axic changed the title inline metering with injected gas function Inline metering with injected gas function Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant