@@ -133,7 +133,7 @@ def test_validate_gas_limit_almost_too_low(noproof_consensus_chain):
133
133
block1 = noproof_consensus_chain .mine_block ()
134
134
block2 = noproof_consensus_chain .mine_block ()
135
135
136
- max_reduction = block1 .header .gas_limit // constants .GAS_LIMIT_ADJUSTMENT_FACTOR
136
+ max_reduction = block1 .header .gas_limit // constants .GAS_LIMIT_ADJUSTMENT_FACTOR - 1
137
137
barely_valid_low_gas_limit = block1 .header .gas_limit - max_reduction
138
138
barely_valid_header = block2 .header .copy (gas_limit = barely_valid_low_gas_limit )
139
139
@@ -146,8 +146,8 @@ def test_validate_gas_limit_too_low(noproof_consensus_chain):
146
146
block1 = noproof_consensus_chain .mine_block ()
147
147
block2 = noproof_consensus_chain .mine_block ()
148
148
149
- max_reduction = block1 .header .gas_limit // constants .GAS_LIMIT_ADJUSTMENT_FACTOR
150
- invalid_low_gas_limit = block1 .header .gas_limit - max_reduction - 1
149
+ exclusive_decrease_limit = block1 .header .gas_limit // constants .GAS_LIMIT_ADJUSTMENT_FACTOR
150
+ invalid_low_gas_limit = block1 .header .gas_limit - exclusive_decrease_limit
151
151
invalid_header = block2 .header .copy (gas_limit = invalid_low_gas_limit )
152
152
153
153
vm = noproof_consensus_chain .get_vm (block2 .header )
@@ -160,7 +160,7 @@ def test_validate_gas_limit_almost_too_high(noproof_consensus_chain):
160
160
block1 = noproof_consensus_chain .mine_block ()
161
161
block2 = noproof_consensus_chain .mine_block ()
162
162
163
- max_increase = block1 .header .gas_limit // constants .GAS_LIMIT_ADJUSTMENT_FACTOR
163
+ max_increase = block1 .header .gas_limit // constants .GAS_LIMIT_ADJUSTMENT_FACTOR - 1
164
164
barely_valid_high_gas_limit = block1 .header .gas_limit + max_increase
165
165
barely_valid_header = block2 .header .copy (gas_limit = barely_valid_high_gas_limit )
166
166
@@ -173,8 +173,8 @@ def test_validate_gas_limit_too_high(noproof_consensus_chain):
173
173
block1 = noproof_consensus_chain .mine_block ()
174
174
block2 = noproof_consensus_chain .mine_block ()
175
175
176
- max_increase = block1 .header .gas_limit // constants .GAS_LIMIT_ADJUSTMENT_FACTOR
177
- invalid_high_gas_limit = block1 .header .gas_limit + max_increase + 1
176
+ exclusive_increase_limit = block1 .header .gas_limit // constants .GAS_LIMIT_ADJUSTMENT_FACTOR
177
+ invalid_high_gas_limit = block1 .header .gas_limit + exclusive_increase_limit
178
178
invalid_header = block2 .header .copy (gas_limit = invalid_high_gas_limit )
179
179
180
180
vm = noproof_consensus_chain .get_vm (block2 .header )
0 commit comments