Skip to content

Commit

Permalink
avoid undue gas_target halving on 1559 fork block
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient committed May 5, 2021
1 parent 8a7e5bc commit 4b132db
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion EIPS/eip-1559.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,15 @@ ELASTICITY_MULTIPLIER = 2

class World(ABC):
def validate_block(self, block: Block) -> None:
parent_gas_target = self.parent(block).gas_limit // ELASTICITY_MULTIPLIER

# On the fork block, don't account for the ELASTICITY_MULTIPLIER to avoid
# unduly havling the gas_target.
if INITIAL_FORK_BLOCK_NUMBER == block.number:
parent_gas_target = self.parent(block).gas_limit

parent_base_fee_per_gas = self.parent(block).base_fee_per_gas
parent_gas_used = self.parent(block).gas_used
parent_gas_target = self.parent(block).gas_limit // ELASTICITY_MULTIPLIER
gas_target = block.gas_limit // ELASTICITY_MULTIPLIER
transactions = self.transactions(block)

Expand Down

0 comments on commit 4b132db

Please sign in to comment.