Skip to content

fix: count stx mint data at block 0 towards account balances#2289

Merged
rafaelcr merged 2 commits intodevelopfrom
fix/devnet-balances
May 23, 2025
Merged

fix: count stx mint data at block 0 towards account balances#2289
rafaelcr merged 2 commits intodevelopfrom
fix/devnet-balances

Conversation

@rafaelcr
Copy link
Copy Markdown
Collaborator

@rafaelcr rafaelcr commented May 22, 2025

Our chain_tip table starts with block_height at zero, so when the API received the block 0 boot data from the Stacks node it is always marked as non-canonical.

This affected FT balance calculations because STX mint events contained within were not being considered, especially in devnet or testnet deployments where devs were configuring [[ustx_balance]] settings in their Stacks nodes.

This PR makes it so block 0 STX mint data is always considered for balances.

Related to #2267

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2025

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@rafaelcr rafaelcr changed the title fix: always treat block 0 boot data as canonical fix: count stx mint data at block 0 towards account balances May 22, 2025
Copy link
Copy Markdown
Contributor

@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 fix!

@rafaelcr rafaelcr merged commit a0cd9f2 into develop May 23, 2025
26 checks passed
@rafaelcr rafaelcr deleted the fix/devnet-balances branch May 23, 2025 02:43
hirosystems-release-bot Bot added a commit that referenced this pull request May 26, 2025
## [8.11.0](v8.10.0...v8.11.0) (2025-05-26)

### Features

* add /extended/v2/block-tenures/:height/blocks endpoint ([#2285](#2285)) ([f5c2e01](f5c2e01))
* stacks core event and rpc proxy body limits configurable via env ([#2278](#2278)) ([8a54e9d](8a54e9d))
* store and expose vm_error for failed transactions ([#2286](#2286)) ([7ac7513](7ac7513))

### Bug Fixes

* consider microblock transactions in balance calculations ([#2277](#2277)) ([3418863](3418863))
* count stx mint data at block 0 towards account balances ([#2289](#2289)) ([a0cd9f2](a0cd9f2))
* ignore unanchored param for BNS names endpoint ([#2263](#2263)) ([3d33725](3d33725))
* keep a table of latest stacks node event timestamps ([#2266](#2266)) ([6f111ad](6f111ad))
* module imports in block tenure routes ([#2287](#2287)) ([2cb442e](2cb442e))
* **rosetta:** get current block should only join by stacks chain tip information ([#2265](#2265)) ([78ebad0](78ebad0))
* simplify transaction events query ([#2279](#2279)) ([517ca68](517ca68))
@hirosystems-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 8.11.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.

2 participants