Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ethereum/crypto/blake2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import struct
from dataclasses import dataclass
from typing import Final, List, Tuple
from typing import Final, List, Tuple, final

from ethereum_types.numeric import Uint

Expand Down Expand Up @@ -248,6 +248,7 @@ def compress(


# Parameters specific to the Blake2b implementation
@final
@dataclass
class Blake2b(Blake2):
"""
Expand Down
10 changes: 9 additions & 1 deletion src/ethereum/forks/amsterdam/block_access_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

from dataclasses import dataclass, field
from typing import Dict, List, Optional, Set, Tuple, TypeAlias
from typing import Dict, List, Optional, Set, Tuple, TypeAlias, final

from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes, Bytes32
Expand All @@ -28,6 +28,7 @@
from .state_tracker import BlockState, TransactionState, get_code


@final
@slotted_freezable
@dataclass
class StorageChange:
Expand All @@ -54,6 +55,7 @@ class StorageChange:
"""


@final
@slotted_freezable
@dataclass
class BalanceChange:
Expand All @@ -80,6 +82,7 @@ class BalanceChange:
"""


@final
@slotted_freezable
@dataclass
class NonceChange:
Expand All @@ -106,6 +109,7 @@ class NonceChange:
"""


@final
@slotted_freezable
@dataclass
class CodeChange:
Expand All @@ -132,6 +136,7 @@ class CodeChange:
"""


@final
@slotted_freezable
@dataclass
class SlotChanges:
Expand All @@ -156,6 +161,7 @@ class SlotChanges:
"""


@final
@slotted_freezable
@dataclass
class AccountChanges:
Expand Down Expand Up @@ -233,6 +239,7 @@ class AccountChanges:
"""


@final
@dataclass
class AccountData:
"""
Expand Down Expand Up @@ -273,6 +280,7 @@ class AccountData:
"""


@final
@dataclass
class BlockAccessListBuilder:
"""
Expand Down
7 changes: 6 additions & 1 deletion src/ethereum/forks/amsterdam/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

from dataclasses import dataclass
from typing import Tuple
from typing import Tuple, final

from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes, Bytes8, Bytes32
Expand All @@ -31,6 +31,7 @@
)


@final
@slotted_freezable
@dataclass
class Withdrawal:
Expand Down Expand Up @@ -64,6 +65,7 @@ class Withdrawal:
"""


@final
@slotted_freezable
@dataclass
class Header:
Expand Down Expand Up @@ -267,6 +269,7 @@ class Header:
"""


@final
@slotted_freezable
@dataclass
class Block:
Expand Down Expand Up @@ -320,6 +323,7 @@ class Block:
"""


@final
@slotted_freezable
@dataclass
class Log:
Expand Down Expand Up @@ -352,6 +356,7 @@ class Log:
"""


@final
@slotted_freezable
@dataclass
class Receipt:
Expand Down
4 changes: 3 additions & 1 deletion src/ethereum/forks/amsterdam/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

from dataclasses import dataclass
from typing import Final, List, Optional, Tuple
from typing import Final, List, Optional, Tuple, final

from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes
Expand Down Expand Up @@ -135,6 +135,7 @@
BLOB_COUNT_LIMIT = 6


@final
@slotted_freezable
@dataclass
class ChainContext:
Expand All @@ -152,6 +153,7 @@ class ChainContext:
"""Parent header used for header validation and system contracts."""


@final
@dataclass
class BlockChain:
"""
Expand Down
2 changes: 2 additions & 0 deletions src/ethereum/forks/amsterdam/fork_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""

from dataclasses import dataclass
from typing import final

from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes, Bytes256
Expand Down Expand Up @@ -50,6 +51,7 @@ def encode_account(raw_account_data: Account, storage_root: Bytes) -> Bytes:
)


@final
@slotted_freezable
@dataclass
class Authorization:
Expand Down
4 changes: 3 additions & 1 deletion src/ethereum/forks/amsterdam/state_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"""

from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Callable, Dict, Optional, Set, Tuple
from typing import TYPE_CHECKING, Callable, Dict, Optional, Set, Tuple, final

from ethereum_types.bytes import Bytes, Bytes32
from ethereum_types.frozen import modify
Expand All @@ -39,6 +39,7 @@
from .block_access_lists import BlockAccessListBuilder


@final
@dataclass
class BlockState:
"""
Expand All @@ -62,6 +63,7 @@ class BlockState:
code_writes: Dict[Hash32, Bytes] = field(default_factory=dict)


@final
@dataclass
class TransactionState:
"""
Expand Down
8 changes: 7 additions & 1 deletion src/ethereum/forks/amsterdam/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from dataclasses import dataclass
from typing import Tuple, TypeGuard
from typing import Tuple, TypeGuard, final

from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes, Bytes0, Bytes32
Expand Down Expand Up @@ -47,6 +47,7 @@
"""


@final
@slotted_freezable
@dataclass
class LegacyTransaction:
Expand Down Expand Up @@ -109,6 +110,7 @@ class LegacyTransaction:
"""


@final
@slotted_freezable
@dataclass
class Access:
Expand All @@ -128,6 +130,7 @@ class Access:
"""


@final
@slotted_freezable
@dataclass
class AccessListTransaction:
Expand Down Expand Up @@ -200,6 +203,7 @@ class AccessListTransaction:
"""


@final
@slotted_freezable
@dataclass
class FeeMarketTransaction:
Expand Down Expand Up @@ -277,6 +281,7 @@ class FeeMarketTransaction:
"""


@final
@slotted_freezable
@dataclass
class BlobTransaction:
Expand Down Expand Up @@ -365,6 +370,7 @@ class BlobTransaction:
"""


@final
@slotted_freezable
@dataclass
class SetCodeTransaction:
Expand Down
7 changes: 6 additions & 1 deletion src/ethereum/forks/amsterdam/vm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

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

from ethereum_types.bytes import Bytes, Bytes0, Bytes32
from ethereum_types.numeric import U64, U256, Uint
Expand All @@ -39,6 +39,7 @@
CALL_SUCCESS = U256(1)


@final
@dataclass
class BlockEnvironment:
"""
Expand All @@ -60,6 +61,7 @@ class BlockEnvironment:
slot_number: U64


@final
@dataclass
class BlockOutput:
"""
Expand Down Expand Up @@ -106,6 +108,7 @@ class BlockOutput:
block_access_list: BlockAccessList = field(default_factory=list)


@final
@dataclass
class TransactionEnvironment:
"""
Expand All @@ -124,6 +127,7 @@ class TransactionEnvironment:
tx_hash: Optional[Hash32]


@final
@dataclass
class Message:
"""
Expand All @@ -149,6 +153,7 @@ class Message:
parent_evm: Optional["Evm"]


@final
@dataclass
class Evm:
"""The internal state of the virtual machine."""
Expand Down
4 changes: 3 additions & 1 deletion src/ethereum/forks/amsterdam/vm/gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

from dataclasses import dataclass
from typing import Final, List, Tuple
from typing import Final, List, Tuple, final

from ethereum_types.numeric import U64, U256, Uint, ulen

Expand Down Expand Up @@ -197,6 +197,7 @@ class GasCosts:
OPCODE_SELFDESTRUCT_NEW_ACCOUNT: Final[Uint] = Uint(25000)


@final
@dataclass
class ExtendMemory:
"""
Expand All @@ -212,6 +213,7 @@ class ExtendMemory:
expand_by: Uint


@final
@dataclass
class MessageCallGas:
"""
Expand Down
3 changes: 2 additions & 1 deletion src/ethereum/forks/amsterdam/vm/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

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

from ethereum_types.bytes import Bytes, Bytes0
from ethereum_types.numeric import U256, Uint, ulen
Expand Down Expand Up @@ -66,6 +66,7 @@
MAX_INIT_CODE_SIZE = 2 * MAX_CODE_SIZE


@final
@dataclass
class MessageCallOutput:
"""
Expand Down
6 changes: 5 additions & 1 deletion src/ethereum/forks/arrow_glacier/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

from dataclasses import dataclass
from typing import Tuple
from typing import Tuple, final

from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes, Bytes8, Bytes32
Expand All @@ -29,6 +29,7 @@
)


@final
@slotted_freezable
@dataclass
class Header:
Expand Down Expand Up @@ -183,6 +184,7 @@ class Header:
"""


@final
@slotted_freezable
@dataclass
class Block:
Expand Down Expand Up @@ -229,6 +231,7 @@ class Block:
"""


@final
@slotted_freezable
@dataclass
class Log:
Expand Down Expand Up @@ -261,6 +264,7 @@ class Log:
"""


@final
@slotted_freezable
@dataclass
class Receipt:
Expand Down
Loading
Loading