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

feat/indexer hotfixes #1383

Merged
merged 3 commits into from
Sep 9, 2024
Merged

feat/indexer hotfixes #1383

merged 3 commits into from
Sep 9, 2024

Conversation

altergui
Copy link
Contributor

@altergui altergui commented Sep 9, 2024

  • indexer: hotfix 0013_recreate_table_transactions
  • indexer: optimize idx.BlockList performance

turns out, some transactions in stage were indexed twice (same hash but different ID),
this likely happened during last chain upgrade. handle this situation gracefully by
simply replacing the duplicate entries.
@coveralls
Copy link

coveralls commented Sep 9, 2024

Pull Request Test Coverage Report for Build 10772047373

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 19 of 46 (41.3%) changed or added relevant lines in 5 files are covered.
  • 28 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.1%) to 62.265%

Changes Missing Coverage Covered Lines Changed/Added Lines %
vochain/indexer/db/blocks.sql.go 6 12 50.0%
vochain/indexer/block.go 7 16 43.75%
vochain/indexer/db/db.go 4 16 25.0%
Files with Coverage Reduction New Missed Lines %
vochain/indexer/block.go 2 21.88%
vochain/state/account.go 2 67.46%
vochain/transaction/election_tx.go 2 62.13%
vochain/indexer/process.go 7 74.34%
vochain/indexer/db/blocks.sql.go 15 35.37%
Totals Coverage Status
Change from base Build 10737162384: -0.1%
Covered Lines: 16791
Relevant Lines: 26967

💛 - Coveralls

turns out, a unified query with `COUNT(*) OVER() AS total_count` is 10x slower
than two separate queries `SELECT *` and `SELECT COUNT(*)`

also, optimize even further (~1000x) for the most common query:
when listing all blocks without filters, don't even count, just return last height

the benchmark code used to test is included
@altergui altergui force-pushed the feat/indexer-hotfixes branch from 631f45d to c3cf08a Compare September 9, 2024 09:57
due to how the indexer is organized, if an organization hasn't created yet any election,
EntityExists returns false although the account does exist.
Copy link

github-actions bot commented Sep 9, 2024

This PR introduces the following changes in the developer-portal documentation:

diff --git a/swaggers/vocdoni-api.yaml b/swaggers/vocdoni-api.yaml
index d473e57..1994085 100644
--- a/swaggers/vocdoni-api.yaml
+++ b/swaggers/vocdoni-api.yaml
@@ -3353,6 +3353,8 @@ components:
       type: object
     models.NewProcessTx:
       properties:
+        faucetPackage:
+          $ref: '#/components/schemas/models.FaucetPackage'
         nonce:
           type: integer
         process:
@@ -3650,6 +3652,8 @@ components:
           type: string
         duration:
           type: integer
+        faucetPackage:
+          $ref: '#/components/schemas/models.FaucetPackage'
         nonce:
           type: integer
         processId:

Copy link
Member

@elboletaire elboletaire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YOLO VI FUNSIONAR

@altergui altergui merged commit 3940463 into main Sep 9, 2024
11 checks passed
@altergui altergui deleted the feat/indexer-hotfixes branch September 9, 2024 11:32
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