Skip to content

Commit

Permalink
Comments about flat-fee costs.
Browse files Browse the repository at this point in the history
  • Loading branch information
virgil-serbanuta committed Nov 27, 2017
1 parent cfb0d89 commit ef831f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ not include the code loading cost.

Also, it may seem counterintuitive to pay for the code loading cost, one may
expect to pay a flat fee as in the EVM model. A flat fee is usually less
efficient, so we're using a size-based fee.
efficient, so we're using a size-based fee. There is a similar memory
consumption associated with loading the code which, arguably, might be included
in a flat-fee cost.

```hs
-- CALLOP in [CALL, CALLCODE, DELEGATECALL, STATICCALL]
Expand Down Expand Up @@ -537,6 +539,10 @@ efficient, so we're using a size-based fee.
memorySizeCallee(existent-account-success) = callDataSize
```

The calee starts with a memory usage of memorySizeCallee (absolute, not a
delta). There is a free memory allowance for each new contract call, equal to
the maximum EVM stack size, that will be taken into account separately.

`constantMemorySize` is the size of whatever is part of the saved state
except for the code and callData (calldepth, callValue, id, gas, caller,
static)
Expand Down

0 comments on commit ef831f8

Please sign in to comment.