Skip to content

Commit

Permalink
Call costs clarifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
virgil-serbanuta committed Nov 27, 2017
1 parent 8d62ec0 commit 78d73e6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -515,6 +524,8 @@ TODO: CALL loads some data in `<callData>`, 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

Expand Down

0 comments on commit 78d73e6

Please sign in to comment.