-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Ensure concurrency safety across when downloading compilers for multiple hardhat projects #3818
Ensure concurrency safety across when downloading compilers for multiple hardhat projects #3818
Conversation
Introduce a new wrapper around the compiler downloader that ensures multiple downloader calls within a transaction are guarenteed to execute sequentially. This fixes a concurrency issue that arises from the separation of the `isCompilerDownloaded` and `downloadCompiler` calls, where the previous call to `downloadCompiler` was safe, but `isCompilerDownloaded` was not. By allowing the composition of calls via `transaction`, and only exposing the underlying downloader via the `transaction` method, we can expose a much safer api surface for manging the downloads of multiple compilers.
🦋 Changeset detectedLatest commit: 63f5bd2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@fvictorio Friendly ping on this as our CI pipelines are pretty flaky when we cache bust the compilers. LMK if you need anything else from me to expedite this! |
The issue has been resolved in this PR |
Introduces a new wrapper around the compiler downloader that ensures multiple downloader calls within a transaction are guaranteed to execute sequentially.
This fixes a concurrency issue that arises from the separation of the
isCompilerDownloaded
anddownloadCompiler
calls, where the previous call todownloadCompiler
was safe, butisCompilerDownloaded
was not.By allowing the composition of calls via
transaction
, and only exposing the underlying downloader via thetransaction
method, we can expose a much safer API surface for managing the downloads of multiple compilers.This also has the nice side effect of downloading the same compiler once and only once. Before this bug fix, we'd be seeing multiple re-downloads of the same compiler within our project, https://github.com/smartcontractkit/chainlink
I ended up creating a wrapper class rather than adding this functionality to the existing compiler class to preserve the current interface that it adheres to, so we can keep using the same interfaces for future compiler implementations without having to think about concurrency handling at the same time.