Skip to content

Conversation

zone117x
Copy link
Contributor

@zone117x zone117x commented May 26, 2025

Closes #2270

Implements SNP event streaming support in the API. An integration test harness is also implemented which spins up a local SNP server, populates it with events from a tsv (simulating a stacks-node), then ensures the API is able to sync all events from SNP.

This PR uses a new approach to orchestrating service dependencies. Rather than using docker-compose, the docker containers are configured programmatically in test initialization code.

Copy link

github-actions bot commented May 26, 2025

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

Copy link

codecov bot commented May 26, 2025

Codecov Report

❌ Patch coverage is 68.75000% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/index.ts 0.00% 6 Missing and 1 partial ⚠️
src/datastore/pg-write-store.ts 0.00% 4 Missing ⚠️
src/event-stream/snp-event-stream.ts 87.87% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

console.log(`Using REDIS_STREAM_KEY_PREFIX: ${process.env.SNP_REDIS_STREAM_KEY_PREFIX}`);
const snpContainer = await startContainer({
docker,
image: 'hirosystems/salt-n-pepper:1.1.1',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This image is private on docker hub so CI isn't working. Need to make it public

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 great! Thanks @zone117x !

@zone117x zone117x merged commit 9a159e1 into develop Jun 3, 2025
27 checks passed
@zone117x zone117x deleted the feat/snp-ingestion branch June 3, 2025 02:22
hirosystems-release-bot bot added a commit that referenced this pull request Aug 6, 2025
## [8.12.0](v8.11.6...v8.12.0) (2025-08-06)

### Features

* Add exclude_function_args parameter to reduce transaction response sizes ([#2312](#2312)) ([852a60e](852a60e))
* add replaced_by_tx_id to replaced mempool transactions ([#2271](#2271)) ([a70c3d1](a70c3d1))
* **prometheus:** add chain tip metrics ([#2333](#2333)) ([bde1037](bde1037))
* SNP integration ([#2291](#2291)) ([9a159e1](9a159e1))

### Bug Fixes

* drop redundant db indexes ([#2329](#2329)) ([0ddd6a6](0ddd6a6))
* ensure some ops only run when SNP is not enabled ([fd4717b](fd4717b))
* only ingest snp chain events to avoid db bloat ([287f572](287f572))
* optimize queries to prune and restore mempool rbf txs ([#2327](#2327)) ([0b196f0](0b196f0))
* optimize replace-by-fee mempool calculations ([#2326](#2326)) ([01998bc](01998bc))
* parallelize mempool rbf updates ([#2328](#2328)) ([e7347e5](e7347e5))
* update snp image in tests ([c7c0dbb](c7c0dbb))
@hirosystems-release-bot
Copy link
Contributor

🎉 This PR is included in version 8.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stacks-blockchain-api : Add support for S&P event streams

2 participants