Skip to content

Commit f9fb054

Browse files
authored
Merge pull request #1185 from hirosystems/beta
release api v4.0.0
2 parents cd0c8ae + eac238a commit f9fb054

File tree

348 files changed

+20504
-18213
lines changed

Some content is hidden

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

348 files changed

+20504
-18213
lines changed

.env

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ PG_APPLICATION_NAME=stacks-blockchain-api
5151
# (with both Event Server and API endpoints).
5252
# STACKS_API_MODE=
5353

54+
# Stacks nodes automatically perform garbage-collection by dropping transactions from the mempool if they
55+
# are pending for more than 256 blocks. This variable controls the block age threshold at which the API will do
56+
# the same.
57+
# STACKS_MEMPOOL_TX_GARBAGE_COLLECTION_THRESHOLD=256
58+
5459
# If specified, an http server providing profiling capability endpoints will be opened on the given port.
5560
# This port should not be publicly exposed.
5661
# STACKS_PROFILER_PORT=9119
@@ -100,11 +105,21 @@ MAINNET_SEND_MANY_CONTRACT_ID=SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-man
100105
# STACKS_API_ENABLE_FT_METADATA=1
101106
# STACKS_API_ENABLE_NFT_METADATA=1
102107

108+
# If token metadata processing is enabled, this variable determines how the API reacts to metadata processing failures.
109+
# When strict mode is enabled, any failures caused by recoverable errors will be retried indefinitely. Otherwise,
110+
# the API will give up after `STACKS_API_TOKEN_METADATA_MAX_RETRIES` is reached for that smart contract.
111+
# STACKS_API_TOKEN_METADATA_STRICT_MODE=1
112+
113+
# Maximum number of times we'll try processing FT/NFT metadata for a specific smart contract if we've failed
114+
# because of a recoverable error.
115+
# Only used if `STACKS_API_TOKEN_METADATA_STRICT_MODE` is disabled.
116+
# STACKS_API_TOKEN_METADATA_MAX_RETRIES=5
117+
103118
# Controls the token metadata error handling mode. The possible values are:
104119
# * `warning`: If required metadata is not found, the API will issue a warning and not display data for that token.
105120
# * `error`: If required metadata is not found, the API will throw an error.
106121
# If not specified or any other value is provided, the mode will be set to `warning`.
107-
# STACKS_API_TOKEN_METADATA_ERROR_MODE=
122+
# STACKS_API_TOKEN_METADATA_ERROR_MODE=warning
108123

109124
# Configure a script to handle image URLs during token metadata processing.
110125
# This example script uses the `imgix.net` service to create CDN URLs.

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ module.exports = {
3030

3131
// TODO: temporarily disable this until the express async handler is typed correctly
3232
'@typescript-eslint/no-misused-promises': 'off',
33+
'@typescript-eslint/no-unsafe-argument': 'off',
3334
},
3435
};

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ jobs:
160160
uses: codecov/codecov-action@v2
161161
if: always()
162162

163+
- name: Upload coverage to Coveralls
164+
uses: coverallsapp/github-action@master
165+
if: always()
166+
with:
167+
github-token: ${{ secrets.github_token }}
168+
flag-name: run-${{ github.job }}
169+
parallel: true
170+
163171
test-bns:
164172
runs-on: ubuntu-latest
165173
steps:
@@ -211,6 +219,14 @@ jobs:
211219
uses: codecov/codecov-action@v2
212220
if: always()
213221

222+
- name: Upload coverage to Coveralls
223+
uses: coverallsapp/github-action@master
224+
if: always()
225+
with:
226+
github-token: ${{ secrets.github_token }}
227+
flag-name: run-${{ github.job }}
228+
parallel: true
229+
214230
test-rosetta:
215231
runs-on: ubuntu-latest
216232
steps:
@@ -262,6 +278,14 @@ jobs:
262278
uses: codecov/codecov-action@v2
263279
if: always()
264280

281+
- name: Upload coverage to Coveralls
282+
uses: coverallsapp/github-action@master
283+
if: always()
284+
with:
285+
github-token: ${{ secrets.github_token }}
286+
flag-name: run-${{ github.job }}
287+
parallel: true
288+
265289
test-rosetta-cli-data:
266290
runs-on: ubuntu-latest
267291
steps:
@@ -321,6 +345,14 @@ jobs:
321345
uses: codecov/codecov-action@v2
322346
if: always()
323347

348+
- name: Upload coverage to Coveralls
349+
uses: coverallsapp/github-action@master
350+
if: always()
351+
with:
352+
github-token: ${{ secrets.github_token }}
353+
flag-name: run-${{ github.job }}
354+
parallel: true
355+
324356
test-rosetta-cli-construction:
325357
runs-on: ubuntu-latest
326358
steps:
@@ -380,6 +412,14 @@ jobs:
380412
uses: codecov/codecov-action@v2
381413
if: always()
382414

415+
- name: Upload coverage to Coveralls
416+
uses: coverallsapp/github-action@master
417+
if: always()
418+
with:
419+
github-token: ${{ secrets.github_token }}
420+
flag-name: run-${{ github.job }}
421+
parallel: true
422+
383423
test-tokens:
384424
runs-on: ubuntu-latest
385425
steps:
@@ -417,6 +457,30 @@ jobs:
417457
uses: codecov/codecov-action@v2
418458
if: always()
419459

460+
- name: Upload coverage to Coveralls
461+
uses: coverallsapp/github-action@master
462+
if: always()
463+
with:
464+
github-token: ${{ secrets.github_token }}
465+
flag-name: run-${{ github.job }}
466+
parallel: true
467+
468+
upload-coveralls:
469+
runs-on: ubuntu-latest
470+
needs:
471+
- test
472+
- test-bns
473+
- test-rosetta
474+
- test-rosetta-cli-construction
475+
- test-rosetta-cli-data
476+
- test-tokens
477+
steps:
478+
- name: Coveralls Finished
479+
uses: coverallsapp/github-action@master
480+
with:
481+
github-token: ${{ secrets.github_token }}
482+
parallel-finished: true
483+
420484
build-publish:
421485
runs-on: ubuntu-latest
422486
needs:
@@ -504,3 +568,18 @@ jobs:
504568
cache-to: type=gha,mode=max
505569
# Only push if (there's a new release on main branch, or if building a non-main branch) and (Only run on non-PR events or only PRs that aren't from forks)
506570
push: ${{ (github.ref != 'refs/heads/master' || steps.semantic.outputs.new_release_version != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
571+
572+
- name: API Discord notification
573+
if: steps.semantic.outputs.new_release_version != ''
574+
uses: Ilshidur/action-discord@f1ed8844d9b33c17221fab0f36672cde39800eed
575+
env:
576+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_API_WEBHOOK }}
577+
DISCORD_USERNAME: Hiro Team
578+
DISCORD_AVATAR: 'https://i.imgur.com/z9Iy6ug.png'
579+
DISCORD_EMBEDS: |
580+
[{
581+
"title": "API Release: ${{ steps.semantic.outputs.new_release_version }}",
582+
"url": "https://github.com/hirosystems/stacks-blockchain-api/releases/tag/v${{ steps.semantic.outputs.new_release_version }}"
583+
}]
584+
with:
585+
args: ":rocket: A new version (${{ steps.semantic.outputs.new_release_version }}) of the Stacks Blockchain API is available on Github!"

.gitpod.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ ENV STACKS_CORE_EVENT_PORT 3700
1515
ENV STACKS_CORE_EVENT_HOST http://0.0.0.0
1616
ENV STACKS_BLOCKCHAIN_API_PORT 3999
1717
ENV STACKS_BLOCKCHAIN_API_HOST 0.0.0.0
18-
ENV STACKS_BLOCKCHAIN_API_DB pg
1918
ENV STACKS_CORE_RPC_HOST 127.0.0.1
2019
ENV STACKS_CORE_RPC_PORT 20443
2120
ENV NODE_ENV development

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ src/migrations/*
33
src/tests-rosetta/
44
src/tests-rosetta-cli/
55
src/tests-bns/
6+
src/tests/synthetic-tx-payloads/

.vscode/launch.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"preLaunchTask": "stacks-node:deploy-dev",
4343
"postDebugTask": "stacks-node:stop-dev",
4444
"env": {
45-
"STACKS_BLOCKCHAIN_API_DB": "pg",
4645
"STACKS_CHAIN_ID": "0x80000000",
4746
"NODE_ENV": "development",
4847
"TS_NODE_SKIP_IGNORE": "true"
@@ -64,7 +63,6 @@
6463
"postDebugTask": "stacks-node:stop-dev",
6564
"env": {
6665
"STACKS_API_MODE": "writeonly",
67-
"STACKS_BLOCKCHAIN_API_DB": "pg",
6866
"STACKS_CHAIN_ID": "0x80000000",
6967
"NODE_ENV": "development",
7068
"TS_NODE_SKIP_IGNORE": "true"
@@ -92,9 +90,8 @@
9290
"env": {
9391
"STACKS_BLOCKCHAIN_API_PORT": "3998",
9492
"STACKS_API_MODE": "readonly",
95-
"STACKS_BLOCKCHAIN_API_DB": "pg",
96-
"STACKS_CHAIN_ID": "0x80000000",
97-
"NODE_ENV": "development",
93+
"STACKS_CHAIN_ID": "0x00000001",
94+
"NODE_ENV": "production",
9895
"TS_NODE_SKIP_IGNORE": "true"
9996
},
10097
"killBehavior": "polite",
@@ -110,7 +107,6 @@
110107
"preLaunchTask": "stacks-node:deploy-follower",
111108
"postDebugTask": "stacks-node:stop-dev",
112109
"env": {
113-
"STACKS_BLOCKCHAIN_API_DB": "pg",
114110
"STACKS_CHAIN_ID": "0x00000001",
115111
"NODE_ENV": "development",
116112
"TS_NODE_SKIP_IGNORE": "true"
@@ -239,7 +235,7 @@
239235
"runtimeArgs": ["-r", "ts-node/register/transpile-only"],
240236
"cwd": "${workspaceFolder}/utils",
241237
"args": ["${workspaceFolder}/utils/src/chaintip-cache-control-test.ts"]
242-
}
238+
},
243239
],
244240
"compounds": [
245241
{

CHANGELOG.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,78 @@
1+
# [4.0.0-beta.8](https://github.com/hirosystems/stacks-blockchain-api/compare/v4.0.0-beta.7...v4.0.0-beta.8) (2022-05-26)
2+
3+
4+
### Bug Fixes
5+
6+
* treat incorrect `get-token-uri` none values as undefined ([#1183](https://github.com/hirosystems/stacks-blockchain-api/issues/1183)) ([33313b1](https://github.com/hirosystems/stacks-blockchain-api/commit/33313b1d78e75a1900de9162cd97a76ff0a64ee0))
7+
8+
# [4.0.0-beta.7](https://github.com/hirosystems/stacks-blockchain-api/compare/v4.0.0-beta.6...v4.0.0-beta.7) (2022-05-25)
9+
10+
11+
### Bug Fixes
12+
13+
* use 128 max size when deserializing contract principals [#1181](https://github.com/hirosystems/stacks-blockchain-api/issues/1181) ([#1182](https://github.com/hirosystems/stacks-blockchain-api/issues/1182)) ([f4d4733](https://github.com/hirosystems/stacks-blockchain-api/commit/f4d4733ad4956c6acc36f73337cc55b6aae5c5fb))
14+
15+
# [4.0.0-beta.6](https://github.com/hirosystems/stacks-blockchain-api/compare/v4.0.0-beta.5...v4.0.0-beta.6) (2022-05-20)
16+
17+
18+
### Bug Fixes
19+
20+
* propagate chain id correctly to bns router ([#1180](https://github.com/hirosystems/stacks-blockchain-api/issues/1180)) ([3a0ead1](https://github.com/hirosystems/stacks-blockchain-api/commit/3a0ead18fd3d65ec8221feada334477ebb576805))
21+
22+
# [4.0.0-beta.5](https://github.com/hirosystems/stacks-blockchain-api/compare/v4.0.0-beta.4...v4.0.0-beta.5) (2022-05-17)
23+
24+
25+
### Features
26+
27+
* add strict ft/nft metadata processing mode for better error handling ([#1165](https://github.com/hirosystems/stacks-blockchain-api/issues/1165)) ([b9ca4bb](https://github.com/hirosystems/stacks-blockchain-api/commit/b9ca4bb69d7f78c634c076855652937e0e1743f1))
28+
29+
# [4.0.0-beta.4](https://github.com/hirosystems/stacks-blockchain-api/compare/v4.0.0-beta.3...v4.0.0-beta.4) (2022-05-17)
30+
31+
32+
### Bug Fixes
33+
34+
* resolve bns names correctly in `/v1/addresses/stacks/[:address]` ([#1175](https://github.com/hirosystems/stacks-blockchain-api/issues/1175)) ([8797ded](https://github.com/hirosystems/stacks-blockchain-api/commit/8797ded691acab322c6c671403ea60bf1bc27294))
35+
36+
# [4.0.0-beta.3](https://github.com/hirosystems/stacks-blockchain-api/compare/v4.0.0-beta.2...v4.0.0-beta.3) (2022-05-11)
37+
38+
39+
### Features
40+
41+
* add block height to responses in `/extended/v1/tokens/nft/holdings` ([#1151](https://github.com/hirosystems/stacks-blockchain-api/issues/1151)) ([7cc8bd0](https://github.com/hirosystems/stacks-blockchain-api/commit/7cc8bd06339a9bf53ef5d133ef4885b26e48cd18))
42+
43+
# [4.0.0-beta.2](https://github.com/hirosystems/stacks-blockchain-api/compare/v4.0.0-beta.1...v4.0.0-beta.2) (2022-05-04)
44+
45+
46+
### Bug Fixes
47+
48+
* `/v1/names/[:name]` name resolution ([#1159](https://github.com/hirosystems/stacks-blockchain-api/issues/1159)) ([e656520](https://github.com/hirosystems/stacks-blockchain-api/commit/e656520701bea584fe7336c1a26388406cd167fe))
49+
50+
# [4.0.0-beta.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v3.0.3...v4.0.0-beta.1) (2022-04-20)
51+
52+
53+
### Bug Fixes
54+
55+
* bns download script download path ([#1091](https://github.com/hirosystems/stacks-blockchain-api/issues/1091)) ([55fa41e](https://github.com/hirosystems/stacks-blockchain-api/commit/55fa41eb31fcc1869a4c16de36ad4f01be9565a9))
56+
* disable notifier for tests that don't need it ([#1102](https://github.com/hirosystems/stacks-blockchain-api/issues/1102)) ([9765cf0](https://github.com/hirosystems/stacks-blockchain-api/commit/9765cf06819767cae88eab6c106bc1d0bd87e47e))
57+
* shorten token metadata pg notifications ([#1143](https://github.com/hirosystems/stacks-blockchain-api/issues/1143)) ([1f09c0e](https://github.com/hirosystems/stacks-blockchain-api/commit/1f09c0e2bffb42a680e899848980b13a6652d51f))
58+
59+
60+
* feat!: prune garbage collected (256 blocks old) mempool txs (#1101) ([fe56756](https://github.com/hirosystems/stacks-blockchain-api/commit/fe56756cdeb3c71dbd2ebbbf820bc2a56fc35f02)), closes [#1101](https://github.com/hirosystems/stacks-blockchain-api/issues/1101)
61+
62+
63+
### Features
64+
65+
* [CPU optimizations] use native rust module for decoding Clarity values, binary transaction blobs, post-condition binary blobs, Stacks addresses ([#1094](https://github.com/hirosystems/stacks-blockchain-api/issues/1094)) ([f5c4da7](https://github.com/hirosystems/stacks-blockchain-api/commit/f5c4da7b87e7eacecc6cd5d7075ecd0a39127ea0))
66+
* add `pruned` event import mode that ignores some historical events ([#1125](https://github.com/hirosystems/stacks-blockchain-api/issues/1125)) ([da992d7](https://github.com/hirosystems/stacks-blockchain-api/commit/da992d77b18bd49eef36e32b1d96d7e924d84cfc))
67+
* events-only endpoint for address and tx_id ([#1027](https://github.com/hirosystems/stacks-blockchain-api/issues/1027)) ([508afc7](https://github.com/hirosystems/stacks-blockchain-api/commit/508afc7b09641b79d5c8136b70088fc471f94433))
68+
* fetch subdomain list for bns name ([#1132](https://github.com/hirosystems/stacks-blockchain-api/issues/1132)) ([e34120f](https://github.com/hirosystems/stacks-blockchain-api/commit/e34120f70bcad5c6474f7631cad31fb04b9dfdfa))
69+
* pin exact dependencies in package.json ([#1068](https://github.com/hirosystems/stacks-blockchain-api/issues/1068)) ([303eaaa](https://github.com/hirosystems/stacks-blockchain-api/commit/303eaaa8cd520cf8db89a4ef359ca739a945cbbc))
70+
71+
72+
### BREAKING CHANGES
73+
74+
* use event-replay to upgrade, this version includes breaking changes to the db sql schema
75+
176
## [3.0.3](https://github.com/hirosystems/stacks-blockchain-api/compare/v3.0.2...v3.0.3) (2022-04-04)
277

378

docker/docker-compose.dev.postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.7'
22
services:
33
postgres:
4-
image: "postgres:12.2"
4+
image: "postgres:14"
55
ports:
66
- "5490:5432"
77
environment:

docker/docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.7'
22
services:
33
postgres:
4-
image: "postgres:12.2"
4+
image: "postgres:14"
55
ports:
66
- "5490:5432"
77
environment:
@@ -42,7 +42,6 @@ services:
4242
STACKS_CORE_EVENT_HOST: http://0.0.0.0
4343
STACKS_BLOCKCHAIN_API_PORT: 3999
4444
STACKS_BLOCKCHAIN_API_HOST: 0.0.0.0
45-
STACKS_BLOCKCHAIN_API_DB: pg
4645
STACKS_CORE_RPC_HOST: stacks-blockchain
4746
STACKS_CORE_RPC_PORT: 20443
4847
NODE_ENV: development

0 commit comments

Comments
 (0)