Skip to content

fix: processBlockData parses HISTORICAL_BLOCKSIZES flat-array shape#63

Closed
mukama wants to merge 1 commit intotetherto:developfrom
mukama:fix/subsidy-fees-block-data
Closed

fix: processBlockData parses HISTORICAL_BLOCKSIZES flat-array shape#63
mukama wants to merge 1 commit intotetherto:developfrom
mukama:fix/subsidy-fees-block-data

Conversation

@mukama
Copy link
Copy Markdown
Contributor

@mukama mukama commented Apr 28, 2026

Summary

Fixes Bug C from the FE refactor smoke test: processBlockData returned an empty daily map for HISTORICAL_BLOCKSIZES because it only handled nested .data/.blocks wrappers, not the flat array of block records the mempool worker actually returns. Also surfaces blockSize on log entries and summary so SubsidyFee's "Avg Fees in Sats/vByte" chart can render.

Asana: https://app.asana.com/1/45238840754660/project/1205537444723387/task/1214118019754316

Test plan

  • 550/550 unit tests pass; standard lint clean
  • Smoke against dev-moria.tether.to: SubsidyFee renders real data

The mempool worker's getWrkExtData returns a flat array of block records
[{ts, blockSize, blockReward, blockTotalFees}, ...], but processBlockData
only handled nested .data/.blocks wrappers - it iterated entry's own field
names, Number('ts') returned NaN, and produced an empty daily map. The
SubsidyFee page then rendered "No data available".

Detect the flat shape (entry has .ts/.timestamp/.time) and process it
directly. Also surface blockSize on getSubsidyFees and getRevenueSummary
log entries (and totalBlockSize/avgBlockSize on the summary) - needed for
SubsidyFee's "Avg Fees in Sats/vByte" chart to render after this fix.
@mukama
Copy link
Copy Markdown
Contributor Author

mukama commented Apr 28, 2026

Consolidated into #67.

@mukama mukama closed this Apr 28, 2026
@mukama mukama deleted the fix/subsidy-fees-block-data branch April 28, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant