-
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
feat(consensus): implement transaction flow script and update contracts #762
feat(consensus): implement transaction flow script and update contracts #762
Conversation
- Add Hardhat node service with Docker configuration - Configure hardhat.config.js with local network settings - Add 20 test accounts with 10,000 ETH each - Add web3 Python package to backend requirements - Update .gitignore for Hardhat artifacts and cache
- Add contract compilation setup with hardhat - Configure project structure for smart contracts - Fix file path for GhostContract.json artifact - Add necessary dependencies for contract compilation - Setup directory structure for contracts and artifacts
- Moved web3 python package into backend requirements file - Added access to compiled hardhat contract in jsonrpc service - Added database migration file so that a transaction has the ghost contract address of hardhat network - When a genlayer contract is deployed then a hardhat contract is deployed, both are linked in the CurrentState table - When a genlayer write method is executed then the new transaction gets the hardhat contract from the CurrentState table - When a genlayer transaction changes from status then a rollup transaction is created on the hardhat network - todo: remove rollup transaction table, put hardhat port in env, link genlayer account to hardhat account, check for out of gas, remove prints
…ements as it gave an import error
- Add genlayer-consensus smart contracts to hardhat/contracts directory - Update hardhat.config.js to enable new code generator (viaIR: true) - Add @openzeppelin/contracts and @openzeppelin/contracts-upgradeable dependencies - Configure hardhat Docker container for contract compilation - Verify hardhat node functionality in genlayer-studio This commit sets up the smart contract development environment with the necessary dependencies and configurations to compile and deploy genlayer-consensus contracts.
- Added migration for ghost_contract_address column in transactions table - Fixed security issues in hardhat docker configuration - Ensured proper migration sequence (0d9538be0318 -> cb34b6b353ed) Migration changes: - Added new column ghost_contract_address (String, nullable) to transactions table - Provided proper upgrade and downgrade paths - Verified migration execution and current head state TODO: Frontend issues to fix: - Methods panel not opening after transaction acceptance - Need to investigate UI response after successful transactions
- Deleted amm_adaptive.py because is not using the new syntax I will upload the new amm_adaptive.py whenevir will be ready
- Fixed contract deployment state updates for frontend synchronization - Improved contract method interactions and state management - Ensured proper state updates after contract value changes
- Add volume mappings for deployments, artifacts and cache - Implement manual deployment file saving - Update hardhat configuration for proper deployment paths This change ensures that deployed contracts persist between container restarts by saving deployment data to mounted volumes. Note: Block persistence still requires a different solution (Ganache/Geth/Besu) as Hardhat Network doesn't support state persistence. Related issue: #669
- Removed start.sh script - Incorporated start script directly into Dockerfile for streamlined execution
Removes redundant assignment of ghost_contract_address in transaction_from_dict function to improve code clarity and prevent potential inconsistencies
- Ensure non-root user is used in Dockerfile to enhance security - Adjust permissions to avoid overly permissive access (777) on /app directories - Add tests to cover deployment scripts, ensuring proper functionality and coverage
- Updated deploy_contracts.js to handle contract initialization after deployment - Added initial ConsensusService integration into server.py - Enhanced Dockerfile.hardhat with proper permissions and chainId handling - Started implementation of consensus_service.py with basic contract interactions Note: consensus_service.py still needs additional work for complete contract initialization and interaction methods.
Integrate complete contract deployment persistence in Hardhat and create ConsensusService for contract interaction. - Add deployFixture to Hardhat deployment script to handle contract initialization - Create ConsensusService class to interact with deployed contracts from backend - Add deploy_fixture method to ConsensusService as fallback initialization option - Ensure consistent contract initialization between Hardhat and backend - Load contract artifacts and addresses in ConsensusService from deployment files The deployFixture now handles all contract initialization during deployment, while ConsensusService provides a Python interface to interact with the deployed contracts. The deploy_fixture method in ConsensusService mirrors the Hardhat initialization logic but is kept as a fallback option.
- Update consensus contracts to latest version - Update deployFixture to match TransactionFlow - Modify test suite for new contract flow - Update hardhat container permissions - Add consensus-flow.js for transaction simulation
…saction-flow-script
…saction-flow-script
- Increase interval from 40s to 60s to allow more time between checks - Extend timeout from 15s to 30s for slower environments - Reduce retries from 20 to 5 but with longer intervals - Increase start period from 40s to 60s for initial container setup
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #762 +/- ##
==========================================
- Coverage 19.55% 18.21% -1.35%
==========================================
Files 129 129
Lines 10006 10076 +70
Branches 319 302 -17
==========================================
- Hits 1957 1835 -122
- Misses 7964 8156 +192
Partials 85 85 ☔ View full report in Codecov by Sentry. |
Quality Gate failedFailed conditions |
🎉 This PR is included in version 0.32.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Fixes #761
What
consensus-flow.js
script for transaction simulationDeployFixture.js
to match updatedTransactionFlow.ts
Why
Testing done
Decisions made
Checks
Reviewing tips
consensus-flow.js
DeployFixture.js
User facing release notes
The genlayer-studio now includes a new script for simulating consensus transactions. This update follow new TransactionFlow updates and improves interaction with the genlayer_explorer indexer by generating transactions. Users can now test the complete consensus flow using the new
consensus-flow.js
script.