Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions src/ethereum/forks/arrow_glacier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
[nm]: https://github.com/NethermindEth/nethermind/releases/tag/1.11.7
""" # noqa: E501

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(13773000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(13773000)
4 changes: 2 additions & 2 deletions src/ethereum/forks/berlin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
[oe]: https://github.com/openethereum/openethereum/releases/tag/v3.2.0
""" # noqa: E501

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(12244000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(12244000)
4 changes: 2 additions & 2 deletions src/ethereum/forks/byzantium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
[p]: https://github.com/paritytech/parity/releases/tag/v1.7.6
"""

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(4370000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(4370000)
4 changes: 2 additions & 2 deletions src/ethereum/forks/cancun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
[r]: https://github.com/paradigmxyz/reth/releases/tag/v0.1.0-alpha.19
""" # noqa: E501

from ethereum.fork_criteria import ByTimestamp
from ethereum.fork_criteria import ByTimestamp, ForkCriteria

FORK_CRITERIA = ByTimestamp(1710338135)
FORK_CRITERIA: ForkCriteria = ByTimestamp(1710338135)
4 changes: 2 additions & 2 deletions src/ethereum/forks/constantinople/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
[t]: https://github.com/ethereum/trinity/releases/tag/v0.1.0-alpha.23
""" # noqa: E501

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(7280000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(7280000)
4 changes: 2 additions & 2 deletions src/ethereum/forks/dao_fork/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
[Geth 1.4.10]: https://github.com/ethereum/go-ethereum/releases/tag/v1.4.10
"""

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(1920000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(1920000)
3 changes: 3 additions & 0 deletions src/ethereum/forks/dao_fork/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
InvalidSenderError,
NonceMismatchError,
)
from ethereum.fork_criteria import ByBlockNumber

from . import FORK_CRITERIA, vm
from .blocks import Block, Header, Log, Receipt
Expand Down Expand Up @@ -271,6 +272,8 @@ def validate_header(chain: BlockChain, header: Header) -> None:
if header.parent_hash != block_parent_hash:
raise InvalidBlock

assert isinstance(FORK_CRITERIA, ByBlockNumber)

if (
header.number >= FORK_CRITERIA.block_number
and header.number < FORK_CRITERIA.block_number + Uint(10)
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/forks/frontier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Frontier is the first production-ready iteration of the Ethereum protocol.
"""

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(0)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(0)
4 changes: 2 additions & 2 deletions src/ethereum/forks/gray_glacier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
[n]: https://github.com/NethermindEth/nethermind/releases/tag/1.13.3
""" # noqa: E501

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(15050000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(15050000)
4 changes: 2 additions & 2 deletions src/ethereum/forks/homestead/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
[Geth 1.3.5]: https://github.com/ethereum/go-ethereum/releases/tag/v1.3.5
"""

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(1150000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(1150000)
4 changes: 2 additions & 2 deletions src/ethereum/forks/istanbul/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
[t]: https://github.com/ethereum/trinity/releases/tag/v0.1.0-alpha.31
"""

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(9069000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(9069000)
4 changes: 2 additions & 2 deletions src/ethereum/forks/london/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
[oe]: https://github.com/openethereum/openethereum/releases/tag/v3.3.0-rc.4
""" # noqa: E501

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(12965000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(12965000)
3 changes: 3 additions & 0 deletions src/ethereum/forks/london/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
InvalidSenderError,
NonceMismatchError,
)
from ethereum.fork_criteria import ByBlockNumber

from . import FORK_CRITERIA, vm
from .blocks import Block, Header, Log, Receipt, encode_receipt
Expand Down Expand Up @@ -319,6 +320,8 @@ def validate_header(chain: BlockChain, header: Header) -> None:
if header.gas_used > header.gas_limit:
raise InvalidBlock

assert isinstance(FORK_CRITERIA, ByBlockNumber)

expected_base_fee_per_gas = INITIAL_BASE_FEE
if header.number != FORK_CRITERIA.block_number:
# For every block except the first, calculate the base fee per gas
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum/forks/muir_glacier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
[t]: https://github.com/ethereum/trinity/releases/tag/v0.1.0-alpha.34
"""

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(9200000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(9200000)
4 changes: 2 additions & 2 deletions src/ethereum/forks/osaka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
[EIP-7910]: https://eips.ethereum.org/EIPS/eip-7910
""" # noqa: E501

from ethereum.fork_criteria import ByTimestamp
from ethereum.fork_criteria import ByTimestamp, ForkCriteria

FORK_CRITERIA = ByTimestamp(1764798551)
FORK_CRITERIA: ForkCriteria = ByTimestamp(1764798551)
4 changes: 2 additions & 2 deletions src/ethereum/forks/paris/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
[nm]: https://github.com/NethermindEth/nethermind/releases/tag/1.14.1
""" # noqa: E501

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

# The actual trigger for the Paris hardfork was The Merge occurring when
# total difficulty (the sum of the all block difficulties) reached the
# Terminal Total Difficulty value (58750000000000000000000 on Mainnet). The
# Merge is now a historical event.
FORK_CRITERIA = ByBlockNumber(15537394)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(15537394)
4 changes: 2 additions & 2 deletions src/ethereum/forks/prague/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
[EIP-7549]: https://eips.ethereum.org/EIPS/eip-7549
""" # noqa: E501

from ethereum.fork_criteria import ByTimestamp
from ethereum.fork_criteria import ByTimestamp, ForkCriteria

FORK_CRITERIA = ByTimestamp(1746612311)
FORK_CRITERIA: ForkCriteria = ByTimestamp(1746612311)
4 changes: 2 additions & 2 deletions src/ethereum/forks/shanghai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
[js]: https://github.com/ethereumjs/ethereumjs-monorepo/releases/tag/%40ethereumjs%2Fvm%406.4.0
""" # noqa: E501

from ethereum.fork_criteria import ByTimestamp
from ethereum.fork_criteria import ByTimestamp, ForkCriteria

FORK_CRITERIA = ByTimestamp(1681338455)
FORK_CRITERIA: ForkCriteria = ByTimestamp(1681338455)
4 changes: 2 additions & 2 deletions src/ethereum/forks/spurious_dragon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
[rb]: https://github.com/cryptape/ruby-ethereum/releases/tag/v0.11.0
"""

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(2675000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(2675000)
4 changes: 2 additions & 2 deletions src/ethereum/forks/tangerine_whistle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
[p]: https://github.com/openethereum/parity-ethereum/releases/tag/v1.3.8
"""

from ethereum.fork_criteria import ByBlockNumber
from ethereum.fork_criteria import ByBlockNumber, ForkCriteria

FORK_CRITERIA = ByBlockNumber(2463000)
FORK_CRITERIA: ForkCriteria = ByBlockNumber(2463000)
Loading