-
Notifications
You must be signed in to change notification settings - Fork 122
fix: simplify transaction events query #2279
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
Conversation
Vercel deployment URL: https://stacks-blockchain-d2g2gtf2a-hirosystems.vercel.app 🚀 |
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the /extended/v1/tx/events
SQL to only include relevant event-type subqueries instead of relying on UNIONs against a null‐filled placeholder.
- Introduce an array of
PgSqlQuery
segments pushed conditionally per event type. - Build the final CTE via
reduce
to unite only the selected filters.
Comments suppressed due to low confidence (1)
src/datastore/pg-store.ts:1785
- Add tests covering scenarios where
args.eventTypeFilter
is empty or includes multiple types to ensure the new dynamic query assembly behaves correctly.
const eventQueries: PgSqlQuery[] = [];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits but looks good 👍
## [8.11.0](v8.10.0...v8.11.0) (2025-05-26) ### Features * add /extended/v2/block-tenures/:height/blocks endpoint ([#2285](#2285)) ([f5c2e01](f5c2e01)) * stacks core event and rpc proxy body limits configurable via env ([#2278](#2278)) ([8a54e9d](8a54e9d)) * store and expose vm_error for failed transactions ([#2286](#2286)) ([7ac7513](7ac7513)) ### Bug Fixes * consider microblock transactions in balance calculations ([#2277](#2277)) ([3418863](3418863)) * count stx mint data at block 0 towards account balances ([#2289](#2289)) ([a0cd9f2](a0cd9f2)) * ignore unanchored param for BNS names endpoint ([#2263](#2263)) ([3d33725](3d33725)) * keep a table of latest stacks node event timestamps ([#2266](#2266)) ([6f111ad](6f111ad)) * module imports in block tenure routes ([#2287](#2287)) ([2cb442e](2cb442e)) * **rosetta:** get current block should only join by stacks chain tip information ([#2265](#2265)) ([78ebad0](78ebad0)) * simplify transaction events query ([#2279](#2279)) ([517ca68](517ca68))
🎉 This PR is included in version 8.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Simply the SQL query for the
/extended/v1/tx/events
endpoint so it doesn't rely on UNIONs with null columns. It will only query against tables based on the given filters.Fixes #2261