Skip to content

Pass through raw meterBundleResponse in block API#160

Merged
niran merged 1 commit intomasterfrom
niran/meter-bundle-passthrough
Apr 9, 2026
Merged

Pass through raw meterBundleResponse in block API#160
niran merged 1 commit intomasterfrom
niran/meter-bundle-passthrough

Conversation

@niran
Copy link
Copy Markdown
Contributor

@niran niran commented Apr 9, 2026

Summary

  • Store the raw meter_bundle_response from S3 on each BlockTransaction instead of extracting individual fields (executionTimeUs, stateRootTimeUs, gasUsed)
  • The /api/block/[hash] API serializes it as metering: { transaction, bundle } where transaction is results[0] and bundle is everything else from the meter bundle response
  • New fields added to MeterBundleResponse or TransactionResult in the base node (e.g. stateRootAccountNodeCount, stateRootStorageNodeCount from v0.7) flow through to API consumers automatically without TIPS code changes

Breaking change

The per-transaction shape in the block API response changes from flat fields:

{
  "hash": "0x...",
  "gasUsed": "4804266",
  "executionTimeUs": 62988,
  "stateRootTimeUs": 926848,
  "bundleId": "..."
}

To nested metering:

{
  "hash": "0x...",
  "bundleId": "...",
  "metering": {
    "transaction": {
      "executionTimeUs": 62988,
      "gasUsed": 4804266,
      "txHash": "0x...",
      "fromAddress": "0x...",
      "toAddress": "0x..."
    },
    "bundle": {
      "stateRootTimeUs": 926848,
      "stateRootAccountNodeCount": 42,
      "stateRootStorageNodeCount": 100,
      "totalGasUsed": 4804266,
      "totalExecutionTimeUs": 62988,
      "bundleHash": "0x...",
      "stateBlockNumber": 44446624
    }
  }
}

The block page UI is updated to read from the new shape. The /bundles/[uuid] page is unaffected (it reads directly from S3).

Store the raw meter_bundle_response from S3 on each BlockTransaction
instead of extracting individual fields (executionTimeUs,
stateRootTimeUs, gasUsed). The API serializes it as
metering: { transaction, bundle } where transaction is results[0]
and bundle is everything else.

This means new fields added to MeterBundleResponse or
TransactionResult in the base node (e.g. stateRootAccountNodeCount,
stateRootStorageNodeCount from v0.7) flow through to API consumers
automatically without TIPS code changes.
@niran niran requested a review from wlawt April 9, 2026 20:41
@niran niran merged commit 3cd73fe into master Apr 9, 2026
7 checks passed
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.

2 participants