• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Zilliqa / scilla / 2403 / 4
61%
master: 61%

Build:
DEFAULT BRANCH: master
Ran 16 Oct 2020 03:24AM UTC
Files 42
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Oct 2020 03:18AM UTC coverage: 54.453% (+0.4%) from 54.034%
OCAML_VERSION=4.08.1

push

travis-ci-com

web-flow
Rewrite gas mechanisms in terms of explicit gas_charge nodes in the AST (#887)

* Introduce GasExpr and GasStmt AST nodes

In the process of rewriting the gas charging mechanism to
ease uniform charging from the interpreter and in the upcoming
compiler / VM, the gas charging mechanism is moving towards having
explicit gas-charge nodes in the AST. The interpreter will charge
gas, and compiler will generate code to charge gas.

This commit is the first step, where we define the new AST nodes.

A later commit will introduce a pass to insert these nodes and
rewrite Eval to charge based on them.

* Dynamic gas cost to be a polynomial in terms of variables' sizes

* Separate SizeOf a variable and ValueOf of a variable

* Use a mini-AST instead of polynomials

* Restore polynomials

* Evaluate gas_charge ast in Eval

* make fmt

* Rewrite Gas.ml in terms of GasCharge expression, evaluated later.

There are minor gas charge differences arising out of this change.

1. Places where we used String.length is now replaced with
   literal_cost of the string, which is computed differently.
2. Places where length of "pp_literal l" was used is now replaced
   with literal_cost. This causes minor differences too.
3. For the Builtin_alt_bn128_G1_mul, computation of Logarithm
   of argument now first adds one and then proceeds.

* Rewrite Eval in terms of charging gas based on gas_charge AST nodes

The gas charge differences in certain contracts is, verified to be,
due to computing the cost of `send` as the size of it's "Scilla List
of Scilla Messages" (now) vs "OCaml List of Scilla Message" earlier.

* make fmt

* Minor fix in comment

* Add pretty printer for gas_charge

* Fix bug in GasCharge: replace_variable_name

* Couple fixes based on review comments

* raise error if gas_charge already in AST

* make fmt

2935 of 5390 relevant lines covered (54.45%)

8349.56 hits per line

Source Files on job 2403.4 (OCAML_VERSION=4.08.1)
  • Tree
  • List 0
  • Changed 19
  • Source Changed 9
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1515
  • Travis Job 2403.4
  • e4e1a0c9 on github
  • Prev Job for OCAML_VERSION=4.08.1 on master (#2398.4)
  • Next Job for OCAML_VERSION=4.08.1 on master (#2406.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc