You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, for class Prague, there's currently a single definition of, for example, the system_contracts method that contains all the contracts added by each EIP included in Prague:
But we could theoretically split this method to be defined in a separate class for each EIP:
classEIP6110:
@classmethoddefsystem_contracts(cls, block_number: int=0, timestamp: int=0) ->List[Address]:
"""EIP-6110 introduces the beacon chain as a system contract."""return [
Address(0x00000000219AB540356CBB839CBE05303D7705FA),
] +super(EIP6110, cls).system_contracts(block_number, timestamp)
And then Prague simply inherit all EIPs on definition:
classPrague(Cancun, EIP6110, EIP7002, ...
Theoretically we could now know the EIP composition of every fork and enable/disable tests for the forks that incorporate the EIP that is supposed to test:
Explore the possibility to refactor the fork definitions of
src/ethereum_test_forks/forks/forks.py
to be distributed in EIP class definitions.For example, for
class Prague
, there's currently a single definition of, for example, thesystem_contracts
method that contains all the contracts added by each EIP included in Prague:execution-spec-tests/src/ethereum_test_forks/forks/forks.py
Lines 1091 to 1099 in fef9a26
But we could theoretically split this method to be defined in a separate class for each EIP:
And then Prague simply inherit all EIPs on definition:
Theoretically we could now know the EIP composition of every fork and enable/disable tests for the forks that incorporate the EIP that is supposed to test:
Also we could more easily think of define custom forks which enable or disable certain EIPs, by dynamically redefining the fork plus some custom EIP:
And then
Prague
class could be re-defined on the fly to be:It would be more difficult to define fork with a certain EIP removed, but it would not be impossible.
The text was updated successfully, but these errors were encountered: