Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions src/ethereum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
This package contains a reference implementation, written as simply as
possible, to aid in defining the behavior of Ethereum clients.
"""

import sys

__version__ = "2.18.0rc2"
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/crypto/blake2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
The Blake2 Implementation
^^^^^^^^^^^^^^^^^^^^^^^^^^
"""

import struct
from dataclasses import dataclass
from typing import Final, List, Tuple
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/crypto/kzg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
The KZG Implementation
^^^^^^^^^^^^^^^^^^^^^^
"""

from hashlib import sha256
from typing import Tuple

Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""


class EthereumException(Exception): # noqa N818
class EthereumException(Exception): # noqa N818
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want it to read EthereumException rather than EthereumError?

"""
Base class for all exceptions _expected_ to be thrown during normal
operation.
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/forks/arrow_glacier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[js]: https://github.com/ethereumjs/ethereumjs-monorepo/releases/tag/%40ethereumjs%2Fvm%405.6.0
[Geth 1.10.12]: https://github.com/ethereum/go-ethereum/releases/tag/v1.10.12
[nm]: https://github.com/NethermindEth/nethermind/releases/tag/1.11.7
""" # noqa: E501
""" # noqa: E501

from ethereum.fork_criteria import ByBlockNumber

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
history of all state transitions that have happened since the genesis of the
chain.
"""

from dataclasses import dataclass
from typing import Tuple

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
There is a distinction between an account that does not exist and
`EMPTY_ACCOUNT`.
"""

from dataclasses import dataclass, field
from typing import Callable, Dict, Iterable, List, Optional, Set, Tuple

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
submitted to be executed. If Ethereum is viewed as a state machine,
transactions are the events that move between states.
"""

from dataclasses import dataclass
from typing import Tuple

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/utils/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Address specific functions used in this arrow_glacier version of
specification.
"""

from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes, Bytes32
from ethereum_types.numeric import U256, Uint
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/utils/hexadecimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Hexadecimal utility functions used in this specification, specific to
Arrow Glacier types.
"""

from ethereum_types.bytes import Bytes

from ethereum.utils.hexadecimal import remove_hex_prefix
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/utils/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Message specific functions used in this arrow_glacier version of
specification.
"""

from ethereum_types.bytes import Bytes, Bytes0
from ethereum_types.numeric import Uint

Expand Down
6 changes: 3 additions & 3 deletions src/ethereum/forks/arrow_glacier/vm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class BlockOutput:
"""

block_gas_used: Uint = Uint(0)
transactions_trie: Trie[
Bytes, Optional[Bytes | LegacyTransaction]
] = field(default_factory=lambda: Trie(secured=False, default=None))
transactions_trie: Trie[Bytes, Optional[Bytes | LegacyTransaction]] = (
field(default_factory=lambda: Trie(secured=False, default=None))
)
receipts_trie: Trie[Bytes, Optional[Bytes | Receipt]] = field(
default_factory=lambda: Trie(secured=False, default=None)
)
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/vm/gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

EVM gas constants and calculators.
"""

from dataclasses import dataclass
from typing import List, Tuple

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/vm/instructions/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementations of the EVM logging instructions.
"""

from functools import partial

from ethereum_types.numeric import Uint
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/vm/instructions/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementations of the EVM Memory instructions.
"""

from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementations of the EVM storage related instructions.
"""

from ethereum_types.numeric import Uint

from ...state import get_storage, get_storage_original, set_storage
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/vm/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

EVM memory operations.
"""

from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the ALT_BN128 precompiled contracts.
"""

from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint
from py_ecc.optimized_bn128.optimized_curve import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `Blake2` precompiled contract.
"""

from ethereum.crypto.blake2 import Blake2b

from ...vm import Evm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the ECRECOVER precompiled contract.
"""

from ethereum_types.numeric import U256

from ethereum.crypto.elliptic_curve import SECP256K1N, secp256k1_recover
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `IDENTITY` precompiled contract.
"""

from ethereum_types.numeric import Uint

from ethereum.utils.numeric import ceil32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Mapping of precompiled contracts their implementations.
"""

from typing import Callable, Dict

from ...fork_types import Address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `MODEXP` precompiled contract.
"""

from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `RIPEMD160` precompiled contract.
"""

import hashlib

from ethereum_types.numeric import Uint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `SHA256` precompiled contract.
"""

import hashlib

from ethereum_types.numeric import Uint
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/arrow_glacier/vm/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Runtime related operations used while executing EVM code.
"""

from typing import Set

from ethereum_types.bytes import Bytes
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/forks/berlin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
[Geth 1.10.1]: https://github.com/ethereum/go-ethereum/releases/tag/v1.10.1
[n]: https://github.com/NethermindEth/nethermind/releases/tag/1.10.58
[oe]: https://github.com/openethereum/openethereum/releases/tag/v3.2.0
""" # noqa: E501
""" # noqa: E501

from ethereum.fork_criteria import ByBlockNumber

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
history of all state transitions that have happened since the genesis of the
chain.
"""

from dataclasses import dataclass
from typing import Tuple

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Entry point for the Ethereum specification.
"""

from dataclasses import dataclass
from typing import List, Optional, Set, Tuple

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
There is a distinction between an account that does not exist and
`EMPTY_ACCOUNT`.
"""

from dataclasses import dataclass, field
from typing import Callable, Dict, Iterable, List, Optional, Set, Tuple

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
submitted to be executed. If Ethereum is viewed as a state machine,
transactions are the events that move between states.
"""

from dataclasses import dataclass
from typing import Tuple

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/utils/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Address specific functions used in this berlin version of
specification.
"""

from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes, Bytes32
from ethereum_types.numeric import U256, Uint
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/utils/hexadecimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Hexadecimal utility functions used in this specification, specific to
Berlin types.
"""

from ethereum_types.bytes import Bytes

from ethereum.utils.hexadecimal import remove_hex_prefix
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/utils/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Message specific functions used in this berlin version of
specification.
"""

from ethereum_types.bytes import Bytes, Bytes0
from ethereum_types.numeric import Uint

Expand Down
6 changes: 3 additions & 3 deletions src/ethereum/forks/berlin/vm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ class BlockOutput:
"""

block_gas_used: Uint = Uint(0)
transactions_trie: Trie[
Bytes, Optional[Bytes | LegacyTransaction]
] = field(default_factory=lambda: Trie(secured=False, default=None))
transactions_trie: Trie[Bytes, Optional[Bytes | LegacyTransaction]] = (
field(default_factory=lambda: Trie(secured=False, default=None))
)
receipts_trie: Trie[Bytes, Optional[Bytes | Receipt]] = field(
default_factory=lambda: Trie(secured=False, default=None)
)
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/vm/gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

EVM gas constants and calculators.
"""

from dataclasses import dataclass
from typing import List, Tuple

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/vm/instructions/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementations of the EVM logging instructions.
"""

from functools import partial

from ethereum_types.numeric import Uint
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/vm/instructions/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementations of the EVM Memory instructions.
"""

from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint

Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/vm/instructions/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementations of the EVM storage related instructions.
"""

from ethereum_types.numeric import Uint

from ...state import get_storage, get_storage_original, set_storage
Expand Down
1 change: 1 addition & 0 deletions src/ethereum/forks/berlin/vm/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

EVM memory operations.
"""

from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the ALT_BN128 precompiled contracts.
"""

from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint
from py_ecc.optimized_bn128.optimized_curve import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `Blake2` precompiled contract.
"""

from ethereum.crypto.blake2 import Blake2b

from ...vm import Evm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the ECRECOVER precompiled contract.
"""

from ethereum_types.numeric import U256

from ethereum.crypto.elliptic_curve import SECP256K1N, secp256k1_recover
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `IDENTITY` precompiled contract.
"""

from ethereum_types.numeric import Uint

from ethereum.utils.numeric import ceil32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Mapping of precompiled contracts their implementations.
"""

from typing import Callable, Dict

from ...fork_types import Address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `MODEXP` precompiled contract.
"""

from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U256, Uint

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `RIPEMD160` precompiled contract.
"""

import hashlib

from ethereum_types.numeric import Uint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

Implementation of the `SHA256` precompiled contract.
"""

import hashlib

from ethereum_types.numeric import Uint
Expand Down
Loading
Loading