From 03e1c889f41bf833a85a8daab8a916e254df8182 Mon Sep 17 00:00:00 2001 From: Konrad Feldmeier Date: Fri, 8 Jul 2016 16:45:31 +0200 Subject: [PATCH] Add gaslimit upper bound of `2**63-1` EIP 106 For reference: - https://github.com/ethereum/EIPs/issues/92 - https://github.com/ethereum/EIPs/issues/106 --- ethereum/blocks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ethereum/blocks.py b/ethereum/blocks.py index e7d12009d..35b5968c0 100644 --- a/ethereum/blocks.py +++ b/ethereum/blocks.py @@ -446,6 +446,9 @@ def __init__(self, header, transaction_list=[], uncles=[], env=None, if self.timestamp >= 2 ** 256: raise ValueError("Timestamp waaaaaaaaaaayy too large") + if self.gas_limit > 2 ** 63 - 1: + raise ValueError("Block's gaslimit went too high!") + for uncle in uncles: assert isinstance(uncle, BlockHeader)