Skip to content

Conversation

@iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented Feb 17, 2025

TL;DR

Added validation checks for token balance materialized view to ensure data integrity.

What changed?

Added additional WHERE clause conditions in the token balances SQL query to validate that:

  • topic_2 and topic_3 are not empty
  • ids_length equals amounts_length

How to test?

  1. Execute the materialized view creation query
  2. Verify that only logs with non-empty topic_2 and topic_3 are processed
  3. Confirm that logs where ids_length matches amounts_length are included
  4. Check that malformed logs are properly filtered out

Why make this change?

To prevent processing of invalid or malformed log entries that could lead to incorrect token balance calculations. This ensures data consistency and accuracy in the materialized view.

Copy link
Contributor Author

iuwqyir commented Feb 17, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@iuwqyir iuwqyir mentioned this pull request Feb 17, 2025
@iuwqyir iuwqyir mentioned this pull request Feb 18, 2025
@iuwqyir iuwqyir marked this pull request as ready for review February 18, 2025 21:14
@iuwqyir iuwqyir requested a review from a team February 18, 2025 21:15
@iuwqyir iuwqyir merged commit a2aede6 into main Feb 19, 2025
5 of 6 checks passed
@iuwqyir iuwqyir deleted the 02-13-improve_token_balances_mv branch February 19, 2025 09:31
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.

3 participants