RPC method

eth_getBlockByNumber on X Layer

Supported on SwiftNodes

Everything below was measured on 2026-10-13 by calling eth_getBlockByNumber on X Layer through the same endpoint customers use, and is re-measured weekly.

What eth_getBlockByNumber does

Returns a block by number or tag (latest, safe, finalized, pending, earliest): the header, and either the transaction hashes or the full transactions. Indexers, explorers and wallets use it to follow the chain.

eth_getBlockByNumber on X Layer: what we measured

Header fields26
Transactions per block11, 14, 10, 14, 13 in five consecutive blocks
Response size, full transactions (true)18.8 KB average
Response size, hashes only (false)2.5 KB
Gas limit210,000,000
Gas used in the latest block1,555,681 (0.741% of the limit)
Base fee0.0200 gwei
Tag "safe"block 73,127,593
Tag "finalized"block 73,126,400
Tag "pending"block 73,127,752
Tag "earliest"block 0

What is different on X Layer

The header includes the fields added by London (EIP-1559 base fee), Shanghai (withdrawals), Cancun (EIP-4844 blob gas), Cancun (EIP-4788 beacon root), Prague (EIP-7685 requests). Code that assumes Ethereum's current header shape will parse it as is.

Asking for full transactions (second parameter true) made the response 7.6 times larger than hashes only. If you need only some transactions, fetch hashes and request those transactions or their receipts individually.

5 of the 62 transactions in those five blocks were system transactions (5 × type 0x7e, L1-to-L2 deposit (OP Stack)). They are not user activity: filter them out when counting transactions.

"finalized" was 1,349 blocks (about 22 min) behind the head.

A real X Layer block header

From block 73,127,741, as our endpoint returned it (long hex values shortened).

{
  "baseFeePerGas": "0x1312d00",
  "blobGasUsed": "0xaab40",
  "difficulty": "0x0",
  "excessBlobGas": "0x0",
  "extraData": "0x0100000032000000010000000001312d00",
  "gasLimit": "0xc845880",
  "gasUsed": "0x17bce1",
  "hash": "0x8974b172e91a708d9fa094c5fe36c129052eae9e972f4f1fa98b152aba080f2b",
  "logsBloom": "0x0020084010000040…(256 bytes)",
  "miner": "0x4200000000000000000000000000000000000011",
  "mixHash": "0x5a79e124b1701bc2fc0a7079be41d8dc149c21be5c5369a8239c37290e43227c",
  "nonce": "0x0000000000000000",
  "number": "0x45bd73d",
  "parentBeaconBlockRoot": "0xba1f89e164490f5b3f2ee81d8f2ee6218fbf34a37a357831a132710517bd8547",
  "parentHash": "0x7e0688dcd6ff4b9197e62620c351bc473f72ccc678ac8ef14d74ab39ee1552aa",
  "receiptsRoot": "0x8412725615c79d596a4aa2686e61d72074ea60c294e9ec8084344e30f115163c",
  "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "size": "0x16b9",
  "stateRoot": "0x3eec95a0d4477ea94a068ef850673f76f1995dcf75b5964a6439deaf77d7a609",
  "timestamp": "0x6ace2cc9",
  "transactions": "11 transactions",
  "transactionsRoot": "0x9d1f6a0022a9bdbb0d569317577f0800258d336c9e46322c192cc8a5207a704f",
  "uncles": [],
  "withdrawals": [],
  "withdrawalsRoot": "0x8ed4baae3a927be3dea54996b4d5899f8c01e7594bf50b17dc1e741388ce3d12"
}

Example request

curl -s https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY \
  -X POST -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["latest",false]}'
import { createPublicClient, http } from "viem";

const client = createPublicClient({
  transport: http("https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY"),
});

// Header plus transaction hashes (2.5 KB)
const block = await client.getBlock({ blockTag: "latest" });

// With full transactions (18.8 KB on average on X Layer)
const full = await client.getBlock({ blockNumber: block.number, includeTransactions: true });
const userTxs = full.transactions.filter((t) => !["0x7e"].includes(t.typeHex));

// A block that will not be reorganised
const final = await client.getBlock({ blockTag: "finalized" });

Other methods on X Layer

eth_getBlockByNumber on other chains

Frequently asked questions

Does X Layer support eth_getBlockByNumber?

Yes. eth_getBlockByNumber answered on the SwiftNodes X Layer endpoint when our weekly probe called it through the customer path (2026-10-13).

How many transactions are in each X Layer block?

In five consecutive blocks on 2026-10-13: 11, 14, 10, 14, 13.

X Layer endpoints, live block height and WebSocket status are on the X Layer RPC page.

One key covers every chain we serve, and SwiftNodes has a free tier.