py-evm
py-evm copied to clipboard
The chain builder tool seems to permit transactions beyond header gas limit
- py-evm Version: master @ 942765d
What is wrong?
I think this is what's happening. I'm debugging a different part of the stack, so can't dive in this moment:
I built a chain using eth.tools.builder.chain.build() and it created transactions in a block that would not be permitted by that block's gas limit. It came back to bite me when I tried to sync off the built chain on another instance (which correctly identified that the gas limit was exceeded).
I used something like:
chain = build(...)
chain.apply_transaction(txn)
chain.mine_block()
The transaction was added, but the gas in the transaction was above the limit.
How can it be fixed
:man_shrugging: I don't know the builder code very well. It seems like it should just be passing through the apply_transaction method, which I expect to validate (since chain.apply_transaction() calls vm.apply_transaction(), which calls vm.validate_transaction_against_header()).