File tree Expand file tree Collapse file tree 17 files changed +39
-32
lines changed Expand file tree Collapse file tree 17 files changed +39
-32
lines changed Original file line number Diff line number Diff line change 21
21
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
22
22
from ethereum .crypto .hash import Hash32 , keccak256
23
23
from ethereum .ethash import dataset_size , generate_cache , hashimoto_light
24
- from ethereum .exceptions import InvalidBlock
24
+ from ethereum .exceptions import InvalidBlock , InvalidSenderError
25
25
26
26
from .. import rlp
27
27
from . import vm
@@ -794,7 +794,7 @@ def process_transaction(
794
794
if Uint (sender_account .balance ) < max_gas_fee + Uint (tx .value ):
795
795
raise InvalidBlock
796
796
if sender_account .code != bytearray ():
797
- raise InvalidBlock
797
+ raise InvalidSenderError ( "not EOA" )
798
798
799
799
effective_gas_fee = tx .gas * env .gas_price
800
800
Original file line number Diff line number Diff line change 21
21
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
22
22
from ethereum .crypto .hash import Hash32 , keccak256
23
23
from ethereum .ethash import dataset_size , generate_cache , hashimoto_light
24
- from ethereum .exceptions import InvalidBlock
24
+ from ethereum .exceptions import InvalidBlock , InvalidSenderError
25
25
26
26
from .. import rlp
27
27
from . import vm
@@ -683,7 +683,7 @@ def process_transaction(
683
683
if Uint (sender_account .balance ) < gas_fee + Uint (tx .value ):
684
684
raise InvalidBlock
685
685
if sender_account .code != bytearray ():
686
- raise InvalidBlock
686
+ raise InvalidSenderError ( "not EOA" )
687
687
688
688
gas = tx .gas - calculate_intrinsic_cost (tx )
689
689
increment_nonce (env .state , sender )
Original file line number Diff line number Diff line change 21
21
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
22
22
from ethereum .crypto .hash import Hash32 , keccak256
23
23
from ethereum .ethash import dataset_size , generate_cache , hashimoto_light
24
- from ethereum .exceptions import InvalidBlock
24
+ from ethereum .exceptions import InvalidBlock , InvalidSenderError
25
25
26
26
from .. import rlp
27
27
from . import vm
@@ -671,7 +671,7 @@ def process_transaction(
671
671
if Uint (sender_account .balance ) < gas_fee + Uint (tx .value ):
672
672
raise InvalidBlock
673
673
if sender_account .code != bytearray ():
674
- raise InvalidBlock
674
+ raise InvalidSenderError ( "not EOA" )
675
675
676
676
gas = tx .gas - calculate_intrinsic_cost (tx )
677
677
increment_nonce (env .state , sender )
Original file line number Diff line number Diff line change 20
20
21
21
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
22
22
from ethereum .crypto .hash import Hash32 , keccak256
23
- from ethereum .exceptions import InvalidBlock
23
+ from ethereum .exceptions import InvalidBlock , InvalidSenderError
24
24
25
25
from .. import rlp
26
26
from . import vm
@@ -427,7 +427,7 @@ def check_transaction(
427
427
if Uint (sender_account .balance ) < max_gas_fee + Uint (tx .value ):
428
428
raise InvalidBlock
429
429
if sender_account .code != bytearray ():
430
- raise InvalidBlock
430
+ raise InvalidSenderError ( "not EOA" )
431
431
432
432
return sender , effective_gas_price , blob_versioned_hashes
433
433
Original file line number Diff line number Diff line change 21
21
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
22
22
from ethereum .crypto .hash import Hash32 , keccak256
23
23
from ethereum .ethash import dataset_size , generate_cache , hashimoto_light
24
- from ethereum .exceptions import InvalidBlock
24
+ from ethereum .exceptions import InvalidBlock , InvalidSenderError
25
25
26
26
from .. import rlp
27
27
from . import vm
@@ -671,7 +671,7 @@ def process_transaction(
671
671
if Uint (sender_account .balance ) < gas_fee + Uint (tx .value ):
672
672
raise InvalidBlock
673
673
if sender_account .code != bytearray ():
674
- raise InvalidBlock
674
+ raise InvalidSenderError ( "not EOA" )
675
675
676
676
gas = tx .gas - calculate_intrinsic_cost (tx )
677
677
increment_nonce (env .state , sender )
Original file line number Diff line number Diff line change 23
23
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
24
24
from ethereum .crypto .hash import Hash32 , keccak256
25
25
from ethereum .ethash import dataset_size , generate_cache , hashimoto_light
26
- from ethereum .exceptions import InvalidBlock
26
+ from ethereum .exceptions import InvalidBlock , InvalidSenderError
27
27
28
28
from .. import rlp
29
29
from . import FORK_CRITERIA , vm
@@ -677,7 +677,7 @@ def process_transaction(
677
677
if Uint (sender_account .balance ) < gas_fee + Uint (tx .value ):
678
678
raise InvalidBlock
679
679
if sender_account .code != bytearray ():
680
- raise InvalidBlock
680
+ raise InvalidSenderError ( "not EOA" )
681
681
682
682
gas = tx .gas - calculate_intrinsic_cost (tx )
683
683
increment_nonce (env .state , sender )
Original file line number Diff line number Diff line change @@ -32,3 +32,10 @@ class RLPEncodingError(EthereumException):
32
32
"""
33
33
Indicates that RLP encoding failed.
34
34
"""
35
+
36
+
37
+ class InvalidSenderError (InvalidTransaction ):
38
+ """
39
+ Thrown when a transaction originates from an account that cannot send
40
+ transactions.
41
+ """
Original file line number Diff line number Diff line change 21
21
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
22
22
from ethereum .crypto .hash import Hash32 , keccak256
23
23
from ethereum .ethash import dataset_size , generate_cache , hashimoto_light
24
- from ethereum .exceptions import InvalidBlock
24
+ from ethereum .exceptions import InvalidBlock , InvalidSenderError
25
25
26
26
from .. import rlp
27
27
from . import vm
@@ -658,7 +658,7 @@ def process_transaction(
658
658
if Uint (sender_account .balance ) < gas_fee + Uint (tx .value ):
659
659
raise InvalidBlock
660
660
if sender_account .code != bytearray ():
661
- raise InvalidBlock
661
+ raise InvalidSenderError ( "not EOA" )
662
662
663
663
gas = tx .gas - calculate_intrinsic_cost (tx )
664
664
increment_nonce (env .state , sender )
Original file line number Diff line number Diff line change 21
21
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
22
22
from ethereum .crypto .hash import Hash32 , keccak256
23
23
from ethereum .ethash import dataset_size , generate_cache , hashimoto_light
24
- from ethereum .exceptions import InvalidBlock
24
+ from ethereum .exceptions import InvalidBlock , InvalidSenderError
25
25
26
26
from .. import rlp
27
27
from . import vm
@@ -794,7 +794,7 @@ def process_transaction(
794
794
if Uint (sender_account .balance ) < max_gas_fee + Uint (tx .value ):
795
795
raise InvalidBlock
796
796
if sender_account .code != bytearray ():
797
- raise InvalidBlock
797
+ raise InvalidSenderError ( "not EOA" )
798
798
799
799
effective_gas_fee = tx .gas * env .gas_price
800
800
Original file line number Diff line number Diff line change 21
21
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
22
22
from ethereum .crypto .hash import Hash32 , keccak256
23
23
from ethereum .ethash import dataset_size , generate_cache , hashimoto_light
24
- from ethereum .exceptions import InvalidBlock
24
+ from ethereum .exceptions import InvalidBlock , InvalidSenderError
25
25
26
26
from .. import rlp
27
27
from . import vm
@@ -659,7 +659,7 @@ def process_transaction(
659
659
if Uint (sender_account .balance ) < gas_fee + Uint (tx .value ):
660
660
raise InvalidBlock
661
661
if sender_account .code != bytearray ():
662
- raise InvalidBlock
662
+ raise InvalidSenderError ( "not EOA" )
663
663
664
664
gas = tx .gas - calculate_intrinsic_cost (tx )
665
665
increment_nonce (env .state , sender )
You can’t perform that action at this time.
0 commit comments