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

fix(hardhat): preinstall solidity compiler to speed up container startup #793

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

mpaya5
Copy link
Contributor

@mpaya5 mpaya5 commented Jan 3, 2025

Fixes #792

What

  • Added a step in the Dockerfile.hardhat to pre-download the Solidity compiler during the build process.

Why

  • To improve container startup performance by reducing the time spent downloading and compiling Solidity contracts at runtime.
  • Enhances developer experience by ensuring the environment is preconfigured.

Testing done

  • Built the Docker image and verified that the Solidity compiler is pre-downloaded during the build step.
  • Verified that the container starts without downloading the compiler again
  • Successfully deployed contracts using the updated Docker image

Decisions made

  • Decided to preinstall the compiler is to simplify the process and improve image portability.

Checks

  • I have tested this code
  • I have reviewed my own PR
  • I have created an issue for this PR
  • I have set a descriptive PR title compliant with conventional commits

Reviewing tips

  • Focus on the RUN npx hardhat compile || true addition in the Dockerfile.hardhat.
  • Verify the change aligns with the goal of improving container startup performance.

User facing release notes

  • Improved Docker Image for Hardhat: The Docker image now pre-downloads the Solidity compiler, significantly reducing container startup time and enhancing deployment efficiency.

@mpaya5 mpaya5 added bug Something isn't working run-tests labels Jan 3, 2025
@mpaya5 mpaya5 self-assigned this Jan 3, 2025
@mpaya5 mpaya5 linked an issue Jan 3, 2025 that may be closed by this pull request
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 18.21%. Comparing base (3ff73e5) to head (6380921).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #793   +/-   ##
=======================================
  Coverage   18.21%   18.21%           
=======================================
  Files         129      129           
  Lines       10076    10076           
  Branches      302      302           
=======================================
  Hits         1835     1835           
  Misses       8156     8156           
  Partials       85       85           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarqubecloud bot commented Jan 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Contributor

@AgustinRamiroDiaz AgustinRamiroDiaz left a comment

Choose a reason for hiding this comment

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

LGTM

@cristiam86 cristiam86 merged commit c8d7fe9 into main Jan 5, 2025
31 of 32 checks passed
Copy link
Contributor

github-actions bot commented Jan 6, 2025

🎉 This PR is included in version 0.32.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released run-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hardhat: Downloading compiler
3 participants