Skip to content

Commit

Permalink
Merge pull request #1 from ethereum/revert-21-feeSchedule
Browse files Browse the repository at this point in the history
Revert 21 fee schedule
  • Loading branch information
wanderer committed Aug 4, 2016
2 parents 2ba06d6 + d098bbe commit 15fb8f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 144 deletions.
141 changes: 0 additions & 141 deletions feeSchedule.md

This file was deleted.

6 changes: 3 additions & 3 deletions metering.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ Metering can be accomplished by injecting the counting code into the AST then pa


## Metering by Branch
Metering is done by counting the cost of running a continuous subtree of the AST. Where the gas total is sum of the gas charged for each opcode. Continuous is defined by subtrees that do not contain any branch conditions. Any time a branch in the AST is reached by the VM gas for that entire subtree is immediately deducted. There are two rules for determining the continuous subtrees;
Metering is done by counting the cost of running a continuous subtree of the AST. Continuous is defined by subtrees that do not contain any branch conditions. Any time a branch in the AST is reached by the VM gas for that entire subtree is immediately deducted. There are two rules for determining the continuous subtrees;

1. For If Else statements the `then` and `else` statements become new subtrees.
2. For branches (`br`, `br_table`) existing in a enclosing construct; all immediately following statements in that enclosing construct becomes a new subtree.

Currently each opcode is measused as 1 unit of gas. Functions, Parameters to functions and Result values are also counted as 1 unit of gas. See the [fee schedule](./feeSchedule.md) for more information.
Currently each opcode is measused as 1 unit of gas. Functions, Parameters to functions and Result values are also counted as 1 unit of gas.

## TODO
* Speficy a cost table for Ethereum System calls
* Speficy cost for memory

## Examples
The examples are in S-expressions which have a near 1 to 1 representation to binary WASM. They also show one possible tranformation to inject metering into canonical WASM code. These examples where generated with a [metering prototype](https://github.com/ewasm/wasm-metering)
The examples are in S-expressions which have a near 1 to 1 representation to binary WASM. They also show one possible tranformation to inject metering into canonical WASM code. These examples where generated with a [metering prototype](https://github.com/wanderer/wasm-metering)
### Basic
This would cost two gas to run
```
Expand Down

0 comments on commit 15fb8f3

Please sign in to comment.