ethereum-execution 2.18.0rc6.dev2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ethereum/__init__.py +30 -0
- ethereum/assets/blocks/block_1.json +22 -0
- ethereum/assets/blocks/block_1234567.json +22 -0
- ethereum/assets/blocks/block_12964999.json +2720 -0
- ethereum/assets/cache_sizes_2048_epochs.json +329 -0
- ethereum/assets/dataset_sizes_2048_epochs.json +412 -0
- ethereum/assets/mainnet.json +26711 -0
- ethereum/crypto/__init__.py +3 -0
- ethereum/crypto/blake2.py +265 -0
- ethereum/crypto/elliptic_curve.py +170 -0
- ethereum/crypto/hash.py +56 -0
- ethereum/crypto/kzg.py +176 -0
- ethereum/ethash.py +426 -0
- ethereum/exceptions.py +75 -0
- ethereum/fork_criteria.py +205 -0
- ethereum/forks/arrow_glacier/__init__.py +33 -0
- ethereum/forks/arrow_glacier/blocks.py +326 -0
- ethereum/forks/arrow_glacier/bloom.py +87 -0
- ethereum/forks/arrow_glacier/exceptions.py +58 -0
- ethereum/forks/arrow_glacier/fork.py +954 -0
- ethereum/forks/arrow_glacier/fork_types.py +62 -0
- ethereum/forks/arrow_glacier/state.py +644 -0
- ethereum/forks/arrow_glacier/transactions.py +573 -0
- ethereum/forks/arrow_glacier/trie.py +498 -0
- ethereum/forks/arrow_glacier/utils/__init__.py +3 -0
- ethereum/forks/arrow_glacier/utils/address.py +94 -0
- ethereum/forks/arrow_glacier/utils/hexadecimal.py +55 -0
- ethereum/forks/arrow_glacier/utils/message.py +90 -0
- ethereum/forks/arrow_glacier/vm/__init__.py +195 -0
- ethereum/forks/arrow_glacier/vm/exceptions.py +131 -0
- ethereum/forks/arrow_glacier/vm/gas.py +245 -0
- ethereum/forks/arrow_glacier/vm/instructions/__init__.py +353 -0
- ethereum/forks/arrow_glacier/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/arrow_glacier/vm/instructions/bitwise.py +245 -0
- ethereum/forks/arrow_glacier/vm/instructions/block.py +212 -0
- ethereum/forks/arrow_glacier/vm/instructions/comparison.py +177 -0
- ethereum/forks/arrow_glacier/vm/instructions/control_flow.py +171 -0
- ethereum/forks/arrow_glacier/vm/instructions/environment.py +544 -0
- ethereum/forks/arrow_glacier/vm/instructions/keccak.py +63 -0
- ethereum/forks/arrow_glacier/vm/instructions/log.py +88 -0
- ethereum/forks/arrow_glacier/vm/instructions/memory.py +141 -0
- ethereum/forks/arrow_glacier/vm/instructions/stack.py +204 -0
- ethereum/forks/arrow_glacier/vm/instructions/storage.py +126 -0
- ethereum/forks/arrow_glacier/vm/instructions/system.py +694 -0
- ethereum/forks/arrow_glacier/vm/interpreter.py +312 -0
- ethereum/forks/arrow_glacier/vm/memory.py +84 -0
- ethereum/forks/arrow_glacier/vm/precompiled_contracts/__init__.py +37 -0
- ethereum/forks/arrow_glacier/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/arrow_glacier/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/arrow_glacier/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/arrow_glacier/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/arrow_glacier/vm/precompiled_contracts/mapping.py +46 -0
- ethereum/forks/arrow_glacier/vm/precompiled_contracts/modexp.py +166 -0
- ethereum/forks/arrow_glacier/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/arrow_glacier/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/arrow_glacier/vm/runtime.py +69 -0
- ethereum/forks/arrow_glacier/vm/stack.py +58 -0
- ethereum/forks/berlin/__init__.py +43 -0
- ethereum/forks/berlin/blocks.py +297 -0
- ethereum/forks/berlin/bloom.py +87 -0
- ethereum/forks/berlin/exceptions.py +24 -0
- ethereum/forks/berlin/fork.py +839 -0
- ethereum/forks/berlin/fork_types.py +62 -0
- ethereum/forks/berlin/state.py +644 -0
- ethereum/forks/berlin/transactions.py +456 -0
- ethereum/forks/berlin/trie.py +498 -0
- ethereum/forks/berlin/utils/__init__.py +3 -0
- ethereum/forks/berlin/utils/address.py +94 -0
- ethereum/forks/berlin/utils/hexadecimal.py +55 -0
- ethereum/forks/berlin/utils/message.py +90 -0
- ethereum/forks/berlin/vm/__init__.py +194 -0
- ethereum/forks/berlin/vm/exceptions.py +123 -0
- ethereum/forks/berlin/vm/gas.py +246 -0
- ethereum/forks/berlin/vm/instructions/__init__.py +351 -0
- ethereum/forks/berlin/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/berlin/vm/instructions/bitwise.py +245 -0
- ethereum/forks/berlin/vm/instructions/block.py +212 -0
- ethereum/forks/berlin/vm/instructions/comparison.py +177 -0
- ethereum/forks/berlin/vm/instructions/control_flow.py +171 -0
- ethereum/forks/berlin/vm/instructions/environment.py +521 -0
- ethereum/forks/berlin/vm/instructions/keccak.py +63 -0
- ethereum/forks/berlin/vm/instructions/log.py +88 -0
- ethereum/forks/berlin/vm/instructions/memory.py +141 -0
- ethereum/forks/berlin/vm/instructions/stack.py +204 -0
- ethereum/forks/berlin/vm/instructions/storage.py +126 -0
- ethereum/forks/berlin/vm/instructions/system.py +706 -0
- ethereum/forks/berlin/vm/interpreter.py +308 -0
- ethereum/forks/berlin/vm/memory.py +84 -0
- ethereum/forks/berlin/vm/precompiled_contracts/__init__.py +37 -0
- ethereum/forks/berlin/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/berlin/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/berlin/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/berlin/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/berlin/vm/precompiled_contracts/mapping.py +46 -0
- ethereum/forks/berlin/vm/precompiled_contracts/modexp.py +166 -0
- ethereum/forks/berlin/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/berlin/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/berlin/vm/runtime.py +69 -0
- ethereum/forks/berlin/vm/stack.py +58 -0
- ethereum/forks/byzantium/__init__.py +50 -0
- ethereum/forks/byzantium/blocks.py +265 -0
- ethereum/forks/byzantium/bloom.py +87 -0
- ethereum/forks/byzantium/fork.py +816 -0
- ethereum/forks/byzantium/fork_types.py +61 -0
- ethereum/forks/byzantium/state.py +583 -0
- ethereum/forks/byzantium/transactions.py +261 -0
- ethereum/forks/byzantium/trie.py +498 -0
- ethereum/forks/byzantium/utils/__init__.py +3 -0
- ethereum/forks/byzantium/utils/address.py +63 -0
- ethereum/forks/byzantium/utils/hexadecimal.py +55 -0
- ethereum/forks/byzantium/utils/message.py +80 -0
- ethereum/forks/byzantium/vm/__init__.py +186 -0
- ethereum/forks/byzantium/vm/exceptions.py +123 -0
- ethereum/forks/byzantium/vm/gas.py +245 -0
- ethereum/forks/byzantium/vm/instructions/__init__.py +337 -0
- ethereum/forks/byzantium/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/byzantium/vm/instructions/bitwise.py +153 -0
- ethereum/forks/byzantium/vm/instructions/block.py +189 -0
- ethereum/forks/byzantium/vm/instructions/comparison.py +177 -0
- ethereum/forks/byzantium/vm/instructions/control_flow.py +171 -0
- ethereum/forks/byzantium/vm/instructions/environment.py +436 -0
- ethereum/forks/byzantium/vm/instructions/keccak.py +63 -0
- ethereum/forks/byzantium/vm/instructions/log.py +88 -0
- ethereum/forks/byzantium/vm/instructions/memory.py +141 -0
- ethereum/forks/byzantium/vm/instructions/stack.py +204 -0
- ethereum/forks/byzantium/vm/instructions/storage.py +88 -0
- ethereum/forks/byzantium/vm/instructions/system.py +601 -0
- ethereum/forks/byzantium/vm/interpreter.py +299 -0
- ethereum/forks/byzantium/vm/memory.py +84 -0
- ethereum/forks/byzantium/vm/precompiled_contracts/__init__.py +36 -0
- ethereum/forks/byzantium/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/byzantium/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/byzantium/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/byzantium/vm/precompiled_contracts/mapping.py +43 -0
- ethereum/forks/byzantium/vm/precompiled_contracts/modexp.py +168 -0
- ethereum/forks/byzantium/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/byzantium/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/byzantium/vm/runtime.py +69 -0
- ethereum/forks/byzantium/vm/stack.py +58 -0
- ethereum/forks/cancun/__init__.py +49 -0
- ethereum/forks/cancun/blocks.py +389 -0
- ethereum/forks/cancun/bloom.py +87 -0
- ethereum/forks/cancun/exceptions.py +109 -0
- ethereum/forks/cancun/fork.py +881 -0
- ethereum/forks/cancun/fork_types.py +63 -0
- ethereum/forks/cancun/state.py +667 -0
- ethereum/forks/cancun/transactions.py +721 -0
- ethereum/forks/cancun/trie.py +508 -0
- ethereum/forks/cancun/utils/__init__.py +3 -0
- ethereum/forks/cancun/utils/address.py +94 -0
- ethereum/forks/cancun/utils/hexadecimal.py +55 -0
- ethereum/forks/cancun/utils/message.py +90 -0
- ethereum/forks/cancun/vm/__init__.py +186 -0
- ethereum/forks/cancun/vm/exceptions.py +139 -0
- ethereum/forks/cancun/vm/gas.py +372 -0
- ethereum/forks/cancun/vm/instructions/__init__.py +365 -0
- ethereum/forks/cancun/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/cancun/vm/instructions/bitwise.py +245 -0
- ethereum/forks/cancun/vm/instructions/block.py +261 -0
- ethereum/forks/cancun/vm/instructions/comparison.py +177 -0
- ethereum/forks/cancun/vm/instructions/control_flow.py +171 -0
- ethereum/forks/cancun/vm/instructions/environment.py +600 -0
- ethereum/forks/cancun/vm/instructions/keccak.py +63 -0
- ethereum/forks/cancun/vm/instructions/log.py +88 -0
- ethereum/forks/cancun/vm/instructions/memory.py +177 -0
- ethereum/forks/cancun/vm/instructions/stack.py +208 -0
- ethereum/forks/cancun/vm/instructions/storage.py +188 -0
- ethereum/forks/cancun/vm/instructions/system.py +708 -0
- ethereum/forks/cancun/vm/interpreter.py +302 -0
- ethereum/forks/cancun/vm/memory.py +84 -0
- ethereum/forks/cancun/vm/precompiled_contracts/__init__.py +39 -0
- ethereum/forks/cancun/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/cancun/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/cancun/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/cancun/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/cancun/vm/precompiled_contracts/mapping.py +49 -0
- ethereum/forks/cancun/vm/precompiled_contracts/modexp.py +166 -0
- ethereum/forks/cancun/vm/precompiled_contracts/point_evaluation.py +72 -0
- ethereum/forks/cancun/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/cancun/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/cancun/vm/runtime.py +69 -0
- ethereum/forks/cancun/vm/stack.py +58 -0
- ethereum/forks/constantinople/__init__.py +51 -0
- ethereum/forks/constantinople/blocks.py +265 -0
- ethereum/forks/constantinople/bloom.py +87 -0
- ethereum/forks/constantinople/fork.py +816 -0
- ethereum/forks/constantinople/fork_types.py +62 -0
- ethereum/forks/constantinople/state.py +583 -0
- ethereum/forks/constantinople/transactions.py +261 -0
- ethereum/forks/constantinople/trie.py +498 -0
- ethereum/forks/constantinople/utils/__init__.py +3 -0
- ethereum/forks/constantinople/utils/address.py +93 -0
- ethereum/forks/constantinople/utils/hexadecimal.py +55 -0
- ethereum/forks/constantinople/utils/message.py +80 -0
- ethereum/forks/constantinople/vm/__init__.py +186 -0
- ethereum/forks/constantinople/vm/exceptions.py +123 -0
- ethereum/forks/constantinople/vm/gas.py +246 -0
- ethereum/forks/constantinople/vm/instructions/__init__.py +347 -0
- ethereum/forks/constantinople/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/constantinople/vm/instructions/bitwise.py +245 -0
- ethereum/forks/constantinople/vm/instructions/block.py +189 -0
- ethereum/forks/constantinople/vm/instructions/comparison.py +177 -0
- ethereum/forks/constantinople/vm/instructions/control_flow.py +171 -0
- ethereum/forks/constantinople/vm/instructions/environment.py +470 -0
- ethereum/forks/constantinople/vm/instructions/keccak.py +63 -0
- ethereum/forks/constantinople/vm/instructions/log.py +88 -0
- ethereum/forks/constantinople/vm/instructions/memory.py +141 -0
- ethereum/forks/constantinople/vm/instructions/stack.py +204 -0
- ethereum/forks/constantinople/vm/instructions/storage.py +88 -0
- ethereum/forks/constantinople/vm/instructions/system.py +673 -0
- ethereum/forks/constantinople/vm/interpreter.py +300 -0
- ethereum/forks/constantinople/vm/memory.py +84 -0
- ethereum/forks/constantinople/vm/precompiled_contracts/__init__.py +36 -0
- ethereum/forks/constantinople/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/constantinople/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/constantinople/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/constantinople/vm/precompiled_contracts/mapping.py +43 -0
- ethereum/forks/constantinople/vm/precompiled_contracts/modexp.py +168 -0
- ethereum/forks/constantinople/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/constantinople/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/constantinople/vm/runtime.py +69 -0
- ethereum/forks/constantinople/vm/stack.py +58 -0
- ethereum/forks/dao_fork/__init__.py +29 -0
- ethereum/forks/dao_fork/blocks.py +265 -0
- ethereum/forks/dao_fork/bloom.py +87 -0
- ethereum/forks/dao_fork/dao.py +357 -0
- ethereum/forks/dao_fork/fork.py +816 -0
- ethereum/forks/dao_fork/fork_types.py +62 -0
- ethereum/forks/dao_fork/state.py +515 -0
- ethereum/forks/dao_fork/transactions.py +227 -0
- ethereum/forks/dao_fork/trie.py +498 -0
- ethereum/forks/dao_fork/utils/__init__.py +3 -0
- ethereum/forks/dao_fork/utils/address.py +62 -0
- ethereum/forks/dao_fork/utils/hexadecimal.py +55 -0
- ethereum/forks/dao_fork/utils/message.py +78 -0
- ethereum/forks/dao_fork/vm/__init__.py +163 -0
- ethereum/forks/dao_fork/vm/exceptions.py +86 -0
- ethereum/forks/dao_fork/vm/gas.py +212 -0
- ethereum/forks/dao_fork/vm/instructions/__init__.py +329 -0
- ethereum/forks/dao_fork/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/dao_fork/vm/instructions/bitwise.py +153 -0
- ethereum/forks/dao_fork/vm/instructions/block.py +189 -0
- ethereum/forks/dao_fork/vm/instructions/comparison.py +177 -0
- ethereum/forks/dao_fork/vm/instructions/control_flow.py +171 -0
- ethereum/forks/dao_fork/vm/instructions/environment.py +376 -0
- ethereum/forks/dao_fork/vm/instructions/keccak.py +63 -0
- ethereum/forks/dao_fork/vm/instructions/log.py +85 -0
- ethereum/forks/dao_fork/vm/instructions/memory.py +141 -0
- ethereum/forks/dao_fork/vm/instructions/stack.py +204 -0
- ethereum/forks/dao_fork/vm/instructions/storage.py +87 -0
- ethereum/forks/dao_fork/vm/instructions/system.py +457 -0
- ethereum/forks/dao_fork/vm/interpreter.py +274 -0
- ethereum/forks/dao_fork/vm/memory.py +84 -0
- ethereum/forks/dao_fork/vm/precompiled_contracts/__init__.py +27 -0
- ethereum/forks/dao_fork/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/dao_fork/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/dao_fork/vm/precompiled_contracts/mapping.py +33 -0
- ethereum/forks/dao_fork/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/dao_fork/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/dao_fork/vm/runtime.py +69 -0
- ethereum/forks/dao_fork/vm/stack.py +58 -0
- ethereum/forks/frontier/__init__.py +7 -0
- ethereum/forks/frontier/blocks.py +265 -0
- ethereum/forks/frontier/bloom.py +87 -0
- ethereum/forks/frontier/fork.py +789 -0
- ethereum/forks/frontier/fork_types.py +62 -0
- ethereum/forks/frontier/state.py +515 -0
- ethereum/forks/frontier/transactions.py +216 -0
- ethereum/forks/frontier/trie.py +499 -0
- ethereum/forks/frontier/utils/__init__.py +3 -0
- ethereum/forks/frontier/utils/address.py +62 -0
- ethereum/forks/frontier/utils/hexadecimal.py +55 -0
- ethereum/forks/frontier/utils/message.py +77 -0
- ethereum/forks/frontier/vm/__init__.py +162 -0
- ethereum/forks/frontier/vm/exceptions.py +86 -0
- ethereum/forks/frontier/vm/gas.py +212 -0
- ethereum/forks/frontier/vm/instructions/__init__.py +327 -0
- ethereum/forks/frontier/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/frontier/vm/instructions/bitwise.py +153 -0
- ethereum/forks/frontier/vm/instructions/block.py +189 -0
- ethereum/forks/frontier/vm/instructions/comparison.py +177 -0
- ethereum/forks/frontier/vm/instructions/control_flow.py +171 -0
- ethereum/forks/frontier/vm/instructions/environment.py +376 -0
- ethereum/forks/frontier/vm/instructions/keccak.py +63 -0
- ethereum/forks/frontier/vm/instructions/log.py +85 -0
- ethereum/forks/frontier/vm/instructions/memory.py +141 -0
- ethereum/forks/frontier/vm/instructions/stack.py +204 -0
- ethereum/forks/frontier/vm/instructions/storage.py +87 -0
- ethereum/forks/frontier/vm/instructions/system.py +403 -0
- ethereum/forks/frontier/vm/interpreter.py +272 -0
- ethereum/forks/frontier/vm/memory.py +84 -0
- ethereum/forks/frontier/vm/precompiled_contracts/__init__.py +27 -0
- ethereum/forks/frontier/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/frontier/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/frontier/vm/precompiled_contracts/mapping.py +33 -0
- ethereum/forks/frontier/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/frontier/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/frontier/vm/runtime.py +69 -0
- ethereum/forks/frontier/vm/stack.py +58 -0
- ethereum/forks/gray_glacier/__init__.py +34 -0
- ethereum/forks/gray_glacier/blocks.py +326 -0
- ethereum/forks/gray_glacier/bloom.py +87 -0
- ethereum/forks/gray_glacier/exceptions.py +58 -0
- ethereum/forks/gray_glacier/fork.py +954 -0
- ethereum/forks/gray_glacier/fork_types.py +62 -0
- ethereum/forks/gray_glacier/state.py +644 -0
- ethereum/forks/gray_glacier/transactions.py +573 -0
- ethereum/forks/gray_glacier/trie.py +498 -0
- ethereum/forks/gray_glacier/utils/__init__.py +3 -0
- ethereum/forks/gray_glacier/utils/address.py +94 -0
- ethereum/forks/gray_glacier/utils/hexadecimal.py +55 -0
- ethereum/forks/gray_glacier/utils/message.py +90 -0
- ethereum/forks/gray_glacier/vm/__init__.py +195 -0
- ethereum/forks/gray_glacier/vm/exceptions.py +131 -0
- ethereum/forks/gray_glacier/vm/gas.py +245 -0
- ethereum/forks/gray_glacier/vm/instructions/__init__.py +353 -0
- ethereum/forks/gray_glacier/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/gray_glacier/vm/instructions/bitwise.py +245 -0
- ethereum/forks/gray_glacier/vm/instructions/block.py +212 -0
- ethereum/forks/gray_glacier/vm/instructions/comparison.py +177 -0
- ethereum/forks/gray_glacier/vm/instructions/control_flow.py +171 -0
- ethereum/forks/gray_glacier/vm/instructions/environment.py +544 -0
- ethereum/forks/gray_glacier/vm/instructions/keccak.py +63 -0
- ethereum/forks/gray_glacier/vm/instructions/log.py +88 -0
- ethereum/forks/gray_glacier/vm/instructions/memory.py +141 -0
- ethereum/forks/gray_glacier/vm/instructions/stack.py +204 -0
- ethereum/forks/gray_glacier/vm/instructions/storage.py +126 -0
- ethereum/forks/gray_glacier/vm/instructions/system.py +694 -0
- ethereum/forks/gray_glacier/vm/interpreter.py +312 -0
- ethereum/forks/gray_glacier/vm/memory.py +84 -0
- ethereum/forks/gray_glacier/vm/precompiled_contracts/__init__.py +37 -0
- ethereum/forks/gray_glacier/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/gray_glacier/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/gray_glacier/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/gray_glacier/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/gray_glacier/vm/precompiled_contracts/mapping.py +46 -0
- ethereum/forks/gray_glacier/vm/precompiled_contracts/modexp.py +166 -0
- ethereum/forks/gray_glacier/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/gray_glacier/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/gray_glacier/vm/runtime.py +69 -0
- ethereum/forks/gray_glacier/vm/stack.py +58 -0
- ethereum/forks/homestead/__init__.py +34 -0
- ethereum/forks/homestead/blocks.py +265 -0
- ethereum/forks/homestead/bloom.py +87 -0
- ethereum/forks/homestead/fork.py +798 -0
- ethereum/forks/homestead/fork_types.py +62 -0
- ethereum/forks/homestead/state.py +515 -0
- ethereum/forks/homestead/transactions.py +227 -0
- ethereum/forks/homestead/trie.py +498 -0
- ethereum/forks/homestead/utils/__init__.py +3 -0
- ethereum/forks/homestead/utils/address.py +62 -0
- ethereum/forks/homestead/utils/hexadecimal.py +55 -0
- ethereum/forks/homestead/utils/message.py +78 -0
- ethereum/forks/homestead/vm/__init__.py +163 -0
- ethereum/forks/homestead/vm/exceptions.py +86 -0
- ethereum/forks/homestead/vm/gas.py +212 -0
- ethereum/forks/homestead/vm/instructions/__init__.py +329 -0
- ethereum/forks/homestead/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/homestead/vm/instructions/bitwise.py +153 -0
- ethereum/forks/homestead/vm/instructions/block.py +189 -0
- ethereum/forks/homestead/vm/instructions/comparison.py +177 -0
- ethereum/forks/homestead/vm/instructions/control_flow.py +171 -0
- ethereum/forks/homestead/vm/instructions/environment.py +376 -0
- ethereum/forks/homestead/vm/instructions/keccak.py +63 -0
- ethereum/forks/homestead/vm/instructions/log.py +85 -0
- ethereum/forks/homestead/vm/instructions/memory.py +141 -0
- ethereum/forks/homestead/vm/instructions/stack.py +204 -0
- ethereum/forks/homestead/vm/instructions/storage.py +87 -0
- ethereum/forks/homestead/vm/instructions/system.py +457 -0
- ethereum/forks/homestead/vm/interpreter.py +274 -0
- ethereum/forks/homestead/vm/memory.py +84 -0
- ethereum/forks/homestead/vm/precompiled_contracts/__init__.py +27 -0
- ethereum/forks/homestead/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/homestead/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/homestead/vm/precompiled_contracts/mapping.py +33 -0
- ethereum/forks/homestead/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/homestead/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/homestead/vm/runtime.py +69 -0
- ethereum/forks/homestead/vm/stack.py +58 -0
- ethereum/forks/istanbul/__init__.py +53 -0
- ethereum/forks/istanbul/blocks.py +265 -0
- ethereum/forks/istanbul/bloom.py +87 -0
- ethereum/forks/istanbul/fork.py +816 -0
- ethereum/forks/istanbul/fork_types.py +62 -0
- ethereum/forks/istanbul/state.py +644 -0
- ethereum/forks/istanbul/transactions.py +261 -0
- ethereum/forks/istanbul/trie.py +498 -0
- ethereum/forks/istanbul/utils/__init__.py +3 -0
- ethereum/forks/istanbul/utils/address.py +94 -0
- ethereum/forks/istanbul/utils/hexadecimal.py +55 -0
- ethereum/forks/istanbul/utils/message.py +80 -0
- ethereum/forks/istanbul/vm/__init__.py +186 -0
- ethereum/forks/istanbul/vm/exceptions.py +123 -0
- ethereum/forks/istanbul/vm/gas.py +248 -0
- ethereum/forks/istanbul/vm/instructions/__init__.py +351 -0
- ethereum/forks/istanbul/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/istanbul/vm/instructions/bitwise.py +245 -0
- ethereum/forks/istanbul/vm/instructions/block.py +212 -0
- ethereum/forks/istanbul/vm/instructions/comparison.py +177 -0
- ethereum/forks/istanbul/vm/instructions/control_flow.py +171 -0
- ethereum/forks/istanbul/vm/instructions/environment.py +499 -0
- ethereum/forks/istanbul/vm/instructions/keccak.py +63 -0
- ethereum/forks/istanbul/vm/instructions/log.py +88 -0
- ethereum/forks/istanbul/vm/instructions/memory.py +141 -0
- ethereum/forks/istanbul/vm/instructions/stack.py +204 -0
- ethereum/forks/istanbul/vm/instructions/storage.py +113 -0
- ethereum/forks/istanbul/vm/instructions/system.py +673 -0
- ethereum/forks/istanbul/vm/interpreter.py +306 -0
- ethereum/forks/istanbul/vm/memory.py +84 -0
- ethereum/forks/istanbul/vm/precompiled_contracts/__init__.py +37 -0
- ethereum/forks/istanbul/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/istanbul/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/istanbul/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/istanbul/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/istanbul/vm/precompiled_contracts/mapping.py +46 -0
- ethereum/forks/istanbul/vm/precompiled_contracts/modexp.py +168 -0
- ethereum/forks/istanbul/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/istanbul/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/istanbul/vm/runtime.py +69 -0
- ethereum/forks/istanbul/vm/stack.py +58 -0
- ethereum/forks/london/__init__.py +48 -0
- ethereum/forks/london/blocks.py +326 -0
- ethereum/forks/london/bloom.py +87 -0
- ethereum/forks/london/exceptions.py +58 -0
- ethereum/forks/london/fork.py +960 -0
- ethereum/forks/london/fork_types.py +62 -0
- ethereum/forks/london/state.py +644 -0
- ethereum/forks/london/transactions.py +573 -0
- ethereum/forks/london/trie.py +498 -0
- ethereum/forks/london/utils/__init__.py +3 -0
- ethereum/forks/london/utils/address.py +94 -0
- ethereum/forks/london/utils/hexadecimal.py +55 -0
- ethereum/forks/london/utils/message.py +90 -0
- ethereum/forks/london/vm/__init__.py +195 -0
- ethereum/forks/london/vm/exceptions.py +131 -0
- ethereum/forks/london/vm/gas.py +245 -0
- ethereum/forks/london/vm/instructions/__init__.py +353 -0
- ethereum/forks/london/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/london/vm/instructions/bitwise.py +245 -0
- ethereum/forks/london/vm/instructions/block.py +212 -0
- ethereum/forks/london/vm/instructions/comparison.py +177 -0
- ethereum/forks/london/vm/instructions/control_flow.py +171 -0
- ethereum/forks/london/vm/instructions/environment.py +544 -0
- ethereum/forks/london/vm/instructions/keccak.py +63 -0
- ethereum/forks/london/vm/instructions/log.py +88 -0
- ethereum/forks/london/vm/instructions/memory.py +141 -0
- ethereum/forks/london/vm/instructions/stack.py +204 -0
- ethereum/forks/london/vm/instructions/storage.py +126 -0
- ethereum/forks/london/vm/instructions/system.py +694 -0
- ethereum/forks/london/vm/interpreter.py +312 -0
- ethereum/forks/london/vm/memory.py +84 -0
- ethereum/forks/london/vm/precompiled_contracts/__init__.py +37 -0
- ethereum/forks/london/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/london/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/london/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/london/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/london/vm/precompiled_contracts/mapping.py +46 -0
- ethereum/forks/london/vm/precompiled_contracts/modexp.py +166 -0
- ethereum/forks/london/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/london/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/london/vm/runtime.py +69 -0
- ethereum/forks/london/vm/stack.py +58 -0
- ethereum/forks/muir_glacier/__init__.py +38 -0
- ethereum/forks/muir_glacier/blocks.py +265 -0
- ethereum/forks/muir_glacier/bloom.py +87 -0
- ethereum/forks/muir_glacier/fork.py +818 -0
- ethereum/forks/muir_glacier/fork_types.py +62 -0
- ethereum/forks/muir_glacier/state.py +644 -0
- ethereum/forks/muir_glacier/transactions.py +261 -0
- ethereum/forks/muir_glacier/trie.py +498 -0
- ethereum/forks/muir_glacier/utils/__init__.py +3 -0
- ethereum/forks/muir_glacier/utils/address.py +94 -0
- ethereum/forks/muir_glacier/utils/hexadecimal.py +55 -0
- ethereum/forks/muir_glacier/utils/message.py +80 -0
- ethereum/forks/muir_glacier/vm/__init__.py +186 -0
- ethereum/forks/muir_glacier/vm/exceptions.py +123 -0
- ethereum/forks/muir_glacier/vm/gas.py +248 -0
- ethereum/forks/muir_glacier/vm/instructions/__init__.py +351 -0
- ethereum/forks/muir_glacier/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/muir_glacier/vm/instructions/bitwise.py +245 -0
- ethereum/forks/muir_glacier/vm/instructions/block.py +212 -0
- ethereum/forks/muir_glacier/vm/instructions/comparison.py +177 -0
- ethereum/forks/muir_glacier/vm/instructions/control_flow.py +171 -0
- ethereum/forks/muir_glacier/vm/instructions/environment.py +499 -0
- ethereum/forks/muir_glacier/vm/instructions/keccak.py +63 -0
- ethereum/forks/muir_glacier/vm/instructions/log.py +88 -0
- ethereum/forks/muir_glacier/vm/instructions/memory.py +141 -0
- ethereum/forks/muir_glacier/vm/instructions/stack.py +204 -0
- ethereum/forks/muir_glacier/vm/instructions/storage.py +113 -0
- ethereum/forks/muir_glacier/vm/instructions/system.py +673 -0
- ethereum/forks/muir_glacier/vm/interpreter.py +306 -0
- ethereum/forks/muir_glacier/vm/memory.py +84 -0
- ethereum/forks/muir_glacier/vm/precompiled_contracts/__init__.py +37 -0
- ethereum/forks/muir_glacier/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/muir_glacier/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/muir_glacier/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/muir_glacier/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/muir_glacier/vm/precompiled_contracts/mapping.py +46 -0
- ethereum/forks/muir_glacier/vm/precompiled_contracts/modexp.py +168 -0
- ethereum/forks/muir_glacier/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/muir_glacier/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/muir_glacier/vm/runtime.py +69 -0
- ethereum/forks/muir_glacier/vm/stack.py +58 -0
- ethereum/forks/osaka/__init__.py +55 -0
- ethereum/forks/osaka/blocks.py +405 -0
- ethereum/forks/osaka/bloom.py +87 -0
- ethereum/forks/osaka/exceptions.py +131 -0
- ethereum/forks/osaka/fork.py +1059 -0
- ethereum/forks/osaka/fork_types.py +78 -0
- ethereum/forks/osaka/requests.py +191 -0
- ethereum/forks/osaka/state.py +667 -0
- ethereum/forks/osaka/transactions.py +887 -0
- ethereum/forks/osaka/trie.py +508 -0
- ethereum/forks/osaka/utils/__init__.py +3 -0
- ethereum/forks/osaka/utils/address.py +94 -0
- ethereum/forks/osaka/utils/hexadecimal.py +55 -0
- ethereum/forks/osaka/utils/message.py +90 -0
- ethereum/forks/osaka/vm/__init__.py +191 -0
- ethereum/forks/osaka/vm/eoa_delegation.py +211 -0
- ethereum/forks/osaka/vm/exceptions.py +139 -0
- ethereum/forks/osaka/vm/gas.py +396 -0
- ethereum/forks/osaka/vm/instructions/__init__.py +367 -0
- ethereum/forks/osaka/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/osaka/vm/instructions/bitwise.py +274 -0
- ethereum/forks/osaka/vm/instructions/block.py +261 -0
- ethereum/forks/osaka/vm/instructions/comparison.py +177 -0
- ethereum/forks/osaka/vm/instructions/control_flow.py +171 -0
- ethereum/forks/osaka/vm/instructions/environment.py +600 -0
- ethereum/forks/osaka/vm/instructions/keccak.py +63 -0
- ethereum/forks/osaka/vm/instructions/log.py +88 -0
- ethereum/forks/osaka/vm/instructions/memory.py +177 -0
- ethereum/forks/osaka/vm/instructions/stack.py +208 -0
- ethereum/forks/osaka/vm/instructions/storage.py +188 -0
- ethereum/forks/osaka/vm/instructions/system.py +751 -0
- ethereum/forks/osaka/vm/interpreter.py +324 -0
- ethereum/forks/osaka/vm/memory.py +83 -0
- ethereum/forks/osaka/vm/precompiled_contracts/__init__.py +55 -0
- ethereum/forks/osaka/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/osaka/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/osaka/vm/precompiled_contracts/bls12_381/__init__.py +622 -0
- ethereum/forks/osaka/vm/precompiled_contracts/bls12_381/bls12_381_g1.py +151 -0
- ethereum/forks/osaka/vm/precompiled_contracts/bls12_381/bls12_381_g2.py +153 -0
- ethereum/forks/osaka/vm/precompiled_contracts/bls12_381/bls12_381_pairing.py +69 -0
- ethereum/forks/osaka/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/osaka/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/osaka/vm/precompiled_contracts/mapping.py +77 -0
- ethereum/forks/osaka/vm/precompiled_contracts/modexp.py +175 -0
- ethereum/forks/osaka/vm/precompiled_contracts/p256verify.py +89 -0
- ethereum/forks/osaka/vm/precompiled_contracts/point_evaluation.py +72 -0
- ethereum/forks/osaka/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/osaka/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/osaka/vm/runtime.py +69 -0
- ethereum/forks/osaka/vm/stack.py +58 -0
- ethereum/forks/paris/__init__.py +43 -0
- ethereum/forks/paris/blocks.py +312 -0
- ethereum/forks/paris/bloom.py +87 -0
- ethereum/forks/paris/exceptions.py +58 -0
- ethereum/forks/paris/fork.py +651 -0
- ethereum/forks/paris/fork_types.py +62 -0
- ethereum/forks/paris/state.py +571 -0
- ethereum/forks/paris/transactions.py +573 -0
- ethereum/forks/paris/trie.py +498 -0
- ethereum/forks/paris/utils/__init__.py +3 -0
- ethereum/forks/paris/utils/address.py +94 -0
- ethereum/forks/paris/utils/hexadecimal.py +55 -0
- ethereum/forks/paris/utils/message.py +90 -0
- ethereum/forks/paris/vm/__init__.py +174 -0
- ethereum/forks/paris/vm/exceptions.py +131 -0
- ethereum/forks/paris/vm/gas.py +245 -0
- ethereum/forks/paris/vm/instructions/__init__.py +353 -0
- ethereum/forks/paris/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/paris/vm/instructions/bitwise.py +245 -0
- ethereum/forks/paris/vm/instructions/block.py +261 -0
- ethereum/forks/paris/vm/instructions/comparison.py +177 -0
- ethereum/forks/paris/vm/instructions/control_flow.py +171 -0
- ethereum/forks/paris/vm/instructions/environment.py +544 -0
- ethereum/forks/paris/vm/instructions/keccak.py +63 -0
- ethereum/forks/paris/vm/instructions/log.py +88 -0
- ethereum/forks/paris/vm/instructions/memory.py +141 -0
- ethereum/forks/paris/vm/instructions/stack.py +204 -0
- ethereum/forks/paris/vm/instructions/storage.py +126 -0
- ethereum/forks/paris/vm/instructions/system.py +689 -0
- ethereum/forks/paris/vm/interpreter.py +298 -0
- ethereum/forks/paris/vm/memory.py +84 -0
- ethereum/forks/paris/vm/precompiled_contracts/__init__.py +37 -0
- ethereum/forks/paris/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/paris/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/paris/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/paris/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/paris/vm/precompiled_contracts/mapping.py +46 -0
- ethereum/forks/paris/vm/precompiled_contracts/modexp.py +166 -0
- ethereum/forks/paris/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/paris/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/paris/vm/runtime.py +69 -0
- ethereum/forks/paris/vm/stack.py +58 -0
- ethereum/forks/prague/__init__.py +54 -0
- ethereum/forks/prague/blocks.py +405 -0
- ethereum/forks/prague/bloom.py +87 -0
- ethereum/forks/prague/exceptions.py +115 -0
- ethereum/forks/prague/fork.py +1044 -0
- ethereum/forks/prague/fork_types.py +78 -0
- ethereum/forks/prague/requests.py +191 -0
- ethereum/forks/prague/state.py +667 -0
- ethereum/forks/prague/transactions.py +879 -0
- ethereum/forks/prague/trie.py +508 -0
- ethereum/forks/prague/utils/__init__.py +3 -0
- ethereum/forks/prague/utils/address.py +94 -0
- ethereum/forks/prague/utils/hexadecimal.py +55 -0
- ethereum/forks/prague/utils/message.py +90 -0
- ethereum/forks/prague/vm/__init__.py +191 -0
- ethereum/forks/prague/vm/eoa_delegation.py +211 -0
- ethereum/forks/prague/vm/exceptions.py +139 -0
- ethereum/forks/prague/vm/gas.py +379 -0
- ethereum/forks/prague/vm/instructions/__init__.py +365 -0
- ethereum/forks/prague/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/prague/vm/instructions/bitwise.py +245 -0
- ethereum/forks/prague/vm/instructions/block.py +261 -0
- ethereum/forks/prague/vm/instructions/comparison.py +177 -0
- ethereum/forks/prague/vm/instructions/control_flow.py +171 -0
- ethereum/forks/prague/vm/instructions/environment.py +600 -0
- ethereum/forks/prague/vm/instructions/keccak.py +63 -0
- ethereum/forks/prague/vm/instructions/log.py +88 -0
- ethereum/forks/prague/vm/instructions/memory.py +177 -0
- ethereum/forks/prague/vm/instructions/stack.py +208 -0
- ethereum/forks/prague/vm/instructions/storage.py +188 -0
- ethereum/forks/prague/vm/instructions/system.py +751 -0
- ethereum/forks/prague/vm/interpreter.py +324 -0
- ethereum/forks/prague/vm/memory.py +83 -0
- ethereum/forks/prague/vm/precompiled_contracts/__init__.py +53 -0
- ethereum/forks/prague/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/prague/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/prague/vm/precompiled_contracts/bls12_381/__init__.py +622 -0
- ethereum/forks/prague/vm/precompiled_contracts/bls12_381/bls12_381_g1.py +151 -0
- ethereum/forks/prague/vm/precompiled_contracts/bls12_381/bls12_381_g2.py +153 -0
- ethereum/forks/prague/vm/precompiled_contracts/bls12_381/bls12_381_pairing.py +69 -0
- ethereum/forks/prague/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/prague/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/prague/vm/precompiled_contracts/mapping.py +74 -0
- ethereum/forks/prague/vm/precompiled_contracts/modexp.py +166 -0
- ethereum/forks/prague/vm/precompiled_contracts/point_evaluation.py +72 -0
- ethereum/forks/prague/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/prague/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/prague/vm/runtime.py +69 -0
- ethereum/forks/prague/vm/stack.py +58 -0
- ethereum/forks/shanghai/__init__.py +47 -0
- ethereum/forks/shanghai/blocks.py +360 -0
- ethereum/forks/shanghai/bloom.py +87 -0
- ethereum/forks/shanghai/exceptions.py +64 -0
- ethereum/forks/shanghai/fork.py +686 -0
- ethereum/forks/shanghai/fork_types.py +62 -0
- ethereum/forks/shanghai/state.py +571 -0
- ethereum/forks/shanghai/transactions.py +585 -0
- ethereum/forks/shanghai/trie.py +508 -0
- ethereum/forks/shanghai/utils/__init__.py +3 -0
- ethereum/forks/shanghai/utils/address.py +94 -0
- ethereum/forks/shanghai/utils/hexadecimal.py +55 -0
- ethereum/forks/shanghai/utils/message.py +90 -0
- ethereum/forks/shanghai/vm/__init__.py +179 -0
- ethereum/forks/shanghai/vm/exceptions.py +131 -0
- ethereum/forks/shanghai/vm/gas.py +266 -0
- ethereum/forks/shanghai/vm/instructions/__init__.py +355 -0
- ethereum/forks/shanghai/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/shanghai/vm/instructions/bitwise.py +245 -0
- ethereum/forks/shanghai/vm/instructions/block.py +261 -0
- ethereum/forks/shanghai/vm/instructions/comparison.py +177 -0
- ethereum/forks/shanghai/vm/instructions/control_flow.py +171 -0
- ethereum/forks/shanghai/vm/instructions/environment.py +544 -0
- ethereum/forks/shanghai/vm/instructions/keccak.py +63 -0
- ethereum/forks/shanghai/vm/instructions/log.py +88 -0
- ethereum/forks/shanghai/vm/instructions/memory.py +141 -0
- ethereum/forks/shanghai/vm/instructions/stack.py +208 -0
- ethereum/forks/shanghai/vm/instructions/storage.py +126 -0
- ethereum/forks/shanghai/vm/instructions/system.py +709 -0
- ethereum/forks/shanghai/vm/interpreter.py +299 -0
- ethereum/forks/shanghai/vm/memory.py +84 -0
- ethereum/forks/shanghai/vm/precompiled_contracts/__init__.py +37 -0
- ethereum/forks/shanghai/vm/precompiled_contracts/alt_bn128.py +230 -0
- ethereum/forks/shanghai/vm/precompiled_contracts/blake2f.py +42 -0
- ethereum/forks/shanghai/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/shanghai/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/shanghai/vm/precompiled_contracts/mapping.py +46 -0
- ethereum/forks/shanghai/vm/precompiled_contracts/modexp.py +166 -0
- ethereum/forks/shanghai/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/shanghai/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/shanghai/vm/runtime.py +69 -0
- ethereum/forks/shanghai/vm/stack.py +58 -0
- ethereum/forks/spurious_dragon/__init__.py +38 -0
- ethereum/forks/spurious_dragon/blocks.py +265 -0
- ethereum/forks/spurious_dragon/bloom.py +87 -0
- ethereum/forks/spurious_dragon/fork.py +807 -0
- ethereum/forks/spurious_dragon/fork_types.py +62 -0
- ethereum/forks/spurious_dragon/state.py +583 -0
- ethereum/forks/spurious_dragon/transactions.py +261 -0
- ethereum/forks/spurious_dragon/trie.py +498 -0
- ethereum/forks/spurious_dragon/utils/__init__.py +3 -0
- ethereum/forks/spurious_dragon/utils/address.py +63 -0
- ethereum/forks/spurious_dragon/utils/hexadecimal.py +55 -0
- ethereum/forks/spurious_dragon/utils/message.py +79 -0
- ethereum/forks/spurious_dragon/vm/__init__.py +184 -0
- ethereum/forks/spurious_dragon/vm/exceptions.py +86 -0
- ethereum/forks/spurious_dragon/vm/gas.py +244 -0
- ethereum/forks/spurious_dragon/vm/instructions/__init__.py +329 -0
- ethereum/forks/spurious_dragon/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/spurious_dragon/vm/instructions/bitwise.py +153 -0
- ethereum/forks/spurious_dragon/vm/instructions/block.py +189 -0
- ethereum/forks/spurious_dragon/vm/instructions/comparison.py +177 -0
- ethereum/forks/spurious_dragon/vm/instructions/control_flow.py +171 -0
- ethereum/forks/spurious_dragon/vm/instructions/environment.py +376 -0
- ethereum/forks/spurious_dragon/vm/instructions/keccak.py +63 -0
- ethereum/forks/spurious_dragon/vm/instructions/log.py +85 -0
- ethereum/forks/spurious_dragon/vm/instructions/memory.py +141 -0
- ethereum/forks/spurious_dragon/vm/instructions/stack.py +204 -0
- ethereum/forks/spurious_dragon/vm/instructions/storage.py +87 -0
- ethereum/forks/spurious_dragon/vm/instructions/system.py +491 -0
- ethereum/forks/spurious_dragon/vm/interpreter.py +292 -0
- ethereum/forks/spurious_dragon/vm/memory.py +84 -0
- ethereum/forks/spurious_dragon/vm/precompiled_contracts/__init__.py +27 -0
- ethereum/forks/spurious_dragon/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/spurious_dragon/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/spurious_dragon/vm/precompiled_contracts/mapping.py +33 -0
- ethereum/forks/spurious_dragon/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/spurious_dragon/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/spurious_dragon/vm/runtime.py +69 -0
- ethereum/forks/spurious_dragon/vm/stack.py +58 -0
- ethereum/forks/tangerine_whistle/__init__.py +32 -0
- ethereum/forks/tangerine_whistle/blocks.py +265 -0
- ethereum/forks/tangerine_whistle/bloom.py +87 -0
- ethereum/forks/tangerine_whistle/fork.py +798 -0
- ethereum/forks/tangerine_whistle/fork_types.py +62 -0
- ethereum/forks/tangerine_whistle/state.py +515 -0
- ethereum/forks/tangerine_whistle/transactions.py +227 -0
- ethereum/forks/tangerine_whistle/trie.py +498 -0
- ethereum/forks/tangerine_whistle/utils/__init__.py +3 -0
- ethereum/forks/tangerine_whistle/utils/address.py +63 -0
- ethereum/forks/tangerine_whistle/utils/hexadecimal.py +55 -0
- ethereum/forks/tangerine_whistle/utils/message.py +79 -0
- ethereum/forks/tangerine_whistle/vm/__init__.py +163 -0
- ethereum/forks/tangerine_whistle/vm/exceptions.py +86 -0
- ethereum/forks/tangerine_whistle/vm/gas.py +244 -0
- ethereum/forks/tangerine_whistle/vm/instructions/__init__.py +329 -0
- ethereum/forks/tangerine_whistle/vm/instructions/arithmetic.py +373 -0
- ethereum/forks/tangerine_whistle/vm/instructions/bitwise.py +153 -0
- ethereum/forks/tangerine_whistle/vm/instructions/block.py +189 -0
- ethereum/forks/tangerine_whistle/vm/instructions/comparison.py +177 -0
- ethereum/forks/tangerine_whistle/vm/instructions/control_flow.py +171 -0
- ethereum/forks/tangerine_whistle/vm/instructions/environment.py +376 -0
- ethereum/forks/tangerine_whistle/vm/instructions/keccak.py +63 -0
- ethereum/forks/tangerine_whistle/vm/instructions/log.py +85 -0
- ethereum/forks/tangerine_whistle/vm/instructions/memory.py +141 -0
- ethereum/forks/tangerine_whistle/vm/instructions/stack.py +204 -0
- ethereum/forks/tangerine_whistle/vm/instructions/storage.py +87 -0
- ethereum/forks/tangerine_whistle/vm/instructions/system.py +480 -0
- ethereum/forks/tangerine_whistle/vm/interpreter.py +274 -0
- ethereum/forks/tangerine_whistle/vm/memory.py +84 -0
- ethereum/forks/tangerine_whistle/vm/precompiled_contracts/__init__.py +27 -0
- ethereum/forks/tangerine_whistle/vm/precompiled_contracts/ecrecover.py +64 -0
- ethereum/forks/tangerine_whistle/vm/precompiled_contracts/identity.py +39 -0
- ethereum/forks/tangerine_whistle/vm/precompiled_contracts/mapping.py +33 -0
- ethereum/forks/tangerine_whistle/vm/precompiled_contracts/ripemd160.py +44 -0
- ethereum/forks/tangerine_whistle/vm/precompiled_contracts/sha256.py +41 -0
- ethereum/forks/tangerine_whistle/vm/runtime.py +69 -0
- ethereum/forks/tangerine_whistle/vm/stack.py +58 -0
- ethereum/genesis.py +279 -0
- ethereum/py.typed +0 -0
- ethereum/trace.py +252 -0
- ethereum/utils/__init__.py +18 -0
- ethereum/utils/byte.py +59 -0
- ethereum/utils/hexadecimal.py +221 -0
- ethereum/utils/numeric.py +208 -0
- ethereum_execution-2.18.0rc6.dev2.dist-info/METADATA +113 -0
- ethereum_execution-2.18.0rc6.dev2.dist-info/RECORD +816 -0
- ethereum_execution-2.18.0rc6.dev2.dist-info/WHEEL +5 -0
- ethereum_execution-2.18.0rc6.dev2.dist-info/entry_points.txt +17 -0
- ethereum_execution-2.18.0rc6.dev2.dist-info/licenses/LICENSE.md +35 -0
- ethereum_execution-2.18.0rc6.dev2.dist-info/top_level.txt +3 -0
- ethereum_optimized/__init__.py +78 -0
- ethereum_optimized/fork.py +72 -0
- ethereum_optimized/state_db.py +444 -0
- ethereum_optimized/utils.py +26 -0
- ethereum_spec_tools/__init__.py +6 -0
- ethereum_spec_tools/docc.py +1135 -0
- ethereum_spec_tools/evm_tools/__init__.py +119 -0
- ethereum_spec_tools/evm_tools/__main__.py +7 -0
- ethereum_spec_tools/evm_tools/b11r/__init__.py +143 -0
- ethereum_spec_tools/evm_tools/b11r/b11r_types.py +173 -0
- ethereum_spec_tools/evm_tools/daemon.py +202 -0
- ethereum_spec_tools/evm_tools/loaders/__init__.py +3 -0
- ethereum_spec_tools/evm_tools/loaders/fixture_loader.py +190 -0
- ethereum_spec_tools/evm_tools/loaders/fork_loader.py +320 -0
- ethereum_spec_tools/evm_tools/loaders/transaction_loader.py +208 -0
- ethereum_spec_tools/evm_tools/statetest/__init__.py +291 -0
- ethereum_spec_tools/evm_tools/t8n/__init__.py +402 -0
- ethereum_spec_tools/evm_tools/t8n/env.py +320 -0
- ethereum_spec_tools/evm_tools/t8n/evm_trace/__init__.py +5 -0
- ethereum_spec_tools/evm_tools/t8n/evm_trace/count.py +47 -0
- ethereum_spec_tools/evm_tools/t8n/evm_trace/eip3155.py +333 -0
- ethereum_spec_tools/evm_tools/t8n/evm_trace/group.py +39 -0
- ethereum_spec_tools/evm_tools/t8n/evm_trace/protocols.py +54 -0
- ethereum_spec_tools/evm_tools/t8n/t8n_types.py +393 -0
- ethereum_spec_tools/evm_tools/utils.py +187 -0
- ethereum_spec_tools/forks.py +302 -0
- ethereum_spec_tools/lint/__init__.py +195 -0
- ethereum_spec_tools/lint/__main__.py +11 -0
- ethereum_spec_tools/lint/lints/glacier_forks_hygiene.py +273 -0
- ethereum_spec_tools/lint/lints/import_hygiene.py +145 -0
- ethereum_spec_tools/lint/lints/patch_hygiene.py +161 -0
- ethereum_spec_tools/new_fork/__init__.py +4 -0
- ethereum_spec_tools/new_fork/builder.py +430 -0
- ethereum_spec_tools/new_fork/cli.py +216 -0
- ethereum_spec_tools/new_fork/codemod/__init__.py +3 -0
- ethereum_spec_tools/new_fork/codemod/comment.py +79 -0
- ethereum_spec_tools/new_fork/codemod/constant.py +141 -0
- ethereum_spec_tools/new_fork/codemod/string.py +79 -0
- ethereum_spec_tools/patch_tool.py +78 -0
- ethereum_spec_tools/py.typed +0 -0
- ethereum_spec_tools/sync.py +1016 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Hardfork Utility Functions For The Message Data-structure.
|
|
3
|
+
|
|
4
|
+
.. contents:: Table of Contents
|
|
5
|
+
:backlinks: none
|
|
6
|
+
:local:
|
|
7
|
+
|
|
8
|
+
Introduction
|
|
9
|
+
------------
|
|
10
|
+
|
|
11
|
+
Message specific functions used in this osaka version of
|
|
12
|
+
specification.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from ethereum_types.bytes import Bytes, Bytes0
|
|
16
|
+
from ethereum_types.numeric import Uint
|
|
17
|
+
|
|
18
|
+
from ..fork_types import Address
|
|
19
|
+
from ..state import get_account
|
|
20
|
+
from ..transactions import Transaction
|
|
21
|
+
from ..vm import BlockEnvironment, Message, TransactionEnvironment
|
|
22
|
+
from ..vm.precompiled_contracts.mapping import PRE_COMPILED_CONTRACTS
|
|
23
|
+
from .address import compute_contract_address
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def prepare_message(
|
|
27
|
+
block_env: BlockEnvironment,
|
|
28
|
+
tx_env: TransactionEnvironment,
|
|
29
|
+
tx: Transaction,
|
|
30
|
+
) -> Message:
|
|
31
|
+
"""
|
|
32
|
+
Execute a transaction against the provided environment.
|
|
33
|
+
|
|
34
|
+
Parameters
|
|
35
|
+
----------
|
|
36
|
+
block_env :
|
|
37
|
+
Environment for the Ethereum Virtual Machine.
|
|
38
|
+
tx_env :
|
|
39
|
+
Environment for the transaction.
|
|
40
|
+
tx :
|
|
41
|
+
Transaction to be executed.
|
|
42
|
+
|
|
43
|
+
Returns
|
|
44
|
+
-------
|
|
45
|
+
message: `ethereum.forks.osaka.vm.Message`
|
|
46
|
+
Items containing contract creation or message call specific data.
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
accessed_addresses = set()
|
|
50
|
+
accessed_addresses.add(tx_env.origin)
|
|
51
|
+
accessed_addresses.update(PRE_COMPILED_CONTRACTS.keys())
|
|
52
|
+
accessed_addresses.update(tx_env.access_list_addresses)
|
|
53
|
+
|
|
54
|
+
if isinstance(tx.to, Bytes0):
|
|
55
|
+
current_target = compute_contract_address(
|
|
56
|
+
tx_env.origin,
|
|
57
|
+
get_account(block_env.state, tx_env.origin).nonce - Uint(1),
|
|
58
|
+
)
|
|
59
|
+
msg_data = Bytes(b"")
|
|
60
|
+
code = tx.data
|
|
61
|
+
code_address = None
|
|
62
|
+
elif isinstance(tx.to, Address):
|
|
63
|
+
current_target = tx.to
|
|
64
|
+
msg_data = tx.data
|
|
65
|
+
code = get_account(block_env.state, tx.to).code
|
|
66
|
+
code_address = tx.to
|
|
67
|
+
else:
|
|
68
|
+
raise AssertionError("Target must be address or empty bytes")
|
|
69
|
+
|
|
70
|
+
accessed_addresses.add(current_target)
|
|
71
|
+
|
|
72
|
+
return Message(
|
|
73
|
+
block_env=block_env,
|
|
74
|
+
tx_env=tx_env,
|
|
75
|
+
caller=tx_env.origin,
|
|
76
|
+
target=tx.to,
|
|
77
|
+
gas=tx_env.gas,
|
|
78
|
+
value=tx.value,
|
|
79
|
+
data=msg_data,
|
|
80
|
+
code=code,
|
|
81
|
+
depth=Uint(0),
|
|
82
|
+
current_target=current_target,
|
|
83
|
+
code_address=code_address,
|
|
84
|
+
should_transfer_value=True,
|
|
85
|
+
is_static=False,
|
|
86
|
+
accessed_addresses=accessed_addresses,
|
|
87
|
+
accessed_storage_keys=set(tx_env.access_list_storage_keys),
|
|
88
|
+
disable_precompiles=False,
|
|
89
|
+
parent_evm=None,
|
|
90
|
+
)
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Ethereum Virtual Machine (EVM).
|
|
3
|
+
|
|
4
|
+
.. contents:: Table of Contents
|
|
5
|
+
:backlinks: none
|
|
6
|
+
:local:
|
|
7
|
+
|
|
8
|
+
Introduction
|
|
9
|
+
------------
|
|
10
|
+
|
|
11
|
+
The abstract computer which runs the code stored in an
|
|
12
|
+
`.fork_types.Account`.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from dataclasses import dataclass, field
|
|
16
|
+
from typing import List, Optional, Set, Tuple
|
|
17
|
+
|
|
18
|
+
from ethereum_types.bytes import Bytes, Bytes0, Bytes32
|
|
19
|
+
from ethereum_types.numeric import U64, U256, Uint
|
|
20
|
+
|
|
21
|
+
from ethereum.crypto.hash import Hash32
|
|
22
|
+
from ethereum.exceptions import EthereumException
|
|
23
|
+
|
|
24
|
+
from ..blocks import Log, Receipt, Withdrawal
|
|
25
|
+
from ..fork_types import Address, Authorization, VersionedHash
|
|
26
|
+
from ..state import State, TransientStorage
|
|
27
|
+
from ..transactions import LegacyTransaction
|
|
28
|
+
from ..trie import Trie
|
|
29
|
+
|
|
30
|
+
__all__ = ("Environment", "Evm", "Message")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@dataclass
|
|
34
|
+
class BlockEnvironment:
|
|
35
|
+
"""
|
|
36
|
+
Items external to the virtual machine itself, provided by the environment.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
chain_id: U64
|
|
40
|
+
state: State
|
|
41
|
+
block_gas_limit: Uint
|
|
42
|
+
block_hashes: List[Hash32]
|
|
43
|
+
coinbase: Address
|
|
44
|
+
number: Uint
|
|
45
|
+
base_fee_per_gas: Uint
|
|
46
|
+
time: U256
|
|
47
|
+
prev_randao: Bytes32
|
|
48
|
+
excess_blob_gas: U64
|
|
49
|
+
parent_beacon_block_root: Hash32
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@dataclass
|
|
53
|
+
class BlockOutput:
|
|
54
|
+
"""
|
|
55
|
+
Output from applying the block body to the present state.
|
|
56
|
+
|
|
57
|
+
Contains the following:
|
|
58
|
+
|
|
59
|
+
block_gas_used : `ethereum.base_types.Uint`
|
|
60
|
+
Gas used for executing all transactions.
|
|
61
|
+
transactions_trie : `ethereum.fork_types.Root`
|
|
62
|
+
Trie of all the transactions in the block.
|
|
63
|
+
receipts_trie : `ethereum.fork_types.Root`
|
|
64
|
+
Trie root of all the receipts in the block.
|
|
65
|
+
receipt_keys :
|
|
66
|
+
Key of all the receipts in the block.
|
|
67
|
+
block_logs : `Bloom`
|
|
68
|
+
Logs bloom of all the logs included in all the transactions of the
|
|
69
|
+
block.
|
|
70
|
+
withdrawals_trie : `ethereum.fork_types.Root`
|
|
71
|
+
Trie root of all the withdrawals in the block.
|
|
72
|
+
blob_gas_used : `ethereum.base_types.U64`
|
|
73
|
+
Total blob gas used in the block.
|
|
74
|
+
requests : `Bytes`
|
|
75
|
+
Hash of all the requests in the block.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
block_gas_used: Uint = Uint(0)
|
|
79
|
+
transactions_trie: Trie[Bytes, Optional[Bytes | LegacyTransaction]] = (
|
|
80
|
+
field(default_factory=lambda: Trie(secured=False, default=None))
|
|
81
|
+
)
|
|
82
|
+
receipts_trie: Trie[Bytes, Optional[Bytes | Receipt]] = field(
|
|
83
|
+
default_factory=lambda: Trie(secured=False, default=None)
|
|
84
|
+
)
|
|
85
|
+
receipt_keys: Tuple[Bytes, ...] = field(default_factory=tuple)
|
|
86
|
+
block_logs: Tuple[Log, ...] = field(default_factory=tuple)
|
|
87
|
+
withdrawals_trie: Trie[Bytes, Optional[Bytes | Withdrawal]] = field(
|
|
88
|
+
default_factory=lambda: Trie(secured=False, default=None)
|
|
89
|
+
)
|
|
90
|
+
blob_gas_used: U64 = U64(0)
|
|
91
|
+
requests: List[Bytes] = field(default_factory=list)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
@dataclass
|
|
95
|
+
class TransactionEnvironment:
|
|
96
|
+
"""
|
|
97
|
+
Items that are used by contract creation or message call.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
origin: Address
|
|
101
|
+
gas_price: Uint
|
|
102
|
+
gas: Uint
|
|
103
|
+
access_list_addresses: Set[Address]
|
|
104
|
+
access_list_storage_keys: Set[Tuple[Address, Bytes32]]
|
|
105
|
+
transient_storage: TransientStorage
|
|
106
|
+
blob_versioned_hashes: Tuple[VersionedHash, ...]
|
|
107
|
+
authorizations: Tuple[Authorization, ...]
|
|
108
|
+
index_in_block: Optional[Uint]
|
|
109
|
+
tx_hash: Optional[Hash32]
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
@dataclass
|
|
113
|
+
class Message:
|
|
114
|
+
"""
|
|
115
|
+
Items that are used by contract creation or message call.
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
block_env: BlockEnvironment
|
|
119
|
+
tx_env: TransactionEnvironment
|
|
120
|
+
caller: Address
|
|
121
|
+
target: Bytes0 | Address
|
|
122
|
+
current_target: Address
|
|
123
|
+
gas: Uint
|
|
124
|
+
value: U256
|
|
125
|
+
data: Bytes
|
|
126
|
+
code_address: Optional[Address]
|
|
127
|
+
code: Bytes
|
|
128
|
+
depth: Uint
|
|
129
|
+
should_transfer_value: bool
|
|
130
|
+
is_static: bool
|
|
131
|
+
accessed_addresses: Set[Address]
|
|
132
|
+
accessed_storage_keys: Set[Tuple[Address, Bytes32]]
|
|
133
|
+
disable_precompiles: bool
|
|
134
|
+
parent_evm: Optional["Evm"]
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@dataclass
|
|
138
|
+
class Evm:
|
|
139
|
+
"""The internal state of the virtual machine."""
|
|
140
|
+
|
|
141
|
+
pc: Uint
|
|
142
|
+
stack: List[U256]
|
|
143
|
+
memory: bytearray
|
|
144
|
+
code: Bytes
|
|
145
|
+
gas_left: Uint
|
|
146
|
+
valid_jump_destinations: Set[Uint]
|
|
147
|
+
logs: Tuple[Log, ...]
|
|
148
|
+
refund_counter: int
|
|
149
|
+
running: bool
|
|
150
|
+
message: Message
|
|
151
|
+
output: Bytes
|
|
152
|
+
accounts_to_delete: Set[Address]
|
|
153
|
+
return_data: Bytes
|
|
154
|
+
error: Optional[EthereumException]
|
|
155
|
+
accessed_addresses: Set[Address]
|
|
156
|
+
accessed_storage_keys: Set[Tuple[Address, Bytes32]]
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def incorporate_child_on_success(evm: Evm, child_evm: Evm) -> None:
|
|
160
|
+
"""
|
|
161
|
+
Incorporate the state of a successful `child_evm` into the parent `evm`.
|
|
162
|
+
|
|
163
|
+
Parameters
|
|
164
|
+
----------
|
|
165
|
+
evm :
|
|
166
|
+
The parent `EVM`.
|
|
167
|
+
child_evm :
|
|
168
|
+
The child evm to incorporate.
|
|
169
|
+
|
|
170
|
+
"""
|
|
171
|
+
evm.gas_left += child_evm.gas_left
|
|
172
|
+
evm.logs += child_evm.logs
|
|
173
|
+
evm.refund_counter += child_evm.refund_counter
|
|
174
|
+
evm.accounts_to_delete.update(child_evm.accounts_to_delete)
|
|
175
|
+
evm.accessed_addresses.update(child_evm.accessed_addresses)
|
|
176
|
+
evm.accessed_storage_keys.update(child_evm.accessed_storage_keys)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def incorporate_child_on_error(evm: Evm, child_evm: Evm) -> None:
|
|
180
|
+
"""
|
|
181
|
+
Incorporate the state of an unsuccessful `child_evm` into the parent `evm`.
|
|
182
|
+
|
|
183
|
+
Parameters
|
|
184
|
+
----------
|
|
185
|
+
evm :
|
|
186
|
+
The parent `EVM`.
|
|
187
|
+
child_evm :
|
|
188
|
+
The child evm to incorporate.
|
|
189
|
+
|
|
190
|
+
"""
|
|
191
|
+
evm.gas_left += child_evm.gas_left
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Set EOA account code.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from typing import Optional, Tuple
|
|
6
|
+
|
|
7
|
+
from ethereum_rlp import rlp
|
|
8
|
+
from ethereum_types.bytes import Bytes
|
|
9
|
+
from ethereum_types.numeric import U64, U256, Uint
|
|
10
|
+
|
|
11
|
+
from ethereum.crypto.elliptic_curve import SECP256K1N, secp256k1_recover
|
|
12
|
+
from ethereum.crypto.hash import keccak256
|
|
13
|
+
from ethereum.exceptions import InvalidBlock, InvalidSignatureError
|
|
14
|
+
|
|
15
|
+
from ..fork_types import Address, Authorization
|
|
16
|
+
from ..state import account_exists, get_account, increment_nonce, set_code
|
|
17
|
+
from ..utils.hexadecimal import hex_to_address
|
|
18
|
+
from ..vm.gas import GAS_COLD_ACCOUNT_ACCESS, GAS_WARM_ACCESS
|
|
19
|
+
from . import Evm, Message
|
|
20
|
+
|
|
21
|
+
SET_CODE_TX_MAGIC = b"\x05"
|
|
22
|
+
EOA_DELEGATION_MARKER = b"\xef\x01\x00"
|
|
23
|
+
EOA_DELEGATION_MARKER_LENGTH = len(EOA_DELEGATION_MARKER)
|
|
24
|
+
EOA_DELEGATED_CODE_LENGTH = 23
|
|
25
|
+
PER_EMPTY_ACCOUNT_COST = 25000
|
|
26
|
+
PER_AUTH_BASE_COST = 12500
|
|
27
|
+
NULL_ADDRESS = hex_to_address("0x0000000000000000000000000000000000000000")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def is_valid_delegation(code: bytes) -> bool:
|
|
31
|
+
"""
|
|
32
|
+
Whether the code is a valid delegation designation.
|
|
33
|
+
|
|
34
|
+
Parameters
|
|
35
|
+
----------
|
|
36
|
+
code: `bytes`
|
|
37
|
+
The code to check.
|
|
38
|
+
|
|
39
|
+
Returns
|
|
40
|
+
-------
|
|
41
|
+
valid : `bool`
|
|
42
|
+
True if the code is a valid delegation designation,
|
|
43
|
+
False otherwise.
|
|
44
|
+
|
|
45
|
+
"""
|
|
46
|
+
if (
|
|
47
|
+
len(code) == EOA_DELEGATED_CODE_LENGTH
|
|
48
|
+
and code[:EOA_DELEGATION_MARKER_LENGTH] == EOA_DELEGATION_MARKER
|
|
49
|
+
):
|
|
50
|
+
return True
|
|
51
|
+
return False
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def get_delegated_code_address(code: bytes) -> Optional[Address]:
|
|
55
|
+
"""
|
|
56
|
+
Get the address to which the code delegates.
|
|
57
|
+
|
|
58
|
+
Parameters
|
|
59
|
+
----------
|
|
60
|
+
code: `bytes`
|
|
61
|
+
The code to get the address from.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
address : `Optional[Address]`
|
|
66
|
+
The address of the delegated code.
|
|
67
|
+
|
|
68
|
+
"""
|
|
69
|
+
if is_valid_delegation(code):
|
|
70
|
+
return Address(code[EOA_DELEGATION_MARKER_LENGTH:])
|
|
71
|
+
return None
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def recover_authority(authorization: Authorization) -> Address:
|
|
75
|
+
"""
|
|
76
|
+
Recover the authority address from the authorization.
|
|
77
|
+
|
|
78
|
+
Parameters
|
|
79
|
+
----------
|
|
80
|
+
authorization
|
|
81
|
+
The authorization to recover the authority from.
|
|
82
|
+
|
|
83
|
+
Raises
|
|
84
|
+
------
|
|
85
|
+
InvalidSignatureError
|
|
86
|
+
If the signature is invalid.
|
|
87
|
+
|
|
88
|
+
Returns
|
|
89
|
+
-------
|
|
90
|
+
authority : `Address`
|
|
91
|
+
The recovered authority address.
|
|
92
|
+
|
|
93
|
+
"""
|
|
94
|
+
y_parity, r, s = authorization.y_parity, authorization.r, authorization.s
|
|
95
|
+
if y_parity not in (0, 1):
|
|
96
|
+
raise InvalidSignatureError("Invalid y_parity in authorization")
|
|
97
|
+
if U256(0) >= r or r >= SECP256K1N:
|
|
98
|
+
raise InvalidSignatureError("Invalid r value in authorization")
|
|
99
|
+
if U256(0) >= s or s > SECP256K1N // U256(2):
|
|
100
|
+
raise InvalidSignatureError("Invalid s value in authorization")
|
|
101
|
+
|
|
102
|
+
signing_hash = keccak256(
|
|
103
|
+
SET_CODE_TX_MAGIC
|
|
104
|
+
+ rlp.encode(
|
|
105
|
+
(
|
|
106
|
+
authorization.chain_id,
|
|
107
|
+
authorization.address,
|
|
108
|
+
authorization.nonce,
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
public_key = secp256k1_recover(r, s, U256(y_parity), signing_hash)
|
|
114
|
+
return Address(keccak256(public_key)[12:32])
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def access_delegation(
|
|
118
|
+
evm: Evm, address: Address
|
|
119
|
+
) -> Tuple[bool, Address, Bytes, Uint]:
|
|
120
|
+
"""
|
|
121
|
+
Get the delegation address, code, and the cost of access from the address.
|
|
122
|
+
|
|
123
|
+
Parameters
|
|
124
|
+
----------
|
|
125
|
+
evm : `Evm`
|
|
126
|
+
The execution frame.
|
|
127
|
+
address : `Address`
|
|
128
|
+
The address to get the delegation from.
|
|
129
|
+
|
|
130
|
+
Returns
|
|
131
|
+
-------
|
|
132
|
+
delegation : `Tuple[bool, Address, Bytes, Uint]`
|
|
133
|
+
The delegation address, code, and access gas cost.
|
|
134
|
+
|
|
135
|
+
"""
|
|
136
|
+
state = evm.message.block_env.state
|
|
137
|
+
code = get_account(state, address).code
|
|
138
|
+
if not is_valid_delegation(code):
|
|
139
|
+
return False, address, code, Uint(0)
|
|
140
|
+
|
|
141
|
+
address = Address(code[EOA_DELEGATION_MARKER_LENGTH:])
|
|
142
|
+
if address in evm.accessed_addresses:
|
|
143
|
+
access_gas_cost = GAS_WARM_ACCESS
|
|
144
|
+
else:
|
|
145
|
+
evm.accessed_addresses.add(address)
|
|
146
|
+
access_gas_cost = GAS_COLD_ACCOUNT_ACCESS
|
|
147
|
+
code = get_account(state, address).code
|
|
148
|
+
|
|
149
|
+
return True, address, code, access_gas_cost
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def set_delegation(message: Message) -> U256:
|
|
153
|
+
"""
|
|
154
|
+
Set the delegation code for the authorities in the message.
|
|
155
|
+
|
|
156
|
+
Parameters
|
|
157
|
+
----------
|
|
158
|
+
message :
|
|
159
|
+
Transaction specific items.
|
|
160
|
+
env :
|
|
161
|
+
External items required for EVM execution.
|
|
162
|
+
|
|
163
|
+
Returns
|
|
164
|
+
-------
|
|
165
|
+
refund_counter: `U256`
|
|
166
|
+
Refund from authority which already exists in state.
|
|
167
|
+
|
|
168
|
+
"""
|
|
169
|
+
state = message.block_env.state
|
|
170
|
+
refund_counter = U256(0)
|
|
171
|
+
for auth in message.tx_env.authorizations:
|
|
172
|
+
if auth.chain_id not in (message.block_env.chain_id, U256(0)):
|
|
173
|
+
continue
|
|
174
|
+
|
|
175
|
+
if auth.nonce >= U64.MAX_VALUE:
|
|
176
|
+
continue
|
|
177
|
+
|
|
178
|
+
try:
|
|
179
|
+
authority = recover_authority(auth)
|
|
180
|
+
except InvalidSignatureError:
|
|
181
|
+
continue
|
|
182
|
+
|
|
183
|
+
message.accessed_addresses.add(authority)
|
|
184
|
+
|
|
185
|
+
authority_account = get_account(state, authority)
|
|
186
|
+
authority_code = authority_account.code
|
|
187
|
+
|
|
188
|
+
if authority_code and not is_valid_delegation(authority_code):
|
|
189
|
+
continue
|
|
190
|
+
|
|
191
|
+
authority_nonce = authority_account.nonce
|
|
192
|
+
if authority_nonce != auth.nonce:
|
|
193
|
+
continue
|
|
194
|
+
|
|
195
|
+
if account_exists(state, authority):
|
|
196
|
+
refund_counter += U256(PER_EMPTY_ACCOUNT_COST - PER_AUTH_BASE_COST)
|
|
197
|
+
|
|
198
|
+
if auth.address == NULL_ADDRESS:
|
|
199
|
+
code_to_set = b""
|
|
200
|
+
else:
|
|
201
|
+
code_to_set = EOA_DELEGATION_MARKER + auth.address
|
|
202
|
+
set_code(state, authority, code_to_set)
|
|
203
|
+
|
|
204
|
+
increment_nonce(state, authority)
|
|
205
|
+
|
|
206
|
+
if message.code_address is None:
|
|
207
|
+
raise InvalidBlock("Invalid type 4 transaction: no target")
|
|
208
|
+
|
|
209
|
+
message.code = get_account(state, message.code_address).code
|
|
210
|
+
|
|
211
|
+
return refund_counter
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Ethereum Virtual Machine (EVM) Exceptions.
|
|
3
|
+
|
|
4
|
+
.. contents:: Table of Contents
|
|
5
|
+
:backlinks: none
|
|
6
|
+
:local:
|
|
7
|
+
|
|
8
|
+
Introduction
|
|
9
|
+
------------
|
|
10
|
+
|
|
11
|
+
Exceptions which cause the EVM to halt exceptionally.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from ethereum.exceptions import EthereumException
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ExceptionalHalt(EthereumException):
|
|
18
|
+
"""
|
|
19
|
+
Indicates that the EVM has experienced an exceptional halt. This causes
|
|
20
|
+
execution to immediately end with all gas being consumed.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Revert(EthereumException):
|
|
25
|
+
"""
|
|
26
|
+
Raised by the `REVERT` opcode.
|
|
27
|
+
|
|
28
|
+
Unlike other EVM exceptions this does not result in the consumption of all
|
|
29
|
+
gas.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class StackUnderflowError(ExceptionalHalt):
|
|
36
|
+
"""
|
|
37
|
+
Occurs when a pop is executed on an empty stack.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
pass
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class StackOverflowError(ExceptionalHalt):
|
|
44
|
+
"""
|
|
45
|
+
Occurs when a push is executed on a stack at max capacity.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class OutOfGasError(ExceptionalHalt):
|
|
52
|
+
"""
|
|
53
|
+
Occurs when an operation costs more than the amount of gas left in the
|
|
54
|
+
frame.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
pass
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class InvalidOpcode(ExceptionalHalt):
|
|
61
|
+
"""
|
|
62
|
+
Raised when an invalid opcode is encountered.
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
code: int
|
|
66
|
+
|
|
67
|
+
def __init__(self, code: int) -> None:
|
|
68
|
+
super().__init__(code)
|
|
69
|
+
self.code = code
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class InvalidJumpDestError(ExceptionalHalt):
|
|
73
|
+
"""
|
|
74
|
+
Occurs when the destination of a jump operation doesn't meet any of the
|
|
75
|
+
following criteria.
|
|
76
|
+
|
|
77
|
+
* The jump destination is less than the length of the code.
|
|
78
|
+
* The jump destination should have the `JUMPDEST` opcode (0x5B).
|
|
79
|
+
* The jump destination shouldn't be part of the data corresponding to
|
|
80
|
+
`PUSH-N` opcodes.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class StackDepthLimitError(ExceptionalHalt):
|
|
85
|
+
"""
|
|
86
|
+
Raised when the message depth is greater than `1024`.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
pass
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class WriteInStaticContext(ExceptionalHalt):
|
|
93
|
+
"""
|
|
94
|
+
Raised when an attempt is made to modify the state while operating inside
|
|
95
|
+
of a STATICCALL context.
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
pass
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class OutOfBoundsRead(ExceptionalHalt):
|
|
102
|
+
"""
|
|
103
|
+
Raised when an attempt was made to read data beyond the
|
|
104
|
+
boundaries of the buffer.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
pass
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class InvalidParameter(ExceptionalHalt):
|
|
111
|
+
"""
|
|
112
|
+
Raised when invalid parameters are passed.
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
pass
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class InvalidContractPrefix(ExceptionalHalt):
|
|
119
|
+
"""
|
|
120
|
+
Raised when the new contract code starts with 0xEF.
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
pass
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class AddressCollision(ExceptionalHalt):
|
|
127
|
+
"""
|
|
128
|
+
Raised when the new contract address has a collision.
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
pass
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
class KZGProofError(ExceptionalHalt):
|
|
135
|
+
"""
|
|
136
|
+
Raised when the point evaluation precompile can't verify a proof.
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
pass
|