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

indexer: index more details about blocks #1329

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

altergui
Copy link
Contributor

needed since we started pruning the blockstore

@altergui altergui force-pushed the feat/index-blocks branch 4 times, most recently from 29dccc8 to dbdd78f Compare June 10, 2024 15:10
@altergui altergui self-assigned this Jun 10, 2024
@altergui altergui marked this pull request as ready for review June 10, 2024 15:36
@altergui
Copy link
Contributor Author

@mvdan wdyt in general?

and in particular, TestRestoreBackupAndMigrate is failing, since i changed the db columns. what's the best fix? recreate the sqlite-backup-0009.sql.zst ?

i understand this would not happen if i avoided modifying 0006_create_table_blocks.sql and instead created a 0012_add_columns_to_table_blocks.sql , which i can also do.

@altergui altergui requested a review from mvdan June 11, 2024 15:02
api/helpers.go Outdated Show resolved Hide resolved
@altergui altergui linked an issue Jun 12, 2024 that may be closed by this pull request
@mvdan
Copy link
Contributor

mvdan commented Jun 14, 2024

Yes, please add a new migration step. As far as I can tell, and from what we agreed with @p4u, we are treating the database as stable and we should avoid any breaking changes that force us to delete it and re-index everything. In most cases, like adding new columns, it should be easy to do it as a new step anyway.

api/chain.go Outdated Show resolved Hide resolved
api/helpers.go Outdated Show resolved Hide resolved
@altergui altergui force-pushed the feat/index-blocks branch 2 times, most recently from f620fc0 to 514c499 Compare June 17, 2024 08:00
@altergui
Copy link
Contributor Author

TestRestoreBackupAndMigrate is still failing, with the new migration 0013, complaining about a missing column. digging in 🕵️

@altergui altergui force-pushed the feat/index-blocks branch 2 times, most recently from 1d9efe3 to 5184f2d Compare June 17, 2024 09:23
@coveralls
Copy link

coveralls commented Jun 17, 2024

Pull Request Test Coverage Report for Build 9545233328

Details

  • 37 of 80 (46.25%) changed or added relevant lines in 6 files are covered.
  • 6 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.05%) to 61.38%

Changes Missing Coverage Covered Lines Changed/Added Lines %
vochain/indexer/block.go 2 7 28.57%
api/chain.go 3 11 27.27%
vochain/indexer/indexertypes/block.go 0 10 0.0%
api/helpers.go 4 24 16.67%
Files with Coverage Reduction New Missed Lines %
vochain/indexer/block.go 2 42.86%
vochain/state/account.go 2 67.08%
vochain/transaction/election_tx.go 2 61.54%
Totals Coverage Status
Change from base Build 9545111263: 0.05%
Covered Lines: 15946
Relevant Lines: 25979

💛 - Coveralls

@altergui
Copy link
Contributor Author

TestRestoreBackupAndMigrate is still failing, with the new migration 0013, complaining about a missing column. digging in 🕵️

this was failing due to my buggy migration 0013. fixed, all tests are passing now

@coveralls
Copy link

coveralls commented Jun 17, 2024

Pull Request Test Coverage Report for Build 9548791745

Details

  • 20 of 47 (42.55%) changed or added relevant lines in 4 files are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.01%) to 61.315%

Changes Missing Coverage Covered Lines Changed/Added Lines %
vochain/indexer/db/blocks.sql.go 8 16 50.0%
vochain/indexer/block.go 0 9 0.0%
vochain/indexer/indexertypes/block.go 0 10 0.0%
Files with Coverage Reduction New Missed Lines %
vochain/indexer/block.go 1 0.0%
vochain/indexer/indexer.go 4 68.84%
Totals Coverage Status
Change from base Build 9546446432: 0.01%
Covered Lines: 15923
Relevant Lines: 25969

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 8, 2024

Pull Request Test Coverage Report for Build 10041203332

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

  • 142 of 302 (47.02%) changed or added relevant lines in 9 files are covered.
  • 203 unchanged lines in 10 files lost coverage.
  • Overall coverage decreased (-0.2%) to 61.033%

Changes Missing Coverage Covered Lines Changed/Added Lines %
vochain/indexer/db/blocks.sql.go 18 31 58.06%
vochain/indexer/block.go 4 18 22.22%
vochain/indexer/indexertypes/types.go 9 29 31.03%
vochain/indexer/db/db.go 48 70 68.57%
api/chain.go 16 45 35.56%
vochain/indexer/db/transactions.sql.go 10 39 25.64%
vochain/indexer/transaction.go 15 48 31.25%
Files with Coverage Reduction New Missed Lines %
vochain/indexer/block.go 1 31.82%
util/zk.go 2 86.84%
vochain/indexer/db/db.go 2 29.17%
vochain/state/account.go 2 67.08%
vochain/transaction/election_tx.go 2 62.13%
api/api_types.go 3 67.74%
vochain/indexer/transaction.go 5 47.25%
vochain/indexer/indexertypes/types.go 7 72.17%
api/helpers.go 54 51.09%
api/chain.go 125 36.58%
Totals Coverage Status
Change from base Build 9970800402: -0.2%
Covered Lines: 16087
Relevant Lines: 26358

💛 - Coveralls

@altergui altergui force-pushed the feat/index-blocks branch 4 times, most recently from 40c4b1c to 377af13 Compare July 9, 2024 10:06
since the CreateBlock now fetches the whole block, we need app.NodeClient initialized
in all nodes (including seeds), else seeds panic on first Commit
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.

Implement TX list by block height Return correct date for old blocks
4 participants