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,320 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Define t8n Env class.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
|
8
|
+
|
|
9
|
+
from ethereum_rlp import rlp
|
|
10
|
+
from ethereum_types.bytes import Bytes8, Bytes20, Bytes32, Bytes256
|
|
11
|
+
from ethereum_types.numeric import U64, U256, Uint
|
|
12
|
+
|
|
13
|
+
from ethereum.crypto.hash import Hash32, keccak256
|
|
14
|
+
from ethereum.utils.byte import left_pad_zero_bytes
|
|
15
|
+
from ethereum.utils.hexadecimal import hex_to_bytes
|
|
16
|
+
|
|
17
|
+
from ..utils import parse_hex_or_int
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from ethereum_spec_tools.evm_tools.t8n import T8N
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class Ommer:
|
|
25
|
+
"""The Ommer type for the t8n tool."""
|
|
26
|
+
|
|
27
|
+
delta: str
|
|
28
|
+
address: Any
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class Env:
|
|
32
|
+
"""
|
|
33
|
+
The environment for the transition tool.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
coinbase: Any
|
|
37
|
+
block_gas_limit: Uint
|
|
38
|
+
block_number: Uint
|
|
39
|
+
block_timestamp: U256
|
|
40
|
+
parent_hash: Any
|
|
41
|
+
withdrawals: Any
|
|
42
|
+
block_difficulty: Optional[Uint]
|
|
43
|
+
prev_randao: Optional[Bytes32]
|
|
44
|
+
parent_difficulty: Optional[Uint]
|
|
45
|
+
parent_timestamp: Optional[U256]
|
|
46
|
+
base_fee_per_gas: Optional[Uint]
|
|
47
|
+
parent_gas_used: Optional[Uint]
|
|
48
|
+
parent_gas_limit: Optional[Uint]
|
|
49
|
+
parent_base_fee_per_gas: Optional[Uint]
|
|
50
|
+
block_hashes: Optional[List[Any]]
|
|
51
|
+
parent_ommers_hash: Optional[Hash32]
|
|
52
|
+
ommers: Any
|
|
53
|
+
parent_beacon_block_root: Optional[Hash32]
|
|
54
|
+
parent_excess_blob_gas: Optional[U64]
|
|
55
|
+
parent_blob_gas_used: Optional[U64]
|
|
56
|
+
excess_blob_gas: Optional[U64]
|
|
57
|
+
requests: Any
|
|
58
|
+
|
|
59
|
+
def __init__(self, t8n: "T8N", stdin: Optional[Dict] = None):
|
|
60
|
+
if t8n.options.input_env == "stdin":
|
|
61
|
+
assert stdin is not None
|
|
62
|
+
data = stdin["env"]
|
|
63
|
+
else:
|
|
64
|
+
with open(t8n.options.input_env, "r") as f:
|
|
65
|
+
data = json.load(f)
|
|
66
|
+
|
|
67
|
+
self.coinbase = t8n.fork.hex_to_address(data["currentCoinbase"])
|
|
68
|
+
self.block_gas_limit = parse_hex_or_int(data["currentGasLimit"], Uint)
|
|
69
|
+
self.block_number = parse_hex_or_int(data["currentNumber"], Uint)
|
|
70
|
+
self.block_timestamp = parse_hex_or_int(data["currentTimestamp"], U256)
|
|
71
|
+
|
|
72
|
+
self.read_block_difficulty(data, t8n)
|
|
73
|
+
self.read_base_fee_per_gas(data, t8n)
|
|
74
|
+
self.read_randao(data, t8n)
|
|
75
|
+
self.read_block_hashes(data, t8n)
|
|
76
|
+
self.read_ommers(data, t8n)
|
|
77
|
+
self.read_withdrawals(data, t8n)
|
|
78
|
+
|
|
79
|
+
self.parent_beacon_block_root = None
|
|
80
|
+
if t8n.fork.is_after_fork("cancun"):
|
|
81
|
+
if not t8n.options.state_test:
|
|
82
|
+
parent_beacon_block_root_hex = data["parentBeaconBlockRoot"]
|
|
83
|
+
self.parent_beacon_block_root = (
|
|
84
|
+
Bytes32(hex_to_bytes(parent_beacon_block_root_hex))
|
|
85
|
+
if parent_beacon_block_root_hex is not None
|
|
86
|
+
else None
|
|
87
|
+
)
|
|
88
|
+
self.read_excess_blob_gas(data, t8n)
|
|
89
|
+
|
|
90
|
+
def read_excess_blob_gas(self, data: Any, t8n: "T8N") -> None:
|
|
91
|
+
"""
|
|
92
|
+
Read the excess_blob_gas from the data. If the excess blob gas is
|
|
93
|
+
not present, it is calculated from the parent block parameters.
|
|
94
|
+
"""
|
|
95
|
+
self.parent_blob_gas_used = U64(0)
|
|
96
|
+
self.parent_excess_blob_gas = U64(0)
|
|
97
|
+
self.excess_blob_gas = None
|
|
98
|
+
|
|
99
|
+
if not t8n.fork.is_after_fork("cancun"):
|
|
100
|
+
return
|
|
101
|
+
|
|
102
|
+
if "parentExcessBlobGas" in data:
|
|
103
|
+
self.parent_excess_blob_gas = parse_hex_or_int(
|
|
104
|
+
data["parentExcessBlobGas"], U64
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
if "parentBlobGasUsed" in data:
|
|
108
|
+
self.parent_blob_gas_used = parse_hex_or_int(
|
|
109
|
+
data["parentBlobGasUsed"], U64
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
if "currentExcessBlobGas" in data:
|
|
113
|
+
self.excess_blob_gas = parse_hex_or_int(
|
|
114
|
+
data["currentExcessBlobGas"], U64
|
|
115
|
+
)
|
|
116
|
+
return
|
|
117
|
+
|
|
118
|
+
assert self.parent_excess_blob_gas is not None
|
|
119
|
+
assert self.parent_blob_gas_used is not None
|
|
120
|
+
|
|
121
|
+
arguments = {
|
|
122
|
+
# Useless as far as calculate_excess_blob_gas is concerned.
|
|
123
|
+
"parent_hash": Hash32(b"\0" * 32),
|
|
124
|
+
"ommers_hash": Hash32(b"\0" * 32),
|
|
125
|
+
"coinbase": Bytes20(b"\0" * 20),
|
|
126
|
+
"state_root": Hash32(b"\0" * 32),
|
|
127
|
+
"transactions_root": Hash32(b"\0" * 32),
|
|
128
|
+
"receipt_root": Hash32(b"\0" * 32),
|
|
129
|
+
"bloom": Bytes256(b"\0" * 256),
|
|
130
|
+
"difficulty": Uint(0),
|
|
131
|
+
"number": Uint(0),
|
|
132
|
+
"gas_limit": Uint(0),
|
|
133
|
+
"gas_used": Uint(0),
|
|
134
|
+
"timestamp": U256(0),
|
|
135
|
+
"extra_data": b"",
|
|
136
|
+
"prev_randao": Bytes32(b"\0" * 32),
|
|
137
|
+
"nonce": Bytes8(b"\0" * 8),
|
|
138
|
+
"withdrawals_root": Hash32(b"\0" * 32),
|
|
139
|
+
"parent_beacon_block_root": Hash32(b"\0" * 32),
|
|
140
|
+
# Used for calculating excess_blob_gas.
|
|
141
|
+
"base_fee_per_gas": self.parent_base_fee_per_gas,
|
|
142
|
+
"blob_gas_used": self.parent_blob_gas_used,
|
|
143
|
+
"excess_blob_gas": self.parent_excess_blob_gas,
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if t8n.fork.is_after_fork("prague"):
|
|
147
|
+
arguments["requests_hash"] = Hash32(b"\0" * 32)
|
|
148
|
+
|
|
149
|
+
parent_header = t8n.fork.Header(**arguments)
|
|
150
|
+
|
|
151
|
+
self.excess_blob_gas = t8n.fork.calculate_excess_blob_gas(
|
|
152
|
+
parent_header
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
def read_base_fee_per_gas(self, data: Any, t8n: "T8N") -> None:
|
|
156
|
+
"""
|
|
157
|
+
Read the base_fee_per_gas from the data. If the base fee is
|
|
158
|
+
not present, it is calculated from the parent block parameters.
|
|
159
|
+
"""
|
|
160
|
+
self.parent_gas_used = None
|
|
161
|
+
self.parent_gas_limit = None
|
|
162
|
+
self.parent_base_fee_per_gas = None
|
|
163
|
+
self.base_fee_per_gas = None
|
|
164
|
+
|
|
165
|
+
if t8n.fork.is_after_fork("london"):
|
|
166
|
+
if "currentBaseFee" in data:
|
|
167
|
+
self.base_fee_per_gas = parse_hex_or_int(
|
|
168
|
+
data["currentBaseFee"], Uint
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
if "parentGasUsed" in data:
|
|
172
|
+
self.parent_gas_used = parse_hex_or_int(
|
|
173
|
+
data["parentGasUsed"], Uint
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
if "parentGasLimit" in data:
|
|
177
|
+
self.parent_gas_limit = parse_hex_or_int(
|
|
178
|
+
data["parentGasLimit"], Uint
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
if "parentBaseFee" in data:
|
|
182
|
+
self.parent_base_fee_per_gas = parse_hex_or_int(
|
|
183
|
+
data["parentBaseFee"], Uint
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
if self.base_fee_per_gas is None:
|
|
187
|
+
assert self.parent_gas_limit is not None
|
|
188
|
+
assert self.parent_gas_used is not None
|
|
189
|
+
assert self.parent_base_fee_per_gas is not None
|
|
190
|
+
|
|
191
|
+
parameters: List[object] = [
|
|
192
|
+
self.block_gas_limit,
|
|
193
|
+
self.parent_gas_limit,
|
|
194
|
+
self.parent_gas_used,
|
|
195
|
+
self.parent_base_fee_per_gas,
|
|
196
|
+
]
|
|
197
|
+
|
|
198
|
+
self.base_fee_per_gas = t8n.fork.calculate_base_fee_per_gas(
|
|
199
|
+
*parameters
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
def read_randao(self, data: Any, t8n: "T8N") -> None:
|
|
203
|
+
"""
|
|
204
|
+
Read the randao from the data.
|
|
205
|
+
"""
|
|
206
|
+
self.prev_randao = None
|
|
207
|
+
if t8n.fork.is_after_fork("paris"):
|
|
208
|
+
# tf tool might not always provide an
|
|
209
|
+
# even number of nibbles in the randao
|
|
210
|
+
# This could create issues in the
|
|
211
|
+
# hex_to_bytes function
|
|
212
|
+
current_random = data["currentRandom"]
|
|
213
|
+
if current_random.startswith("0x"):
|
|
214
|
+
current_random = current_random[2:]
|
|
215
|
+
|
|
216
|
+
if len(current_random) % 2 == 1:
|
|
217
|
+
current_random = "0" + current_random
|
|
218
|
+
|
|
219
|
+
self.prev_randao = Bytes32(
|
|
220
|
+
left_pad_zero_bytes(hex_to_bytes(current_random), 32)
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
def read_withdrawals(self, data: Any, t8n: "T8N") -> None:
|
|
224
|
+
"""
|
|
225
|
+
Read the withdrawals from the data.
|
|
226
|
+
"""
|
|
227
|
+
self.withdrawals = None
|
|
228
|
+
if t8n.fork.is_after_fork("shanghai"):
|
|
229
|
+
self.withdrawals = tuple(
|
|
230
|
+
t8n.json_to_withdrawals(wd) for wd in data["withdrawals"]
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
def read_block_difficulty(self, data: Any, t8n: "T8N") -> None:
|
|
234
|
+
"""
|
|
235
|
+
Read the block difficulty from the data.
|
|
236
|
+
If `currentDifficulty` is present, it is used. Otherwise,
|
|
237
|
+
the difficulty is calculated from the parent block.
|
|
238
|
+
"""
|
|
239
|
+
self.block_difficulty = None
|
|
240
|
+
self.parent_timestamp = None
|
|
241
|
+
self.parent_difficulty = None
|
|
242
|
+
self.parent_ommers_hash = None
|
|
243
|
+
if t8n.fork.is_after_fork("paris"):
|
|
244
|
+
return
|
|
245
|
+
elif "currentDifficulty" in data:
|
|
246
|
+
self.block_difficulty = parse_hex_or_int(
|
|
247
|
+
data["currentDifficulty"], Uint
|
|
248
|
+
)
|
|
249
|
+
else:
|
|
250
|
+
self.parent_timestamp = parse_hex_or_int(
|
|
251
|
+
data["parentTimestamp"], U256
|
|
252
|
+
)
|
|
253
|
+
self.parent_difficulty = parse_hex_or_int(
|
|
254
|
+
data["parentDifficulty"], Uint
|
|
255
|
+
)
|
|
256
|
+
args: List[object] = [
|
|
257
|
+
self.block_number,
|
|
258
|
+
self.block_timestamp,
|
|
259
|
+
self.parent_timestamp,
|
|
260
|
+
self.parent_difficulty,
|
|
261
|
+
]
|
|
262
|
+
if t8n.fork.is_after_fork("byzantium"):
|
|
263
|
+
if "parentUncleHash" in data:
|
|
264
|
+
EMPTY_OMMER_HASH = keccak256(rlp.encode([])) # noqa N806
|
|
265
|
+
self.parent_ommers_hash = Hash32(
|
|
266
|
+
hex_to_bytes(data["parentUncleHash"])
|
|
267
|
+
)
|
|
268
|
+
parent_has_ommers = (
|
|
269
|
+
self.parent_ommers_hash != EMPTY_OMMER_HASH
|
|
270
|
+
)
|
|
271
|
+
args.append(parent_has_ommers)
|
|
272
|
+
else:
|
|
273
|
+
args.append(False)
|
|
274
|
+
self.block_difficulty = t8n.fork.calculate_block_difficulty(*args)
|
|
275
|
+
|
|
276
|
+
def read_block_hashes(self, data: Any, t8n: "T8N") -> None:
|
|
277
|
+
"""
|
|
278
|
+
Read the block hashes. Returns a maximum of 256 block hashes.
|
|
279
|
+
"""
|
|
280
|
+
self.parent_hash = None
|
|
281
|
+
if t8n.fork.is_after_fork("prague") and not t8n.options.state_test:
|
|
282
|
+
self.parent_hash = Hash32(hex_to_bytes(data["parentHash"]))
|
|
283
|
+
|
|
284
|
+
# Read the block hashes
|
|
285
|
+
block_hashes: List[Any] = []
|
|
286
|
+
|
|
287
|
+
# The hex key strings provided might not have standard formatting
|
|
288
|
+
clean_block_hashes: Dict[int, Hash32] = {}
|
|
289
|
+
if "blockHashes" in data:
|
|
290
|
+
for key, value in data["blockHashes"].items():
|
|
291
|
+
int_key = int(key, 16)
|
|
292
|
+
clean_block_hashes[int_key] = Hash32(hex_to_bytes(value))
|
|
293
|
+
|
|
294
|
+
# Store a maximum of 256 block hashes.
|
|
295
|
+
max_blockhash_count = min(Uint(256), self.block_number)
|
|
296
|
+
for number in range(
|
|
297
|
+
self.block_number - max_blockhash_count, self.block_number
|
|
298
|
+
):
|
|
299
|
+
if number in clean_block_hashes.keys():
|
|
300
|
+
block_hashes.append(clean_block_hashes[number])
|
|
301
|
+
else:
|
|
302
|
+
block_hashes.append(None)
|
|
303
|
+
|
|
304
|
+
self.block_hashes = block_hashes
|
|
305
|
+
|
|
306
|
+
def read_ommers(self, data: Any, t8n: "T8N") -> None:
|
|
307
|
+
"""
|
|
308
|
+
Read the ommers. The ommers data might not have all the details
|
|
309
|
+
needed to obtain the Header.
|
|
310
|
+
"""
|
|
311
|
+
ommers = []
|
|
312
|
+
if "ommers" in data:
|
|
313
|
+
for ommer in data["ommers"]:
|
|
314
|
+
ommers.append(
|
|
315
|
+
Ommer(
|
|
316
|
+
ommer["delta"],
|
|
317
|
+
t8n.fork.hex_to_address(ommer["address"]),
|
|
318
|
+
)
|
|
319
|
+
)
|
|
320
|
+
self.ommers = ommers
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""
|
|
2
|
+
EVM trace implementation that counts how many times each opcode is executed.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from collections import defaultdict
|
|
6
|
+
|
|
7
|
+
from ethereum.trace import EvmTracer, OpStart, TraceEvent
|
|
8
|
+
|
|
9
|
+
from .protocols import Evm
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CountTracer(EvmTracer):
|
|
13
|
+
"""
|
|
14
|
+
EVM trace implementation that counts how many times each opcode is
|
|
15
|
+
executed.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
transaction_environment: object | None
|
|
19
|
+
active_traces: defaultdict[str, int]
|
|
20
|
+
|
|
21
|
+
def __init__(self) -> None:
|
|
22
|
+
self.transaction_environment = None
|
|
23
|
+
self.active_traces = defaultdict(lambda: 0)
|
|
24
|
+
|
|
25
|
+
def __call__(self, evm: object, event: TraceEvent) -> None:
|
|
26
|
+
"""
|
|
27
|
+
Create a trace of the event.
|
|
28
|
+
"""
|
|
29
|
+
if not isinstance(event, OpStart):
|
|
30
|
+
return
|
|
31
|
+
|
|
32
|
+
assert isinstance(evm, Evm)
|
|
33
|
+
|
|
34
|
+
if self.transaction_environment is not evm.message.tx_env:
|
|
35
|
+
self.active_traces = defaultdict(lambda: 0)
|
|
36
|
+
self.transaction_environment = evm.message.tx_env
|
|
37
|
+
|
|
38
|
+
self.active_traces[event.op.name] += 1
|
|
39
|
+
|
|
40
|
+
def results(self) -> dict[str, int]:
|
|
41
|
+
"""
|
|
42
|
+
Return and clear the current opcode counts.
|
|
43
|
+
"""
|
|
44
|
+
results = self.active_traces
|
|
45
|
+
self.active_traces = defaultdict(lambda: 0)
|
|
46
|
+
self.transaction_environment = None
|
|
47
|
+
return results
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The module implements the raw EVM tracer for t8n.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import os
|
|
7
|
+
from contextlib import ExitStack
|
|
8
|
+
from dataclasses import asdict, dataclass, is_dataclass
|
|
9
|
+
from typing import Any, List, Optional, TextIO, Union
|
|
10
|
+
|
|
11
|
+
from ethereum.exceptions import EthereumException
|
|
12
|
+
from ethereum.trace import (
|
|
13
|
+
EvmStop,
|
|
14
|
+
EvmTracer,
|
|
15
|
+
GasAndRefund,
|
|
16
|
+
OpEnd,
|
|
17
|
+
OpException,
|
|
18
|
+
OpStart,
|
|
19
|
+
PrecompileEnd,
|
|
20
|
+
PrecompileStart,
|
|
21
|
+
TraceEvent,
|
|
22
|
+
TransactionEnd,
|
|
23
|
+
TransactionStart,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
from .protocols import Evm, EvmWithReturnData, TransactionEnvironment
|
|
27
|
+
|
|
28
|
+
EXCLUDE_FROM_OUTPUT = ["gasCostTraced", "errorTraced", "precompile"]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@dataclass
|
|
32
|
+
class Trace:
|
|
33
|
+
"""
|
|
34
|
+
The class implements the raw EVM trace.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
pc: int
|
|
38
|
+
op: Optional[Union[str, int]]
|
|
39
|
+
gas: str
|
|
40
|
+
gasCost: str
|
|
41
|
+
memory: Optional[str]
|
|
42
|
+
memSize: int
|
|
43
|
+
stack: Optional[List[str]]
|
|
44
|
+
returnData: Optional[str]
|
|
45
|
+
depth: int
|
|
46
|
+
refund: int
|
|
47
|
+
opName: str
|
|
48
|
+
gasCostTraced: bool = False
|
|
49
|
+
errorTraced: bool = False
|
|
50
|
+
precompile: bool = False
|
|
51
|
+
error: Optional[str] = None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@dataclass
|
|
55
|
+
class FinalTrace:
|
|
56
|
+
"""
|
|
57
|
+
The class implements final trace for a tx.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
output: str
|
|
61
|
+
gasUsed: str
|
|
62
|
+
error: Optional[str] = None
|
|
63
|
+
|
|
64
|
+
def __init__(
|
|
65
|
+
self, gas_used: int, output: bytes, error: Optional[EthereumException]
|
|
66
|
+
) -> None:
|
|
67
|
+
self.output = output.hex()
|
|
68
|
+
self.gasUsed = hex(gas_used)
|
|
69
|
+
if error:
|
|
70
|
+
self.error = type(error).__name__
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class Eip3155Tracer(EvmTracer):
|
|
74
|
+
"""
|
|
75
|
+
EVM trace implementation compatible with EIP-3155.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
transaction_environment: TransactionEnvironment | None
|
|
79
|
+
active_traces: list[Trace | FinalTrace]
|
|
80
|
+
trace_memory: bool
|
|
81
|
+
trace_stack: bool
|
|
82
|
+
trace_return_data: bool
|
|
83
|
+
output_basedir: str | TextIO
|
|
84
|
+
|
|
85
|
+
def __init__(
|
|
86
|
+
self,
|
|
87
|
+
/,
|
|
88
|
+
trace_memory: bool = False,
|
|
89
|
+
trace_stack: bool = True,
|
|
90
|
+
trace_return_data: bool = False,
|
|
91
|
+
output_basedir: str | TextIO = ".",
|
|
92
|
+
):
|
|
93
|
+
self.transaction_environment = None
|
|
94
|
+
self.active_traces = []
|
|
95
|
+
self.trace_memory = trace_memory
|
|
96
|
+
self.trace_stack = trace_stack
|
|
97
|
+
self.trace_return_data = trace_return_data
|
|
98
|
+
self.output_basedir = output_basedir
|
|
99
|
+
|
|
100
|
+
def __call__(self, evm: Any, event: TraceEvent) -> None:
|
|
101
|
+
"""
|
|
102
|
+
Create a trace of the event.
|
|
103
|
+
"""
|
|
104
|
+
# System Transaction do not have a tx_hash or index
|
|
105
|
+
if (
|
|
106
|
+
evm.message.tx_env.index_in_block is None
|
|
107
|
+
or evm.message.tx_env.tx_hash is None
|
|
108
|
+
):
|
|
109
|
+
return
|
|
110
|
+
|
|
111
|
+
assert isinstance(evm, Evm)
|
|
112
|
+
|
|
113
|
+
if self.transaction_environment is not evm.message.tx_env:
|
|
114
|
+
self.active_traces = []
|
|
115
|
+
self.transaction_environment = evm.message.tx_env
|
|
116
|
+
|
|
117
|
+
last_trace = None
|
|
118
|
+
if self.active_traces:
|
|
119
|
+
last_trace = self.active_traces[-1]
|
|
120
|
+
|
|
121
|
+
refund_counter = evm.refund_counter
|
|
122
|
+
parent_evm = evm.message.parent_evm
|
|
123
|
+
while parent_evm is not None:
|
|
124
|
+
refund_counter += parent_evm.refund_counter
|
|
125
|
+
parent_evm = parent_evm.message.parent_evm
|
|
126
|
+
|
|
127
|
+
len_memory = len(evm.memory)
|
|
128
|
+
|
|
129
|
+
return_data = None
|
|
130
|
+
if isinstance(evm, EvmWithReturnData) and self.trace_return_data:
|
|
131
|
+
return_data = "0x" + evm.return_data.hex()
|
|
132
|
+
|
|
133
|
+
memory = None
|
|
134
|
+
if self.trace_memory and len_memory > 0:
|
|
135
|
+
memory = "0x" + evm.memory.hex()
|
|
136
|
+
|
|
137
|
+
stack = None
|
|
138
|
+
if self.trace_stack:
|
|
139
|
+
stack = [hex(i) for i in evm.stack]
|
|
140
|
+
|
|
141
|
+
if isinstance(event, TransactionStart):
|
|
142
|
+
pass
|
|
143
|
+
elif isinstance(event, TransactionEnd):
|
|
144
|
+
final_trace = FinalTrace(event.gas_used, event.output, event.error)
|
|
145
|
+
self.active_traces.append(final_trace)
|
|
146
|
+
|
|
147
|
+
output_traces(
|
|
148
|
+
self.active_traces,
|
|
149
|
+
evm.message.tx_env.index_in_block,
|
|
150
|
+
evm.message.tx_env.tx_hash,
|
|
151
|
+
self.output_basedir,
|
|
152
|
+
)
|
|
153
|
+
elif isinstance(event, PrecompileStart):
|
|
154
|
+
new_trace = Trace(
|
|
155
|
+
pc=int(evm.pc),
|
|
156
|
+
op="0x" + event.address.hex().lstrip("0"),
|
|
157
|
+
gas=hex(evm.gas_left),
|
|
158
|
+
gasCost="0x0",
|
|
159
|
+
memory=memory,
|
|
160
|
+
memSize=len_memory,
|
|
161
|
+
stack=stack,
|
|
162
|
+
returnData=return_data,
|
|
163
|
+
depth=int(evm.message.depth) + 1,
|
|
164
|
+
refund=refund_counter,
|
|
165
|
+
opName="0x" + event.address.hex().lstrip("0"),
|
|
166
|
+
precompile=True,
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
self.active_traces.append(new_trace)
|
|
170
|
+
elif isinstance(event, PrecompileEnd):
|
|
171
|
+
assert isinstance(last_trace, Trace)
|
|
172
|
+
|
|
173
|
+
last_trace.gasCostTraced = True
|
|
174
|
+
last_trace.errorTraced = True
|
|
175
|
+
elif isinstance(event, OpStart):
|
|
176
|
+
op = event.op.value
|
|
177
|
+
if op == "InvalidOpcode":
|
|
178
|
+
op = "Invalid"
|
|
179
|
+
new_trace = Trace(
|
|
180
|
+
pc=int(evm.pc),
|
|
181
|
+
op=op,
|
|
182
|
+
gas=hex(evm.gas_left),
|
|
183
|
+
gasCost="0x0",
|
|
184
|
+
memory=memory,
|
|
185
|
+
memSize=len_memory,
|
|
186
|
+
stack=stack,
|
|
187
|
+
returnData=return_data,
|
|
188
|
+
depth=int(evm.message.depth) + 1,
|
|
189
|
+
refund=refund_counter,
|
|
190
|
+
opName=str(event.op).split(".")[-1],
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
self.active_traces.append(new_trace)
|
|
194
|
+
elif isinstance(event, OpEnd):
|
|
195
|
+
assert isinstance(last_trace, Trace)
|
|
196
|
+
|
|
197
|
+
last_trace.gasCostTraced = True
|
|
198
|
+
last_trace.errorTraced = True
|
|
199
|
+
elif isinstance(event, OpException):
|
|
200
|
+
if last_trace is not None:
|
|
201
|
+
assert isinstance(last_trace, Trace)
|
|
202
|
+
if (
|
|
203
|
+
# The first opcode in the code is an InvalidOpcode.
|
|
204
|
+
# So we add a new trace with InvalidOpcode as op.
|
|
205
|
+
not last_trace
|
|
206
|
+
# The current opcode is an InvalidOpcode. This condition
|
|
207
|
+
# is true if an InvalidOpcode is found in any location
|
|
208
|
+
# other than the first opcode.
|
|
209
|
+
or last_trace.errorTraced
|
|
210
|
+
# The first opcode in a child message is an InvalidOpcode.
|
|
211
|
+
# This case has to be explicitly handled since the first
|
|
212
|
+
# two conditions do not cover it.
|
|
213
|
+
or last_trace.depth == evm.message.depth
|
|
214
|
+
):
|
|
215
|
+
if not hasattr(event.error, "code"):
|
|
216
|
+
name = event.error.__class__.__name__
|
|
217
|
+
raise TypeError(
|
|
218
|
+
f"OpException event error type `{name}` does not "
|
|
219
|
+
"have code"
|
|
220
|
+
) from event.error
|
|
221
|
+
|
|
222
|
+
new_trace = Trace(
|
|
223
|
+
pc=int(evm.pc),
|
|
224
|
+
op=event.error.code,
|
|
225
|
+
gas=hex(evm.gas_left),
|
|
226
|
+
gasCost="0x0",
|
|
227
|
+
memory=memory,
|
|
228
|
+
memSize=len_memory,
|
|
229
|
+
stack=stack,
|
|
230
|
+
returnData=return_data,
|
|
231
|
+
depth=int(evm.message.depth) + 1,
|
|
232
|
+
refund=refund_counter,
|
|
233
|
+
opName="InvalidOpcode",
|
|
234
|
+
gasCostTraced=True,
|
|
235
|
+
errorTraced=True,
|
|
236
|
+
error=type(event.error).__name__,
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
self.active_traces.append(new_trace)
|
|
240
|
+
elif not last_trace.errorTraced:
|
|
241
|
+
# If the error for the last trace is not covered
|
|
242
|
+
# the exception is attributed to the last trace.
|
|
243
|
+
last_trace.error = type(event.error).__name__
|
|
244
|
+
last_trace.errorTraced = True
|
|
245
|
+
elif isinstance(event, EvmStop):
|
|
246
|
+
if not evm.running:
|
|
247
|
+
return
|
|
248
|
+
elif len(evm.code) == 0:
|
|
249
|
+
return
|
|
250
|
+
else:
|
|
251
|
+
self(
|
|
252
|
+
evm,
|
|
253
|
+
OpStart(event.op),
|
|
254
|
+
)
|
|
255
|
+
elif isinstance(event, GasAndRefund):
|
|
256
|
+
if len(self.active_traces) == 0:
|
|
257
|
+
# In contract creation transactions, there may not be any
|
|
258
|
+
# traces
|
|
259
|
+
return
|
|
260
|
+
|
|
261
|
+
assert isinstance(last_trace, Trace)
|
|
262
|
+
|
|
263
|
+
if not last_trace.gasCostTraced:
|
|
264
|
+
last_trace.gasCost = hex(event.gas_cost)
|
|
265
|
+
last_trace.refund = refund_counter
|
|
266
|
+
last_trace.gasCostTraced = True
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
class _TraceJsonEncoder(json.JSONEncoder):
|
|
270
|
+
@staticmethod
|
|
271
|
+
def retain(k: str, v: Optional[object]) -> bool:
|
|
272
|
+
if v is None:
|
|
273
|
+
return False
|
|
274
|
+
|
|
275
|
+
if k in EXCLUDE_FROM_OUTPUT:
|
|
276
|
+
return False
|
|
277
|
+
|
|
278
|
+
if k in ("pc", "gas", "gasCost", "refund"):
|
|
279
|
+
if isinstance(v, str) and int(v, 0).bit_length() > 64:
|
|
280
|
+
return False
|
|
281
|
+
|
|
282
|
+
return True
|
|
283
|
+
|
|
284
|
+
def default(self, obj: object) -> object:
|
|
285
|
+
if not is_dataclass(obj) or isinstance(obj, type):
|
|
286
|
+
return super().default(obj)
|
|
287
|
+
|
|
288
|
+
trace = {
|
|
289
|
+
k: v
|
|
290
|
+
for k, v in asdict(obj).items()
|
|
291
|
+
if _TraceJsonEncoder.retain(k, v)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
return trace
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def output_op_trace(
|
|
298
|
+
trace: Union[Trace, FinalTrace], json_file: TextIO
|
|
299
|
+
) -> None:
|
|
300
|
+
"""
|
|
301
|
+
Output a single trace to a json file.
|
|
302
|
+
"""
|
|
303
|
+
json.dump(trace, json_file, separators=(",", ":"), cls=_TraceJsonEncoder)
|
|
304
|
+
json_file.write("\n")
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def output_traces(
|
|
308
|
+
traces: List[Union[Trace, FinalTrace]],
|
|
309
|
+
index_in_block: int,
|
|
310
|
+
tx_hash: bytes,
|
|
311
|
+
output_basedir: str | TextIO,
|
|
312
|
+
) -> None:
|
|
313
|
+
"""
|
|
314
|
+
Output the traces to a json file.
|
|
315
|
+
"""
|
|
316
|
+
with ExitStack() as stack:
|
|
317
|
+
json_file: TextIO
|
|
318
|
+
|
|
319
|
+
if isinstance(output_basedir, str):
|
|
320
|
+
tx_hash_str = "0x" + tx_hash.hex()
|
|
321
|
+
output_path = os.path.join(
|
|
322
|
+
output_basedir, f"trace-{index_in_block}-{tx_hash_str}.jsonl"
|
|
323
|
+
)
|
|
324
|
+
json_file = open(output_path, "w")
|
|
325
|
+
stack.push(json_file)
|
|
326
|
+
else:
|
|
327
|
+
json_file = output_basedir
|
|
328
|
+
|
|
329
|
+
for trace in traces:
|
|
330
|
+
if getattr(trace, "precompile", False):
|
|
331
|
+
# Traces related to pre-compile are not output.
|
|
332
|
+
continue
|
|
333
|
+
output_op_trace(trace, json_file)
|