Skip to content

Conversation

@Alann27
Copy link
Contributor

@Alann27 Alann27 commented Jul 7, 2025

Summary

  • Removed the Relay entity and its related references across claim processing functions for simplicity and optimized structure.
  • Stopped saving some unnecessary fields (like proof, root_hash, etc) to save processing time.
  • Added numRelays, numClaimedComputedUnits, numEstimatedComputedUnits and claimedAmount to MsgCreateClaim
  • Improved proof validation status handling with fallback for better event processing
  • Replaced generation of reports using fetchPaginatedRecords with processing manually with functions that generate the reports directly in the db
  • Updated db functions of delegator rewards
  • Improved update of balances to do it in bulk of 10 instead of one by one
  • Added the followings db functions:
    • get_rewards_by_date db function
    • get_rewards_by_addresses_and_time_group_by_service
    • get_rewards_by_addresses_and_time_group_by_address_and_date

Issue

  • Some fields like proof, root_hash, etc; were being so large that they made the indexer crash, we are not using them and don't find any use for them right now.
  • We saw some low queries when updating the balances.
  • The function fetchPaginatedRecords were only returning 100 items instead all records available, causing some data like the reports to be wrong.

Type of change

Select one or more:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (specify)

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have commented my code
  • I have performed a self-review of my own code; both comments & source code
  • I create and reference any new tickets, if applicable
  • I have left TODOs throughout the codebase, if applicable

jorgecuesta and others added 11 commits June 18, 2025 12:50
- Commented out the `proof` property extraction from `msg.msg.decodedMsg` to avoid unnecessary processing of large data.
- Set the `proof` field to an empty string to prevent storage issues with oversized payloads.
- Included a comment explaining the limitation of JSONB storage in the database.
…handling

## Summary

- Removed the `Relay` entity and its related references across claim processing functions for simplicity and optimized structure.
- Adjusted query logic in database functions for claims to remove unnecessary joins and operate exclusively on `msg_create_claims`.
- Updated schema to accommodate changes, including `numRelays`, `claimedAmount`, and related fields in various entities.
- Ensure consistent and accurate data during claim and proof-related event handling.
- Changed `failureReason` default to `null` and adjusted related checks for proper null handling.
… functions that generate the reports directly in postgresql
…rds_by_addresses_and_time_group_by_address_and_date functions
@Alann27 Alann27 requested a review from jorgecuesta July 7, 2025 13:09
@Alann27 Alann27 self-assigned this Jul 7, 2025
@Alann27 Alann27 added bug Something isn't working enhancement New feature or request labels Jul 7, 2025
@Alann27 Alann27 mentioned this pull request Jul 7, 2025
10 tasks
@jorgecuesta jorgecuesta merged commit 0a85358 into main Jul 7, 2025
3 checks passed
@jorgecuesta jorgecuesta deleted the feature/enhancements-and-fixes branch July 7, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants