Gas limit ceiling option.

This commit is contained in:
Gav Wood
2016-06-23 14:29:16 +02:00
parent 129ce97ad5
commit 8fcec20398
17 changed files with 92 additions and 31 deletions

View File

@@ -797,7 +797,7 @@ impl<V> BlockChainClient for Client<V> where V: Verifier {
}
impl<V> MiningBlockChainClient for Client<V> where V: Verifier {
fn prepare_open_block(&self, author: Address, gas_floor_target: U256, extra_data: Bytes) -> OpenBlock {
fn prepare_open_block(&self, author: Address, gas_range_target: (U256, U256), extra_data: Bytes) -> OpenBlock {
let engine = self.engine.deref().deref();
let h = self.chain.best_block_hash();
@@ -810,7 +810,7 @@ impl<V> MiningBlockChainClient for Client<V> where V: Verifier {
self.build_last_hashes(h.clone()),
self.dao_rescue_block_gas_limit(h.clone()),
author,
gas_floor_target,
gas_range_target,
extra_data,
).expect("OpenBlock::new only fails if parent state root invalid; state root of best block's header is never invalid; qed");

View File

@@ -251,6 +251,6 @@ pub trait BlockChainClient : Sync + Send {
/// Extended client interface used for mining
pub trait MiningBlockChainClient : BlockChainClient {
/// Returns OpenBlock prepared for closing.
fn prepare_open_block(&self, author: Address, gas_floor_target: U256, extra_data: Bytes)
fn prepare_open_block(&self, author: Address, gas_range_target: (U256, U256), extra_data: Bytes)
-> OpenBlock;
}

View File

@@ -240,7 +240,7 @@ impl TestBlockChainClient {
}
impl MiningBlockChainClient for TestBlockChainClient {
fn prepare_open_block(&self, _author: Address, _gas_floor_target: U256, _extra_data: Bytes) -> OpenBlock {
fn prepare_open_block(&self, _author: Address, _gas_range_target: (U256, U256), _extra_data: Bytes) -> OpenBlock {
unimplemented!();
}
}