Skip to content

Conversation

@kbizikav
Copy link
Collaborator

@kbizikav kbizikav commented May 28, 2025

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

@kbizikav kbizikav requested a review from Copilot May 30, 2025 11:10
Copy link
Contributor

Copilot AI left a 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

kbizikav and others added 5 commits May 30, 2025 18:11
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kbizikav kbizikav changed the title [WIP] feat: use the graph for event sync feat: use the graph for event sync Jun 3, 2025
@kbizikav kbizikav requested a review from Copilot June 3, 2025 03:50
Copy link
Contributor

Copilot AI left a 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

@kbizikav kbizikav merged commit e4f458b into main Jun 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants