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

feat(fw): add eest utils and improve user repo init experience #461

Closed

Conversation

spencer-tb
Copy link
Collaborator

@spencer-tb spencer-tb commented Feb 28, 2024

🗒️ Description

Initializes an EEST utils entry point that provides common eest related commands:

  1. eest init: Initializes the repo by installing all the relevant packages.
  2. eest clean: Cleans up all generated folders and files.
  3. eest reset: Perfoms a clean and initialization.

Ideally in the future we can add more flags/commands for commonly run local workflows.

Removes solc as an installation dependency

Additionally, this PR adds solc-select to the install requires part of setup.cfg and the tox.ini file. Solc select is a python command line utility used to install and switch between stable solc versions easily: https://github.com/crytic/solc-select, it's similar to pyenv.

As we aim to always stay up to date with the latest stable solidity compiler, solc-select allows us to do this using:

solc-select use latest --always-install

Unfortunately we can't fully rely on the latest version, as from the 0.8.22 release notes:

IMPORTANT NOTE:
This release deprecates support for EVM versions older than Constantinople for the reason of ruling out the need to maintain multiple complex code paths or workarounds for ancient EVM versions. In case you rely on the support for such EVM versions, please reach out to us.

Hence we in the future we should additionally always support a solc version below 0.8.22 for filling tests that are older than Constantinople. Ideally this is something we enforce within the framework. This PR additionally installs version 0.8.21 within the venv, but it is not used within the framework.

Replaces Windows with WSL

Its unlikely that users of this repo use Windows, given that most open source contributors develop on unix based systems.

As solc-select doesn't fully support Windows, and other PRs including: #453 only work for unix based systems - it made sense to replace the support of Windows for WSL within EEST. Due to this the documentation has been updated to support the latter, making it easy for users to get set up with WSL on there Windows machine for all EEST related development.

Updates to workflows

Since solc is removed as a dependency, the github workflows are updated to account for this. Now all workflows run with the latest stable solc binary. Additional changes:

  • Bumped up the python version within fixtures.yaml.
  • Renamed test.yaml to tox.yaml to better align with what the workflow does.

Remaining Todos

  • Replace Windows in docs with WSL.
  • Update github workflows.
  • Add documentation for eest utils.

Future Todos

  • Add the version command to replace fill --version-info.
  • Force test filling for forks before Constantinople to require version 0.8.21.

🔗 Related Issues

None

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@spencer-tb spencer-tb added type:feat type: Feature scope:fw Scope: Framework (evm|tools|forks|pytest) labels Feb 28, 2024
Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

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

Really like this idea - added a few quick thoughts!

src/entry_points/eest_utils.py Outdated Show resolved Hide resolved
docs/getting_started/quick_start.md Outdated Show resolved Hide resolved
src/entry_points/eest_utils.py Outdated Show resolved Hide resolved
src/entry_points/eest_utils.py Outdated Show resolved Hide resolved
src/entry_points/eest_utils.py Outdated Show resolved Hide resolved
stubs/logger.pyi Outdated Show resolved Hide resolved
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Looks awesome! Just a couple of comments.

src/entry_points/eest_utils.py Outdated Show resolved Hide resolved
src/entry_points/eest_utils.py Outdated Show resolved Hide resolved
@spencer-tb
Copy link
Collaborator Author

spencer-tb commented Feb 29, 2024

As highlighted by @danceratopz: we should be careful when fully deprecating all other solc versions, pointing out from version 0.8.22:

IMPORTANT NOTE:
This release deprecates support for EVM versions older than Constantinople for the reason of ruling out the need to maintain multiple complex code paths or workarounds for ancient EVM versions. In case you rely on the support for such EVM versions, please reach out to us.

Hence I have added the installation of both solc 0.8.21 and "latest" within: 5652f31

The optimal solution moving forward in my opinion is to always support solc 0.8.21, and the latest version. For forks that are < Constinople we use version 0.8.21. For all others we use the latest version determined by solc-select.

Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

More suggestions :)

src/entry_points/eest_utils.py Outdated Show resolved Hide resolved
src/entry_points/eest_utils.py Outdated Show resolved Hide resolved
src/entry_points/eest_utils.py Outdated Show resolved Hide resolved
@spencer-tb spencer-tb changed the title feat(fw): add eest utils entry point feat(fw): add eest utils and improve user repo init experience Mar 4, 2024
@spencer-tb spencer-tb added the scope:docs Scope: Documentation label Mar 4, 2024
@spencer-tb
Copy link
Collaborator Author

This is getting messy so setting this to WIP.

I'm planning to split this into 2 PRs now:

  1. for the basic eest utils commands.
  2. for the deprecation solc as a required dependency. It looks like I can remove a lot more code.

@marioevz
Copy link
Member

marioevz commented Apr 2, 2024

It would be really nice to add something like a wizard to create a new test. It could ask questions like:

  • What fork is the test for?
  • Is it a new EIP?
  • What type of test: blockchain or state test?
    The proceed to create the folders and a basic python file, and also the __init__.py.

@spencer-tb spencer-tb marked this pull request as draft June 7, 2024 04:51
@spencer-tb spencer-tb mentioned this pull request Jun 7, 2024
7 tasks
@danceratopz
Copy link
Member

It would be really nice to add something like a wizard to create a new test. It could ask questions like:

* What fork is the test for?

* Is it a new EIP?

* What type of test: blockchain or state test?
  The proceed to create the folders and a basic python file, and also the `__init__.py`.

Nice idea 😄 #950

@danceratopz
Copy link
Member

Shame this didn't get over the finish line, great ideas! In the meantime, most of the pain points addressed here have been solved via:

I just opened an issue for a clean command, that would still be a welcome addition imo: #976

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:docs Scope: Documentation scope:fw Scope: Framework (evm|tools|forks|pytest) type:feat type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants