From ef831f803eabd24000aa574ed91421158f27f4dc Mon Sep 17 00:00:00 2001 From: Virgil Serbanuta Date: Mon, 27 Nov 2017 16:21:05 +0200 Subject: [PATCH] Comments about flat-fee costs. --- gas.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gas.md b/gas.md index 3da754077..9445c24d9 100644 --- a/gas.md +++ b/gas.md @@ -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] @@ -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)