From 78d73e6003519f35e3cd768f025e1d10723dab30 Mon Sep 17 00:00:00 2001 From: Virgil Serbanuta Date: Mon, 27 Nov 2017 11:34:22 +0200 Subject: [PATCH] Call costs clarifications. --- gas.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gas.md b/gas.md index d0c830f06..5ebd5b5dc 100644 --- a/gas.md +++ b/gas.md @@ -472,6 +472,15 @@ now we can "hide" this cost in the codeLoadingCost/codeByteLoadingCost values, and we'll make the error case less efficient. TODO: Clarify codeLoadingCost/codeByteLoadingCost. +Although the caller pays for code loading one way or another, one may argue +that this should be paid from the `GCAP`. However, it seems conceptually easier +to consider that `GCAP` pays for the running cost of the contract, so it will +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. + ```hs -- CALLOP in [CALL, CALLCODE, DELEGATECALL, STATICCALL] @@ -515,6 +524,8 @@ TODO: CALL loads some data in ``, but that's not used anywhere. Above I included a possible definition (`callDataSetupCost`), but we should find out what happens to that and include the right cost. +TODO: Is the callFeeCost fixed or based on the stack size? + TODO: Returning can be either implicit or explicit, should take that into account