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

Zilliqa / scilla / 2403
61%

Build:
DEFAULT BRANCH: master
Ran 16 Oct 2020 03:24AM UTC
Jobs 4
Files 42
Run time 34s
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

pending completion
2403

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%)

33398.22 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2403.1 (OCAML_VERSION=4.11.1) 16 Oct 2020 03:24AM UTC 0
54.45
Travis Job 2403.1
2 2403.2 (OCAML_VERSION=4.10.1) 16 Oct 2020 03:24AM UTC 0
54.45
Travis Job 2403.2
3 2403.3 (OCAML_VERSION=4.09.1) 16 Oct 2020 03:24AM UTC 0
54.45
Travis Job 2403.3
4 2403.4 (OCAML_VERSION=4.08.1) 16 Oct 2020 03:24AM UTC 0
54.45
Travis Job 2403.4
Source Files on build 2403
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #2403
  • e4e1a0c9 on github
  • Prev Build on master (#2398)
  • Next Build on master (#2406)
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