How to get TPS of Fuel?

Is there any node statistic method where I can calc TPS of Fuel?

Hi there!

The graphql endpoint contains relevant information about blocks timestamp that can be used for getting the avg TPS.


const getLatestBlocks = async () => {
  let response = await fetch("https://beta-4.fuel.network/graphql", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Accept: "application/json",
    },
    body: JSON.stringify({
      query: LATEST_BLOCKS_QUERY,
    }),
  });
  const json = await response.json();
  const timestamps = json.data.blocks.nodes.map(block=>block.header.time)
  const average = timestamps.reduce((a, b) => a + b, 0) / timestamps.length;
   console.log("Average tx ms", average)
};

With this query

const LATEST_BLOCKS_QUERY = `
query LatestBlocks {
  blocks(last: 5) {
    nodes {
      id
			header{
        height
        time
      }      
    }
  }
}
`
3 Likes

Preface: TPS is a horrible measure of performance for blockchain.

That being said, in our Fuel client, which is nowhere near optimized, we are getting 20-25,000 TPS on a single core for simple transfers.

With an 8-core, optimizations and full parallelism enabled that could easily be multiplied by a factor of 8, so 160k TPS.

Note, this is just what the client can process on a powerful CPU locally. Bandwidth is usually a primary constraining factor, IO typically second to that.

With Ethereum 4844, we can use around 1mb every 13 seconds. This would give us around 400 TPS on a 200 byte transaction size until the next phase of sharding is implemented using pure Ethereum DA.

Reference:

1 Like