Skip to content

feat: Asset Hub migration and elastic scaling preparation - Array responses for useRcBlock, remove rcAt in favor of useRcBlock#1709

Merged
TarikGul merged 11 commits into
masterfrom
tg-rcAt-modify
Jul 23, 2025
Merged

feat: Asset Hub migration and elastic scaling preparation - Array responses for useRcBlock, remove rcAt in favor of useRcBlock#1709
TarikGul merged 11 commits into
masterfrom
tg-rcAt-modify

Conversation

@TarikGul

@TarikGul TarikGul commented Jul 23, 2025

Copy link
Copy Markdown
Member

Summary

This PR updates all endpoints that support useRcBlock parameters to return array responses in preparation for Asset Hub migration and Polkadot/Kusama elastic scaling. This enables support for multiple Asset Hub blocks per
relay chain block while maintaining backward compatibility. This PR also removes any use of rcAt in favor of useRcBlock.

useRcBlock

  • useRcBlock works in conjunction with at, unless its a /blocks endpoint which will use the block number in the path, or header if no block is supplied.

Response Structure Changes

WithuseRcBlock parameters:

[
  {
    "at": {...},
    "data": "...",
    "rcBlockNumber": "5678901",
    "ahTimestamp": "1234567890"
  }
]

When no Asset Hub blocks found:

[]

Without these parameters (unchanged):

{
  "at": {...},
  "data": "..."
}

Affected Endpoints

Account Endpoints with useRcBlock

  • /accounts/{accountId}/asset-balances
  • /accounts/{accountId}/asset-approvals
  • /accounts/{accountId}/pool-asset-balances
  • /accounts/{accountId}/pool-asset-approvals
  • /accounts/{accountId}/balance-info
  • /accounts/{accountId}/staking-info
  • /accounts/{accountId}/staking-payouts
  • /accounts/{accountId}/vesting-info
  • /accounts/{accountId}/proxy-info

Block Endpoints with useRcBlock

  • /blocks/head
  • /blocks/{blockId}
  • /blocks/{blockId}/header
  • /blocks/head/header
  • /blocks/{blockId}/extrinsics/{extrinsicIndex}
  • /blocks/{blockId}/extrinsics-raw
  • /blocks (range queries)

Pallets Endpoints with useRcBlock

  • /pallets/asset-conversion/next-available-id
  • /pallets/asset-conversion/liquidity-pools
  • /pallets/assets/{assetId}/asset-info
  • /pallets/{palletId}/consts
  • /pallets/{palletId}/consts/{constantItemId}
  • /pallets/{palletId}/dispatchables
  • /pallets/{palletId}/dispatchables/{dispatchableItemId}
  • /pallets/{palletId}/events
  • /pallets/{palletId}/events/{eventItemId}
  • /pallets/{palletId}/errors
  • /pallets/{palletId}/errors/{errorItemId}
  • /pallets/foreign-assets
  • /pallets/nomination-pools/info
  • /pallets/nomination-pools/{poolId}
  • /pallets/ongoing-referenda
  • /pallets/pool-assets/{assetId}/asset-info
  • /pallets/staking/progress
  • /pallets/staking/validators
  • /pallets/{palletId}/storage
  • /pallets/{palletId}/storage/{storageItemId}

Usage

Using useRcBlock parameter:

const response = await fetch('/accounts/123/balance-info?at=5000000&useRcBlock=true');
const data = await response.json();

if (data.length === 0) {
  console.log('No Asset Hub blocks found');
} else {
  data.forEach(item => {
    console.log(item.free);
    console.log(item.rcBlockNumber);
  });
}

Standard usage (unchanged):

const response = await fetch('/accounts/123/balance-info');
const data = await response.json();
console.log(data.free); // Single object response

Backward Compatibility

Regular queries without useRcBlock continue to return single objects unchanged. Only queries using these parameters now return arrays.

@TarikGul TarikGul requested a review from a team as a code owner July 23, 2025 02:41
@TarikGul TarikGul changed the title feat: Asset Hub migration and elastic scaling preparation - Array responses for rcAt and useRcBlock parameters feat: Asset Hub migration and elastic scaling preparation - Array responses for useRcBlock, remove rcAt in favor of useRcBlock Jul 23, 2025
@TarikGul TarikGul merged commit 1c97088 into master Jul 23, 2025
19 of 21 checks passed
@TarikGul TarikGul deleted the tg-rcAt-modify branch July 23, 2025 20:17
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.

3 participants