-
Notifications
You must be signed in to change notification settings - Fork 9
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): prevent race conditions in contract deployment #704
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… conditions - Added healthcheck to hardhat service in docker-compose.yml - Modified Dockerfile.hardhat to deploy contracts after node is ready - Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash.
- Changed hardhat artifacts from bind mount to named volume - This ensures correct permissions are maintained - Fixes CI/CD pipeline issues with hardhat compilation
I’m not sure why I’m encountering these errors. I’ve been running My Docker Versions:
|
Quality Gate failedFailed conditions |
cristiam86
approved these changes
Dec 10, 2024
4 tasks
cristiam86
added a commit
that referenced
this pull request
Dec 10, 2024
* chore(deps): update dependency @vue/eslint-config-prettier to v10 * fix: adding Hardhat Dockerfile in GitHub Workflow (#693) * fix(hardhat): prevent race conditions in contract deployment (#704) * fix(hardhat): Add contract deployment and healthcheck to prevent race conditions - Added healthcheck to hardhat service in docker-compose.yml - Modified Dockerfile.hardhat to deploy contracts after node is ready - Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash. * fix: use named volume for hardhat artifacts to fix permissions issue - Changed hardhat artifacts from bind mount to named volume - This ensures correct permissions are maintained - Fixes CI/CD pipeline issues with hardhat compilation * chore(docker): add curl to Dockerfile.hardhat and update healthcheck method * chore(docker): merge RUN instructions and sort package names in Dockerfile * fix: change health check command to nc instead of curl * fix: healthcheck trying curl with increased retries --------- Co-authored-by: kstroobants <[email protected]> * fix: catch exception to keep loop running (#705) Co-authored-by: Cristiam Da Silva <[email protected]> * fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707) Co-authored-by: Cristiam Da Silva <[email protected]> * chore: Update reviewers for renovate (#694) Co-authored-by: Cristiam Da Silva <[email protected]> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]> Co-authored-by: Miguel Paya <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: Cristiam Da Silva <[email protected]> Co-authored-by: Agustín Díaz <[email protected]>
cristiam86
added a commit
that referenced
this pull request
Dec 10, 2024
* chore(deps): update dependency @vue/eslint-config-prettier to v10 * fix: adding Hardhat Dockerfile in GitHub Workflow (#693) * fix(hardhat): prevent race conditions in contract deployment (#704) * fix(hardhat): Add contract deployment and healthcheck to prevent race conditions - Added healthcheck to hardhat service in docker-compose.yml - Modified Dockerfile.hardhat to deploy contracts after node is ready - Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash. * fix: use named volume for hardhat artifacts to fix permissions issue - Changed hardhat artifacts from bind mount to named volume - This ensures correct permissions are maintained - Fixes CI/CD pipeline issues with hardhat compilation * chore(docker): add curl to Dockerfile.hardhat and update healthcheck method * chore(docker): merge RUN instructions and sort package names in Dockerfile * fix: change health check command to nc instead of curl * fix: healthcheck trying curl with increased retries --------- Co-authored-by: kstroobants <[email protected]> * fix: catch exception to keep loop running (#705) Co-authored-by: Cristiam Da Silva <[email protected]> * fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707) Co-authored-by: Cristiam Da Silva <[email protected]> * chore: Update reviewers for renovate (#694) Co-authored-by: Cristiam Da Silva <[email protected]> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]> Co-authored-by: Miguel Paya <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: Cristiam Da Silva <[email protected]> Co-authored-by: Agustín Díaz <[email protected]>
cristiam86
added a commit
that referenced
this pull request
Dec 10, 2024
…698) * chore(deps): update dependency @vue/eslint-config-typescript to v14 * fix: adding Hardhat Dockerfile in GitHub Workflow (#693) * fix(hardhat): prevent race conditions in contract deployment (#704) * fix(hardhat): Add contract deployment and healthcheck to prevent race conditions - Added healthcheck to hardhat service in docker-compose.yml - Modified Dockerfile.hardhat to deploy contracts after node is ready - Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash. * fix: use named volume for hardhat artifacts to fix permissions issue - Changed hardhat artifacts from bind mount to named volume - This ensures correct permissions are maintained - Fixes CI/CD pipeline issues with hardhat compilation * chore(docker): add curl to Dockerfile.hardhat and update healthcheck method * chore(docker): merge RUN instructions and sort package names in Dockerfile * fix: change health check command to nc instead of curl * fix: healthcheck trying curl with increased retries --------- Co-authored-by: kstroobants <[email protected]> * fix: catch exception to keep loop running (#705) Co-authored-by: Cristiam Da Silva <[email protected]> * fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707) Co-authored-by: Cristiam Da Silva <[email protected]> * chore: Update reviewers for renovate (#694) Co-authored-by: Cristiam Da Silva <[email protected]> * chore(deps): update dependency @vue/eslint-config-typescript to v14 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]> Co-authored-by: Miguel Paya <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: Cristiam Da Silva <[email protected]> Co-authored-by: Agustín Díaz <[email protected]>
🎉 This PR is included in version 0.29.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
cristiam86
added a commit
that referenced
this pull request
Dec 11, 2024
* chore(deps): update dependency @vue/eslint-config-prettier to v10 (#697) * chore(deps): update dependency @vue/eslint-config-prettier to v10 * fix: adding Hardhat Dockerfile in GitHub Workflow (#693) * fix(hardhat): prevent race conditions in contract deployment (#704) * fix(hardhat): Add contract deployment and healthcheck to prevent race conditions - Added healthcheck to hardhat service in docker-compose.yml - Modified Dockerfile.hardhat to deploy contracts after node is ready - Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash. * fix: use named volume for hardhat artifacts to fix permissions issue - Changed hardhat artifacts from bind mount to named volume - This ensures correct permissions are maintained - Fixes CI/CD pipeline issues with hardhat compilation * chore(docker): add curl to Dockerfile.hardhat and update healthcheck method * chore(docker): merge RUN instructions and sort package names in Dockerfile * fix: change health check command to nc instead of curl * fix: healthcheck trying curl with increased retries --------- Co-authored-by: kstroobants <[email protected]> * fix: catch exception to keep loop running (#705) Co-authored-by: Cristiam Da Silva <[email protected]> * fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707) Co-authored-by: Cristiam Da Silva <[email protected]> * chore: Update reviewers for renovate (#694) Co-authored-by: Cristiam Da Silva <[email protected]> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]> Co-authored-by: Miguel Paya <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: Cristiam Da Silva <[email protected]> Co-authored-by: Agustín Díaz <[email protected]> * chore(deps): update sonarsource/sonarcloud-github-action action to v4 (#696) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cristiam Da Silva <[email protected]> * chore(deps): update node.js to v22 (#695) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cristiam Da Silva <[email protected]> * chore(deps): update codecov/codecov-action action to v5 (#660) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cristiam Da Silva <[email protected]> * chore(deps): update dependency pre-commit to v4 (#557) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cristiam Da Silva <[email protected]> * chore(deps): update dependency @types/chai to v5 (#551) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cristiam Da Silva <[email protected]> * fix(deps): update all non-major dependencies (#534) * fix(deps): update all non-major dependencies * remove trailing whitespace --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Den <[email protected]> Co-authored-by: Cristiam Da Silva <[email protected]> * chore(deps): update dependency @vitejs/plugin-vue-jsx to v4 (#514) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cristiam Da Silva <[email protected]> * chore: updated target branch to staging * chore: update dependencies * chore(deps): update dependency @vue/eslint-config-prettier to v10 (#716) * chore(deps): update dependency @vue/eslint-config-prettier to v10 * fix: adding Hardhat Dockerfile in GitHub Workflow (#693) * fix(hardhat): prevent race conditions in contract deployment (#704) * fix(hardhat): Add contract deployment and healthcheck to prevent race conditions - Added healthcheck to hardhat service in docker-compose.yml - Modified Dockerfile.hardhat to deploy contracts after node is ready - Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash. * fix: use named volume for hardhat artifacts to fix permissions issue - Changed hardhat artifacts from bind mount to named volume - This ensures correct permissions are maintained - Fixes CI/CD pipeline issues with hardhat compilation * chore(docker): add curl to Dockerfile.hardhat and update healthcheck method * chore(docker): merge RUN instructions and sort package names in Dockerfile * fix: change health check command to nc instead of curl * fix: healthcheck trying curl with increased retries --------- Co-authored-by: kstroobants <[email protected]> * fix: catch exception to keep loop running (#705) Co-authored-by: Cristiam Da Silva <[email protected]> * fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707) Co-authored-by: Cristiam Da Silva <[email protected]> * chore: Update reviewers for renovate (#694) Co-authored-by: Cristiam Da Silva <[email protected]> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]> Co-authored-by: Miguel Paya <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: Cristiam Da Silva <[email protected]> Co-authored-by: Agustín Díaz <[email protected]> * chore(deps): update node.js to v22 (#717) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cristiam Da Silva <[email protected]> * chore: updated frontend dependencies config * fix: dependencies * chore(deps): update dependency @vue/eslint-config-typescript to v14 (#698) * chore(deps): update dependency @vue/eslint-config-typescript to v14 * fix: adding Hardhat Dockerfile in GitHub Workflow (#693) * fix(hardhat): prevent race conditions in contract deployment (#704) * fix(hardhat): Add contract deployment and healthcheck to prevent race conditions - Added healthcheck to hardhat service in docker-compose.yml - Modified Dockerfile.hardhat to deploy contracts after node is ready - Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash. * fix: use named volume for hardhat artifacts to fix permissions issue - Changed hardhat artifacts from bind mount to named volume - This ensures correct permissions are maintained - Fixes CI/CD pipeline issues with hardhat compilation * chore(docker): add curl to Dockerfile.hardhat and update healthcheck method * chore(docker): merge RUN instructions and sort package names in Dockerfile * fix: change health check command to nc instead of curl * fix: healthcheck trying curl with increased retries --------- Co-authored-by: kstroobants <[email protected]> * fix: catch exception to keep loop running (#705) Co-authored-by: Cristiam Da Silva <[email protected]> * fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707) Co-authored-by: Cristiam Da Silva <[email protected]> * chore: Update reviewers for renovate (#694) Co-authored-by: Cristiam Da Silva <[email protected]> * chore(deps): update dependency @vue/eslint-config-typescript to v14 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]> Co-authored-by: Miguel Paya <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: Cristiam Da Silva <[email protected]> Co-authored-by: Agustín Díaz <[email protected]> * chore(deps): update codecov/codecov-action action to v5 (#719) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cristiam Da Silva <[email protected]> * fix: docker python images version * fix: removed unused dependencies --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]> Co-authored-by: Miguel Paya <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: kstroobants <[email protected]> Co-authored-by: Agustín Díaz <[email protected]> Co-authored-by: Den <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Why
A race condition was causing the jsonrpc service to attempt accessing hardhat accounts before they were available. This would cause:
Fixes #702
Testing done
docker compose up
cycles to verify consistent initializationDecisions made
Checks
Reviewing tips
User facing release notes
Fixed an initialization issue that could cause the system to fail when starting up. The service now properly ensures all blockchain components are ready before beginning operations, providing a more stable environment for transactions and consensus operations.