getMaxShredInsertSlot

Explore getMaxShredInsertSlot: Use Cases, Code Examples, Parameters, Response Format, and Best Practices

The getMaxShredInsertSlot RPC method returns the highest slot number for which a Solana node has successfully received and inserted shreds—small pieces of block data propagated through the Turbine protocol. This metric reflects how up-to-date the node is with block ingestion and is an important indicator of node performance and synchronization.


đź”§ Common Use Cases

  • Node Sync Monitoring Assess how current a node is by comparing its maxShredInsertSlot to the cluster's latest slot. Significant lag may indicate synchronization issues.

  • Performance Tracking Continuously monitor this value to gauge a node’s processing efficiency and responsiveness to incoming shreds over time.

  • Debugging Ingestion Issues A stagnant or lagging slot value may reveal problems with a node’s ability to ingest block data, possibly due to poor network connectivity or CPU/memory bottlenecks.


📝 Request Parameters

This method does not take any parameters.


📦 Response Structure

The result field in the JSON-RPC response returns a single unsigned 64-bit integer:

  • u64: The highest slot number for which the node has inserted shreds.


đź’» Example

Fetch the Highest Shred Inserted Slot

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getMaxShredInsertSlot"
}

Code Examples

const fetch = require('node-fetch');

async function getMaxShredInsertSlot(rpcUrl) {
  try {
    const response = await fetch(rpcUrl, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'getMaxShredInsertSlot'
      }),
    });

    const data = await response.json();
    
    // Print the exact full response
    console.log('Full RPC Response:');
    console.log(JSON.stringify(data, null, 2));
    
    return data;
  } catch (error) {
    console.error('Error getting health:', error.message);
    return null;
  }
}

// Example usage
const RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key';

getMaxShredInsertSlot(RPC_URL);

Example Response

{
  "jsonrpc": "2.0",
  "result": 355368267,
  "id": 1
}

đź’ˇ Developer Tips

  • Node-Specific Metric: This value is local to the node you’re querying. Nodes may differ slightly based on latency and hardware performance.

  • Not a Finality Indicator: Unlike getSlot or getBlockHeight, this metric shows ingestion progress—not whether the block has been finalized. For finalized data, use getSlot with the finalized commitment.

  • Relation to getMaxRetransmitSlot: Typically, maxShredInsertSlot will be equal to or slightly lower than maxRetransmitSlot, as shreds must first be received (retransmit) before they can be inserted.

  • Continuously Increasing: The value should steadily increase as new slots are produced and processed. If it stalls, it could indicate issues worth investigating.


By using getMaxShredInsertSlot, developers and operators can gain precise insights into a node’s data ingestion progress—an essential factor in maintaining performance, uptime, and network reliability within the Solana ecosystem.

Last updated