Skip to content

Conversation

@He1DAr
Copy link
Contributor

@He1DAr He1DAr commented Jul 22, 2025

Description

We're planning to support filtering by tx type in Stacks explorer search. This PR aims to add a new filter type to allow user filtering txs by type.

Type of Change

  • New feature
  • Bug fix
  • API reference/documentation update
  • Other

Checklist

  • Code is commented where needed
  • Unit test coverage for new or modified code paths
  • npm run test passes
  • Changelog is updated
  • Tag 1 of @rafaelcr or @zone117x for review

@github-actions
Copy link

github-actions bot commented Jul 22, 2025

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

@codecov
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

Attention: Patch coverage is 86.20690% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/api/controllers/db-controller.ts 78.94% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

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

This looks very good @He1DAr but we need to run some load tests on this before we can merge. Let's discuss how we can do this.

exports.up = pgm => {
pgm.createIndex('txs', 'status', {
where: 'canonical = TRUE AND microblock_canonical = TRUE',
name: 'idx_txs_status_optimized'
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to provide a name, node-pg-migrate will define one for you with the current standards we use

exports.shorthands = undefined;

exports.up = pgm => {
pgm.createIndex('txs', 'status', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding the index is great but I don't think it will help a lot especially for the success status, given that the vast majority of transactions are successful.

I'm worried that running the endpoint on mainnet will cause performance issues when it tries to calculate the COUNT(*) of records to show in the total. We'll need to run load test on this.

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