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

Automatically download new compiler versions in contract-verifier #3257

Closed
popzxc opened this issue Nov 12, 2024 · 0 comments · Fixed by #3291
Closed

Automatically download new compiler versions in contract-verifier #3257

popzxc opened this issue Nov 12, 2024 · 0 comments · Fixed by #3291

Comments

@popzxc
Copy link
Member

popzxc commented Nov 12, 2024

Right now, all the compiler versions are included into the contract-verifier image.
It means that each time a new compiler version is released, it has to be manually added there.

What we want is to be able to download compilers on demand without having to rebuild docker images.
How it should work:

  • Compiler versions are checked periodically via GH releases.
  • These versions are marked as available.
  • If a compilation requests happens for a compiler version that is currently absent on the pod, it's downloaded from GH releases (e.g. it's lazy downloading; there is no need to download everything at start) and then persisted locally.

Considerations:

  • The implementation should work correctly even if we support parallel processing of compilation requests (e.g. if we have 2 requests to compile a contract with currently absent compiler, we should download it once, not twice).
  • The implementation should handle network errors (e.g. if download request fails, we must retry it).
  • There should be no deadlocks (e.g. if we repeatedly can't download a compiler, it should not stop processing of other requests).
github-merge-queue bot pushed a commit that referenced this issue Nov 21, 2024
)

Resolves #3257

- Adds resolver multiplexer: implementation of resolver that would go
through list of resolvers, trying to find one that works.
- Adds GH resolver: implementation of resolver that is able to fetch
releases from GH dynamically
- Adds a task to periodically (1h) update the list of supported compiler
versions.
- GH resolver has a temporary kill switch: it can be disabled by setting
`DISABLE_GITHUB_RESOLVER` env variable (in case we notice any problems).

⚠️ This PR doesn't contain any new tests, because I'm not sure if we
want to rely on the availability of GH API. Mocking relevant parts (e.g.
creating an alternative mock client for octocrab) would be _very_
troublesome, so idk if it's justified. Happy to discuss.

I've checked the functionality manually though.
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 a pull request may close this issue.

1 participant