Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7994

Why am I receiving slot change updates in batches?

$
0
0

I'm listening to slot changes and I noticed I'm receiving the updates in batches, meaning I receive a bunch of them almost at the same time, then wait 1-2 seconds and I receive another bunch. Instead, I was expecting to receive one every 400ms.

I'm using with the following code:

const connection = new Connection(  RPC_URL,  {    wsEndpoint: RPC_URL_WS,    commitment: "confirmed",  })    connection.onSlotChange(async (slotInto) => {  console.log(`${getCurrentDateTimeUTC()} ${slotInto.slot}`)})

this prints something like this (I added the spaces to highlight the 'batches':

2024-07-22T01:20:32.731Z 2789218732024-07-22T01:20:32.732Z 2789218742024-07-22T01:20:32.732Z 2789218752024-07-22T01:20:32.732Z 2789218762024-07-22T01:20:34.680Z 2789218772024-07-22T01:20:34.680Z 2789218782024-07-22T01:20:34.680Z 2789218792024-07-22T01:20:34.681Z 2789218802024-07-22T01:20:34.681Z 2789218812024-07-22T01:20:36.110Z 2789218822024-07-22T01:20:36.111Z 2789218832024-07-22T01:20:36.111Z 2789218842024-07-22T01:20:37.211Z 2789218852024-07-22T01:20:37.211Z 2789218862024-07-22T01:20:38.436Z 2789218872024-07-22T01:20:38.437Z 2789218882024-07-22T01:20:38.437Z 2789218892024-07-22T01:20:38.442Z 278921890

Is this expected? I thought slots should be every 400ms. Am I missing something?


Viewing all articles
Browse latest Browse all 7994

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>