Skip to content

Conversation

@rafaelcr
Copy link
Collaborator

@rafaelcr rafaelcr commented Oct 27, 2025

Introduces a new principal_txs table to consolidate and optimize transaction tracking for principals, replacing the old principal_stx_txs table with a more comprehensive solution that allows us to do direct SELECTs instead of calculating data on demand. The old table is kept intact for backwards compatibility.

  • Tracks all transaction types (STX, FT, NFT) for principals with detailed event counts and balance tracking. Includes fields for sent/received amounts, balance flags, and event counts for mints, burns, and transfers
  • Updated principal activity ETag calculation to correctly handle the new data structure (object with confirmed/mempool properties instead of array)
  • Refactored datastore methods to use the new optimized table structure, keeping queries as fast as possible
  • Added migration to create the new table and populate it from existing data

@github-actions
Copy link

github-actions bot commented Oct 27, 2025

Vercel deployment URL: https://stacks-blockchain-7wae3l55r-hirosystems.vercel.app 🚀

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 93.54839% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...play/parquet-based/importers/new-block-importer.ts 0.00% 5 Missing ⚠️
src/datastore/pg-write-store.ts 98.78% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@rafaelcr rafaelcr changed the title Fix/cache etags fix: optimize address transaction lists and etags Oct 31, 2025
@rafaelcr rafaelcr changed the title fix: optimize address transaction lists and etags fix: optimize principal transaction lists and etags Oct 31, 2025
@rafaelcr rafaelcr linked an issue Oct 31, 2025 that may be closed by this pull request
@rafaelcr rafaelcr marked this pull request as ready for review November 3, 2025 21:46
@rafaelcr rafaelcr requested a review from CharlieC3 November 3, 2025 21:49
@rafaelcr
Copy link
Collaborator Author

rafaelcr commented Nov 3, 2025

Next step is to perform smoke tests on dev to compare consistency vs prod and check query response times for accounts with large numbers of transactions

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.

Timeout for account with many transactions

3 participants