How do validators agree on a time in Solana with POH?

I understand that the leader and all the validators keep computing chain of SHA256 hashes. Once T hashes are computed, the slot ends and it’s time for the next validator.

But different validators could be using computers with different computational power. In the time it takes for one validator to compute 100 hashes, another validator could compute 400 hashes.

How do validators synchronize time in this case? Suppose the leader of next slot is fast and computes hashes early on, he could be starting the next slot early on.

1 Like

So I’m not sure on any specifics, but I did find what may be a little bit of a clue in this comment:

A looping sha 266 takes n time but n/cores to verify

So what he’s saying is that the verifiable delay function ( VDF ) in Solana has to be computed on 1 core: it can’t be parallelized. So the only thing that could make one computer faster than another would be having a faster CPU core. This is much, much, much harder to get than a greater number of CPU cores. For instance, a GPU can get 4,000 compute cores, but that won’t allow you to compute the VDF function any faster than it would if you had 1 core.

What can be done in parallel is verifying that the function was completed successfully. This is what must be as fast as possible, so that one one computer says “this much time has passed”, another computer can validate that they are correct without having to wait that much time to validate the result themselves. When validating, if you have 4000 CPU/GPU cores, then it takes 1/4000th of the time to validate than it does to actually compute the initial hash.

So it seems to me that maybe the top speed of our processors is low enough that the time difference isn’t incredibly important, because having more CPU/GPU cores doesn’t make you any faster at computing the VDF, keeping the guarantee that a certain amount of time will have passed to compute that hash, even though there are some differences in the amount of time slower or faster CPUs take to process the hash.

Still, I don’t know anything about how any differences in speed are taken into account or synchronized in Solana or anything.

Thanks a lot, @zicklag for the great explanation. It is certainly true that computing the chain of SHA256 hashes can’t be parallelized. But unfortunately, different computers take different amounts of time to compute a SHA256 hash.

Some computers have 2 GH speed. Others have 3.5 GH speed. Some libraries optimize computing SHA256 hashes better than others. There are some dedicated ASIC chips that can compute SHA256 hashes much faster than regular computers. Computers slow down when they are hot. The operating system also keeps switching between processes, which may make one computer slow at computing the hashes.
Also, the leader appends transactions to the chain of SHA256 hashes, whereas the validators compute a simple chain of SHA256 hashes. This makes the validator faster than the leader in computing hashes.

If nodes in Solana measure time only by the number of hashes that are computed, then they will be out of sync pretty soon right? Different validators assume they are in different slots.

I see your point. Especially about the dedicated hardware. I don’t know how that works in Solana. :man_shrugging:

I’d be interested to find out out.