Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: convert chain_tip materialized view into a table #1751

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

rafaelcr
Copy link
Collaborator

@rafaelcr rafaelcr commented Nov 16, 2023

This PR removes the chain_tip materialized view, because it relied on COUNT(*) operations that are considerably slow. Instead it updates the chain tip with totals as blocks are ingested.

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (nakamoto@3a2e1ea). Click here to learn what that means.

Additional details and impacted files
@@             Coverage Diff             @@
##             nakamoto    #1751   +/-   ##
===========================================
  Coverage            ?   71.27%           
===========================================
  Files               ?       86           
  Lines               ?    11448           
  Branches            ?     2473           
===========================================
  Hits                ?     8160           
  Misses              ?     3138           
  Partials            ?      150           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Nov 16, 2023

Vercel deployment URL: https://stacks-blockchain-dweu8yng4-blockstack.vercel.app 🚀

@rafaelcr rafaelcr marked this pull request as ready for review November 16, 2023 17:21
Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

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

Nice job on the reorg handling 💯

@rafaelcr rafaelcr merged commit 04b71cc into nakamoto Nov 16, 2023
30 checks passed
@rafaelcr rafaelcr deleted the fix/count-table branch November 16, 2023 19:34
blockstack-devops pushed a commit that referenced this pull request Nov 16, 2023
## [7.4.0-nakamoto.1](v7.3.2...v7.4.0-nakamoto.1) (2023-11-16)

### Features

* add dataset store ([4211328](4211328))
* add step to compile duckdb for Alpine image ([0f40e14](0f40e14))
* better handling of raw events insertion ([bb70ca9](bb70ca9))
* event-replay new_block events handling ([1708b42](1708b42))
* event-replay new_burn_block events handling ([6c0f448](6c0f448))
* event-replay raw events handling ([81f43cf](81f43cf))
* event-replay remainder events handling ([3ede07f](3ede07f))
* event-replay supporting parallel insertions ([f33ecee](f33ecee))
* events folder as environment var ([701bd1a](701bd1a))
* parallel processing using node cluster ([d02a7e8](d02a7e8))
* processing raw events in parallel ([7a6f241](7a6f241))

### Bug Fixes

* add token offering ([8ef039e](8ef039e))
* allow contract-principals in `/extended/v1/address/:principal/mempool` endpoint [#1685](#1685) ([#1704](#1704)) ([163b76a](163b76a))
* better args handlling ([c77ac57](c77ac57))
* better path handling for workers ([1bd8f17](1bd8f17))
* changed processing order ([62a12bd](62a12bd))
* convert `chain_tip` materialized view into a table ([#1751](#1751)) ([04b71cc](04b71cc))
* flaky test ([484d2ea](484d2ea))
* flaky test ([65175f5](65175f5))
* lint ([01589ea](01589ea))
* lint ([82eadcb](82eadcb))
* lint ([8c67ae5](8c67ae5))
* on attachments_new events processing ([0707313](0707313))
* re-enable indexes when finishing the replay ([fc379eb](fc379eb))
* remove dangling promise ([62a48ae](62a48ae))
* revert configurable DB index type ([86154b2](86154b2))
* upgrade semver package to fix ReDoS vulnerability ([6b1605b](6b1605b))
@blockstack-devops
Copy link

🎉 This PR is included in version 7.4.0-nakamoto.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

rafaelcr added a commit that referenced this pull request Dec 29, 2023
* feat: chain tip table

* fix: handle reorgs
rafaelcr added a commit that referenced this pull request Dec 29, 2023
* fix: convert `chain_tip` materialized view into a table (#1751)

* feat: chain tip table

* fix: handle reorgs

* fix: lint
blockstack-devops pushed a commit that referenced this pull request Dec 29, 2023
## [7.3.7-beta.1](v7.3.6...v7.3.7-beta.1) (2023-12-29)

### Bug Fixes

* convert `chain_tip` materialized view into a table ([#1789](#1789)) ([0211932](0211932)), closes [#1751](#1751)
* release pino logger and mempool nonces ([16d3593](16d3593))
blockstack-devops pushed a commit that referenced this pull request Jan 4, 2024
## [7.4.0](v7.3.6...v7.4.0) (2024-01-04)

### Features

* add `/extended/v2/mempool/fees` endpoint ([#1795](#1795)) ([ea9c378](ea9c378))

### Bug Fixes

* convert `chain_tip` materialized view into a table ([#1789](#1789)) ([0211932](0211932)), closes [#1751](#1751)
* optimize mempool transaction reads and writes ([#1781](#1781)) ([#1792](#1792)) ([2700642](2700642))
* release pino logger and mempool nonces ([16d3593](16d3593))
* update client code, fix mempool fee return type ([#1797](#1797)) ([9853e29](9853e29))
blockstack-devops pushed a commit that referenced this pull request Jan 9, 2024
## [7.6.0-nakamoto.1](v7.5.0...v7.6.0-nakamoto.1) (2024-01-09)

### Features

* `GET /extended/v1/burn_block` ([#1766](#1766)) ([cb38b68](cb38b68))
* add `/extended/v2/blocks/:height_or_hash` ([#1774](#1774)) ([e532a5e](e532a5e))
* add `/extended/v2/blocks` endpoint with burn block filters ([#1769](#1769)) ([ceb7be0](ceb7be0))
* add `tx_count` property to `/extended/v2/blocks` ([#1778](#1778)) ([da4cd56](da4cd56))
* add dataset store ([4211328](4211328))
* add step to compile duckdb for Alpine image ([0f40e14](0f40e14))
* better handling of raw events insertion ([bb70ca9](bb70ca9))
* create `/extended/v2/burn-blocks/:height_or_hash/blocks` endpoint ([#1782](#1782)) ([20466a1](20466a1))
* disable rosetta via an ENV var ([#1804](#1804)) ([2d2aee3](2d2aee3))
* event-replay new_block events handling ([1708b42](1708b42))
* event-replay new_burn_block events handling ([6c0f448](6c0f448))
* event-replay raw events handling ([81f43cf](81f43cf))
* event-replay remainder events handling ([3ede07f](3ede07f))
* event-replay supporting parallel insertions ([f33ecee](f33ecee))
* events folder as environment var ([701bd1a](701bd1a))
* ingestion for `TenureChange` and `NakamotoCoinbase` tx types ([#1753](#1753)) ([7c45f53](7c45f53))
* parallel processing using node cluster ([d02a7e8](d02a7e8))
* pox-4 support ([#1754](#1754)) ([285806f](285806f))
* processing raw events in parallel ([7a6f241](7a6f241))
* update to latest TenureChange tx payload ([#1767](#1767)) ([2afb65c](2afb65c))

### Bug Fixes

* add token offering ([8ef039e](8ef039e))
* allow contract-principals in `/extended/v1/address/:principal/mempool` endpoint [#1685](#1685) ([#1704](#1704)) ([163b76a](163b76a))
* better args handlling ([c77ac57](c77ac57))
* better path handling for workers ([1bd8f17](1bd8f17))
* changed processing order ([62a12bd](62a12bd))
* convert `chain_tip` materialized view into a table ([#1751](#1751)) ([04b71cc](04b71cc))
* do not load duckdb binary unless required ([#1776](#1776)) ([db859ae](db859ae))
* flaky test ([484d2ea](484d2ea))
* flaky test ([65175f5](65175f5))
* handle `Problematic` status in `/drop_mempool_tx` event ([#1790](#1790)) ([ce9b38f](ce9b38f))
* import statement in replay controller ([7a10cd8](7a10cd8))
* insert block transaction data in batches ([#1760](#1760)) ([bf99e90](bf99e90))
* lint ([01589ea](01589ea))
* lint ([82eadcb](82eadcb))
* lint ([8c67ae5](8c67ae5))
* move `/extended/v1/burn_block` to `/extended/v2/burn-blocks` ([#1772](#1772)) ([bf2ef0a](bf2ef0a))
* on attachments_new events processing ([0707313](0707313))
* optimize mempool transaction reads and writes ([#1781](#1781)) ([3a02f57](3a02f57))
* re-enable indexes when finishing the replay ([fc379eb](fc379eb))
* remove dangling promise ([62a48ae](62a48ae))
* remove deprecated token endpoints ([#1775](#1775)) ([18f74b7](18f74b7))
* revert configurable DB index type ([86154b2](86154b2))
* upgrade semver package to fix ReDoS vulnerability ([6b1605b](6b1605b))
* vercel preview builds ([#1783](#1783)) ([d36b1c2](d36b1c2))
@blockstack-devops
Copy link

🎉 This PR is included in version 7.6.0-nakamoto.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

blockstack-devops pushed a commit that referenced this pull request Jan 9, 2024
## [7.6.0](v7.5.0...v7.6.0) (2024-01-09)

### Features

* `GET /extended/v1/burn_block` ([#1766](#1766)) ([cb38b68](cb38b68))
* add `/extended/v2/blocks/:height_or_hash` ([#1774](#1774)) ([e532a5e](e532a5e))
* add `/extended/v2/blocks` endpoint with burn block filters ([#1769](#1769)) ([ceb7be0](ceb7be0))
* add `order_by` and `order` params to `/extended/v1/tx/mempool` ([#1810](#1810)) ([2d45b2e](2d45b2e))
* add `tx_count` property to `/extended/v2/blocks` ([#1778](#1778)) ([da4cd56](da4cd56))
* add dataset store ([4211328](4211328))
* add step to compile duckdb for Alpine image ([0f40e14](0f40e14))
* better handling of raw events insertion ([bb70ca9](bb70ca9))
* create `/extended/v2/burn-blocks/:height_or_hash/blocks` endpoint ([#1782](#1782)) ([20466a1](20466a1))
* disable rosetta via an ENV var ([#1804](#1804)) ([2d2aee3](2d2aee3))
* event-replay new_block events handling ([1708b42](1708b42))
* event-replay new_burn_block events handling ([6c0f448](6c0f448))
* event-replay raw events handling ([81f43cf](81f43cf))
* event-replay remainder events handling ([3ede07f](3ede07f))
* event-replay supporting parallel insertions ([f33ecee](f33ecee))
* events folder as environment var ([701bd1a](701bd1a))
* ingestion for `TenureChange` and `NakamotoCoinbase` tx types ([#1753](#1753)) ([7c45f53](7c45f53))
* parallel processing using node cluster ([d02a7e8](d02a7e8))
* pox-4 support ([#1754](#1754)) ([285806f](285806f))
* processing raw events in parallel ([7a6f241](7a6f241))
* support tenure_change in tx type filter queries ([#1808](#1808)) ([0831393](0831393))
* update to latest TenureChange tx payload ([#1767](#1767)) ([2afb65c](2afb65c))

### Bug Fixes

* add token offering ([8ef039e](8ef039e))
* allow contract-principals in `/extended/v1/address/:principal/mempool` endpoint [#1685](#1685) ([#1704](#1704)) ([163b76a](163b76a))
* better args handlling ([c77ac57](c77ac57))
* better path handling for workers ([1bd8f17](1bd8f17))
* changed processing order ([62a12bd](62a12bd))
* convert `chain_tip` materialized view into a table ([#1751](#1751)) ([04b71cc](04b71cc))
* do not load duckdb binary unless required ([#1776](#1776)) ([db859ae](db859ae))
* **docs:** URL query arrays should be formatted with `form` rather than comma-separated ([#1807](#1807)) ([e184fb5](e184fb5))
* flaky test ([484d2ea](484d2ea))
* flaky test ([65175f5](65175f5))
* handle `Problematic` status in `/drop_mempool_tx` event ([#1790](#1790)) ([ce9b38f](ce9b38f))
* import statement in replay controller ([7a10cd8](7a10cd8))
* insert block transaction data in batches ([#1760](#1760)) ([bf99e90](bf99e90))
* lint ([01589ea](01589ea))
* lint ([82eadcb](82eadcb))
* lint ([8c67ae5](8c67ae5))
* move `/extended/v1/burn_block` to `/extended/v2/burn-blocks` ([#1772](#1772)) ([bf2ef0a](bf2ef0a))
* on attachments_new events processing ([0707313](0707313))
* optimize mempool transaction reads and writes ([#1781](#1781)) ([3a02f57](3a02f57))
* re-enable indexes when finishing the replay ([fc379eb](fc379eb))
* remove dangling promise ([62a48ae](62a48ae))
* remove deprecated token endpoints ([#1775](#1775)) ([18f74b7](18f74b7))
* revert configurable DB index type ([86154b2](86154b2))
* support comma-separated strings in array query params ([#1809](#1809)) ([c9a4df8](c9a4df8))
* upgrade semver package to fix ReDoS vulnerability ([6b1605b](6b1605b))
* vercel preview builds ([#1783](#1783)) ([d36b1c2](d36b1c2))
@blockstack-devops
Copy link

🎉 This PR is included in version 7.6.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants