Skip to content

Commit 566cf2a

Browse files
committed
Merge branch 'develop' into beta
# Conflicts: # CHANGELOG.md
2 parents e9aa8a6 + c7c9869 commit 566cf2a

File tree

2 files changed

+20
-29
lines changed

2 files changed

+20
-29
lines changed

CHANGELOG.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,12 @@
1616
* remove signer columns from tenure-change transactions ([#1845](https://github.com/hirosystems/stacks-blockchain-api/issues/1845)) ([8ec726b](https://github.com/hirosystems/stacks-blockchain-api/commit/8ec726b05531abb7787d035d21f7afc276574b9c))
1717
* sql transactional consistency bug with fetching chaintip in various areas ([#1853](https://github.com/hirosystems/stacks-blockchain-api/issues/1853)) ([ada8536](https://github.com/hirosystems/stacks-blockchain-api/commit/ada85364b5465b59e1dba0e82815bd8b8057f23f))
1818

19-
## [7.10.0-nakamoto.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.9.0...v7.10.0-nakamoto.1) (2024-03-21)
20-
21-
22-
### Features
23-
24-
* add signer-keys from pox4 events ([#1857](https://github.com/hirosystems/stacks-blockchain-api/issues/1857)) ([c17ad23](https://github.com/hirosystems/stacks-blockchain-api/commit/c17ad23d3f451d7c072ff94f4cb1ae7a2f78705d))
25-
* ingest signer_bitvec ([#1900](https://github.com/hirosystems/stacks-blockchain-api/issues/1900)) ([aa1750f](https://github.com/hirosystems/stacks-blockchain-api/commit/aa1750f7ebbdfe4c2a84583f98c3ff465236f8aa))
26-
* nakamoto block timestamps ([#1886](https://github.com/hirosystems/stacks-blockchain-api/issues/1886)) ([f547832](https://github.com/hirosystems/stacks-blockchain-api/commit/f5478329d7267a65b5f3c557b197feadff298afb))
27-
* pox 4 revoke events and signer-key support ([#1829](https://github.com/hirosystems/stacks-blockchain-api/issues/1829)) ([5e5650a](https://github.com/hirosystems/stacks-blockchain-api/commit/5e5650a29bcc5950f061ed0a84961075c855a863)), closes [#1849](https://github.com/hirosystems/stacks-blockchain-api/issues/1849)
28-
* pox stacker & signer cycle details ([#1873](https://github.com/hirosystems/stacks-blockchain-api/issues/1873)) ([d2c2805](https://github.com/hirosystems/stacks-blockchain-api/commit/d2c28059cfca99cd9b9a35cb8c96074a60fedd35))
19+
## [7.9.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.9.0...v7.9.1) (2024-04-05)
2920

3021

3122
### Bug Fixes
3223

33-
* event-replay readiness for nakamoto & fix for [#1879](https://github.com/hirosystems/stacks-blockchain-api/issues/1879) ([#1903](https://github.com/hirosystems/stacks-blockchain-api/issues/1903)) ([1572e73](https://github.com/hirosystems/stacks-blockchain-api/commit/1572e737337680510850b23662e1f36c57ebc198))
34-
* remove signer columns from tenure-change transactions ([#1845](https://github.com/hirosystems/stacks-blockchain-api/issues/1845)) ([8ec726b](https://github.com/hirosystems/stacks-blockchain-api/commit/8ec726b05531abb7787d035d21f7afc276574b9c))
35-
* sql transactional consistency bug with fetching chaintip in various areas ([#1853](https://github.com/hirosystems/stacks-blockchain-api/issues/1853)) ([ada8536](https://github.com/hirosystems/stacks-blockchain-api/commit/ada85364b5465b59e1dba0e82815bd8b8057f23f))
24+
* batch drop mempool transactions ([#1920](https://github.com/hirosystems/stacks-blockchain-api/issues/1920)) ([#1927](https://github.com/hirosystems/stacks-blockchain-api/issues/1927)) ([f522d79](https://github.com/hirosystems/stacks-blockchain-api/commit/f522d795cef9b3f3ac0f1222b74a261f332c3065))
3625

3726
## [7.9.0](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.8.2...v7.9.0) (2024-03-15)
3827

src/datastore/pg-write-store.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,22 +1933,24 @@ export class PgWriteStore extends PgStore {
19331933
}
19341934

19351935
async dropMempoolTxs({ status, txIds }: { status: DbTxStatus; txIds: string[] }): Promise<void> {
1936-
const updateResults = await this.sql<{ tx_id: string }[]>`
1937-
WITH pruned AS (
1938-
UPDATE mempool_txs
1939-
SET pruned = TRUE, status = ${status}
1940-
WHERE tx_id IN ${this.sql(txIds)} AND pruned = FALSE
1941-
RETURNING tx_id
1942-
),
1943-
count_update AS (
1944-
UPDATE chain_tip SET
1945-
mempool_tx_count = mempool_tx_count - (SELECT COUNT(*) FROM pruned),
1946-
mempool_updated_at = NOW()
1947-
)
1948-
SELECT tx_id FROM pruned
1949-
`;
1950-
for (const txId of updateResults.map(r => r.tx_id)) {
1951-
await this.notifier?.sendTx({ txId });
1936+
for (const batch of batchIterate(txIds, INSERT_BATCH_SIZE)) {
1937+
const updateResults = await this.sql<{ tx_id: string }[]>`
1938+
WITH pruned AS (
1939+
UPDATE mempool_txs
1940+
SET pruned = TRUE, status = ${status}
1941+
WHERE tx_id IN ${this.sql(batch)} AND pruned = FALSE
1942+
RETURNING tx_id
1943+
),
1944+
count_update AS (
1945+
UPDATE chain_tip SET
1946+
mempool_tx_count = mempool_tx_count - (SELECT COUNT(*) FROM pruned),
1947+
mempool_updated_at = NOW()
1948+
)
1949+
SELECT tx_id FROM pruned
1950+
`;
1951+
for (const txId of updateResults.map(r => r.tx_id)) {
1952+
await this.notifier?.sendTx({ txId });
1953+
}
19521954
}
19531955
}
19541956

0 commit comments

Comments
 (0)