Skip to content

Commit e71b111

Browse files
authored
Merge pull request #1868 from hirosystems/master
merge master into develop
2 parents f887f31 + f82ed89 commit e71b111

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1452
-503
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ PG_APPLICATION_NAME=stacks-blockchain-api
4343
# Limit to how many concurrent connections can be created, defaults to 10
4444
# PG_CONNECTION_POOL_MAX=10
4545

46+
# Insert concurrency when processing new blocks
47+
# If your PostgreSQL is operating on SSD and has multiple CPU cores, consider raising this value, for instance, to 8 or 16.
48+
# STACKS_BLOCK_DATA_INSERT_CONCURRENCY=4
49+
4650
# If specified, controls the Stacks Blockchain API mode. The possible values are:
4751
# * `readonly`: Runs the API endpoints without an Event Server that listens to events from a node and
4852
# writes them to the local database. The API will only read data from the PG database

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18
1+
v20

CHANGELOG.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
1+
## [7.8.2](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.8.1...v7.8.2) (2024-02-19)
2+
3+
4+
### Bug Fixes
5+
6+
* report placeholder in prom metrics for invalid request paths ([#1867](https://github.com/hirosystems/stacks-blockchain-api/issues/1867)) ([7921488](https://github.com/hirosystems/stacks-blockchain-api/commit/79214883a5c58724ddc3e7d7b57381317cb6e27d))
7+
8+
## [7.8.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.8.0...v7.8.1) (2024-02-02)
9+
10+
11+
### Bug Fixes
12+
13+
* **rosetta:** use /v2/fees/transaction for fee estimation ([b287b7b](https://github.com/hirosystems/stacks-blockchain-api/commit/b287b7bb3426719553e9ffa3b88178fb24207a6b))
14+
* sql transactional consistency bug with fetching chaintip in various areas ([#1853](https://github.com/hirosystems/stacks-blockchain-api/issues/1853)) ([07339c0](https://github.com/hirosystems/stacks-blockchain-api/commit/07339c08f3f42bc7b08c2e830939bfadcd308cb0))
15+
16+
## [7.8.0](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.7.2...v7.8.0) (2024-01-23)
17+
18+
19+
### Features
20+
21+
* add `/extended/v2/smart-contracts/status` endpoint ([#1833](https://github.com/hirosystems/stacks-blockchain-api/issues/1833)) ([3535c11](https://github.com/hirosystems/stacks-blockchain-api/commit/3535c113e0d3b730b3e0d9df630c51b04e516a7e))
22+
* run inserts in batch and in parallel when processing new block ([#1818](https://github.com/hirosystems/stacks-blockchain-api/issues/1818)) ([86dfdb5](https://github.com/hirosystems/stacks-blockchain-api/commit/86dfdb5d536fee8d7490ca5213f7005a8800f9fa))
23+
* upgrade to node 20, use bookworm-slim image ([#1832](https://github.com/hirosystems/stacks-blockchain-api/issues/1832)) ([0a42109](https://github.com/hirosystems/stacks-blockchain-api/commit/0a42109242ab5804004e01338f236f61ef07651b))
24+
25+
26+
### Bug Fixes
27+
28+
* change all HASH indexes to BTREE to optimize writes ([#1825](https://github.com/hirosystems/stacks-blockchain-api/issues/1825)) ([234936b](https://github.com/hirosystems/stacks-blockchain-api/commit/234936b430640fb7108e6cb57bdb21d1085a65b2))
29+
* log block event counts after processing ([#1820](https://github.com/hirosystems/stacks-blockchain-api/issues/1820)) ([9c39743](https://github.com/hirosystems/stacks-blockchain-api/commit/9c397439e6eb2830186cda90a213b3ab3d5a4301)), closes [#1819](https://github.com/hirosystems/stacks-blockchain-api/issues/1819) [#1819](https://github.com/hirosystems/stacks-blockchain-api/issues/1819)
30+
* optimize re-org queries and indexes ([#1821](https://github.com/hirosystems/stacks-blockchain-api/issues/1821)) ([5505d35](https://github.com/hirosystems/stacks-blockchain-api/commit/5505d354ecae6e52c751b3b634752fd56d24642f))
31+
* parallelize re-org update queries ([#1835](https://github.com/hirosystems/stacks-blockchain-api/issues/1835)) ([340a304](https://github.com/hirosystems/stacks-blockchain-api/commit/340a3043529ca12316198d8f4605128396f02560))
32+
33+
## [7.8.0-beta.4](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.8.0-beta.3...v7.8.0-beta.4) (2024-01-16)
34+
35+
36+
### Features
37+
38+
* upgrade to node 20, use bookworm-slim image ([#1832](https://github.com/hirosystems/stacks-blockchain-api/issues/1832)) ([0a42109](https://github.com/hirosystems/stacks-blockchain-api/commit/0a42109242ab5804004e01338f236f61ef07651b))
39+
40+
## [7.8.0-beta.3](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.8.0-beta.2...v7.8.0-beta.3) (2024-01-12)
41+
42+
43+
### Bug Fixes
44+
45+
* change all HASH indexes to BTREE to optimize writes ([#1825](https://github.com/hirosystems/stacks-blockchain-api/issues/1825)) ([234936b](https://github.com/hirosystems/stacks-blockchain-api/commit/234936b430640fb7108e6cb57bdb21d1085a65b2))
46+
47+
## [7.8.0-beta.2](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.8.0-beta.1...v7.8.0-beta.2) (2024-01-12)
48+
49+
50+
### Bug Fixes
51+
52+
* optimize re-org queries and indexes ([#1821](https://github.com/hirosystems/stacks-blockchain-api/issues/1821)) ([5505d35](https://github.com/hirosystems/stacks-blockchain-api/commit/5505d354ecae6e52c751b3b634752fd56d24642f))
53+
54+
## [7.8.0-beta.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.7.1...v7.8.0-beta.1) (2024-01-11)
55+
56+
57+
### Features
58+
59+
* run inserts in batch and in parallel when processing new block ([#1818](https://github.com/hirosystems/stacks-blockchain-api/issues/1818)) ([86dfdb5](https://github.com/hirosystems/stacks-blockchain-api/commit/86dfdb5d536fee8d7490ca5213f7005a8800f9fa))
60+
61+
### Bug Fixes
62+
63+
* log block event counts after processing ([#1820](https://github.com/hirosystems/stacks-blockchain-api/issues/1820)) ([9c39743](https://github.com/hirosystems/stacks-blockchain-api/commit/9c397439e6eb2830186cda90a213b3ab3d5a4301)), closes [#1819](https://github.com/hirosystems/stacks-blockchain-api/issues/1819) [#1819](https://github.com/hirosystems/stacks-blockchain-api/issues/1819)
64+
65+
166
## [7.7.2](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.7.1...v7.7.2) (2024-01-16)
267

368

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM node:18-bullseye
1+
FROM node:20-bookworm-slim
22

33
WORKDIR /app
44
COPY . .
55
COPY --from=qldrsc/duckdb /usr/local/bin/duckdb /bin/duckdb
66

77
RUN apt-get update && \
8-
apt-get install -y git openjdk-11-jre && \
8+
apt-get install -y git openjdk-17-jre && \
99
apt-get clean && \
1010
rm -rf /var/lib/apt/lists/*
1111
RUN echo "GIT_TAG=$(git tag --points-at HEAD)" >> .env

docker/rosetta.Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ ARG ARCHIVE_VERSION=latest
1212

1313
#######################################################################
1414
## Build the stacks-blockchain-api
15-
FROM node:18-buster as stacks-blockchain-api-build
15+
FROM node:20-bookworm-slim as stacks-blockchain-api-build
1616
ARG STACKS_API_VERSION
1717
ENV STACKS_API_REPO=hirosystems/stacks-blockchain-api
1818
ENV STACKS_API_VERSION=${STACKS_API_VERSION}
1919
ENV DEBIAN_FRONTEND noninteractive
2020
WORKDIR /app
2121
RUN apt-get update -y \
2222
&& apt-get install -y \
23+
git \
2324
curl \
2425
jq \
25-
openjdk-11-jre-headless \
26+
openjdk-17-jre-headless \
2627
cmake \
2728
&& git clone -b ${STACKS_API_VERSION} https://github.com/${STACKS_API_REPO} . \
2829
&& echo "GIT_TAG=$(git tag --points-at HEAD)" >> .env \
@@ -102,7 +103,7 @@ RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
102103

103104
RUN curl -sL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
104105
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
105-
&& curl -sL https://deb.nodesource.com/setup_16.x | bash -
106+
&& curl -sL https://deb.nodesource.com/setup_20.x | bash -
106107
RUN apt-get update \
107108
&& apt-get install -y \
108109
postgresql-${PG_VERSION} \

docker/standalone-regtest.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM node:18-bullseye as api-builder
3+
FROM node:20-bookworm-slim as api-builder
44

55
ARG API_GIT_COMMIT
66
ARG STACKS_API_VERSION
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.swap-helper-bridged-v1-1": {
3+
"found": true,
4+
"result": {
5+
"contract_id": "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.swap-helper-bridged-v1-1",
6+
"status": "success",
7+
"tx_id": "0x8542d28e427256ea3c29dcd8793222891999ceff4ef1bb062e2f21cb6def6884",
8+
"block_height": 111021
9+
}
10+
},
11+
"SP1JTCR202ECC6333N7ZXD7MK7E3ZTEEE1MJ73C60.name-registrar": {
12+
"found": true,
13+
"result": {
14+
"contract_id": "SP1JTCR202ECC6333N7ZXD7MK7E3ZTEEE1MJ73C60.name-registrar",
15+
"status": "success",
16+
"tx_id": "0x6e1114cce8c6f2e9c8130f9acd75d67bb667ae584f882acdd2db6dd74e6cbe5e",
17+
"block_height": 113010
18+
}
19+
},
20+
"SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v1": {
21+
"found": true,
22+
"result": {
23+
"contract_id": "SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v1",
24+
"status": "pending",
25+
"tx_id": "0x10bdcf10ffee72994f493ac36760f4e95a76c8471370182fd4705c2153dc173d"
26+
}
27+
},
28+
"SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core": {
29+
"found": false
30+
}
31+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"description": "GET request that returns the deployment status of multiple smart contracts",
3+
"title": "SmartContractsStatusResponse",
4+
"type": "object",
5+
"additionalProperties": {
6+
"anyOf": [
7+
{
8+
"$ref": "./smart-contract-found.schema.json"
9+
},
10+
{
11+
"$ref": "./smart-contract-not-found.schema.json"
12+
}
13+
]
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"type": "object",
3+
"title": "SmartContractFound",
4+
"additionalProperties": false,
5+
"required": ["found", "result"],
6+
"properties": {
7+
"found": {
8+
"type": "boolean",
9+
"enum": [true]
10+
},
11+
"result": {
12+
"$ref": "../../entities/smart-contracts/smart-contract-status.schema.json"
13+
}
14+
}
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"type": "object",
3+
"title": "SmartContractNotFound",
4+
"additionalProperties": false,
5+
"properties": {
6+
"found": {
7+
"type": "boolean",
8+
"enum": [false]
9+
}
10+
},
11+
"required": ["found"]
12+
}

0 commit comments

Comments
 (0)