[go: up one dir, main page]

Proto: update the gas cost of hashing a skip list cell

Context

Benchmark samplers for skip lists have changed in !7305 (merged). Consequently, related gas values have changed, which was shown by an alert thrown after the latest benchmark run on the reference machine. The raw output used by the alert system is this file: comparison_with_reference.csv.

In this file, the section about skip lists can be found by searching skip_list_hash. The changed values are cost_hash_skip_list_cell_coef and cost_hash_skip_list_cell. But Snoop is going under structural changes, and the names have been prefixed by proto/alpha/skip_list/ in the meantime, so the comparison really is between:

  • cost_hash_skip_list_cell_coef and proto/alpha/skip_list/cost_hash_skip_list_cell_coef;
  • and cost_hash_skip_list_cell and proto/alpha/skip_list/cost_hash_skip_list_cell.

Then, the code committed in this request is an adjustment of the raw code generated from the solution file produced by Snoop: inferred_skip_list_hash.sol.

$ cat /tmp/codegen_params.json
{ "precision": 5, "max_relative_error": 0.1, "cast_mode": "Round", "inverse_scaling": 3, "resolution": 5 }
$ ./octez-snoop generate code using solution inferred_skip_list_hash.sol and model proto/alpha/skip_list/hash_cell --fixed-point /tmp/codegen_params.json
(* model model_proto/alpha/skip_list/hash_cell *)
(* fun size -> (242.202299543 + (56.9693504823 * size)) *)
let model_proto/alpha/skip_list/hash_cell size =
  let open S.Syntax in
    let size = S.safe_int size in
    let v0 = size in
    (S.safe_int 250) + (((v0 lsl 5) + (v0 lsl 4)) + (v0 lsl 3))

The values of the gas parameters below will be changed accordingly for the reference run:

  • proto/alpha/skip_list/cost_hash_skip_list_cell: 242;
  • proto/alpha/skip_list/cost_hash_skip_list_cell_coef: 56.

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Nicolas Ayache

Merge request reports

Loading