From 1207d1e3bef46164d49b8be04271fc26e3befde8 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 280eb6e473e..4803bac6e6e 100644 --- a/ethcore/src/engines/authority_round/mod.rs +++ b/ethcore/src/engines/authority_round/mod.rs @@ -1112,7 +1112,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); + } } } @@ -1792,7 +1796,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,