2

How can I decrease the lag of my tezos-node?

I'm playing around with tezos-node, and I noticed that my node lags behind the blockchain by about 10 seconds. Specifically, I'm seeing a difference of around 10 seconds when poll the RPC endpoint chains/main/blocks until it gives me a new block* and then compare the new block's timestamp to system time. In other words, my node is lagging behind the blockchain by about 10 seconds.

I'm a total noob here, but this seems like a long time. I'm guessing the two main sources of latency are 1) the time it takes the new block to arrive at my node (network latency), and 2) the time it takes my node to verify the new block. Naively I'd expect 1) to take about a second and 2) to take even less time.

So, what's going on here, and what can I do? I haven't tried playing with the peers list, but is that something I should consider? Is there a guide on performance-tuning tezos-node I should look into?

Thanks!

*I'm using Taquito getBlock to do this BTW.

EDIT: Corrected RPC endpoint

2

It may be that the whole network is lagging behind, because the timestamp of a block is not necessarily the time at which the block is produced, but instead the minimal time at which the block could be produced.

For the latency, one should note that each node first validates a block before propagating it further, so the network diameter also plays a role. And that a block should also include a number of endorsement operations, so one needs to take into account their propagation as well.

The node's log normally contains information about when the block arrives at the node and how much time it takes for the node to validate the block.

2
  • Thanks Eugen, that helps! Do you have any recommendations for setting the peers so the effective network diameter is minimized? May 10 at 15:00
  • The default values should normally be fine. I don't have a better answer; you can consider asking this specific question on TSE.
    – Eugen
    May 12 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.