Refactor includability check in forks#890
Refactor includability check in forks#890richardgreg wants to merge 15 commits intoethereum:masterfrom richardgreg:includability-check-refactor
Conversation
|
Some |
|
@petertdavies could you take a quick look and state if I'm on the right path? |
|
@SamWilsn could you review this if you have the time? 🙂 |
|
I'll do my best! Trying to get #925 merged before we start refactoring in earnest. |
|
@richardgreg There might be a few more checks that we might have to move to |
|
Awesome |
|
Hi @gurukamath, I just dealt with some conflicts while performing a rebase. I will get around to adding the checks with your template as soon as possible, but if this PR is okay, I'll appreciate it if you merge it so I don't have to rebase again when I get back to the task 😅 🙏🏾 |
|
Does anyone know if these changes are still needed? I noticed it was approved two weeks ago but was never merged and now has a lot of conflicts |
|
|
|
Ah, sorry about the conflicts. We've removed the |
| sender = env.origin | ||
| sender_account = get_account(env.state, sender) | ||
| gas_fee = tx.gas * tx.gas_price | ||
| ensure(sender_account.nonce == tx.nonce, InvalidBlock) | ||
| ensure(sender_account.balance >= gas_fee + tx.value, InvalidBlock) | ||
| ensure(sender_account.code == bytearray(), InvalidBlock) | ||
|
|
||
| ensure(tx.gas <= gas_available, InvalidBlock) | ||
| sender_address = recover_sender(tx) |
There was a problem hiding this comment.
| sender = env.origin | |
| sender_account = get_account(env.state, sender) | |
| gas_fee = tx.gas * tx.gas_price | |
| ensure(sender_account.nonce == tx.nonce, InvalidBlock) | |
| ensure(sender_account.balance >= gas_fee + tx.value, InvalidBlock) | |
| ensure(sender_account.code == bytearray(), InvalidBlock) | |
| ensure(tx.gas <= gas_available, InvalidBlock) | |
| sender_address = recover_sender(tx) | |
| ensure(tx.gas <= gas_available, InvalidBlock) | |
| sender_address = recover_sender(tx) | |
| sender_account = get_account(env.state, sender_address) | |
| gas_fee = tx.gas * tx.gas_price | |
| ensure(sender_account.nonce == tx.nonce, InvalidBlock) | |
| ensure(sender_account.balance >= gas_fee + tx.value, InvalidBlock) | |
| ensure(sender_account.code == bytearray(), InvalidBlock) |
This way, there is no need for env to be a parameter in the check_transaction function.
|
This has been handled in #1131 |
…thereum#890) * put EmptyOmmersRoot in env file instead of 0 by default * fix(types): tests --------- Co-authored-by: Mario Vega <marioevz@gmail.com>
What was wrong?
Includability checks should be moved from
process_transaction()tocheck_transaction()Related to Issue #
Ref #799
How was it fixed?
process_transaction()tocheck_transaction()check_transactionCute Animal Picture