EIP 1108: Reduce alt_bn128 precompile gas costs (#11008)

* feat: implement eip1108

* doc nit: price per point pair

Co-Authored-By: David <dvdplm@gmail.com>

* fix: test-build

* fix: update chain specs

* fix: basic_authority.json chain spec

* fix: change `eip_transition == 0x7fffffffffffff`

* add issue link to `TODO`
This commit is contained in:
Niklas Adolfsson
2019-09-02 11:38:27 +02:00
committed by Wei Tang
parent 05f9606bf2
commit a9cb572238
38 changed files with 1107 additions and 224 deletions

View File

@@ -412,7 +412,8 @@ impl<'a> CallCreateExecutive<'a> {
let default = [];
let data = if let Some(ref d) = params.data { d as &[u8] } else { &default as &[u8] };
let cost = builtin.cost(data);
// NOTE(niklasad1): block number is used by `builtin alt_bn128 ops` to enable eip1108
let cost = builtin.cost(data, self.info.number);
if cost <= params.gas {
let mut builtin_out_buffer = Vec::new();
let result = {