Revision daea8ababad0396971bf2c9062c5f177521b051d authored by Ilias Garnier on 21 June 2019, 12:47:37 UTC, committed by Pierre Boutillier on 21 October 2019, 12:25:27 UTC
I. Rescaling step cost - Rescale step_cost by 2^7 to allow finer cost accounting in the interpeter. - Expose new function atomic_step_cost exposing finer resolution step increments. II. Provide facilities for interpreter-specific cost accounting Introduce new functions `Gas.incr_interpreter_cost` and `Gas.bill_interpreter_cost`. - The context stores a new counter 'interpreter_cost' of type Gas_limit_repr.cost - functions are provided to: - increment this counter (incr_interpreter_cost) and - bill for the gas corresponding to this counter and reset this counter. Until bill_interpreter_cost is called, the interpreter_cost is _not_ taken into account into the effectively consumed gas. - Each call to incr_interpreter_cost still checks that we are under the operation and block gas limits. - The interpreter uses these functions instead of the usual Gas.consume. The invariant that has to be respected for this to be transparent to the rest of the protocol is that all continuations of the `step` function to other functions should bill and reset the interpreter_cost beforehand. This concerns calls to interp, calls to the typechecker, calls to read from a big map, calls to the serialization/deserialization mechanism, etc; in short, all calls to other parts of the protocol should have a context in a state where this fine-grained gas bookkeeping has been settled and reset.
1 parent c5bda6c
File | Mode | Size |
---|---|---|
.github | ||
.gitlab | ||
docs | ||
emacs | ||
scripts | ||
src | ||
tests_python | ||
vendors | ||
.dockerignore | -rw-r--r-- | 627 bytes |
.gitattributes | -rw-r--r-- | 132 bytes |
.gitignore | -rw-r--r-- | 830 bytes |
.gitlab-ci.yml | -rw-r--r-- | 19.6 KB |
.ocp-indent | -rw-r--r-- | 17 bytes |
LICENSE | -rw-r--r-- | 1.1 KB |
Makefile | -rw-r--r-- | 5.4 KB |
README.md | -rw-r--r-- | 1.7 KB |
active_protocol_versions | -rw-r--r-- | 6 bytes |
contributing.md | -rw-r--r-- | 2.4 KB |
dune | -rw-r--r-- | 191 bytes |
dune-workspace | -rw-r--r-- | 16 bytes |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...