Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-refactor pre-EOF #2106

Merged
merged 2 commits into from May 4, 2023

Conversation

fselmo
Copy link
Collaborator

@fselmo fselmo commented May 3, 2023

Context: EOF will no longer be in Cancun and the bytecode does not look like the current version of the ethereum/tests that are in our fixture directory. That update of the fixture will come in a separate PR. This change in the structure of the tests puts our code base mostly back to where it was to prepare for EOF implementation.


This PR puts the state of the Computation class hierarchy mostly back to where it was, keeping some good cleanup and updating the ComputationAPI to match properties implemented in the BaseComputation implementation class.

Some of the earlier ethereum/tests pointed to EOF code within the bytecode, not at the start. This led to a refactoring for the class architecture to make it work with our current model, with the bigger refactor PR from last week. With the updated tests (and checking against the EIPs), it would be best to put the state of the Computation hierarchy mostly back to where it was so as to not break too much of the existing structure. Massaging EOF into this model won't require as drastic of an architecture change.

Since there won't be a release until all these changes are in, the most this does is muddy the commit history / git blame a bit 馃檨. At least we gained a touch of housekeeping along the way.

How was it fixed?

  • Refactor away the separation of MessageComputation to make room for other *Computation classes and return to the {ForkName}Computation being the overarching class that takes care of applying messages to state and "applying" itself during bytecode execution.

Note: The newsfragment for the previous refactor PR (#2097) was removed and replaced with the one from this PR.

Todo:

  • Clean up commit history (maybe a bit too much)
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

Put the state of the Computation class hierarchy mostly back to where it was, keeping some good cleanup and updating the ComputationAPI to match properties implemented in the base computation implementation class.

Some of the earlier `ethereum/tests` pointed to EOF code within the bytecode, not at the start. This led to some wrong class architecting to make it work with our current model, with the bigger refactor commit from last week. It would be best to put the state of the Computation hierarchy mostly back to how it was so as to not break too much of the existing structure. Massaging EOF into this model won't be too difficult with the (proper) way the EOF tests are written now.

Since there won't be a release until all these changes are in, the most this does is muddy the commit history a bit. But at least we gained a touch of housekeeping along the way.
@fselmo fselmo force-pushed the re-refactor-computation-and-executor branch from a1ef2b7 to 6b026c4 Compare May 3, 2023 20:37
@fselmo fselmo marked this pull request as ready for review May 3, 2023 20:55
@fselmo fselmo requested review from kclowes and pacrob May 3, 2023 20:55
docs/api/vm/api.vm.forks.rst Outdated Show resolved Hide resolved
Copy link
Collaborator

@pacrob pacrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit, otherwise lgtm!

Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: !

@fselmo fselmo force-pushed the re-refactor-computation-and-executor branch from c0ad110 to 5ef8742 Compare May 4, 2023 19:38
@fselmo fselmo merged commit 42593c5 into ethereum:master May 4, 2023
1 of 33 checks passed
@fselmo fselmo deleted the re-refactor-computation-and-executor branch May 4, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants