kate_blockLength method retrieves the dimensions and configuration parameters of the Kate commitment data availability matrix for a specific block.
Method Signature
Parameters
Block hash at which to query the block length parameters. If not provided, uses the best (latest finalized) block.Format: 32-byte hexadecimal hash prefixed with
0xExample: "0xa1b2c3d4e5f6789012345678901234567890123456789012345678901234567890"Returns
Block length configuration containing matrix dimensions and chunk size.Structure:Fields:
Number of rows in the data availability matrix.Type:
BlockLengthRows(u32)Typical Value: 256This represents the maximum number of rows that can be used in the block’s Kate commitment matrix.Number of columns in the data availability matrix.Type:
BlockLengthColumns(u32)Typical Value: 256This represents the maximum number of columns in the block’s Kate commitment matrix.Size of each data chunk in bytes.Typical Value: 32Each cell in the matrix contains a chunk of this size. The total block capacity is
rows × cols × chunk_size bytes.Example Request
Example Response
Query Latest Block
Query block length for the most recent finalized block:Understanding Block Dimensions
Matrix Size
The data availability matrix is a 2D grid where:- Rows: Typically 256 rows maximum
- Columns: Typically 256 columns maximum (after erasure coding extension)
- Total Cells:
rows × cols = 256 × 256 = 65,536cells
Block Capacity
The theoretical maximum data capacity of a block is:- Erasure coding overhead
- Header and metadata
- Inherent extrinsics
Chunk Size
Each cell in the matrix contains a 32-byte chunk. These chunks are:- Field elements in the KZG polynomial commitment scheme
- Erasure-coded for data availability guarantees
- Individually verifiable with KZG proofs
Error Responses
Invalid Block Hash
Missing Block
Implementation Details
Source Code Reference
From/rpc/kate-rpc/src/lib.rs:302-312:
Key Points
- No finalization check: Unlike other Kate RPC methods,
kate_blockLengthdoes not require the block to be finalized - Fast query: This is a lightweight operation that only queries block metadata
- Metrics: Records query performance if metrics are enabled
Use Cases
Determine Sampling Strategy
Use block dimensions to plan data availability sampling:Calculate Block Utilization
Determine how much of the block capacity is being used:Validate Cell Coordinates
Ensure cell coordinates are within valid bounds:Estimate Data Size
Calculate how much data can fit in a block:Matrix Dimensions Over Time
Track how block dimensions change (if dynamically adjusted):Response Format Details
BlockLength Structure
The response uses wrapped integer types for type safety:Performance Characteristics
- Query Speed: Very fast (< 1ms typically)
- No Computation: Simply reads block metadata
- No Finalization Wait: Can query any block immediately
- No Rate Limits: Can be called frequently without performance impact
Related Methods
- kate_queryRows - Query rows using dimensions from this method
- kate_queryProof - Query cell proofs within the matrix bounds
- kate_queryMultiProof - Query multi-proofs for cells