Skip to content

Commit

Permalink
Run Shanghai through core tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fselmo committed Feb 28, 2023
1 parent f6f23b6 commit 6279e21
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions eth/chains/mainnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
MuirGlacierVM,
ParisVM,
PetersburgVM,
ShanghaiVM,
SpuriousDragonVM,
TangerineWhistleVM,
)
Expand Down Expand Up @@ -126,6 +127,7 @@ class MainnetHomesteadVM(MainnetDAOValidatorVM):
)
POS_MAINNET_VMS = (
ParisVM,
ShanghaiVM,
)

MAINNET_VMS = MINING_MAINNET_VMS + POS_MAINNET_VMS
Expand Down
3 changes: 3 additions & 0 deletions eth/tools/builder/chain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
arrow_glacier_at,
gray_glacier_at,
paris_at,
shanghai_at,
latest_mainnet_at,
)

Expand All @@ -51,6 +52,7 @@
)
pos_mainnet_fork_at_fns = (
paris_at,
shanghai_at,
)
mainnet_fork_at_fns = mining_mainnet_fork_at_fns + pos_mainnet_fork_at_fns

Expand Down Expand Up @@ -86,6 +88,7 @@ class API:
arrow_glacier_at = staticmethod(arrow_glacier_at)
gray_glacier_at = staticmethod(gray_glacier_at)
paris_at = staticmethod(paris_at)
shanghai_at = staticmethod(shanghai_at)

# iterable of the fork specific functions
mainnet_fork_at_fns = mainnet_fork_at_fns
Expand Down
4 changes: 3 additions & 1 deletion eth/tools/builder/chain/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
ArrowGlacierVM,
GrayGlacierVM,
ParisVM,
ShanghaiVM,
)


Expand Down Expand Up @@ -250,8 +251,9 @@ def dao_fork_at(dao_fork_block_number: BlockNumber,
arrow_glacier_at = fork_at(ArrowGlacierVM)
gray_glacier_at = fork_at(GrayGlacierVM)
paris_at = fork_at(ParisVM)
shanghai_at = fork_at(ShanghaiVM)

latest_mainnet_at = paris_at
latest_mainnet_at = shanghai_at

GENESIS_DEFAULTS = cast(
Tuple[Tuple[str, Union[BlockNumber, int, None, bytes, Address, Hash32]], ...],
Expand Down
2 changes: 1 addition & 1 deletion eth/tools/fixtures/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
Type,
)

from eth.vm.forks.shanghai import ShanghaiVM
from eth_utils.toolz import (
assoc,
first,
Expand Down Expand Up @@ -55,6 +54,7 @@
LondonVM,
GrayGlacierVM,
ParisVM,
ShanghaiVM,
)


Expand Down
3 changes: 3 additions & 0 deletions eth/vm/forks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@
from .paris import ( # noqa: F401
ParisVM,
)
from .shanghai import ( # noqa: F401
ShanghaiVM,
)
5 changes: 4 additions & 1 deletion tests/core/builder-tools/test_chain_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
name,
paris_at,
petersburg_at,
shanghai_at,
spurious_dragon_at,
tangerine_whistle_at,
)
Expand All @@ -43,6 +44,7 @@
ArrowGlacierVM,
GrayGlacierVM,
ParisVM,
ShanghaiVM,
)


Expand Down Expand Up @@ -100,7 +102,8 @@ def test_chain_builder_construct_chain_vm_configuration_multiple_forks():
(arrow_glacier_at, ArrowGlacierVM),
(gray_glacier_at, GrayGlacierVM),
(paris_at, ParisVM),
(latest_mainnet_at, ParisVM), # this will change whenever the next upgrade is locked
(shanghai_at, ShanghaiVM),
(latest_mainnet_at, ShanghaiVM), # this will change whenever the next upgrade is locked
)
)
def test_chain_builder_construct_chain_fork_specific_helpers(fork_fn, vm_class):
Expand Down

0 comments on commit 6279e21

Please sign in to comment.