diff --git a/src/ethereum/arrow_glacier/fork.py b/src/ethereum/arrow_glacier/fork.py index 82f452daf3f..954204fee05 100644 --- a/src/ethereum/arrow_glacier/fork.py +++ b/src/ethereum/arrow_glacier/fork.py @@ -391,6 +391,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, base_fee_per_gas: Uint, gas_available: Uint, @@ -401,6 +402,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. base_fee_per_gas : @@ -422,6 +425,18 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + sender = env.origin + sender_account = get_account(env.state, sender) + + if isinstance(tx, FeeMarketTransaction): + gas_fee = tx.gas * tx.max_fee_per_gas + else: + 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(chain_id, tx) @@ -783,15 +798,6 @@ def process_transaction( sender = env.origin sender_account = get_account(env.state, sender) - if isinstance(tx, FeeMarketTransaction): - max_gas_fee = tx.gas * tx.max_fee_per_gas - else: - max_gas_fee = tx.gas * tx.gas_price - - ensure(sender_account.nonce == tx.nonce, InvalidBlock) - ensure(sender_account.balance >= max_gas_fee + tx.value, InvalidBlock) - ensure(sender_account.code == bytearray(), InvalidBlock) - effective_gas_fee = tx.gas * env.gas_price gas = tx.gas - calculate_intrinsic_cost(tx) diff --git a/src/ethereum/berlin/fork.py b/src/ethereum/berlin/fork.py index 9c64bd85c02..36cd44b6859 100644 --- a/src/ethereum/berlin/fork.py +++ b/src/ethereum/berlin/fork.py @@ -314,6 +314,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, chain_id: U64, @@ -323,6 +324,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -340,6 +343,13 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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(chain_id, tx) @@ -680,9 +690,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender) diff --git a/src/ethereum/byzantium/fork.py b/src/ethereum/byzantium/fork.py index 31b745aabea..58f296a16f2 100644 --- a/src/ethereum/byzantium/fork.py +++ b/src/ethereum/byzantium/fork.py @@ -308,6 +308,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, chain_id: U64, @@ -317,6 +318,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -334,6 +337,13 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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(chain_id, tx) @@ -668,9 +678,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender) diff --git a/src/ethereum/constantinople/fork.py b/src/ethereum/constantinople/fork.py index f52b17d8909..208152d7ea6 100644 --- a/src/ethereum/constantinople/fork.py +++ b/src/ethereum/constantinople/fork.py @@ -308,6 +308,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, chain_id: U64, @@ -317,6 +318,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -334,6 +337,14 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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(chain_id, tx) @@ -668,9 +679,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender) diff --git a/src/ethereum/dao_fork/fork.py b/src/ethereum/dao_fork/fork.py index fb453598c8a..afd59edf0cc 100644 --- a/src/ethereum/dao_fork/fork.py +++ b/src/ethereum/dao_fork/fork.py @@ -319,6 +319,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, ) -> Address: @@ -327,6 +328,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -342,6 +345,13 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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) @@ -673,9 +683,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender) diff --git a/src/ethereum/frontier/fork.py b/src/ethereum/frontier/fork.py index 897fdb4e214..9228b190ae2 100644 --- a/src/ethereum/frontier/fork.py +++ b/src/ethereum/frontier/fork.py @@ -300,6 +300,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, ) -> Address: @@ -308,6 +309,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -323,6 +326,13 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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) @@ -654,9 +664,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender) diff --git a/src/ethereum/gray_glacier/fork.py b/src/ethereum/gray_glacier/fork.py index c13d0435182..a1512e05067 100644 --- a/src/ethereum/gray_glacier/fork.py +++ b/src/ethereum/gray_glacier/fork.py @@ -391,6 +391,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, base_fee_per_gas: Uint, gas_available: Uint, @@ -401,6 +402,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. base_fee_per_gas : @@ -422,6 +425,18 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + sender = env.origin + sender_account = get_account(env.state, sender) + + if isinstance(tx, FeeMarketTransaction): + gas_fee = tx.gas * tx.max_fee_per_gas + else: + 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(chain_id, tx) @@ -783,15 +798,6 @@ def process_transaction( sender = env.origin sender_account = get_account(env.state, sender) - if isinstance(tx, FeeMarketTransaction): - max_gas_fee = tx.gas * tx.max_fee_per_gas - else: - max_gas_fee = tx.gas * tx.gas_price - - ensure(sender_account.nonce == tx.nonce, InvalidBlock) - ensure(sender_account.balance >= max_gas_fee + tx.value, InvalidBlock) - ensure(sender_account.code == bytearray(), InvalidBlock) - effective_gas_fee = tx.gas * env.gas_price gas = tx.gas - calculate_intrinsic_cost(tx) diff --git a/src/ethereum/homestead/fork.py b/src/ethereum/homestead/fork.py index 1037b340df5..b36bf8b0c78 100644 --- a/src/ethereum/homestead/fork.py +++ b/src/ethereum/homestead/fork.py @@ -302,6 +302,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, ) -> Address: @@ -310,6 +311,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -325,6 +328,13 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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) @@ -656,9 +666,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender) diff --git a/src/ethereum/istanbul/fork.py b/src/ethereum/istanbul/fork.py index f98937d8e80..1f9a1d60873 100644 --- a/src/ethereum/istanbul/fork.py +++ b/src/ethereum/istanbul/fork.py @@ -308,6 +308,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, chain_id: U64, @@ -317,6 +318,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -334,6 +337,13 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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(chain_id, tx) @@ -669,9 +679,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender) diff --git a/src/ethereum/london/fork.py b/src/ethereum/london/fork.py index 9f13fd4251d..32437fd8a1a 100644 --- a/src/ethereum/london/fork.py +++ b/src/ethereum/london/fork.py @@ -399,6 +399,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, base_fee_per_gas: Uint, gas_available: Uint, @@ -409,6 +410,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. base_fee_per_gas : @@ -430,6 +433,18 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + sender = env.origin + sender_account = get_account(env.state, sender) + + if isinstance(tx, FeeMarketTransaction): + gas_fee = tx.gas * tx.max_fee_per_gas + else: + 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(chain_id, tx) @@ -791,15 +806,6 @@ def process_transaction( sender = env.origin sender_account = get_account(env.state, sender) - if isinstance(tx, FeeMarketTransaction): - max_gas_fee = tx.gas * tx.max_fee_per_gas - else: - max_gas_fee = tx.gas * tx.gas_price - - ensure(sender_account.nonce == tx.nonce, InvalidBlock) - ensure(sender_account.balance >= max_gas_fee + tx.value, InvalidBlock) - ensure(sender_account.code == bytearray(), InvalidBlock) - effective_gas_fee = tx.gas * env.gas_price gas = tx.gas - calculate_intrinsic_cost(tx) diff --git a/src/ethereum/muir_glacier/fork.py b/src/ethereum/muir_glacier/fork.py index b8c786a26ae..42cc51baf9a 100644 --- a/src/ethereum/muir_glacier/fork.py +++ b/src/ethereum/muir_glacier/fork.py @@ -308,6 +308,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, chain_id: U64, @@ -317,6 +318,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -334,6 +337,13 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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(chain_id, tx) @@ -669,9 +679,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender) diff --git a/src/ethereum/paris/fork.py b/src/ethereum/paris/fork.py index 95d2ab85eb5..45c89a28af6 100644 --- a/src/ethereum/paris/fork.py +++ b/src/ethereum/paris/fork.py @@ -303,6 +303,7 @@ def validate_header(header: Header, parent_header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, base_fee_per_gas: Uint, gas_available: Uint, @@ -313,6 +314,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. base_fee_per_gas : @@ -334,6 +337,17 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + sender = env.origin + sender_account = get_account(env.state, sender) + + if isinstance(tx, FeeMarketTransaction): + gas_fee = tx.gas * tx.max_fee_per_gas + else: + 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(chain_id, tx) @@ -571,15 +585,6 @@ def process_transaction( sender = env.origin sender_account = get_account(env.state, sender) - if isinstance(tx, FeeMarketTransaction): - max_gas_fee = tx.gas * tx.max_fee_per_gas - else: - max_gas_fee = tx.gas * tx.gas_price - - ensure(sender_account.nonce == tx.nonce, InvalidBlock) - ensure(sender_account.balance >= max_gas_fee + tx.value, InvalidBlock) - ensure(sender_account.code == bytearray(), InvalidBlock) - effective_gas_fee = tx.gas * env.gas_price gas = tx.gas - calculate_intrinsic_cost(tx) diff --git a/src/ethereum/shanghai/fork.py b/src/ethereum/shanghai/fork.py index 42b964e9588..19bf5fbe0b6 100644 --- a/src/ethereum/shanghai/fork.py +++ b/src/ethereum/shanghai/fork.py @@ -310,6 +310,7 @@ def validate_header(header: Header, parent_header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, base_fee_per_gas: Uint, gas_available: Uint, @@ -320,6 +321,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. base_fee_per_gas : @@ -341,6 +344,18 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + sender = env.origin + sender_account = get_account(env.state, sender) + + if isinstance(tx, FeeMarketTransaction): + gas_fee = tx.gas * tx.max_fee_per_gas + else: + 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(chain_id, tx) @@ -596,15 +611,6 @@ def process_transaction( sender = env.origin sender_account = get_account(env.state, sender) - if isinstance(tx, FeeMarketTransaction): - max_gas_fee = tx.gas * tx.max_fee_per_gas - else: - max_gas_fee = tx.gas * tx.gas_price - - ensure(sender_account.nonce == tx.nonce, InvalidBlock) - ensure(sender_account.balance >= max_gas_fee + tx.value, InvalidBlock) - ensure(sender_account.code == bytearray(), InvalidBlock) - effective_gas_fee = tx.gas * env.gas_price gas = tx.gas - calculate_intrinsic_cost(tx) diff --git a/src/ethereum/spurious_dragon/fork.py b/src/ethereum/spurious_dragon/fork.py index 0598e23a03d..695deca8ffe 100644 --- a/src/ethereum/spurious_dragon/fork.py +++ b/src/ethereum/spurious_dragon/fork.py @@ -304,6 +304,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, chain_id: U64, @@ -313,6 +314,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -330,6 +333,13 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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(chain_id, tx) @@ -664,9 +674,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender) diff --git a/src/ethereum/tangerine_whistle/fork.py b/src/ethereum/tangerine_whistle/fork.py index 1037b340df5..b36bf8b0c78 100644 --- a/src/ethereum/tangerine_whistle/fork.py +++ b/src/ethereum/tangerine_whistle/fork.py @@ -302,6 +302,7 @@ def validate_proof_of_work(header: Header) -> None: def check_transaction( + env: vm.Environment, tx: Transaction, gas_available: Uint, ) -> Address: @@ -310,6 +311,8 @@ def check_transaction( Parameters ---------- + env : + Environment for the Ethereum Virtual Machine. tx : The transaction. gas_available : @@ -325,6 +328,13 @@ def check_transaction( InvalidBlock : If the transaction is not includable. """ + 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) @@ -656,9 +666,6 @@ def process_transaction( 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) gas = tx.gas - calculate_intrinsic_cost(tx) increment_nonce(env.state, sender)