Skip to content

Commit f20002c

Browse files
committed
Merge branch 'master' into develop
2 parents 6f111ad + 77991fb commit f20002c

File tree

4 files changed

+69
-35
lines changed

4 files changed

+69
-35
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ STACKS_NODE_TYPE=L1
158158
# Enable FT metadata processing for Rosetta operations display. Disabled by default.
159159
# STACKS_API_ENABLE_FT_METADATA=1
160160

161+
# Enable legacy API endpoints. Disabled by default.
162+
# STACKS_API_ENABLE_LEGACY_ENDPOINTS=1
163+
161164
# The Rosetta API endpoints require FT metadata to display operations with the proper `symbol` and
162165
# `decimals` values. If FT metadata is enabled, this variable controls the token metadata error
163166
# handling mode when metadata is not found.

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
1+
## [8.10.0](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.9.0...v8.10.0) (2025-04-18)
2+
3+
4+
### Features
5+
6+
* add `Warning` http response deprecation notices ([#2253](https://github.com/hirosystems/stacks-blockchain-api/issues/2253)) ([e62ce79](https://github.com/hirosystems/stacks-blockchain-api/commit/e62ce79756338fdcc43a1641787c704ef1202143))
7+
8+
9+
### Bug Fixes
10+
11+
* optimize contract event list db index ([#2258](https://github.com/hirosystems/stacks-blockchain-api/issues/2258)) ([e1044d1](https://github.com/hirosystems/stacks-blockchain-api/commit/e1044d1f2cdbe4a202193794d04a8bbdd0ac9592))
12+
* optimize query for transactions in block ([#2259](https://github.com/hirosystems/stacks-blockchain-api/issues/2259)) ([e69f9e4](https://github.com/hirosystems/stacks-blockchain-api/commit/e69f9e4149d3bcedee4d47a3e4a8f1ea2b8ff964))
13+
14+
## [8.9.0](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.8.0...v8.9.0) (2025-04-10)
15+
16+
> [!IMPORTANT]
17+
> This release marks the `/mempool/dropped` endpoint as legacy deprecated, which means we will keep its code in the API but will no longer respond to it from our production deployments.
18+
> If you still need to use this endpoint in your own API deployment, set the `STACKS_API_ENABLE_LEGACY_ENDPOINTS` to `true` in your environment before starting the API.
19+
20+
### Features
21+
22+
* mark /mempool/dropped endpoint as legacy deprecated ([#2255](https://github.com/hirosystems/stacks-blockchain-api/issues/2255)) ([576d05b](https://github.com/hirosystems/stacks-blockchain-api/commit/576d05bfb843852bd4d6fc2e1f863f983568fbe6))
23+
124
## [8.8.0](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.7.0...v8.8.0) (2025-04-02)
225

26+
> [!IMPORTANT]
27+
> This release deprecates the [`/extended/v1/address/:addr/balances`](https://docs.hiro.so/stacks/api/accounts/balances) and [`/extended/v1/address/:addr/stx`](https://docs.hiro.so/stacks/api/accounts/stx-balances) endpoints in favor of new endpoints [`/extended/v2/addresses/:addr/balances/stx`](https://docs.hiro.so/stacks/api/accounts/principal-stx-balance) and [`/extended/v2/addresses/:addr/balances/ft`](https://docs.hiro.so/stacks/api/accounts/principal-ft-balances) that are optimized for higher performance.
28+
>
29+
> We strongly encourage applications and developers to use the new endpoints as soon as possible, as we plan on eventually removing access the now deprecated endpoints.
330
431
### Features
532

src/api/routes/tx.ts

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
handleTransactionCache,
1717
} from '../controllers/cache-controller';
1818
import { DbEventTypeId } from '../../datastore/common';
19-
import { has0xPrefix } from '@hirosystems/api-toolkit';
19+
import { has0xPrefix, parseBoolean } from '@hirosystems/api-toolkit';
2020

2121
import { FastifyPluginAsync } from 'fastify';
2222
import { Server } from 'node:http';
@@ -318,43 +318,46 @@ export const TxRoutes: FastifyPluginAsync<
318318
}
319319
);
320320

321-
fastify.get(
322-
'/mempool/dropped',
323-
{
324-
preHandler: handleMempoolCache,
325-
schema: {
326-
operationId: 'get_dropped_mempool_transaction_list',
327-
summary: 'Get dropped mempool transactions',
328-
description: `Retrieves all recently-broadcast transactions that have been dropped from the mempool.
329-
330-
Transactions are dropped from the mempool if:
331-
* they were stale and awaiting garbage collection or,
332-
* were expensive, or
333-
* were replaced with a new fee`,
334-
tags: ['Transactions'],
335-
querystring: Type.Object({
336-
offset: OffsetParam(),
337-
limit: LimitParam(ResourceType.Tx),
338-
}),
339-
response: {
340-
200: PaginatedResponse(MempoolTransactionSchema, {
341-
description: 'List of dropped mempool transactions',
321+
if (parseBoolean(process.env['STACKS_API_ENABLE_LEGACY_ENDPOINTS'])) {
322+
fastify.get(
323+
'/mempool/dropped',
324+
{
325+
preHandler: handleMempoolCache,
326+
schema: {
327+
deprecated: true,
328+
operationId: 'get_dropped_mempool_transaction_list',
329+
summary: 'Get dropped mempool transactions',
330+
description: `Retrieves all recently-broadcast transactions that have been dropped from the mempool.
331+
332+
Transactions are dropped from the mempool if:
333+
* they were stale and awaiting garbage collection or,
334+
* were expensive, or
335+
* were replaced with a new fee`,
336+
tags: ['Transactions'],
337+
querystring: Type.Object({
338+
offset: OffsetParam(),
339+
limit: LimitParam(ResourceType.Tx),
342340
}),
341+
response: {
342+
200: PaginatedResponse(MempoolTransactionSchema, {
343+
description: 'List of dropped mempool transactions',
344+
}),
345+
},
343346
},
344347
},
345-
},
346-
async (req, reply) => {
347-
const limit = getPagingQueryLimit(ResourceType.Tx, req.query.limit);
348-
const offset = parsePagingQueryInput(req.query.offset ?? 0);
349-
const { results: txResults, total } = await fastify.db.getDroppedTxs({
350-
offset,
351-
limit,
352-
});
353-
const results = txResults.map(tx => parseDbMempoolTx(tx));
354-
const response = { limit, offset, total, results };
355-
await reply.send(response);
356-
}
357-
);
348+
async (req, reply) => {
349+
const limit = getPagingQueryLimit(ResourceType.Tx, req.query.limit);
350+
const offset = parsePagingQueryInput(req.query.offset ?? 0);
351+
const { results: txResults, total } = await fastify.db.getDroppedTxs({
352+
offset,
353+
limit,
354+
});
355+
const results = txResults.map(tx => parseDbMempoolTx(tx));
356+
const response = { limit, offset, total, results };
357+
await reply.send(response);
358+
}
359+
);
360+
}
358361

359362
fastify.get(
360363
'/mempool/stats',

tests/api/setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ export default (): void => {
88
}
99
loadDotEnv();
1010
process.env.PG_DATABASE = 'postgres';
11+
process.env.STACKS_API_ENABLE_LEGACY_ENDPOINTS = '1';
1112
console.log('Jest - setup done');
1213
};

0 commit comments

Comments
 (0)