Skip to content
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

Optimizations for Governance Transactions Queries #580

Merged
merged 26 commits into from
Jan 10, 2025

Conversation

dcshock
Copy link
Contributor

@dcshock dcshock commented Jan 9, 2025

Description

On 12/24/2024 and issue was found that impacted uptime of the Explorer API. It was determined that a single user was repeatedly querying an endpoint for governance transactions, and that the query was resulting in a long running transaction that after repeatedly being initiated would cause the service to restart. In order to resolve the issues a few performance improvements are in this PR:

  1. a caching interface has been added for a couple of the block and transaction endpoints that tend to get hit often
  2. the materialized view for validator status has been removed as it isn't necessary, and provides additional complexity that the team would rather not have to debug through
  3. the query for governance transactions has been optimized so that it responds timely

Most notable change is in the service/src/main/kotlin/io/provenance/explorer/domain/entities/Transactions.kt file.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit and integration
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

dcshock and others added 24 commits December 30, 2024 19:12
… a regular view to avoid deadlocks that occur with realtime fetches to the website
@dcshock dcshock self-assigned this Jan 9, 2025
@dcshock dcshock requested a review from a team as a code owner January 9, 2025 18:44
iramiller
iramiller previously approved these changes Jan 9, 2025
@arnabmitra
Copy link
Collaborator

ktlint is failing ..but looks good otherwise

…he 0.47.1 version on version 1.5.0

 this needs to be better...
@dcshock
Copy link
Contributor Author

dcshock commented Jan 10, 2025

ktlint is failing ..but looks good otherwise

resolved the linting issue. We'll swing back through with a linting update to ktlint 1.5.0

@dcshock dcshock merged commit 98aed22 into main Jan 10, 2025
4 checks passed
@dcshock dcshock deleted the remove-materialized-view branch January 10, 2025 16:28
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.

5 participants