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,39 @@
|
|
|
1
|
+
"""
|
|
2
|
+
EVM trace implementation that fans out to many concrete trace implementations.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from typing import Final
|
|
6
|
+
|
|
7
|
+
from typing_extensions import override
|
|
8
|
+
|
|
9
|
+
from ethereum.trace import EvmTracer, TraceEvent
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class GroupTracer(EvmTracer):
|
|
13
|
+
"""
|
|
14
|
+
EVM trace implementation that fans out to many concrete trace
|
|
15
|
+
implementations.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
tracers: Final[set[EvmTracer]]
|
|
19
|
+
|
|
20
|
+
def __init__(self) -> None:
|
|
21
|
+
self.tracers = set()
|
|
22
|
+
|
|
23
|
+
def add(self, tracer: EvmTracer) -> None:
|
|
24
|
+
"""
|
|
25
|
+
Insert a new tracer.
|
|
26
|
+
"""
|
|
27
|
+
self.tracers.add(tracer)
|
|
28
|
+
|
|
29
|
+
@override
|
|
30
|
+
def __call__(
|
|
31
|
+
self,
|
|
32
|
+
evm: object,
|
|
33
|
+
event: TraceEvent,
|
|
34
|
+
) -> None:
|
|
35
|
+
"""
|
|
36
|
+
Record a trace event.
|
|
37
|
+
"""
|
|
38
|
+
for tracer in self.tracers:
|
|
39
|
+
tracer(evm, event)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Protocol definitions for working with EVM trace events.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from typing import Optional, Protocol, runtime_checkable
|
|
6
|
+
|
|
7
|
+
from ethereum_types.bytes import Bytes
|
|
8
|
+
from ethereum_types.numeric import U256, Uint
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@runtime_checkable
|
|
12
|
+
class TransactionEnvironment(Protocol):
|
|
13
|
+
"""
|
|
14
|
+
The class implements the tx_env interface for trace.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
index_in_block: Uint | None
|
|
18
|
+
tx_hash: Bytes | None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@runtime_checkable
|
|
22
|
+
class Message(Protocol):
|
|
23
|
+
"""
|
|
24
|
+
The class implements the message interface for trace.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
depth: int
|
|
28
|
+
tx_env: TransactionEnvironment
|
|
29
|
+
parent_evm: Optional["Evm"]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@runtime_checkable
|
|
33
|
+
class Evm(Protocol):
|
|
34
|
+
"""
|
|
35
|
+
The class describes the EVM interface for pre-byzantium forks trace.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
pc: Uint
|
|
39
|
+
stack: list[U256]
|
|
40
|
+
memory: bytearray
|
|
41
|
+
code: Bytes
|
|
42
|
+
gas_left: Uint
|
|
43
|
+
refund_counter: int
|
|
44
|
+
running: bool
|
|
45
|
+
message: Message
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@runtime_checkable
|
|
49
|
+
class EvmWithReturnData(Evm, Protocol):
|
|
50
|
+
"""
|
|
51
|
+
The class describes the EVM interface for post-byzantium forks trace.
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
return_data: Bytes
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Define the types used by the t8n tool.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
|
|
8
|
+
|
|
9
|
+
from ethereum_rlp import Simple, rlp
|
|
10
|
+
from ethereum_types.bytes import Bytes
|
|
11
|
+
from ethereum_types.numeric import U64, U256, Uint
|
|
12
|
+
|
|
13
|
+
from ethereum.crypto.hash import Hash32, keccak256
|
|
14
|
+
from ethereum.utils.hexadecimal import hex_to_bytes, hex_to_u256, hex_to_uint
|
|
15
|
+
|
|
16
|
+
from ..loaders.transaction_loader import TransactionLoad, UnsupportedTxError
|
|
17
|
+
from ..utils import FatalError, encode_to_hex, secp256k1_sign
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from . import T8N
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Alloc:
|
|
24
|
+
"""
|
|
25
|
+
The alloc (state) type for the t8n tool.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
state: Any
|
|
29
|
+
state_backup: Any
|
|
30
|
+
|
|
31
|
+
def __init__(self, t8n: "T8N", stdin: Optional[Dict] = None):
|
|
32
|
+
"""Read the alloc file and return the state."""
|
|
33
|
+
if t8n.options.input_alloc == "stdin":
|
|
34
|
+
assert stdin is not None
|
|
35
|
+
data = stdin["alloc"]
|
|
36
|
+
else:
|
|
37
|
+
with open(t8n.options.input_alloc, "r") as f:
|
|
38
|
+
data = json.load(f)
|
|
39
|
+
|
|
40
|
+
# The json_to_state functions expects the values to hex
|
|
41
|
+
# strings, so we convert them here.
|
|
42
|
+
for address, account in data.items():
|
|
43
|
+
for key, value in account.items():
|
|
44
|
+
if key == "storage" or not value:
|
|
45
|
+
continue
|
|
46
|
+
elif not value.startswith("0x"):
|
|
47
|
+
data[address][key] = "0x" + hex(int(value))
|
|
48
|
+
|
|
49
|
+
state = t8n.json_to_state(data)
|
|
50
|
+
if t8n.fork.fork_module == "dao_fork":
|
|
51
|
+
t8n.fork.apply_dao(state)
|
|
52
|
+
|
|
53
|
+
self.state = state
|
|
54
|
+
|
|
55
|
+
def to_json(self) -> Any:
|
|
56
|
+
"""Encode the state to JSON."""
|
|
57
|
+
data = {}
|
|
58
|
+
for address, account in self.state._main_trie._data.items():
|
|
59
|
+
account_data: Dict[str, Any] = {}
|
|
60
|
+
|
|
61
|
+
if account.balance:
|
|
62
|
+
account_data["balance"] = hex(account.balance)
|
|
63
|
+
|
|
64
|
+
if account.nonce:
|
|
65
|
+
account_data["nonce"] = hex(account.nonce)
|
|
66
|
+
|
|
67
|
+
if account.code:
|
|
68
|
+
account_data["code"] = "0x" + account.code.hex()
|
|
69
|
+
|
|
70
|
+
if address in self.state._storage_tries:
|
|
71
|
+
account_data["storage"] = {
|
|
72
|
+
"0x" + k.hex(): hex(v)
|
|
73
|
+
for k, v in self.state._storage_tries[
|
|
74
|
+
address
|
|
75
|
+
]._data.items()
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
data["0x" + address.hex()] = account_data
|
|
79
|
+
|
|
80
|
+
return data
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class Txs:
|
|
84
|
+
"""
|
|
85
|
+
Read the transactions file, sort out the valid transactions and
|
|
86
|
+
return a list of transactions.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
def __init__(self, t8n: "T8N", stdin: Optional[Dict] = None):
|
|
90
|
+
self.t8n = t8n
|
|
91
|
+
self.successfully_parsed: List[int] = []
|
|
92
|
+
self.transactions: List[Tuple[Uint, Any]] = []
|
|
93
|
+
self.rejected_txs = {}
|
|
94
|
+
self.rlp_input = False
|
|
95
|
+
self.all_txs = []
|
|
96
|
+
|
|
97
|
+
if t8n.options.input_txs == "stdin":
|
|
98
|
+
assert stdin is not None
|
|
99
|
+
data = stdin["txs"]
|
|
100
|
+
else:
|
|
101
|
+
with open(t8n.options.input_txs, "r") as f:
|
|
102
|
+
data = json.load(f)
|
|
103
|
+
|
|
104
|
+
if data is None:
|
|
105
|
+
self.data: Simple = []
|
|
106
|
+
elif isinstance(data, str):
|
|
107
|
+
self.rlp_input = True
|
|
108
|
+
self.data = rlp.decode(hex_to_bytes(data))
|
|
109
|
+
else:
|
|
110
|
+
self.data = data
|
|
111
|
+
|
|
112
|
+
for idx, raw_tx in enumerate(self.data):
|
|
113
|
+
try:
|
|
114
|
+
if self.rlp_input:
|
|
115
|
+
self.transactions.append(self.parse_rlp_tx(raw_tx))
|
|
116
|
+
self.successfully_parsed.append(idx)
|
|
117
|
+
else:
|
|
118
|
+
self.transactions.append(self.parse_json_tx(raw_tx))
|
|
119
|
+
self.successfully_parsed.append(idx)
|
|
120
|
+
except UnsupportedTxError as e:
|
|
121
|
+
self.t8n.logger.warning(
|
|
122
|
+
f"Unsupported transaction type {idx}: {e.error_message}"
|
|
123
|
+
)
|
|
124
|
+
self.rejected_txs[idx] = (
|
|
125
|
+
f"Unsupported transaction type: {e.error_message}"
|
|
126
|
+
)
|
|
127
|
+
self.all_txs.append(e.encoded_params)
|
|
128
|
+
except Exception as e:
|
|
129
|
+
msg = f"Failed to parse transaction {idx}: {str(e)}"
|
|
130
|
+
self.t8n.logger.warning(msg, exc_info=e)
|
|
131
|
+
self.rejected_txs[idx] = msg
|
|
132
|
+
|
|
133
|
+
def parse_rlp_tx(self, raw_tx: Any) -> Any:
|
|
134
|
+
"""
|
|
135
|
+
Read transactions from RLP.
|
|
136
|
+
"""
|
|
137
|
+
t8n = self.t8n
|
|
138
|
+
|
|
139
|
+
tx_rlp = rlp.encode(raw_tx)
|
|
140
|
+
if t8n.fork.is_after_fork("berlin"):
|
|
141
|
+
if isinstance(raw_tx, Bytes):
|
|
142
|
+
transaction = t8n.fork.decode_transaction(raw_tx)
|
|
143
|
+
self.all_txs.append(raw_tx)
|
|
144
|
+
else:
|
|
145
|
+
transaction = rlp.decode_to(t8n.fork.LegacyTransaction, tx_rlp)
|
|
146
|
+
self.all_txs.append(transaction)
|
|
147
|
+
else:
|
|
148
|
+
transaction = rlp.decode_to(t8n.fork.Transaction, tx_rlp)
|
|
149
|
+
self.all_txs.append(transaction)
|
|
150
|
+
|
|
151
|
+
return transaction
|
|
152
|
+
|
|
153
|
+
def parse_json_tx(self, raw_tx: Any) -> Any:
|
|
154
|
+
"""
|
|
155
|
+
Read the transactions from json.
|
|
156
|
+
If a transaction is unsigned but has a `secretKey` field, the
|
|
157
|
+
transaction will be signed.
|
|
158
|
+
"""
|
|
159
|
+
t8n = self.t8n
|
|
160
|
+
|
|
161
|
+
# for idx, json_tx in enumerate(self.data):
|
|
162
|
+
raw_tx["gasLimit"] = raw_tx["gas"]
|
|
163
|
+
raw_tx["data"] = raw_tx["input"]
|
|
164
|
+
if "to" not in raw_tx or raw_tx["to"] is None:
|
|
165
|
+
raw_tx["to"] = ""
|
|
166
|
+
|
|
167
|
+
# tf tool might provide None instead of 0
|
|
168
|
+
# for v, r, s
|
|
169
|
+
raw_tx["v"] = raw_tx.get("v") or raw_tx.get("y_parity") or "0x00"
|
|
170
|
+
raw_tx["r"] = raw_tx.get("r") or "0x00"
|
|
171
|
+
raw_tx["s"] = raw_tx.get("s") or "0x00"
|
|
172
|
+
|
|
173
|
+
v = hex_to_u256(raw_tx["v"])
|
|
174
|
+
r = hex_to_u256(raw_tx["r"])
|
|
175
|
+
s = hex_to_u256(raw_tx["s"])
|
|
176
|
+
|
|
177
|
+
if "secretKey" in raw_tx and v == r == s == 0:
|
|
178
|
+
self.sign_transaction(raw_tx)
|
|
179
|
+
|
|
180
|
+
tx = TransactionLoad(raw_tx, t8n.fork).read()
|
|
181
|
+
self.all_txs.append(tx)
|
|
182
|
+
|
|
183
|
+
if t8n.fork.is_after_fork("berlin"):
|
|
184
|
+
transaction = t8n.fork.decode_transaction(tx)
|
|
185
|
+
else:
|
|
186
|
+
transaction = tx
|
|
187
|
+
|
|
188
|
+
return transaction
|
|
189
|
+
|
|
190
|
+
def sign_transaction(self, json_tx: Any) -> None:
|
|
191
|
+
"""
|
|
192
|
+
Sign a transaction. This function will be invoked if a `secretKey`
|
|
193
|
+
is provided in the transaction.
|
|
194
|
+
Post spurious dragon, the transaction is signed according to EIP-155
|
|
195
|
+
if the protected flag is missing or set to true.
|
|
196
|
+
"""
|
|
197
|
+
t8n = self.t8n
|
|
198
|
+
protected = json_tx.get("protected", True)
|
|
199
|
+
|
|
200
|
+
tx = TransactionLoad(json_tx, t8n.fork).read()
|
|
201
|
+
|
|
202
|
+
if isinstance(tx, bytes):
|
|
203
|
+
tx_decoded = t8n.fork.decode_transaction(tx)
|
|
204
|
+
else:
|
|
205
|
+
tx_decoded = tx
|
|
206
|
+
|
|
207
|
+
secret_key = hex_to_uint(json_tx["secretKey"][2:])
|
|
208
|
+
if t8n.fork.is_after_fork("berlin"):
|
|
209
|
+
Transaction = t8n.fork.LegacyTransaction # noqa N806
|
|
210
|
+
else:
|
|
211
|
+
Transaction = t8n.fork.Transaction # noqa N806
|
|
212
|
+
|
|
213
|
+
v_addend: U256
|
|
214
|
+
if isinstance(tx_decoded, Transaction):
|
|
215
|
+
if t8n.fork.is_after_fork("spurious_dragon"):
|
|
216
|
+
if protected:
|
|
217
|
+
signing_hash = t8n.fork.signing_hash_155(
|
|
218
|
+
tx_decoded, U64(1)
|
|
219
|
+
)
|
|
220
|
+
v_addend = U256(37) # Assuming chain_id = 1
|
|
221
|
+
else:
|
|
222
|
+
signing_hash = t8n.fork.signing_hash_pre155(tx_decoded)
|
|
223
|
+
v_addend = U256(27)
|
|
224
|
+
else:
|
|
225
|
+
signing_hash = t8n.fork.signing_hash(tx_decoded)
|
|
226
|
+
v_addend = U256(27)
|
|
227
|
+
elif isinstance(tx_decoded, t8n.fork.AccessListTransaction):
|
|
228
|
+
signing_hash = t8n.fork.signing_hash_2930(tx_decoded)
|
|
229
|
+
v_addend = U256(0)
|
|
230
|
+
elif isinstance(tx_decoded, t8n.fork.FeeMarketTransaction):
|
|
231
|
+
signing_hash = t8n.fork.signing_hash_1559(tx_decoded)
|
|
232
|
+
v_addend = U256(0)
|
|
233
|
+
elif isinstance(tx_decoded, t8n.fork.BlobTransaction):
|
|
234
|
+
signing_hash = t8n.fork.signing_hash_4844(tx_decoded)
|
|
235
|
+
v_addend = U256(0)
|
|
236
|
+
elif isinstance(tx_decoded, t8n.fork.SetCodeTransaction):
|
|
237
|
+
signing_hash = t8n.fork.signing_hash_7702(tx_decoded)
|
|
238
|
+
v_addend = U256(0)
|
|
239
|
+
else:
|
|
240
|
+
raise FatalError("Unknown transaction type")
|
|
241
|
+
|
|
242
|
+
r, s, y = secp256k1_sign(signing_hash, int(secret_key))
|
|
243
|
+
json_tx["r"] = hex(r)
|
|
244
|
+
json_tx["s"] = hex(s)
|
|
245
|
+
json_tx["v"] = hex(y + v_addend)
|
|
246
|
+
|
|
247
|
+
if v_addend == 0:
|
|
248
|
+
json_tx["y_parity"] = json_tx["v"]
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
@dataclass
|
|
252
|
+
class Result:
|
|
253
|
+
"""Type that represents the result of a transition execution."""
|
|
254
|
+
|
|
255
|
+
difficulty: Any
|
|
256
|
+
base_fee: Any
|
|
257
|
+
state_root: Any = None
|
|
258
|
+
tx_root: Any = None
|
|
259
|
+
receipt_root: Any = None
|
|
260
|
+
withdrawals_root: Any = None
|
|
261
|
+
logs_hash: Any = None
|
|
262
|
+
bloom: Any = None
|
|
263
|
+
receipts: Any = None
|
|
264
|
+
rejected: Any = None
|
|
265
|
+
gas_used: Any = None
|
|
266
|
+
excess_blob_gas: Optional[U64] = None
|
|
267
|
+
blob_gas_used: Optional[Uint] = None
|
|
268
|
+
requests_hash: Optional[Hash32] = None
|
|
269
|
+
requests: Optional[List[Bytes]] = None
|
|
270
|
+
block_exception: Optional[str] = None
|
|
271
|
+
|
|
272
|
+
def get_receipts_from_output(
|
|
273
|
+
self,
|
|
274
|
+
t8n: Any,
|
|
275
|
+
block_output: Any,
|
|
276
|
+
) -> List[Any]:
|
|
277
|
+
"""
|
|
278
|
+
Get receipts from the transaction and receipts tries.
|
|
279
|
+
"""
|
|
280
|
+
receipts: List[Any] = []
|
|
281
|
+
for key in block_output.receipt_keys:
|
|
282
|
+
tx = t8n.fork.trie_get(block_output.transactions_trie, key)
|
|
283
|
+
receipt = t8n.fork.trie_get(block_output.receipts_trie, key)
|
|
284
|
+
|
|
285
|
+
assert tx is not None
|
|
286
|
+
assert receipt is not None
|
|
287
|
+
|
|
288
|
+
tx_hash = t8n.fork.get_transaction_hash(tx)
|
|
289
|
+
|
|
290
|
+
if hasattr(t8n.fork, "decode_receipt"):
|
|
291
|
+
decoded_receipt = t8n.fork.decode_receipt(receipt)
|
|
292
|
+
else:
|
|
293
|
+
decoded_receipt = receipt
|
|
294
|
+
|
|
295
|
+
receipts.append((tx_hash, decoded_receipt))
|
|
296
|
+
|
|
297
|
+
return receipts
|
|
298
|
+
|
|
299
|
+
def update(self, t8n: "T8N", block_env: Any, block_output: Any) -> None:
|
|
300
|
+
"""
|
|
301
|
+
Update the result after processing the inputs.
|
|
302
|
+
"""
|
|
303
|
+
self.gas_used = block_output.block_gas_used
|
|
304
|
+
self.tx_root = t8n.fork.root(block_output.transactions_trie)
|
|
305
|
+
self.receipt_root = t8n.fork.root(block_output.receipts_trie)
|
|
306
|
+
self.bloom = t8n.fork.logs_bloom(block_output.block_logs)
|
|
307
|
+
self.logs_hash = keccak256(rlp.encode(block_output.block_logs))
|
|
308
|
+
self.state_root = t8n.fork.state_root(block_env.state)
|
|
309
|
+
self.receipts = self.get_receipts_from_output(t8n, block_output)
|
|
310
|
+
|
|
311
|
+
if hasattr(block_env, "base_fee_per_gas"):
|
|
312
|
+
self.base_fee = block_env.base_fee_per_gas
|
|
313
|
+
|
|
314
|
+
if hasattr(block_output, "withdrawals_trie"):
|
|
315
|
+
self.withdrawals_root = t8n.fork.root(
|
|
316
|
+
block_output.withdrawals_trie
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
if hasattr(block_env, "excess_blob_gas"):
|
|
320
|
+
self.excess_blob_gas = block_env.excess_blob_gas
|
|
321
|
+
|
|
322
|
+
if hasattr(block_output, "requests"):
|
|
323
|
+
self.requests = block_output.requests
|
|
324
|
+
self.requests_hash = t8n.fork.compute_requests_hash(self.requests)
|
|
325
|
+
|
|
326
|
+
def json_encode_receipts(self) -> Any:
|
|
327
|
+
"""
|
|
328
|
+
Encode receipts to JSON.
|
|
329
|
+
"""
|
|
330
|
+
receipts_json = []
|
|
331
|
+
for tx_hash, receipt in self.receipts:
|
|
332
|
+
receipt_dict = {"transactionHash": "0x" + tx_hash.hex()}
|
|
333
|
+
|
|
334
|
+
if hasattr(receipt, "succeeded"):
|
|
335
|
+
receipt_dict["succeeded"] = receipt.succeeded
|
|
336
|
+
else:
|
|
337
|
+
assert hasattr(receipt, "post_state")
|
|
338
|
+
receipt_dict["post_state"] = "0x" + receipt.post_state.hex()
|
|
339
|
+
|
|
340
|
+
receipt_dict["gasUsed"] = hex(receipt.cumulative_gas_used)
|
|
341
|
+
receipt_dict["bloom"] = "0x" + receipt.bloom.hex()
|
|
342
|
+
|
|
343
|
+
receipts_json.append(receipt_dict)
|
|
344
|
+
|
|
345
|
+
return receipts_json
|
|
346
|
+
|
|
347
|
+
def to_json(self) -> Any:
|
|
348
|
+
"""Encode the result to JSON."""
|
|
349
|
+
data = {}
|
|
350
|
+
|
|
351
|
+
data["stateRoot"] = "0x" + self.state_root.hex()
|
|
352
|
+
data["txRoot"] = "0x" + self.tx_root.hex()
|
|
353
|
+
data["receiptsRoot"] = "0x" + self.receipt_root.hex()
|
|
354
|
+
if self.withdrawals_root:
|
|
355
|
+
data["withdrawalsRoot"] = "0x" + self.withdrawals_root.hex()
|
|
356
|
+
data["logsHash"] = "0x" + self.logs_hash.hex()
|
|
357
|
+
data["logsBloom"] = "0x" + self.bloom.hex()
|
|
358
|
+
data["gasUsed"] = hex(self.gas_used)
|
|
359
|
+
if self.difficulty:
|
|
360
|
+
data["currentDifficulty"] = hex(self.difficulty)
|
|
361
|
+
else:
|
|
362
|
+
data["currentDifficulty"] = None
|
|
363
|
+
|
|
364
|
+
if self.base_fee:
|
|
365
|
+
data["currentBaseFee"] = hex(self.base_fee)
|
|
366
|
+
else:
|
|
367
|
+
data["currentBaseFee"] = None
|
|
368
|
+
|
|
369
|
+
if self.excess_blob_gas is not None:
|
|
370
|
+
data["currentExcessBlobGas"] = hex(self.excess_blob_gas)
|
|
371
|
+
|
|
372
|
+
if self.blob_gas_used is not None:
|
|
373
|
+
data["blobGasUsed"] = hex(self.blob_gas_used)
|
|
374
|
+
|
|
375
|
+
data["rejected"] = [
|
|
376
|
+
{"index": idx, "error": error}
|
|
377
|
+
for idx, error in self.rejected.items()
|
|
378
|
+
]
|
|
379
|
+
|
|
380
|
+
data["receipts"] = self.json_encode_receipts()
|
|
381
|
+
|
|
382
|
+
if self.requests_hash is not None:
|
|
383
|
+
assert self.requests is not None
|
|
384
|
+
|
|
385
|
+
data["requestsHash"] = encode_to_hex(self.requests_hash)
|
|
386
|
+
# T8N doesn't consider the request type byte to be part of the
|
|
387
|
+
# request
|
|
388
|
+
data["requests"] = [encode_to_hex(req) for req in self.requests]
|
|
389
|
+
|
|
390
|
+
if self.block_exception is not None:
|
|
391
|
+
data["blockException"] = self.block_exception
|
|
392
|
+
|
|
393
|
+
return data
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Utilities for the EVM tools.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import logging
|
|
7
|
+
import sys
|
|
8
|
+
from typing import (
|
|
9
|
+
Any,
|
|
10
|
+
Callable,
|
|
11
|
+
Dict,
|
|
12
|
+
List,
|
|
13
|
+
Optional,
|
|
14
|
+
Sequence,
|
|
15
|
+
Tuple,
|
|
16
|
+
TypeVar,
|
|
17
|
+
Union,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
import coincurve
|
|
21
|
+
from ethereum_types.numeric import U64, U256, Uint
|
|
22
|
+
|
|
23
|
+
from ethereum.crypto.hash import Hash32
|
|
24
|
+
from ethereum_spec_tools.forks import Hardfork
|
|
25
|
+
|
|
26
|
+
W = TypeVar("W", Uint, U64, U256)
|
|
27
|
+
|
|
28
|
+
EXCEPTION_MAPS = {
|
|
29
|
+
"FrontierToHomesteadAt5": {
|
|
30
|
+
"fork_blocks": [("frontier", 0), ("homestead", 5)],
|
|
31
|
+
},
|
|
32
|
+
"HomesteadToDaoAt5": {
|
|
33
|
+
"fork_blocks": [("homestead", 0), ("dao_fork", 5)],
|
|
34
|
+
},
|
|
35
|
+
"HomesteadToEIP150At5": {
|
|
36
|
+
"fork_blocks": [("homestead", 0), ("tangerine_whistle", 5)],
|
|
37
|
+
},
|
|
38
|
+
"EIP158ToByzantiumAt5": {
|
|
39
|
+
"fork_blocks": [("spurious_dragon", 0), ("byzantium", 5)],
|
|
40
|
+
},
|
|
41
|
+
"ByzantiumToConstantinopleAt5": {
|
|
42
|
+
"fork_blocks": [("byzantium", 0), ("constantinople", 5)],
|
|
43
|
+
},
|
|
44
|
+
"ConstantinopleToIstanbulAt5": {
|
|
45
|
+
"fork_blocks": [("constantinople", 0), ("istanbul", 5)],
|
|
46
|
+
},
|
|
47
|
+
"BerlinToLondonAt5": {
|
|
48
|
+
"fork_blocks": [("berlin", 0), ("london", 5)],
|
|
49
|
+
},
|
|
50
|
+
"EIP150": {
|
|
51
|
+
"fork_blocks": [("tangerine_whistle", 0)],
|
|
52
|
+
},
|
|
53
|
+
"EIP158": {
|
|
54
|
+
"fork_blocks": [("spurious_dragon", 0)],
|
|
55
|
+
},
|
|
56
|
+
"Merge": {
|
|
57
|
+
"fork_blocks": [("paris", 0)],
|
|
58
|
+
},
|
|
59
|
+
"ConstantinopleFix": {
|
|
60
|
+
"fork_blocks": [("constantinople", 0)],
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
UNSUPPORTED_FORKS = ("constantinople",)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def parse_hex_or_int(value: str, to_type: Callable[[int], W]) -> W:
|
|
68
|
+
"""Read a Uint type from a hex string or int."""
|
|
69
|
+
# find the function based on the type
|
|
70
|
+
# if the value is a hex string, convert it
|
|
71
|
+
if isinstance(value, str) and value.startswith("0x"):
|
|
72
|
+
return to_type(int(value[2:], 16))
|
|
73
|
+
# if the value is an str, convert it
|
|
74
|
+
else:
|
|
75
|
+
return to_type(int(value))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class FatalError(Exception):
|
|
79
|
+
"""Exception that causes the tool to stop."""
|
|
80
|
+
|
|
81
|
+
pass
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def get_module_name(
|
|
85
|
+
forks: Sequence[Hardfork], options: Any, stdin: Any
|
|
86
|
+
) -> Tuple[str, int]:
|
|
87
|
+
"""
|
|
88
|
+
Get the module name and the fork block for the given state fork.
|
|
89
|
+
"""
|
|
90
|
+
if options.state_fork.casefold() in UNSUPPORTED_FORKS:
|
|
91
|
+
sys.exit(f"Unsupported state fork: {options.state_fork}")
|
|
92
|
+
# If the state fork is an exception, use the exception config.
|
|
93
|
+
exception_config: Optional[Dict[str, Any]] = None
|
|
94
|
+
try:
|
|
95
|
+
exception_config = EXCEPTION_MAPS[options.state_fork]
|
|
96
|
+
except KeyError:
|
|
97
|
+
pass
|
|
98
|
+
|
|
99
|
+
if exception_config:
|
|
100
|
+
if options.input_env == "stdin":
|
|
101
|
+
assert stdin is not None
|
|
102
|
+
data = stdin["env"]
|
|
103
|
+
else:
|
|
104
|
+
with open(options.input_env, "r") as f:
|
|
105
|
+
data = json.load(f)
|
|
106
|
+
|
|
107
|
+
block_number = parse_hex_or_int(data["currentNumber"], Uint)
|
|
108
|
+
|
|
109
|
+
for fork, fork_block in exception_config["fork_blocks"]:
|
|
110
|
+
if block_number >= Uint(fork_block):
|
|
111
|
+
current_fork_module = fork
|
|
112
|
+
current_fork_block = fork_block
|
|
113
|
+
|
|
114
|
+
return current_fork_module, current_fork_block
|
|
115
|
+
|
|
116
|
+
# If the state fork is not an exception, use the fork name.
|
|
117
|
+
for fork in forks:
|
|
118
|
+
fork_module = fork.name.split(".")[-1]
|
|
119
|
+
key = "".join(x.title() for x in fork_module.split("_"))
|
|
120
|
+
|
|
121
|
+
if key == options.state_fork:
|
|
122
|
+
return fork_module, 0
|
|
123
|
+
|
|
124
|
+
# Neither in exception nor a standard fork name.
|
|
125
|
+
sys.exit(f"Unsupported state fork: {options.state_fork}")
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def get_supported_forks() -> List[str]:
|
|
129
|
+
"""
|
|
130
|
+
Get the supported forks.
|
|
131
|
+
"""
|
|
132
|
+
supported_forks = [
|
|
133
|
+
fork.title_case_name.replace(" ", "") for fork in Hardfork.discover()
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
# Add the exception forks
|
|
137
|
+
supported_forks.extend(EXCEPTION_MAPS.keys())
|
|
138
|
+
|
|
139
|
+
# Remove the unsupported forks
|
|
140
|
+
supported_forks = [
|
|
141
|
+
fork
|
|
142
|
+
for fork in supported_forks
|
|
143
|
+
if fork.casefold() not in UNSUPPORTED_FORKS
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
return supported_forks
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def get_stream_logger(name: str) -> Any:
|
|
150
|
+
"""
|
|
151
|
+
Get a logger that writes to stdout.
|
|
152
|
+
"""
|
|
153
|
+
logger = logging.getLogger(name)
|
|
154
|
+
if not logger.handlers:
|
|
155
|
+
logger.setLevel(level=logging.INFO)
|
|
156
|
+
stream_handler = logging.StreamHandler()
|
|
157
|
+
formatter = logging.Formatter("%(levelname)s:%(name)s:%(message)s")
|
|
158
|
+
stream_handler.setFormatter(formatter)
|
|
159
|
+
logger.addHandler(stream_handler)
|
|
160
|
+
|
|
161
|
+
return logger
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def secp256k1_sign(msg_hash: Hash32, secret_key: int) -> Tuple[U256, ...]:
|
|
165
|
+
"""
|
|
166
|
+
Returns the signature of a message hash given the secret key.
|
|
167
|
+
"""
|
|
168
|
+
private_key = coincurve.PrivateKey.from_int(secret_key)
|
|
169
|
+
signature = private_key.sign_recoverable(msg_hash, hasher=None)
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
U256.from_be_bytes(signature[0:32]),
|
|
173
|
+
U256.from_be_bytes(signature[32:64]),
|
|
174
|
+
U256(signature[64]),
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def encode_to_hex(data: Union[bytes, int]) -> str:
|
|
179
|
+
"""
|
|
180
|
+
Encode the data to a hex string.
|
|
181
|
+
"""
|
|
182
|
+
if isinstance(data, int):
|
|
183
|
+
return hex(data)
|
|
184
|
+
elif isinstance(data, bytes):
|
|
185
|
+
return "0x" + data.hex()
|
|
186
|
+
else:
|
|
187
|
+
raise Exception("Invalid data type")
|