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,376 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Ethereum Virtual Machine (EVM) Environmental Instructions.
|
|
3
|
+
|
|
4
|
+
.. contents:: Table of Contents
|
|
5
|
+
:backlinks: none
|
|
6
|
+
:local:
|
|
7
|
+
|
|
8
|
+
Introduction
|
|
9
|
+
------------
|
|
10
|
+
|
|
11
|
+
Implementations of the EVM environment related instructions.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from ethereum_types.numeric import U256, Uint
|
|
15
|
+
|
|
16
|
+
from ethereum.utils.numeric import ceil32
|
|
17
|
+
|
|
18
|
+
from ...state import get_account
|
|
19
|
+
from ...utils.address import to_address_masked
|
|
20
|
+
from ...vm.memory import buffer_read, memory_write
|
|
21
|
+
from .. import Evm
|
|
22
|
+
from ..gas import (
|
|
23
|
+
GAS_BALANCE,
|
|
24
|
+
GAS_BASE,
|
|
25
|
+
GAS_COPY,
|
|
26
|
+
GAS_EXTERNAL,
|
|
27
|
+
GAS_VERY_LOW,
|
|
28
|
+
calculate_gas_extend_memory,
|
|
29
|
+
charge_gas,
|
|
30
|
+
)
|
|
31
|
+
from ..stack import pop, push
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def address(evm: Evm) -> None:
|
|
35
|
+
"""
|
|
36
|
+
Pushes the address of the current executing account to the stack.
|
|
37
|
+
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
evm :
|
|
41
|
+
The current EVM frame.
|
|
42
|
+
|
|
43
|
+
"""
|
|
44
|
+
# STACK
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
# GAS
|
|
48
|
+
charge_gas(evm, GAS_BASE)
|
|
49
|
+
|
|
50
|
+
# OPERATION
|
|
51
|
+
push(evm.stack, U256.from_be_bytes(evm.message.current_target))
|
|
52
|
+
|
|
53
|
+
# PROGRAM COUNTER
|
|
54
|
+
evm.pc += Uint(1)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def balance(evm: Evm) -> None:
|
|
58
|
+
"""
|
|
59
|
+
Pushes the balance of the given account onto the stack.
|
|
60
|
+
|
|
61
|
+
Parameters
|
|
62
|
+
----------
|
|
63
|
+
evm :
|
|
64
|
+
The current EVM frame.
|
|
65
|
+
|
|
66
|
+
"""
|
|
67
|
+
# STACK
|
|
68
|
+
address = to_address_masked(pop(evm.stack))
|
|
69
|
+
|
|
70
|
+
# GAS
|
|
71
|
+
charge_gas(evm, GAS_BALANCE)
|
|
72
|
+
|
|
73
|
+
# OPERATION
|
|
74
|
+
# Non-existent accounts default to EMPTY_ACCOUNT, which has balance 0.
|
|
75
|
+
balance = get_account(evm.message.block_env.state, address).balance
|
|
76
|
+
|
|
77
|
+
push(evm.stack, balance)
|
|
78
|
+
|
|
79
|
+
# PROGRAM COUNTER
|
|
80
|
+
evm.pc += Uint(1)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def origin(evm: Evm) -> None:
|
|
84
|
+
"""
|
|
85
|
+
Pushes the address of the original transaction sender to the stack.
|
|
86
|
+
The origin address can only be an EOA.
|
|
87
|
+
|
|
88
|
+
Parameters
|
|
89
|
+
----------
|
|
90
|
+
evm :
|
|
91
|
+
The current EVM frame.
|
|
92
|
+
|
|
93
|
+
"""
|
|
94
|
+
# STACK
|
|
95
|
+
pass
|
|
96
|
+
|
|
97
|
+
# GAS
|
|
98
|
+
charge_gas(evm, GAS_BASE)
|
|
99
|
+
|
|
100
|
+
# OPERATION
|
|
101
|
+
push(evm.stack, U256.from_be_bytes(evm.message.tx_env.origin))
|
|
102
|
+
|
|
103
|
+
# PROGRAM COUNTER
|
|
104
|
+
evm.pc += Uint(1)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def caller(evm: Evm) -> None:
|
|
108
|
+
"""
|
|
109
|
+
Pushes the address of the caller onto the stack.
|
|
110
|
+
|
|
111
|
+
Parameters
|
|
112
|
+
----------
|
|
113
|
+
evm :
|
|
114
|
+
The current EVM frame.
|
|
115
|
+
|
|
116
|
+
"""
|
|
117
|
+
# STACK
|
|
118
|
+
pass
|
|
119
|
+
|
|
120
|
+
# GAS
|
|
121
|
+
charge_gas(evm, GAS_BASE)
|
|
122
|
+
|
|
123
|
+
# OPERATION
|
|
124
|
+
push(evm.stack, U256.from_be_bytes(evm.message.caller))
|
|
125
|
+
|
|
126
|
+
# PROGRAM COUNTER
|
|
127
|
+
evm.pc += Uint(1)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def callvalue(evm: Evm) -> None:
|
|
131
|
+
"""
|
|
132
|
+
Push the value (in wei) sent with the call onto the stack.
|
|
133
|
+
|
|
134
|
+
Parameters
|
|
135
|
+
----------
|
|
136
|
+
evm :
|
|
137
|
+
The current EVM frame.
|
|
138
|
+
|
|
139
|
+
"""
|
|
140
|
+
# STACK
|
|
141
|
+
pass
|
|
142
|
+
|
|
143
|
+
# GAS
|
|
144
|
+
charge_gas(evm, GAS_BASE)
|
|
145
|
+
|
|
146
|
+
# OPERATION
|
|
147
|
+
push(evm.stack, evm.message.value)
|
|
148
|
+
|
|
149
|
+
# PROGRAM COUNTER
|
|
150
|
+
evm.pc += Uint(1)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def calldataload(evm: Evm) -> None:
|
|
154
|
+
"""
|
|
155
|
+
Push a word (32 bytes) of the input data belonging to the current
|
|
156
|
+
environment onto the stack.
|
|
157
|
+
|
|
158
|
+
Parameters
|
|
159
|
+
----------
|
|
160
|
+
evm :
|
|
161
|
+
The current EVM frame.
|
|
162
|
+
|
|
163
|
+
"""
|
|
164
|
+
# STACK
|
|
165
|
+
start_index = pop(evm.stack)
|
|
166
|
+
|
|
167
|
+
# GAS
|
|
168
|
+
charge_gas(evm, GAS_VERY_LOW)
|
|
169
|
+
|
|
170
|
+
# OPERATION
|
|
171
|
+
value = buffer_read(evm.message.data, start_index, U256(32))
|
|
172
|
+
|
|
173
|
+
push(evm.stack, U256.from_be_bytes(value))
|
|
174
|
+
|
|
175
|
+
# PROGRAM COUNTER
|
|
176
|
+
evm.pc += Uint(1)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def calldatasize(evm: Evm) -> None:
|
|
180
|
+
"""
|
|
181
|
+
Push the size of input data in current environment onto the stack.
|
|
182
|
+
|
|
183
|
+
Parameters
|
|
184
|
+
----------
|
|
185
|
+
evm :
|
|
186
|
+
The current EVM frame.
|
|
187
|
+
|
|
188
|
+
"""
|
|
189
|
+
# STACK
|
|
190
|
+
pass
|
|
191
|
+
|
|
192
|
+
# GAS
|
|
193
|
+
charge_gas(evm, GAS_BASE)
|
|
194
|
+
|
|
195
|
+
# OPERATION
|
|
196
|
+
push(evm.stack, U256(len(evm.message.data)))
|
|
197
|
+
|
|
198
|
+
# PROGRAM COUNTER
|
|
199
|
+
evm.pc += Uint(1)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def calldatacopy(evm: Evm) -> None:
|
|
203
|
+
"""
|
|
204
|
+
Copy a portion of the input data in current environment to memory.
|
|
205
|
+
|
|
206
|
+
This will also expand the memory, in case that the memory is insufficient
|
|
207
|
+
to store the data.
|
|
208
|
+
|
|
209
|
+
Parameters
|
|
210
|
+
----------
|
|
211
|
+
evm :
|
|
212
|
+
The current EVM frame.
|
|
213
|
+
|
|
214
|
+
"""
|
|
215
|
+
# STACK
|
|
216
|
+
memory_start_index = pop(evm.stack)
|
|
217
|
+
data_start_index = pop(evm.stack)
|
|
218
|
+
size = pop(evm.stack)
|
|
219
|
+
|
|
220
|
+
# GAS
|
|
221
|
+
words = ceil32(Uint(size)) // Uint(32)
|
|
222
|
+
copy_gas_cost = GAS_COPY * words
|
|
223
|
+
extend_memory = calculate_gas_extend_memory(
|
|
224
|
+
evm.memory, [(memory_start_index, size)]
|
|
225
|
+
)
|
|
226
|
+
charge_gas(evm, GAS_VERY_LOW + copy_gas_cost + extend_memory.cost)
|
|
227
|
+
|
|
228
|
+
# OPERATION
|
|
229
|
+
evm.memory += b"\x00" * extend_memory.expand_by
|
|
230
|
+
value = buffer_read(evm.message.data, data_start_index, size)
|
|
231
|
+
memory_write(evm.memory, memory_start_index, value)
|
|
232
|
+
|
|
233
|
+
# PROGRAM COUNTER
|
|
234
|
+
evm.pc += Uint(1)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def codesize(evm: Evm) -> None:
|
|
238
|
+
"""
|
|
239
|
+
Push the size of code running in current environment onto the stack.
|
|
240
|
+
|
|
241
|
+
Parameters
|
|
242
|
+
----------
|
|
243
|
+
evm :
|
|
244
|
+
The current EVM frame.
|
|
245
|
+
|
|
246
|
+
"""
|
|
247
|
+
# STACK
|
|
248
|
+
pass
|
|
249
|
+
|
|
250
|
+
# GAS
|
|
251
|
+
charge_gas(evm, GAS_BASE)
|
|
252
|
+
|
|
253
|
+
# OPERATION
|
|
254
|
+
push(evm.stack, U256(len(evm.code)))
|
|
255
|
+
|
|
256
|
+
# PROGRAM COUNTER
|
|
257
|
+
evm.pc += Uint(1)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def codecopy(evm: Evm) -> None:
|
|
261
|
+
"""
|
|
262
|
+
Copy a portion of the code in current environment to memory.
|
|
263
|
+
|
|
264
|
+
This will also expand the memory, in case that the memory is insufficient
|
|
265
|
+
to store the data.
|
|
266
|
+
|
|
267
|
+
Parameters
|
|
268
|
+
----------
|
|
269
|
+
evm :
|
|
270
|
+
The current EVM frame.
|
|
271
|
+
|
|
272
|
+
"""
|
|
273
|
+
# STACK
|
|
274
|
+
memory_start_index = pop(evm.stack)
|
|
275
|
+
code_start_index = pop(evm.stack)
|
|
276
|
+
size = pop(evm.stack)
|
|
277
|
+
|
|
278
|
+
# GAS
|
|
279
|
+
words = ceil32(Uint(size)) // Uint(32)
|
|
280
|
+
copy_gas_cost = GAS_COPY * words
|
|
281
|
+
extend_memory = calculate_gas_extend_memory(
|
|
282
|
+
evm.memory, [(memory_start_index, size)]
|
|
283
|
+
)
|
|
284
|
+
charge_gas(evm, GAS_VERY_LOW + copy_gas_cost + extend_memory.cost)
|
|
285
|
+
|
|
286
|
+
# OPERATION
|
|
287
|
+
evm.memory += b"\x00" * extend_memory.expand_by
|
|
288
|
+
value = buffer_read(evm.code, code_start_index, size)
|
|
289
|
+
memory_write(evm.memory, memory_start_index, value)
|
|
290
|
+
|
|
291
|
+
# PROGRAM COUNTER
|
|
292
|
+
evm.pc += Uint(1)
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
def gasprice(evm: Evm) -> None:
|
|
296
|
+
"""
|
|
297
|
+
Push the gas price used in current environment onto the stack.
|
|
298
|
+
|
|
299
|
+
Parameters
|
|
300
|
+
----------
|
|
301
|
+
evm :
|
|
302
|
+
The current EVM frame.
|
|
303
|
+
|
|
304
|
+
"""
|
|
305
|
+
# STACK
|
|
306
|
+
pass
|
|
307
|
+
|
|
308
|
+
# GAS
|
|
309
|
+
charge_gas(evm, GAS_BASE)
|
|
310
|
+
|
|
311
|
+
# OPERATION
|
|
312
|
+
push(evm.stack, U256(evm.message.tx_env.gas_price))
|
|
313
|
+
|
|
314
|
+
# PROGRAM COUNTER
|
|
315
|
+
evm.pc += Uint(1)
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
def extcodesize(evm: Evm) -> None:
|
|
319
|
+
"""
|
|
320
|
+
Push the code size of a given account onto the stack.
|
|
321
|
+
|
|
322
|
+
Parameters
|
|
323
|
+
----------
|
|
324
|
+
evm :
|
|
325
|
+
The current EVM frame.
|
|
326
|
+
|
|
327
|
+
"""
|
|
328
|
+
# STACK
|
|
329
|
+
address = to_address_masked(pop(evm.stack))
|
|
330
|
+
|
|
331
|
+
# GAS
|
|
332
|
+
charge_gas(evm, GAS_EXTERNAL)
|
|
333
|
+
|
|
334
|
+
# OPERATION
|
|
335
|
+
code = get_account(evm.message.block_env.state, address).code
|
|
336
|
+
|
|
337
|
+
codesize = U256(len(code))
|
|
338
|
+
push(evm.stack, codesize)
|
|
339
|
+
|
|
340
|
+
# PROGRAM COUNTER
|
|
341
|
+
evm.pc += Uint(1)
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
def extcodecopy(evm: Evm) -> None:
|
|
345
|
+
"""
|
|
346
|
+
Copy a portion of an account's code to memory.
|
|
347
|
+
|
|
348
|
+
Parameters
|
|
349
|
+
----------
|
|
350
|
+
evm :
|
|
351
|
+
The current EVM frame.
|
|
352
|
+
|
|
353
|
+
"""
|
|
354
|
+
# STACK
|
|
355
|
+
address = to_address_masked(pop(evm.stack))
|
|
356
|
+
memory_start_index = pop(evm.stack)
|
|
357
|
+
code_start_index = pop(evm.stack)
|
|
358
|
+
size = pop(evm.stack)
|
|
359
|
+
|
|
360
|
+
# GAS
|
|
361
|
+
words = ceil32(Uint(size)) // Uint(32)
|
|
362
|
+
copy_gas_cost = GAS_COPY * words
|
|
363
|
+
extend_memory = calculate_gas_extend_memory(
|
|
364
|
+
evm.memory, [(memory_start_index, size)]
|
|
365
|
+
)
|
|
366
|
+
charge_gas(evm, GAS_EXTERNAL + copy_gas_cost + extend_memory.cost)
|
|
367
|
+
|
|
368
|
+
# OPERATION
|
|
369
|
+
evm.memory += b"\x00" * extend_memory.expand_by
|
|
370
|
+
code = get_account(evm.message.block_env.state, address).code
|
|
371
|
+
|
|
372
|
+
value = buffer_read(code, code_start_index, size)
|
|
373
|
+
memory_write(evm.memory, memory_start_index, value)
|
|
374
|
+
|
|
375
|
+
# PROGRAM COUNTER
|
|
376
|
+
evm.pc += Uint(1)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Ethereum Virtual Machine (EVM) Keccak Instructions.
|
|
3
|
+
|
|
4
|
+
.. contents:: Table of Contents
|
|
5
|
+
:backlinks: none
|
|
6
|
+
:local:
|
|
7
|
+
|
|
8
|
+
Introduction
|
|
9
|
+
------------
|
|
10
|
+
|
|
11
|
+
Implementations of the EVM keccak instructions.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from ethereum_types.numeric import U256, Uint
|
|
15
|
+
|
|
16
|
+
from ethereum.crypto.hash import keccak256
|
|
17
|
+
from ethereum.utils.numeric import ceil32
|
|
18
|
+
|
|
19
|
+
from .. import Evm
|
|
20
|
+
from ..gas import (
|
|
21
|
+
GAS_KECCAK256,
|
|
22
|
+
GAS_KECCAK256_WORD,
|
|
23
|
+
calculate_gas_extend_memory,
|
|
24
|
+
charge_gas,
|
|
25
|
+
)
|
|
26
|
+
from ..memory import memory_read_bytes
|
|
27
|
+
from ..stack import pop, push
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def keccak(evm: Evm) -> None:
|
|
31
|
+
"""
|
|
32
|
+
Pushes to the stack the Keccak-256 hash of a region of memory.
|
|
33
|
+
|
|
34
|
+
This also expands the memory, in case the memory is insufficient to
|
|
35
|
+
access the data's memory location.
|
|
36
|
+
|
|
37
|
+
Parameters
|
|
38
|
+
----------
|
|
39
|
+
evm :
|
|
40
|
+
The current EVM frame.
|
|
41
|
+
|
|
42
|
+
"""
|
|
43
|
+
# STACK
|
|
44
|
+
memory_start_index = pop(evm.stack)
|
|
45
|
+
size = pop(evm.stack)
|
|
46
|
+
|
|
47
|
+
# GAS
|
|
48
|
+
words = ceil32(Uint(size)) // Uint(32)
|
|
49
|
+
word_gas_cost = GAS_KECCAK256_WORD * words
|
|
50
|
+
extend_memory = calculate_gas_extend_memory(
|
|
51
|
+
evm.memory, [(memory_start_index, size)]
|
|
52
|
+
)
|
|
53
|
+
charge_gas(evm, GAS_KECCAK256 + word_gas_cost + extend_memory.cost)
|
|
54
|
+
|
|
55
|
+
# OPERATION
|
|
56
|
+
evm.memory += b"\x00" * extend_memory.expand_by
|
|
57
|
+
data = memory_read_bytes(evm.memory, memory_start_index, size)
|
|
58
|
+
hashed = keccak256(data)
|
|
59
|
+
|
|
60
|
+
push(evm.stack, U256.from_be_bytes(hashed))
|
|
61
|
+
|
|
62
|
+
# PROGRAM COUNTER
|
|
63
|
+
evm.pc += Uint(1)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Ethereum Virtual Machine (EVM) Logging Instructions.
|
|
3
|
+
|
|
4
|
+
.. contents:: Table of Contents
|
|
5
|
+
:backlinks: none
|
|
6
|
+
:local:
|
|
7
|
+
|
|
8
|
+
Introduction
|
|
9
|
+
------------
|
|
10
|
+
|
|
11
|
+
Implementations of the EVM logging instructions.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from functools import partial
|
|
15
|
+
|
|
16
|
+
from ethereum_types.numeric import Uint
|
|
17
|
+
|
|
18
|
+
from ...blocks import Log
|
|
19
|
+
from .. import Evm
|
|
20
|
+
from ..gas import (
|
|
21
|
+
GAS_LOG,
|
|
22
|
+
GAS_LOG_DATA,
|
|
23
|
+
GAS_LOG_TOPIC,
|
|
24
|
+
calculate_gas_extend_memory,
|
|
25
|
+
charge_gas,
|
|
26
|
+
)
|
|
27
|
+
from ..memory import memory_read_bytes
|
|
28
|
+
from ..stack import pop
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def log_n(evm: Evm, num_topics: int) -> None:
|
|
32
|
+
"""
|
|
33
|
+
Appends a log entry, having `num_topics` topics, to the evm logs.
|
|
34
|
+
|
|
35
|
+
This will also expand the memory if the data (required by the log entry)
|
|
36
|
+
corresponding to the memory is not accessible.
|
|
37
|
+
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
evm :
|
|
41
|
+
The current EVM frame.
|
|
42
|
+
num_topics :
|
|
43
|
+
The number of topics to be included in the log entry.
|
|
44
|
+
|
|
45
|
+
"""
|
|
46
|
+
# STACK
|
|
47
|
+
memory_start_index = pop(evm.stack)
|
|
48
|
+
size = pop(evm.stack)
|
|
49
|
+
|
|
50
|
+
topics = []
|
|
51
|
+
for _ in range(num_topics):
|
|
52
|
+
topic = pop(evm.stack).to_be_bytes32()
|
|
53
|
+
topics.append(topic)
|
|
54
|
+
|
|
55
|
+
# GAS
|
|
56
|
+
extend_memory = calculate_gas_extend_memory(
|
|
57
|
+
evm.memory, [(memory_start_index, size)]
|
|
58
|
+
)
|
|
59
|
+
charge_gas(
|
|
60
|
+
evm,
|
|
61
|
+
GAS_LOG
|
|
62
|
+
+ GAS_LOG_DATA * Uint(size)
|
|
63
|
+
+ GAS_LOG_TOPIC * Uint(num_topics)
|
|
64
|
+
+ extend_memory.cost,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
# OPERATION
|
|
68
|
+
evm.memory += b"\x00" * extend_memory.expand_by
|
|
69
|
+
log_entry = Log(
|
|
70
|
+
address=evm.message.current_target,
|
|
71
|
+
topics=tuple(topics),
|
|
72
|
+
data=memory_read_bytes(evm.memory, memory_start_index, size),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
evm.logs = evm.logs + (log_entry,)
|
|
76
|
+
|
|
77
|
+
# PROGRAM COUNTER
|
|
78
|
+
evm.pc += Uint(1)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
log0 = partial(log_n, num_topics=0)
|
|
82
|
+
log1 = partial(log_n, num_topics=1)
|
|
83
|
+
log2 = partial(log_n, num_topics=2)
|
|
84
|
+
log3 = partial(log_n, num_topics=3)
|
|
85
|
+
log4 = partial(log_n, num_topics=4)
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Ethereum Virtual Machine (EVM) Memory Instructions.
|
|
3
|
+
|
|
4
|
+
.. contents:: Table of Contents
|
|
5
|
+
:backlinks: none
|
|
6
|
+
:local:
|
|
7
|
+
|
|
8
|
+
Introduction
|
|
9
|
+
------------
|
|
10
|
+
|
|
11
|
+
Implementations of the EVM Memory instructions.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from ethereum_types.bytes import Bytes
|
|
15
|
+
from ethereum_types.numeric import U256, Uint
|
|
16
|
+
|
|
17
|
+
from .. import Evm
|
|
18
|
+
from ..gas import (
|
|
19
|
+
GAS_BASE,
|
|
20
|
+
GAS_VERY_LOW,
|
|
21
|
+
calculate_gas_extend_memory,
|
|
22
|
+
charge_gas,
|
|
23
|
+
)
|
|
24
|
+
from ..memory import memory_read_bytes, memory_write
|
|
25
|
+
from ..stack import pop, push
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def mstore(evm: Evm) -> None:
|
|
29
|
+
"""
|
|
30
|
+
Stores a word to memory.
|
|
31
|
+
This also expands the memory, if the memory is
|
|
32
|
+
insufficient to store the word.
|
|
33
|
+
|
|
34
|
+
Parameters
|
|
35
|
+
----------
|
|
36
|
+
evm :
|
|
37
|
+
The current EVM frame.
|
|
38
|
+
|
|
39
|
+
"""
|
|
40
|
+
# STACK
|
|
41
|
+
start_position = pop(evm.stack)
|
|
42
|
+
value = pop(evm.stack).to_be_bytes32()
|
|
43
|
+
|
|
44
|
+
# GAS
|
|
45
|
+
extend_memory = calculate_gas_extend_memory(
|
|
46
|
+
evm.memory, [(start_position, U256(len(value)))]
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
charge_gas(evm, GAS_VERY_LOW + extend_memory.cost)
|
|
50
|
+
|
|
51
|
+
# OPERATION
|
|
52
|
+
evm.memory += b"\x00" * extend_memory.expand_by
|
|
53
|
+
memory_write(evm.memory, start_position, value)
|
|
54
|
+
|
|
55
|
+
# PROGRAM COUNTER
|
|
56
|
+
evm.pc += Uint(1)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def mstore8(evm: Evm) -> None:
|
|
60
|
+
"""
|
|
61
|
+
Stores a byte to memory.
|
|
62
|
+
This also expands the memory, if the memory is
|
|
63
|
+
insufficient to store the word.
|
|
64
|
+
|
|
65
|
+
Parameters
|
|
66
|
+
----------
|
|
67
|
+
evm :
|
|
68
|
+
The current EVM frame.
|
|
69
|
+
|
|
70
|
+
"""
|
|
71
|
+
# STACK
|
|
72
|
+
start_position = pop(evm.stack)
|
|
73
|
+
value = pop(evm.stack)
|
|
74
|
+
|
|
75
|
+
# GAS
|
|
76
|
+
extend_memory = calculate_gas_extend_memory(
|
|
77
|
+
evm.memory, [(start_position, U256(1))]
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
charge_gas(evm, GAS_VERY_LOW + extend_memory.cost)
|
|
81
|
+
|
|
82
|
+
# OPERATION
|
|
83
|
+
evm.memory += b"\x00" * extend_memory.expand_by
|
|
84
|
+
normalized_bytes_value = Bytes([value & U256(0xFF)])
|
|
85
|
+
memory_write(evm.memory, start_position, normalized_bytes_value)
|
|
86
|
+
|
|
87
|
+
# PROGRAM COUNTER
|
|
88
|
+
evm.pc += Uint(1)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def mload(evm: Evm) -> None:
|
|
92
|
+
"""
|
|
93
|
+
Load word from memory.
|
|
94
|
+
|
|
95
|
+
Parameters
|
|
96
|
+
----------
|
|
97
|
+
evm :
|
|
98
|
+
The current EVM frame.
|
|
99
|
+
|
|
100
|
+
"""
|
|
101
|
+
# STACK
|
|
102
|
+
start_position = pop(evm.stack)
|
|
103
|
+
|
|
104
|
+
# GAS
|
|
105
|
+
extend_memory = calculate_gas_extend_memory(
|
|
106
|
+
evm.memory, [(start_position, U256(32))]
|
|
107
|
+
)
|
|
108
|
+
charge_gas(evm, GAS_VERY_LOW + extend_memory.cost)
|
|
109
|
+
|
|
110
|
+
# OPERATION
|
|
111
|
+
evm.memory += b"\x00" * extend_memory.expand_by
|
|
112
|
+
value = U256.from_be_bytes(
|
|
113
|
+
memory_read_bytes(evm.memory, start_position, U256(32))
|
|
114
|
+
)
|
|
115
|
+
push(evm.stack, value)
|
|
116
|
+
|
|
117
|
+
# PROGRAM COUNTER
|
|
118
|
+
evm.pc += Uint(1)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def msize(evm: Evm) -> None:
|
|
122
|
+
"""
|
|
123
|
+
Push the size of active memory in bytes onto the stack.
|
|
124
|
+
|
|
125
|
+
Parameters
|
|
126
|
+
----------
|
|
127
|
+
evm :
|
|
128
|
+
The current EVM frame.
|
|
129
|
+
|
|
130
|
+
"""
|
|
131
|
+
# STACK
|
|
132
|
+
pass
|
|
133
|
+
|
|
134
|
+
# GAS
|
|
135
|
+
charge_gas(evm, GAS_BASE)
|
|
136
|
+
|
|
137
|
+
# OPERATION
|
|
138
|
+
push(evm.stack, U256(len(evm.memory)))
|
|
139
|
+
|
|
140
|
+
# PROGRAM COUNTER
|
|
141
|
+
evm.pc += Uint(1)
|