-
Notifications
You must be signed in to change notification settings - Fork 9
feat: use the graph for event sync #55
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements event synchronization using The Graph to address RPC instability and latency issues during event retrieval. Key changes include updating error handling and type conversions in the contracts module, refactoring functions in the CLI to use new helper methods (e.g. get_address_from_private_key), and adding new configuration options for The Graph integration.
Reviewed Changes
Copilot reviewed 72 out of 72 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/external_api/contracts/error.rs | Updates error variants and reorders error attributes |
| src/external_api/contracts/convert.rs | Adds conversion functions between different blockchain types |
| src/cli/mod.rs | Refactors address retrieval and changes type from H256 to B256 |
| src/cli/interactive.rs | Corrects address duplication logic using HashMap entry API |
| src/cli/export_deposit_accounts.rs | Updates function signatures to accept provider and B256 types |
| src/cli/console.rs | Renames initialize_console to clear_console |
| src/cli/configure.rs | Migrates from ethers to alloy utilities and updates parsing logic |
| src/cli/balance_validation.rs | Adjusts gas price retrieval and balance validations |
| src/cli/availability.rs | Fixes typo in function name (availability) |
| src/cli/accounts_status.rs | Refactors withdrawal address display and balance retrieval |
| docs/* | Fixes several typos and grammatical issues in documentation |
| config/* | Adds new configuration fields for The Graph integration |
| abi/ERC20.json | Adds the ERC20 ABI definition |
| Cargo.toml | Updates versions and dependency definitions |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the event retrieval mechanism by replacing RPC-based event queries with The Graph, while also refactoring various modules to use alloy types instead of ethers types and correcting several typos.
- Updated error handling and type conversions in contracts and CLI modules
- Refactored configuration and dependency management in Cargo.toml and config files
- Fixed assorted spelling mistakes in documentation
Reviewed Changes
Copilot reviewed 72 out of 72 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/external_api/contracts/error.rs | Updated error definitions with alloy types and additional variants for contract-related errors |
| src/cli/mod.rs | Adjusted function calls to use updated utilities and state initialization |
| src/cli/interactive.rs | Improved deposit address duplication check using hash map entries |
| src/cli/export_deposit_accounts.rs | Modified function signatures to accept alloy types and provider reference |
| src/cli/console.rs | Renamed console initialization function to clear_console and updated logging |
| src/cli/configure.rs | Refactored withdrawal key input, updated parsing logic and utility calls |
| src/cli/balance_validation.rs | Corrected typo in function call and updated provider usage for gas price retrieval |
| src/cli/availability.rs | Fixed spelling in function name from check_avaliability to check_availability |
| src/cli/accounts_status.rs | Updated withdrawal address display logic and provider usage for balance checks |
| docs/* | Spelling corrections and clarifications in CLI usage documentation |
| config/*.toml | Added Graph configuration options and updated retry interval values |
| Cargo.toml | Removed ethers dependency and updated self_update and alloy dependency configuration |
RPC-based event retrieval often becomes unstable depending on the RPC load conditions and also takes time. This PR solves this problem by replacing event retrieval with The Graph