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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Separate pyevm implementation from environment #134

Merged
merged 20 commits into from
Apr 17, 2024

Conversation

DanielSchiavini
Copy link
Collaborator

What I did

I have separated the environment logic from the pyevm implementation details.

  • This should make it easier for us to separate concerns in the future for example:

How I did it

  • Move all pyevm dependencies to a separate module
  • Define a clear interface using public method calls
  • Updated dependent code and fixed tests

How to verify it

  • Tests should still pass

Description for the changelog

N/A

Cute Animal Picture

image

@DanielSchiavini DanielSchiavini changed the title Refactor environment to separate it from pyevm refactor: Separate pyevm implementation from environment Feb 11, 2024
@DanielSchiavini DanielSchiavini self-assigned this Mar 22, 2024
boa/environment.py Outdated Show resolved Hide resolved
boa/environment.py Outdated Show resolved Hide resolved
boa/vm/py_evm.py Outdated
return self.vm.state.snapshot()

def anchor(self):
return self.vm.patch.anchor()
Copy link
Member

Choose a reason for hiding this comment

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

this should probably anchor evm state

boa/vm/py_evm.py Outdated Show resolved Hide resolved
boa/vm/py_evm.py Outdated Show resolved Hide resolved
boa/vm/py_evm.py Outdated Show resolved Hide resolved
Copy link
Member

@charles-cooper charles-cooper left a comment

Choose a reason for hiding this comment

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

overall design looks great! left some comments on specifics

boa/vm/py_evm.py Outdated Show resolved Hide resolved
boa/vm/py_evm.py Outdated Show resolved Hide resolved
boa/vm/py_evm.py Outdated Show resolved Hide resolved
boa/vm/py_evm.py Outdated Show resolved Hide resolved
boa/vm/py_evm.py Outdated Show resolved Hide resolved
boa/vm/py_evm.py Outdated
self.vm = self.chain.get_vm()
self.vm.__class__._state_class.account_db_class = account_db_class

self.vm.patch = VMPatcher(self.vm)
Copy link
Member

Choose a reason for hiding this comment

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

we can probably promote VMPatcher to self.patch instead of inside of self.vm

Copy link
Member

Choose a reason for hiding this comment

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

(it should probably be part of our "EVM API")

boa/vm/py_evm.py Outdated Show resolved Hide resolved
boa/environment.py Outdated Show resolved Hide resolved
@charles-cooper charles-cooper merged commit 287523f into vyperlang:master Apr 17, 2024
4 of 9 checks passed
@DanielSchiavini DanielSchiavini deleted the 104/refactor-pyevm branch April 17, 2024 18:10
DanielSchiavini added a commit to DanielSchiavini/titanoboa that referenced this pull request May 6, 2024
… assignment

This was caused by a typo, the property block_id was removed in vyperlang#134
Another typo broke the time travel tests
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.

2 participants