ethereum / execution-spec-tests

A Python framework and collection of test cases to generate test vectors for Ethereum execution clients
https://ethereum.github.io/execution-spec-tests
MIT License
88 stars 62 forks source link

feat(fw): finalize transition base class #611

Open spencer-tb opened 3 weeks ago

spencer-tb commented 3 weeks ago

We have the following methods that need to implemented for the transition fork base class:

# transition_base_fork.py

class TransitionBaseClass:
    """
    Base class for transition forks.
    """

    @classmethod
    def transitions_to(cls) -> Fork:
        """
        Returns the fork where the transition ends.
        """
        raise Exception("Not implemented")

    @classmethod
    def transitions_from(cls) -> Fork:
        """
        Returns the fork where the transition starts.
        """
        raise Exception("Not implemented")

    @classmethod
    def always_execute(cls) -> bool:
        """
        Whether the transition fork should be treated as a normal fork and all tests should
        be filled with it.
        """
        raise Exception("Not implemented")

The always execute method is required for Verkle, as we want to be able to fill all the tests at the transition. This is going to be trickier than expected as we need to make sure that we dynamically set the correct time stamp based off the number of blocks in the test.