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
History
File Mode Size
ci
create_genesis
docker
activate_protocol.sh -rwxr-xr-x 3.2 KB
alphanet.sh -rwxr-xr-x 24.3 KB
alphanet_constants.patch -rw-r--r-- 824 bytes
alphanet_version -rw-r--r-- 21 bytes
apply_patch.sh -rwxr-xr-x 1.0 KB
b58_prefix.py -rwxr-xr-x 1015 bytes
betanet.sh l--------- 11 bytes
check_opam_test.sh -rwxr-xr-x 879 bytes
check_patch.sh -rwxr-xr-x 322 bytes
create_docker_image.sh -rwxr-xr-x 757 bytes
gen_genesis.ml -rw-r--r-- 2.5 KB
install_build_deps.raw.sh -rwxr-xr-x 729 bytes
install_build_deps.sh -rwxr-xr-x 1.0 KB
localnet.sh l--------- 11 bytes
mainnet.sh l--------- 11 bytes
nginx.conf -rw-r--r-- 569 bytes
ocamldot.py -rwxr-xr-x 2.6 KB
opam-check.sh -rwxr-xr-x 1.1 KB
opam-pin.sh -rwxr-xr-x 588 bytes
opam-remove.sh -rwxr-xr-x 391 bytes
opam-test-all.sh -rwxr-xr-x 1.2 KB
opam-unpin.sh -rwxr-xr-x 233 bytes
opam-upgrade.sh -rwxr-xr-x 600 bytes
reset_chain.sh -rwxr-xr-x 418 bytes
sandbox.json -rw-r--r-- 89 bytes
snapshot_alpha.sh -rwxr-xr-x 4.4 KB
update_hashes.sh -rwxr-xr-x 1.9 KB
update_integration_test.sh -rwxr-xr-x 663 bytes
update_opam_repo.sh -rwxr-xr-x 3.7 KB
update_opam_test.sh -rwxr-xr-x 581 bytes
version.sh -rw-r--r-- 464 bytes
yes-node.patch -rw-r--r-- 1.5 KB
yes-wallet.ml -rw-r--r-- 3.0 KB
zeronet.patch -rw-r--r-- 723 bytes
zeronet.sh l--------- 11 bytes

back to top