ethereum / py-evm

A Python implementation of the Ethereum Virtual Machine
https://py-evm.readthedocs.io/en/latest/
MIT License
2.26k stars 650 forks source link

Refactor current VM computations to be message computations #2097

Closed fselmo closed 1 year ago

fselmo commented 1 year ago

What was wrong?

Related to Issue #2089

Computations currently require a message and a transaction context. This is because, up until EOF, computations were built from a message with transaction-like fields. This PR opens support for computations that do not come from messages. One such example will be an EOF computation which is built from instructions in the bytecode of a message computation.

How was it fixed?

To make way for the above changes, the BaseComputation class is refactored in this PR to be more basic. It strips out the the idea that all computations rely on a message. This is now a property of the MessageComputation class that we are more familiar with, which is still configured as part of all VMs at present, and inherits from and builds upon the BaseComputation.

This PR does not attempt to add any new computation classes. It is simply paving the way for them by splitting the current BaseComputation class into these two classes.

Todo:

Cute Animal Picture

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