Skip to content

merge develop into main (sql view optimization changes) #116

Open
elai-boosted wants to merge 28 commits intodevelopfrom
main
Open

merge develop into main (sql view optimization changes) #116
elai-boosted wants to merge 28 commits intodevelopfrom
main

Conversation

@elai-boosted
Copy link
Collaborator

What's new?

Please include a summary of the change and any issues fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

How was this tested?

Please include a summary of the testing conducted to validate the change(s) introduced in this PR. Include screenshots as applicable.

Please use the following checklist as a guideline and remove any irrelevant options

  • Run locally and ensure all streams run without errors

ImShady and others added 11 commits October 10, 2025 19:29
* feat: enhance datadog metrics reporting (#95)

* improve metrics reporting for db stats and blocks processing rate

* remove excess extra lines

* adds simple unit tests (#98)

* feat(axb-156): Updated registered voters view to incorporate voting power from rewards  (#97)

* updated registered voters view

* update

* updated comments

* View creation improvements (#99)

* decouples view creation from indexer start to avoid blocking indexer on sql errors

* executes view queries as a transaction, uses drop view + create view rather than create or replace

* sets config variables to backfill testnet from block 207,230,000 (#100)

* adjust retry delay

* disable database metrics capture

* complete backfill, returning to live mode (#101)

* Introduce env-based config selection for network indexing (#104)

* Setup 3 mainnet environments (#102)

* Fork main as-is

* Remove testnet toml

* Update configs for truth as of right now

* Rename dev to development

* Pick up correct config

* Switch back to INDEXER_ENVIRONMENT

* Set new mainnet contract

* added staging workflow

---------

Co-authored-by: Youssef-Boosted <[email protected]>

* Partially revert "Setup 3 mainnet environments" (#103)

* Revert "Setup 3 mainnet environments (#102)"

This reverts commit fbae78a.

* keep the staging gh pipeline

* Introduce env-based config selection for network indexing

---------

Co-authored-by: jefag <[email protected]>
Co-authored-by: Youssef-Boosted <[email protected]>

---------

Co-authored-by: Pierre Haroun <[email protected]>
Co-authored-by: elai-boosted <[email protected]>
Co-authored-by: Pierre Haroun <[email protected]>
Co-authored-by: jefag <[email protected]>
Co-authored-by: Youssef-Boosted <[email protected]>
* enable new prod indexing

* dont deploy to old prod anymore
* preliminary optimizations to sql views

* fixes on delegation events

* updated proposal voting history
* feat(views): add unstake and withdraw events to user_activities

* fix: include unstake_all and withdraw_all events in user_activities view

* fix(sql): parse amount from logs for unstake_all and withdraw_all

* fix(sql): filter failed receipts for unstake and withdraw

* chore: add CI workflows from main (hos-dev/stg/prd)
* fix: deduplicate registered voters using ROW_NUMBER

* fix(views): deduplicate vplu by registered_voter_id to handle relayer events

* refactor(views): remove ROW_NUMBER deduplication per performance feedback, keeping vplu fix

* fix(views): apply Elaine's feedback - remove signer fallback in vplu, deduplicate delegation_events join
…torage_deposit (#123)

* fix: deduplicate registered voters using ROW_NUMBER

* fix(views): deduplicate vplu by registered_voter_id to handle relayer events

* refactor(views): remove ROW_NUMBER deduplication per performance feedback, keeping vplu fix

* fix(views): apply Elaine's feedback - remove signer fallback in vplu, deduplicate delegation_events join

* Use on_lockup_deployed + storage_deposit instead of deploy_lockup + storage_deposit

* fix(views): remove DISTINCT ON from delegation_events join to fix VP regression

The DISTINCT ON (delegator_id) was picking ft_burn events over ft_mint,
causing the delegate_event = 'ft_mint' filter to fail and making
delegating voters show their full principal balance instead of 0.

Restores the direct LEFT JOIN while keeping registered_voter_id
instead of signer_account_id for the join key.

* harden

---------

Co-authored-by: Atomauro <[email protected]>
… for duplications (#126)

* fix(views): use ft_burn amount for delegation_events.near_amount

* fix(views): remove json unnest to prevent duplicate delegation events

* fix(sql): remove unnested_logs bug from id generation
@atomauro atomauro temporarily deployed to hos-development March 4, 2026 20:04 — with GitHub Actions Inactive
@atomauro atomauro deployed to hos-production March 4, 2026 20:33 — with GitHub Actions Active
@atomauro atomauro deployed to hos-development March 23, 2026 06:00 — with GitHub Actions Active
@atomauro atomauro deployed to hos-staging March 23, 2026 06:01 — with GitHub Actions Active
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.

8 participants