From 8604e32290161db6dbc43f29542488e5626df305 Mon Sep 17 00:00:00 2001 From: Toufeeq Pasha Date: Thu, 12 Jun 2025 09:42:29 +0530 Subject: [PATCH 1/8] updated the header lookup --- packages/apps-config/src/api/spec/avail.ts | 3 ++- packages/apps-config/src/api/spec/dataavail.ts | 3 ++- packages/apps-config/src/api/typesBundle.ts | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/apps-config/src/api/spec/avail.ts b/packages/apps-config/src/api/spec/avail.ts index a5a796ad1a2a..ee2b8efad0e5 100644 --- a/packages/apps-config/src/api/spec/avail.ts +++ b/packages/apps-config/src/api/spec/avail.ts @@ -79,7 +79,8 @@ const definitions: OverrideBundleDefinition = { }, CompactDataLookup: { size: 'Compact', - index: 'Vec' + index: 'Vec', + rowsPerTx: 'Vec' }, KateCommitment: { rows: 'Compact', diff --git a/packages/apps-config/src/api/spec/dataavail.ts b/packages/apps-config/src/api/spec/dataavail.ts index 2751e80f1f3e..c69b55c74f1e 100644 --- a/packages/apps-config/src/api/spec/dataavail.ts +++ b/packages/apps-config/src/api/spec/dataavail.ts @@ -95,7 +95,8 @@ const definitions: OverrideBundleDefinition = { }, DataLookup: { size: 'Compact', - index: 'Vec' + index: 'Vec', + rowsPerTx: 'Vec' }, KateCommitment: { rows: 'Compact', diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index a5f39679dee2..31e644b2f2b5 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -16353,7 +16353,8 @@ export const typesBundle = { }, "CompactDataLookup": { "size": "Compact", - "index": "Vec" + "index": "Vec", + "rowsPerTx": "Vec" }, "KateCommitment": { "rows": "Compact", @@ -22754,7 +22755,8 @@ export const typesBundle = { }, "DataLookup": { "size": "Compact", - "index": "Vec" + "index": "Vec", + "rowsPerTx": "Vec" }, "KateCommitment": { "rows": "Compact", From 3825e2c66bc658d4ca406085acc1b12a65f9a562 Mon Sep 17 00:00:00 2001 From: Toufeeq Pasha Date: Tue, 2 Dec 2025 23:00:36 +0530 Subject: [PATCH 2/8] Update HeaderExtension definition to support KZG & FRI headers --- packages/apps-config/src/api/spec/avail.ts | 33 ++++- .../apps-config/src/api/spec/dataavail.ts | 80 ++++++++----- packages/apps-config/src/api/typesBundle.ts | 113 +++++++++++++----- 3 files changed, 160 insertions(+), 66 deletions(-) diff --git a/packages/apps-config/src/api/spec/avail.ts b/packages/apps-config/src/api/spec/avail.ts index ee2b8efad0e5..719dd867a288 100644 --- a/packages/apps-config/src/api/spec/avail.ts +++ b/packages/apps-config/src/api/spec/avail.ts @@ -78,6 +78,10 @@ const definitions: OverrideBundleDefinition = { start: 'Compact' }, CompactDataLookup: { + size: 'Compact', + index: 'Vec' + }, + CompactDataLookupV4: { size: 'Compact', index: 'Vec', rowsPerTx: 'Vec' @@ -92,11 +96,34 @@ const definitions: OverrideBundleDefinition = { appLookup: 'CompactDataLookup', commitment: 'KateCommitment' }, + V4HeaderExtension: { + appLookup: 'CompactDataLookupV4', + commitment: 'KateCommitment' + }, + KzgHeader: { + _enum: { + V4: 'V4HeaderExtension' + } + }, + FriParamsVersion: 'u8', + FriBlobCommitment: { + sizeBytes: 'u64', + commitment: 'Vec' + }, + FriV1HeaderExtension: { + blobs: 'Vec', + dataRoot: 'H256', + paramsVersion: 'FriParamsVersion' + }, + FriHeader: { + _enum: { + V1: 'FriV1HeaderExtension' + } + }, HeaderExtension: { _enum: { - V1: 'V3HeaderExtension', - V2: 'V3HeaderExtension', - V3: 'V3HeaderExtension' + Kzg: 'KzgHeader', + Fri: 'FriHeader' } }, DaHeader: { diff --git a/packages/apps-config/src/api/spec/dataavail.ts b/packages/apps-config/src/api/spec/dataavail.ts index c69b55c74f1e..83895404acd9 100644 --- a/packages/apps-config/src/api/spec/dataavail.ts +++ b/packages/apps-config/src/api/spec/dataavail.ts @@ -89,13 +89,17 @@ const definitions: OverrideBundleDefinition = { minmax: [0, undefined], types: { AppId: 'Compact', - DataLookupIndexItem: { + DataLookupItem: { appId: 'AppId', start: 'Compact' }, - DataLookup: { + CompactDataLookup: { size: 'Compact', - index: 'Vec', + index: 'Vec' + }, + CompactDataLookupV4: { + size: 'Compact', + index: 'Vec', rowsPerTx: 'Vec' }, KateCommitment: { @@ -104,29 +108,38 @@ const definitions: OverrideBundleDefinition = { commitment: 'Vec', dataRoot: 'H256' }, - V1HeaderExtension: { - appLookup: 'DataLookup', + V3HeaderExtension: { + appLookup: 'CompactDataLookup', commitment: 'KateCommitment' }, - V2HeaderExtension: { - appLookup: 'DataLookup', + V4HeaderExtension: { + appLookup: 'CompactDataLookupV4', commitment: 'KateCommitment' }, - V3HeaderExtension: { - appLookup: 'DataLookup', - commitment: 'KateCommitment' + KzgHeader: { + _enum: { + V4: 'V4HeaderExtension' + } + }, + FriParamsVersion: 'u8', + FriBlobCommitment: { + sizeBytes: 'u64', + commitment: 'Vec' }, - VTHeaderExtension: { - newField: 'Vec', - commitment: 'KateCommitment', - appLookup: 'DataLookup' + FriV1HeaderExtension: { + blobs: 'Vec', + dataRoot: 'H256', + paramsVersion: 'FriParamsVersion' + }, + FriHeader: { + _enum: { + V1: 'FriV1HeaderExtension' + } }, HeaderExtension: { _enum: { - V1: 'V1HeaderExtension', - V2: 'V2HeaderExtension', - V3: 'V3HeaderExtension', - VTest: 'VTHeaderExtension' + Kzg: 'KzgHeader', + Fri: 'FriHeader' } }, DaHeader: { @@ -160,40 +173,47 @@ const definitions: OverrideBundleDefinition = { mandatory: 'u32' }, DataProof: { - root: 'H256', + roots: 'TxDataRoots', proof: 'Vec', numberOfLeaves: 'Compact', leafIndex: 'Compact', leaf: 'H256' }, - DataProofV2: { + TxDataRoots: { dataRoot: 'H256', blobRoot: 'H256', - bridgeRoot: 'H256', - proof: 'Vec', - numberOfLeaves: 'Compact', - leafIndex: 'Compact', - leaf: 'H256' + bridgeRoot: 'H256' }, ProofResponse: { - dataProof: 'DataProofV2', - message: 'Option' + dataProof: 'DataProof', + message: 'Option' }, - Message: { - messageType: 'MessageType', + AddressedMessage: { + message: 'Message', from: 'H256', to: 'H256', originDomain: 'u32', destinationDomain: 'u32', - data: 'Vec', id: 'u64' }, + Message: { + _enum: { + ArbitraryMessage: 'ArbitraryMessage', + FungibleToken: 'FungibleToken' + } + }, MessageType: { _enum: [ 'ArbitraryMessage', 'FungibleToken' ] }, + FungibleToken: { + assetId: 'H256', + amount: 'String' + }, + BoundedData: 'Vec', + ArbitraryMessage: 'BoundedData', Cell: { row: 'BlockLengthRows', col: 'BlockLengthColumns' diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index 31e644b2f2b5..c97609e87427 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -16352,6 +16352,10 @@ export const typesBundle = { "start": "Compact" }, "CompactDataLookup": { + "size": "Compact", + "index": "Vec" + }, + "CompactDataLookupV4": { "size": "Compact", "index": "Vec", "rowsPerTx": "Vec" @@ -16366,11 +16370,34 @@ export const typesBundle = { "appLookup": "CompactDataLookup", "commitment": "KateCommitment" }, + "V4HeaderExtension": { + "appLookup": "CompactDataLookupV4", + "commitment": "KateCommitment" + }, + "KzgHeader": { + "_enum": { + "V4": "V4HeaderExtension" + } + }, + "FriParamsVersion": "u8", + "FriBlobCommitment": { + "sizeBytes": "u64", + "commitment": "Vec" + }, + "FriV1HeaderExtension": { + "blobs": "Vec", + "dataRoot": "H256", + "paramsVersion": "FriParamsVersion" + }, + "FriHeader": { + "_enum": { + "V1": "FriV1HeaderExtension" + } + }, "HeaderExtension": { "_enum": { - "V1": "V3HeaderExtension", - "V2": "V3HeaderExtension", - "V3": "V3HeaderExtension" + "Kzg": "KzgHeader", + "Fri": "FriHeader" } }, "DaHeader": { @@ -22749,13 +22776,17 @@ export const typesBundle = { ], "types": { "AppId": "Compact", - "DataLookupIndexItem": { + "DataLookupItem": { "appId": "AppId", "start": "Compact" }, - "DataLookup": { + "CompactDataLookup": { + "size": "Compact", + "index": "Vec" + }, + "CompactDataLookupV4": { "size": "Compact", - "index": "Vec", + "index": "Vec", "rowsPerTx": "Vec" }, "KateCommitment": { @@ -22764,29 +22795,38 @@ export const typesBundle = { "commitment": "Vec", "dataRoot": "H256" }, - "V1HeaderExtension": { - "appLookup": "DataLookup", + "V3HeaderExtension": { + "appLookup": "CompactDataLookup", "commitment": "KateCommitment" }, - "V2HeaderExtension": { - "appLookup": "DataLookup", + "V4HeaderExtension": { + "appLookup": "CompactDataLookupV4", "commitment": "KateCommitment" }, - "V3HeaderExtension": { - "appLookup": "DataLookup", - "commitment": "KateCommitment" + "KzgHeader": { + "_enum": { + "V4": "V4HeaderExtension" + } + }, + "FriParamsVersion": "u8", + "FriBlobCommitment": { + "sizeBytes": "u64", + "commitment": "Vec" + }, + "FriV1HeaderExtension": { + "blobs": "Vec", + "dataRoot": "H256", + "paramsVersion": "FriParamsVersion" }, - "VTHeaderExtension": { - "newField": "Vec", - "commitment": "KateCommitment", - "appLookup": "DataLookup" + "FriHeader": { + "_enum": { + "V1": "FriV1HeaderExtension" + } }, "HeaderExtension": { "_enum": { - "V1": "V1HeaderExtension", - "V2": "V2HeaderExtension", - "V3": "V3HeaderExtension", - "VTest": "VTHeaderExtension" + "Kzg": "KzgHeader", + "Fri": "FriHeader" } }, "DaHeader": { @@ -22820,40 +22860,47 @@ export const typesBundle = { "mandatory": "u32" }, "DataProof": { - "root": "H256", + "roots": "TxDataRoots", "proof": "Vec", "numberOfLeaves": "Compact", "leafIndex": "Compact", "leaf": "H256" }, - "DataProofV2": { + "TxDataRoots": { "dataRoot": "H256", "blobRoot": "H256", - "bridgeRoot": "H256", - "proof": "Vec", - "numberOfLeaves": "Compact", - "leafIndex": "Compact", - "leaf": "H256" + "bridgeRoot": "H256" }, "ProofResponse": { - "dataProof": "DataProofV2", - "message": "Option" + "dataProof": "DataProof", + "message": "Option" }, - "Message": { - "messageType": "MessageType", + "AddressedMessage": { + "message": "Message", "from": "H256", "to": "H256", "originDomain": "u32", "destinationDomain": "u32", - "data": "Vec", "id": "u64" }, + "Message": { + "_enum": { + "ArbitraryMessage": "ArbitraryMessage", + "FungibleToken": "FungibleToken" + } + }, "MessageType": { "_enum": [ "ArbitraryMessage", "FungibleToken" ] }, + "FungibleToken": { + "assetId": "H256", + "amount": "String" + }, + "BoundedData": "Vec", + "ArbitraryMessage": "BoundedData", "Cell": { "row": "BlockLengthRows", "col": "BlockLengthColumns" From 1379dec7ddb67f27c7fe230d613b7e9cc4fadfbe Mon Sep 17 00:00:00 2001 From: Toufeeq Pasha Date: Thu, 22 Jan 2026 11:26:55 +0530 Subject: [PATCH 3/8] adde blobHash to FriHeader --- packages/apps-config/src/api/spec/avail.ts | 1 + packages/apps-config/src/api/spec/dataavail.ts | 1 + packages/apps-config/src/api/typesBundle.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/apps-config/src/api/spec/avail.ts b/packages/apps-config/src/api/spec/avail.ts index 719dd867a288..26e11905e082 100644 --- a/packages/apps-config/src/api/spec/avail.ts +++ b/packages/apps-config/src/api/spec/avail.ts @@ -107,6 +107,7 @@ const definitions: OverrideBundleDefinition = { }, FriParamsVersion: 'u8', FriBlobCommitment: { + blobHash: 'H256', sizeBytes: 'u64', commitment: 'Vec' }, diff --git a/packages/apps-config/src/api/spec/dataavail.ts b/packages/apps-config/src/api/spec/dataavail.ts index 83895404acd9..385bab6d52eb 100644 --- a/packages/apps-config/src/api/spec/dataavail.ts +++ b/packages/apps-config/src/api/spec/dataavail.ts @@ -123,6 +123,7 @@ const definitions: OverrideBundleDefinition = { }, FriParamsVersion: 'u8', FriBlobCommitment: { + blobHash: 'H256', sizeBytes: 'u64', commitment: 'Vec' }, diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index c97609e87427..8c7d201bc411 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -16381,6 +16381,7 @@ export const typesBundle = { }, "FriParamsVersion": "u8", "FriBlobCommitment": { + "blobHash": "H256", "sizeBytes": "u64", "commitment": "Vec" }, From d126ed8be9be303e4d4756df207cbb9a584944f5 Mon Sep 17 00:00:00 2001 From: Toufeeq Pasha Date: Thu, 22 Jan 2026 11:40:45 +0530 Subject: [PATCH 4/8] remove app-id extension --- packages/apps-config/src/api/typesBundle.ts | 1 + packages/react-signer/src/TxSigned.tsx | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index 8c7d201bc411..46d6b89cc098 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -22811,6 +22811,7 @@ export const typesBundle = { }, "FriParamsVersion": "u8", "FriBlobCommitment": { + "blobHash": "H256", "sizeBytes": "u64", "commitment": "Vec" }, diff --git a/packages/react-signer/src/TxSigned.tsx b/packages/react-signer/src/TxSigned.tsx index 3a99aef60520..5bb487d350e3 100644 --- a/packages/react-signer/src/TxSigned.tsx +++ b/packages/react-signer/src/TxSigned.tsx @@ -24,12 +24,11 @@ import { Button, ErrorBoundary, Modal, Output, styled, Toggle } from '@polkadot/ import { useApi, useLedger, useQueue, useToggle } from '@polkadot/react-hooks'; import { keyring } from '@polkadot/ui-keyring'; // import { settings } from '@polkadot/ui-settings'; -import { assert, BN_ZERO, nextTick } from '@polkadot/util'; +import { assert, nextTick } from '@polkadot/util'; import { addressEq } from '@polkadot/util-crypto'; import { AccountSigner, LedgerSigner, QrSigner } from './signers/index.js'; import Address from './Address.js'; -import AppId from './AppId.js'; import Qr from './Qr.js'; import SignFields from './SignFields.js'; import Tip from './Tip.js'; @@ -249,7 +248,6 @@ function TxSigned ({ className, currentItem, isQueueSubmit, queueSize, requestAd const [{ innerHash, innerTx }, setCallInfo] = useState(EMPTY_INNER); const [tip, setTip] = useState(); const [initialIsQueueSubmit] = useState(isQueueSubmit); - const [appId, setAppId] = useState(BN_ZERO); useEffect((): void => { setFlags(tryExtract(senderInfo.signAddress)); @@ -341,7 +339,7 @@ function TxSigned ({ className, currentItem, isQueueSubmit, queueSize, requestAd if (senderInfo.signAddress) { const [tx, [status, pairOrAddress, options, isMockSign]] = await Promise.all([ wrapTx(api, currentItem, senderInfo), - extractParams(api, senderInfo.signAddress, { appId, nonce: -1, tip, withSignedTransaction: true } as Partial, getLedger, setQrState) + extractParams(api, senderInfo.signAddress, { nonce: -1, tip, withSignedTransaction: true } as Partial, getLedger, setQrState) ]); queueSetTxStatus(currentItem.id, status); @@ -350,7 +348,7 @@ function TxSigned ({ className, currentItem, isQueueSubmit, queueSize, requestAd await signAndSend(queueSetTxStatus, currentItem, tx, pairOrAddress, options, api, isMockSign); } }, - [api, appId, getLedger, tip] + [api, getLedger, tip] ); const _onSign = useCallback( @@ -460,7 +458,6 @@ function TxSigned ({ className, currentItem, isQueueSubmit, queueSize, requestAd {!currentItem.payload && ( )} - {!isSubmit && ( Date: Wed, 4 Mar 2026 20:27:00 +0530 Subject: [PATCH 5/8] update header --- packages/apps-config/src/api/typesBundle.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index 46d6b89cc098..c8a85b92a4a1 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -16379,7 +16379,9 @@ export const typesBundle = { "V4": "V4HeaderExtension" } }, - "FriParamsVersion": "u8", + "FriParamsVersion": { + "_enum": [ "V0" ] + }, "FriBlobCommitment": { "blobHash": "H256", "sizeBytes": "u64", From b9663bbc9c75132f55f04ada99c8104f97a0b95d Mon Sep 17 00:00:00 2001 From: Toufeeq Pasha Date: Fri, 1 May 2026 12:43:46 +0530 Subject: [PATCH 6/8] refactor: remove deprecated data structures and update header extensions for FRI support --- packages/apps-config/src/api/spec/avail.ts | 42 +-------- .../apps-config/src/api/spec/dataavail.ts | 42 +-------- packages/apps-config/src/api/typesBundle.ts | 88 ++----------------- 3 files changed, 15 insertions(+), 157 deletions(-) diff --git a/packages/apps-config/src/api/spec/avail.ts b/packages/apps-config/src/api/spec/avail.ts index 26e11905e082..acc0b92d6e96 100644 --- a/packages/apps-config/src/api/spec/avail.ts +++ b/packages/apps-config/src/api/spec/avail.ts @@ -73,39 +73,9 @@ const definitions: OverrideBundleDefinition = { minmax: [0, undefined], types: { AppId: 'Compact', - DataLookupItem: { - appId: 'AppId', - start: 'Compact' - }, - CompactDataLookup: { - size: 'Compact', - index: 'Vec' - }, - CompactDataLookupV4: { - size: 'Compact', - index: 'Vec', - rowsPerTx: 'Vec' - }, - KateCommitment: { - rows: 'Compact', - cols: 'Compact', - commitment: 'Vec', - dataRoot: 'H256' - }, - V3HeaderExtension: { - appLookup: 'CompactDataLookup', - commitment: 'KateCommitment' - }, - V4HeaderExtension: { - appLookup: 'CompactDataLookupV4', - commitment: 'KateCommitment' - }, - KzgHeader: { - _enum: { - V4: 'V4HeaderExtension' - } + FriParamsVersion: { + _enum: ['V0'] }, - FriParamsVersion: 'u8', FriBlobCommitment: { blobHash: 'H256', sizeBytes: 'u64', @@ -116,15 +86,9 @@ const definitions: OverrideBundleDefinition = { dataRoot: 'H256', paramsVersion: 'FriParamsVersion' }, - FriHeader: { - _enum: { - V1: 'FriV1HeaderExtension' - } - }, HeaderExtension: { _enum: { - Kzg: 'KzgHeader', - Fri: 'FriHeader' + V1: 'FriV1HeaderExtension' } }, DaHeader: { diff --git a/packages/apps-config/src/api/spec/dataavail.ts b/packages/apps-config/src/api/spec/dataavail.ts index 385bab6d52eb..017d24aa1b8f 100644 --- a/packages/apps-config/src/api/spec/dataavail.ts +++ b/packages/apps-config/src/api/spec/dataavail.ts @@ -89,39 +89,9 @@ const definitions: OverrideBundleDefinition = { minmax: [0, undefined], types: { AppId: 'Compact', - DataLookupItem: { - appId: 'AppId', - start: 'Compact' - }, - CompactDataLookup: { - size: 'Compact', - index: 'Vec' - }, - CompactDataLookupV4: { - size: 'Compact', - index: 'Vec', - rowsPerTx: 'Vec' - }, - KateCommitment: { - rows: 'Compact', - cols: 'Compact', - commitment: 'Vec', - dataRoot: 'H256' - }, - V3HeaderExtension: { - appLookup: 'CompactDataLookup', - commitment: 'KateCommitment' - }, - V4HeaderExtension: { - appLookup: 'CompactDataLookupV4', - commitment: 'KateCommitment' - }, - KzgHeader: { - _enum: { - V4: 'V4HeaderExtension' - } + FriParamsVersion: { + _enum: ['V0'] }, - FriParamsVersion: 'u8', FriBlobCommitment: { blobHash: 'H256', sizeBytes: 'u64', @@ -132,15 +102,9 @@ const definitions: OverrideBundleDefinition = { dataRoot: 'H256', paramsVersion: 'FriParamsVersion' }, - FriHeader: { - _enum: { - V1: 'FriV1HeaderExtension' - } - }, HeaderExtension: { _enum: { - Kzg: 'KzgHeader', - Fri: 'FriHeader' + V1: 'FriV1HeaderExtension' } }, DaHeader: { diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index c8a85b92a4a1..7ba4a0cb12ae 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -16347,40 +16347,10 @@ export const typesBundle = { ], "types": { "AppId": "Compact", - "DataLookupItem": { - "appId": "AppId", - "start": "Compact" - }, - "CompactDataLookup": { - "size": "Compact", - "index": "Vec" - }, - "CompactDataLookupV4": { - "size": "Compact", - "index": "Vec", - "rowsPerTx": "Vec" - }, - "KateCommitment": { - "rows": "Compact", - "cols": "Compact", - "commitment": "Vec", - "dataRoot": "H256" - }, - "V3HeaderExtension": { - "appLookup": "CompactDataLookup", - "commitment": "KateCommitment" - }, - "V4HeaderExtension": { - "appLookup": "CompactDataLookupV4", - "commitment": "KateCommitment" - }, - "KzgHeader": { - "_enum": { - "V4": "V4HeaderExtension" - } - }, "FriParamsVersion": { - "_enum": [ "V0" ] + "_enum": [ + "V0" + ] }, "FriBlobCommitment": { "blobHash": "H256", @@ -16392,15 +16362,9 @@ export const typesBundle = { "dataRoot": "H256", "paramsVersion": "FriParamsVersion" }, - "FriHeader": { - "_enum": { - "V1": "FriV1HeaderExtension" - } - }, "HeaderExtension": { "_enum": { - "Kzg": "KzgHeader", - "Fri": "FriHeader" + "V1": "FriV1HeaderExtension" } }, "DaHeader": { @@ -22779,39 +22743,11 @@ export const typesBundle = { ], "types": { "AppId": "Compact", - "DataLookupItem": { - "appId": "AppId", - "start": "Compact" - }, - "CompactDataLookup": { - "size": "Compact", - "index": "Vec" - }, - "CompactDataLookupV4": { - "size": "Compact", - "index": "Vec", - "rowsPerTx": "Vec" - }, - "KateCommitment": { - "rows": "Compact", - "cols": "Compact", - "commitment": "Vec", - "dataRoot": "H256" - }, - "V3HeaderExtension": { - "appLookup": "CompactDataLookup", - "commitment": "KateCommitment" - }, - "V4HeaderExtension": { - "appLookup": "CompactDataLookupV4", - "commitment": "KateCommitment" - }, - "KzgHeader": { - "_enum": { - "V4": "V4HeaderExtension" - } + "FriParamsVersion": { + "_enum": [ + "V0" + ] }, - "FriParamsVersion": "u8", "FriBlobCommitment": { "blobHash": "H256", "sizeBytes": "u64", @@ -22822,15 +22758,9 @@ export const typesBundle = { "dataRoot": "H256", "paramsVersion": "FriParamsVersion" }, - "FriHeader": { - "_enum": { - "V1": "FriV1HeaderExtension" - } - }, "HeaderExtension": { "_enum": { - "Kzg": "KzgHeader", - "Fri": "FriHeader" + "V1": "FriV1HeaderExtension" } }, "DaHeader": { From 90242e4dd9dfba94a3fba441c33c03f614b70f8f Mon Sep 17 00:00:00 2001 From: Toufeeq Pasha Date: Mon, 4 May 2026 13:33:51 +0530 Subject: [PATCH 7/8] feat: add blob RPC methods and types for blob management and FRI support --- packages/apps-config/src/api/spec/avail.ts | 144 +++++++-- .../apps-config/src/api/spec/dataavail.ts | 130 +++++++-- packages/apps-config/src/api/typesBundle.ts | 273 +++++++++++++++--- 3 files changed, 474 insertions(+), 73 deletions(-) diff --git a/packages/apps-config/src/api/spec/avail.ts b/packages/apps-config/src/api/spec/avail.ts index acc0b92d6e96..3a36aa3c20ce 100644 --- a/packages/apps-config/src/api/spec/avail.ts +++ b/packages/apps-config/src/api/spec/avail.ts @@ -8,24 +8,52 @@ import type { OverrideBundleDefinition } from '@polkadot/types/types'; const definitions: OverrideBundleDefinition = { rpc: { - kate: { - blockLength: { - description: 'Get Block Length', + blob: { + submitBlob: { + description: 'Submit a blob and its signed metadata transaction', params: [ + { + name: 'metadata_signed_transaction', + type: 'String' + }, + { + name: 'blob', + type: 'String' + } + ], + type: 'Null' + }, + getBlob: { + description: 'Get blob data by blob hash', + params: [ + { + name: 'blob_hash', + type: 'H256' + }, { name: 'at', type: 'Hash', isOptional: true } ], - type: 'BlockLength' + type: 'Blob' }, - queryProof: { - description: 'Generate the kate proof for the given `cells`', + getBlobInfo: { + description: 'Get blob inclusion and ownership information', params: [ { - name: 'cells', - type: 'Vec' + name: 'blob_hash', + type: 'H256' + } + ], + type: 'BlobInfo' + }, + inclusionProof: { + description: 'Generate the inclusion proof for the given blob hash', + params: [ + { + name: 'blob_hash', + type: 'H256' }, { name: 'at', @@ -33,14 +61,25 @@ const definitions: OverrideBundleDefinition = { isOptional: true } ], - type: 'Vec<(U256, [u8; 48])>' + type: 'DataProof' }, - queryDataProof: { - description: 'Generate the data proof for the given `transaction_index`', + getBlobsSummary: { + description: 'Get included blob summaries for a block', params: [ { - name: 'transaction_index', - type: 'u32' + name: 'at', + type: 'Hash', + isOptional: true + } + ], + type: 'Vec' + }, + getBlobsByAppId: { + description: 'Get blob hashes for an AppId in a block', + params: [ + { + name: 'app_id', + type: 'AppId' }, { name: 'at', @@ -48,22 +87,58 @@ const definitions: OverrideBundleDefinition = { isOptional: true } ], - type: 'ProofResponse' + type: 'Vec' }, - queryRows: { - description: 'Query rows based on their indices', + getEvalData: { + description: 'Get FRI evaluation data for a blob', params: [ { - name: 'rows', + name: 'blob_hash', + type: 'H256' + }, + { + name: 'at', + type: 'Hash', + isOptional: true + } + ], + type: 'BlobEvalData' + }, + getSamplingProof: { + description: 'Get FRI sampling proofs for blob cells', + params: [ + { + name: 'cells', type: 'Vec' }, + { + name: 'blob_hash', + type: 'H256' + }, { name: 'at', type: 'Hash', isOptional: true } ], - type: 'Vec>' + type: 'Vec' + } + }, + bridge: { + queryDataProof: { + description: 'Generate the data proof for the given `transaction_index`', + params: [ + { + name: 'transaction_index', + type: 'u32' + }, + { + name: 'at', + type: 'Hash', + isOptional: true + } + ], + type: 'ProofResponse' } } }, @@ -163,6 +238,39 @@ const definitions: OverrideBundleDefinition = { }, BoundedData: 'Vec', ArbitraryMessage: 'BoundedData', + Blob: { + blobHash: 'H256', + data: 'Vec', + size: 'u64' + }, + OwnershipEntry: { + address: 'AccountId32', + babeKey: 'AuthorityId', + encodedPeerId: 'String', + signature: 'Vec' + }, + BlobInfo: { + hash: 'H256', + blockHash: 'H256', + blockNumber: 'u32', + ownership: 'Vec' + }, + BlobSummary: { + hash: 'H256', + txIndex: 'u32', + appId: 'AppId', + sizeBytes: 'u64' + }, + BlobEvalData: { + evalPointSeed: '[u8; 32]', + evalClaim: '[u8; 16]', + evalProof: 'Vec' + }, + SamplingProof: { + index: 'u32', + cell: 'Vec', + proof: 'Vec' + }, Cell: { row: 'BlockLengthRows', col: 'BlockLengthColumns' diff --git a/packages/apps-config/src/api/spec/dataavail.ts b/packages/apps-config/src/api/spec/dataavail.ts index 017d24aa1b8f..3a36aa3c20ce 100644 --- a/packages/apps-config/src/api/spec/dataavail.ts +++ b/packages/apps-config/src/api/spec/dataavail.ts @@ -8,24 +8,52 @@ import type { OverrideBundleDefinition } from '@polkadot/types/types'; const definitions: OverrideBundleDefinition = { rpc: { - kate: { - blockLength: { - description: 'Get Block Length', + blob: { + submitBlob: { + description: 'Submit a blob and its signed metadata transaction', params: [ + { + name: 'metadata_signed_transaction', + type: 'String' + }, + { + name: 'blob', + type: 'String' + } + ], + type: 'Null' + }, + getBlob: { + description: 'Get blob data by blob hash', + params: [ + { + name: 'blob_hash', + type: 'H256' + }, { name: 'at', type: 'Hash', isOptional: true } ], - type: 'BlockLength' + type: 'Blob' }, - queryProof: { - description: 'Generate the kate proof for the given `cells`', + getBlobInfo: { + description: 'Get blob inclusion and ownership information', params: [ { - name: 'cells', - type: 'Vec' + name: 'blob_hash', + type: 'H256' + } + ], + type: 'BlobInfo' + }, + inclusionProof: { + description: 'Generate the inclusion proof for the given blob hash', + params: [ + { + name: 'blob_hash', + type: 'H256' }, { name: 'at', @@ -33,10 +61,21 @@ const definitions: OverrideBundleDefinition = { isOptional: true } ], - type: 'Vec' + type: 'DataProof' }, - queryAppData: { - description: 'Fetches app data rows for the given app', + getBlobsSummary: { + description: 'Get included blob summaries for a block', + params: [ + { + name: 'at', + type: 'Hash', + isOptional: true + } + ], + type: 'Vec' + }, + getBlobsByAppId: { + description: 'Get blob hashes for an AppId in a block', params: [ { name: 'app_id', @@ -48,15 +87,14 @@ const definitions: OverrideBundleDefinition = { isOptional: true } ], - type: 'Vec>>' + type: 'Vec' }, - - queryDataProof: { - description: 'Generate the data proof for the given `transaction_index`', + getEvalData: { + description: 'Get FRI evaluation data for a blob', params: [ { - name: 'transaction_index', - type: 'u32' + name: 'blob_hash', + type: 'H256' }, { name: 'at', @@ -64,9 +102,30 @@ const definitions: OverrideBundleDefinition = { isOptional: true } ], - type: 'DataProof' + type: 'BlobEvalData' }, - queryDataProofV2: { + getSamplingProof: { + description: 'Get FRI sampling proofs for blob cells', + params: [ + { + name: 'cells', + type: 'Vec' + }, + { + name: 'blob_hash', + type: 'H256' + }, + { + name: 'at', + type: 'Hash', + isOptional: true + } + ], + type: 'Vec' + } + }, + bridge: { + queryDataProof: { description: 'Generate the data proof for the given `transaction_index`', params: [ { @@ -179,6 +238,39 @@ const definitions: OverrideBundleDefinition = { }, BoundedData: 'Vec', ArbitraryMessage: 'BoundedData', + Blob: { + blobHash: 'H256', + data: 'Vec', + size: 'u64' + }, + OwnershipEntry: { + address: 'AccountId32', + babeKey: 'AuthorityId', + encodedPeerId: 'String', + signature: 'Vec' + }, + BlobInfo: { + hash: 'H256', + blockHash: 'H256', + blockNumber: 'u32', + ownership: 'Vec' + }, + BlobSummary: { + hash: 'H256', + txIndex: 'u32', + appId: 'AppId', + sizeBytes: 'u64' + }, + BlobEvalData: { + evalPointSeed: '[u8; 32]', + evalClaim: '[u8; 16]', + evalProof: 'Vec' + }, + SamplingProof: { + index: 'u32', + cell: 'Vec', + proof: 'Vec' + }, Cell: { row: 'BlockLengthRows', col: 'BlockLengthColumns' diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index 7ba4a0cb12ae..632f297eab5f 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -16280,24 +16280,52 @@ export const typesBundle = { }, "avail": { "rpc": { - "kate": { - "blockLength": { - "description": "Get Block Length", + "blob": { + "submitBlob": { + "description": "Submit a blob and its signed metadata transaction", "params": [ + { + "name": "metadata_signed_transaction", + "type": "String" + }, + { + "name": "blob", + "type": "String" + } + ], + "type": "Null" + }, + "getBlob": { + "description": "Get blob data by blob hash", + "params": [ + { + "name": "blob_hash", + "type": "H256" + }, { "name": "at", "type": "Hash", "isOptional": true } ], - "type": "BlockLength" + "type": "Blob" }, - "queryProof": { - "description": "Generate the kate proof for the given `cells`", + "getBlobInfo": { + "description": "Get blob inclusion and ownership information", "params": [ { - "name": "cells", - "type": "Vec" + "name": "blob_hash", + "type": "H256" + } + ], + "type": "BlobInfo" + }, + "inclusionProof": { + "description": "Generate the inclusion proof for the given blob hash", + "params": [ + { + "name": "blob_hash", + "type": "H256" }, { "name": "at", @@ -16305,14 +16333,25 @@ export const typesBundle = { "isOptional": true } ], - "type": "Vec<(U256, [u8; 48])>" + "type": "DataProof" }, - "queryDataProof": { - "description": "Generate the data proof for the given `transaction_index`", + "getBlobsSummary": { + "description": "Get included blob summaries for a block", "params": [ { - "name": "transaction_index", - "type": "u32" + "name": "at", + "type": "Hash", + "isOptional": true + } + ], + "type": "Vec" + }, + "getBlobsByAppId": { + "description": "Get blob hashes for an AppId in a block", + "params": [ + { + "name": "app_id", + "type": "AppId" }, { "name": "at", @@ -16320,22 +16359,58 @@ export const typesBundle = { "isOptional": true } ], - "type": "ProofResponse" + "type": "Vec" + }, + "getEvalData": { + "description": "Get FRI evaluation data for a blob", + "params": [ + { + "name": "blob_hash", + "type": "H256" + }, + { + "name": "at", + "type": "Hash", + "isOptional": true + } + ], + "type": "BlobEvalData" }, - "queryRows": { - "description": "Query rows based on their indices", + "getSamplingProof": { + "description": "Get FRI sampling proofs for blob cells", "params": [ { - "name": "rows", + "name": "cells", "type": "Vec" }, + { + "name": "blob_hash", + "type": "H256" + }, + { + "name": "at", + "type": "Hash", + "isOptional": true + } + ], + "type": "Vec" + } + }, + "bridge": { + "queryDataProof": { + "description": "Generate the data proof for the given `transaction_index`", + "params": [ + { + "name": "transaction_index", + "type": "u32" + }, { "name": "at", "type": "Hash", "isOptional": true } ], - "type": "Vec>" + "type": "ProofResponse" } } }, @@ -16439,6 +16514,39 @@ export const typesBundle = { }, "BoundedData": "Vec", "ArbitraryMessage": "BoundedData", + "Blob": { + "blobHash": "H256", + "data": "Vec", + "size": "u64" + }, + "OwnershipEntry": { + "address": "AccountId32", + "babeKey": "AuthorityId", + "encodedPeerId": "String", + "signature": "Vec" + }, + "BlobInfo": { + "hash": "H256", + "blockHash": "H256", + "blockNumber": "u32", + "ownership": "Vec" + }, + "BlobSummary": { + "hash": "H256", + "txIndex": "u32", + "appId": "AppId", + "sizeBytes": "u64" + }, + "BlobEvalData": { + "evalPointSeed": "[u8; 32]", + "evalClaim": "[u8; 16]", + "evalProof": "Vec" + }, + "SamplingProof": { + "index": "u32", + "cell": "Vec", + "proof": "Vec" + }, "Cell": { "row": "BlockLengthRows", "col": "BlockLengthColumns" @@ -22661,24 +22769,52 @@ export const typesBundle = { }, "data-avail": { "rpc": { - "kate": { - "blockLength": { - "description": "Get Block Length", + "blob": { + "submitBlob": { + "description": "Submit a blob and its signed metadata transaction", "params": [ + { + "name": "metadata_signed_transaction", + "type": "String" + }, + { + "name": "blob", + "type": "String" + } + ], + "type": "Null" + }, + "getBlob": { + "description": "Get blob data by blob hash", + "params": [ + { + "name": "blob_hash", + "type": "H256" + }, { "name": "at", "type": "Hash", "isOptional": true } ], - "type": "BlockLength" + "type": "Blob" }, - "queryProof": { - "description": "Generate the kate proof for the given `cells`", + "getBlobInfo": { + "description": "Get blob inclusion and ownership information", "params": [ { - "name": "cells", - "type": "Vec" + "name": "blob_hash", + "type": "H256" + } + ], + "type": "BlobInfo" + }, + "inclusionProof": { + "description": "Generate the inclusion proof for the given blob hash", + "params": [ + { + "name": "blob_hash", + "type": "H256" }, { "name": "at", @@ -22686,10 +22822,21 @@ export const typesBundle = { "isOptional": true } ], - "type": "Vec" + "type": "DataProof" }, - "queryAppData": { - "description": "Fetches app data rows for the given app", + "getBlobsSummary": { + "description": "Get included blob summaries for a block", + "params": [ + { + "name": "at", + "type": "Hash", + "isOptional": true + } + ], + "type": "Vec" + }, + "getBlobsByAppId": { + "description": "Get blob hashes for an AppId in a block", "params": [ { "name": "app_id", @@ -22701,14 +22848,14 @@ export const typesBundle = { "isOptional": true } ], - "type": "Vec>>" + "type": "Vec" }, - "queryDataProof": { - "description": "Generate the data proof for the given `transaction_index`", + "getEvalData": { + "description": "Get FRI evaluation data for a blob", "params": [ { - "name": "transaction_index", - "type": "u32" + "name": "blob_hash", + "type": "H256" }, { "name": "at", @@ -22716,9 +22863,30 @@ export const typesBundle = { "isOptional": true } ], - "type": "DataProof" + "type": "BlobEvalData" }, - "queryDataProofV2": { + "getSamplingProof": { + "description": "Get FRI sampling proofs for blob cells", + "params": [ + { + "name": "cells", + "type": "Vec" + }, + { + "name": "blob_hash", + "type": "H256" + }, + { + "name": "at", + "type": "Hash", + "isOptional": true + } + ], + "type": "Vec" + } + }, + "bridge": { + "queryDataProof": { "description": "Generate the data proof for the given `transaction_index`", "params": [ { @@ -22835,6 +23003,39 @@ export const typesBundle = { }, "BoundedData": "Vec", "ArbitraryMessage": "BoundedData", + "Blob": { + "blobHash": "H256", + "data": "Vec", + "size": "u64" + }, + "OwnershipEntry": { + "address": "AccountId32", + "babeKey": "AuthorityId", + "encodedPeerId": "String", + "signature": "Vec" + }, + "BlobInfo": { + "hash": "H256", + "blockHash": "H256", + "blockNumber": "u32", + "ownership": "Vec" + }, + "BlobSummary": { + "hash": "H256", + "txIndex": "u32", + "appId": "AppId", + "sizeBytes": "u64" + }, + "BlobEvalData": { + "evalPointSeed": "[u8; 32]", + "evalClaim": "[u8; 16]", + "evalProof": "Vec" + }, + "SamplingProof": { + "index": "u32", + "cell": "Vec", + "proof": "Vec" + }, "Cell": { "row": "BlockLengthRows", "col": "BlockLengthColumns" From 69028edb2a6a4973c3545a364bc7f15f2a9a129c Mon Sep 17 00:00:00 2001 From: Toufeeq Pasha Date: Wed, 13 May 2026 12:38:21 +0530 Subject: [PATCH 8/8] fix: reorder fields in FriV1HeaderExtension for consistency with existing circuit --- packages/apps-config/src/api/spec/avail.ts | 4 ++-- packages/apps-config/src/api/spec/dataavail.ts | 4 ++-- packages/apps-config/src/api/typesBundle.ts | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/apps-config/src/api/spec/avail.ts b/packages/apps-config/src/api/spec/avail.ts index 3a36aa3c20ce..78eb1064f604 100644 --- a/packages/apps-config/src/api/spec/avail.ts +++ b/packages/apps-config/src/api/spec/avail.ts @@ -158,8 +158,8 @@ const definitions: OverrideBundleDefinition = { }, FriV1HeaderExtension: { blobs: 'Vec', - dataRoot: 'H256', - paramsVersion: 'FriParamsVersion' + paramsVersion: 'FriParamsVersion', + dataRoot: 'H256' }, HeaderExtension: { _enum: { diff --git a/packages/apps-config/src/api/spec/dataavail.ts b/packages/apps-config/src/api/spec/dataavail.ts index 3a36aa3c20ce..78eb1064f604 100644 --- a/packages/apps-config/src/api/spec/dataavail.ts +++ b/packages/apps-config/src/api/spec/dataavail.ts @@ -158,8 +158,8 @@ const definitions: OverrideBundleDefinition = { }, FriV1HeaderExtension: { blobs: 'Vec', - dataRoot: 'H256', - paramsVersion: 'FriParamsVersion' + paramsVersion: 'FriParamsVersion', + dataRoot: 'H256' }, HeaderExtension: { _enum: { diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index 632f297eab5f..836fcd0ef47a 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -16434,8 +16434,8 @@ export const typesBundle = { }, "FriV1HeaderExtension": { "blobs": "Vec", - "dataRoot": "H256", - "paramsVersion": "FriParamsVersion" + "paramsVersion": "FriParamsVersion", + "dataRoot": "H256" }, "HeaderExtension": { "_enum": { @@ -22923,8 +22923,8 @@ export const typesBundle = { }, "FriV1HeaderExtension": { "blobs": "Vec", - "dataRoot": "H256", - "paramsVersion": "FriParamsVersion" + "paramsVersion": "FriParamsVersion", + "dataRoot": "H256" }, "HeaderExtension": { "_enum": {