Skip to content

Commit

Permalink
Add info level logging of block gas limit switching
Browse files Browse the repository at this point in the history
  • Loading branch information
varasev authored and afck committed Jul 23, 2019
1 parent 4c626ec commit 5355d05
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ethcore/src/engines/authority_round/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,11 @@ impl Engine<EthereumMachine> for AuthorityRound {
header.set_difficulty(score);
if let Some(gas_limit) = self.gas_limit_override(header) {
trace!(target: "engine", "Setting gas limit to {} for block {}.", gas_limit, header.number());
let parent_gas_limit = *parent.gas_limit();
header.set_gas_limit(gas_limit);
if parent_gas_limit != gas_limit {
info!(target: "engine", "Block gas limit was changed from {} to {}.", parent_gas_limit, gas_limit);
}
}
}

Expand Down Expand Up @@ -1799,7 +1803,7 @@ impl Engine<EthereumMachine> for AuthorityRound {
}

fn gas_limit_override(&self, header: &Header) -> Option<U256> {
let (_, &address) = self.machine.params().block_gas_limit_contract.range(..header.number()).last()?;
let (_, &address) = self.machine.params().block_gas_limit_contract.range(..=header.number()).last()?;

let client = match self.client.read().as_ref().and_then(|weak| weak.upgrade()) {
Some(client) => client,
Expand Down

0 comments on commit 5355d05

Please sign in to comment.