From 5355d05cca7f1328e61390132d701e6ddece9508 Mon Sep 17 00:00:00 2001 From: Vadim Date: Mon, 15 Jul 2019 15:16:51 +0300 Subject: [PATCH] Add `info` level logging of block gas limit switching --- ethcore/src/engines/authority_round/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ethcore/src/engines/authority_round/mod.rs b/ethcore/src/engines/authority_round/mod.rs index c4e077d3b2d..4170c5da955 100644 --- a/ethcore/src/engines/authority_round/mod.rs +++ b/ethcore/src/engines/authority_round/mod.rs @@ -1119,7 +1119,11 @@ impl Engine 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); + } } } @@ -1799,7 +1803,7 @@ impl Engine for AuthorityRound { } fn gas_limit_override(&self, header: &Header) -> Option { - 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,