42 milliseconds

An essay about relativity and its practical effects upon distributed computing.


On a global scale, relativity means something.

Even if we could drill fiber optic cables through the earth's core, it would still take 42 milliseconds for light to travel from one side of the planet to the other. I don't think many people grasp what this actually means. The layman may think of this as merely the amount of time it takes for the message to be sent, similar to how the speed of mail via Pony Express was limited to how fast a horse could gallop. But reality is stranger than that, and it's because of relativity.

This is because the speed of light is more properly understood to be the speed of causality, or the speed of time itself. If two messages were sent down the fiber optic cable, one from each end, such that the both messages crossed the center of the planet's core at the 'same time', one might think that the events happened simultaneously. But this is an illusion. They only happened simulatenously from the frame of reference of the midpoint.

If you were to ride along with the mail in the Pony Express, then from the frames of reference of your origin, journey, and destination, all events would agree on the duration of your trip. If you were to ride along with one of the messages in the optical cable, things would be different. Your origin and destination would still agree on the duration of your trip, but you would not agree with them. Your journey would to you be instantaneous, and the world would appear to have skipped ahead 1/24th of a second. Its almost as if you had sped up the world for a brief instant, rather than having been the one sped up yourself.

Worse still, the order of the messages is indeterminate. From the frame of reference of either end of the cable, at the instant they are sending their message, the other side is not yet sending their message, and they will not for 42 milliseconds. This is not how long it takes for the message to travel, it is how long it takes for time to occur. As the two messages approach the center, from each's perspective, their having being sent is an event in the past, and the other's having been sent is still an event in the future - and this is true for both of them, at the same time.

Its not that they just didn't know about the other message yet, its that the universe doesn't know that it's happened yet. From a physical perspective, it actually hasn't happened yet. And this is a problem for distributed ledgers tracking events on any timescale smaller than 42 milliseconds. 42 milliseconds may not seem like a lot, but its within the realm of human experience - 60fps is 16 milliseconds per frame, nearly 1/3 the time our message took to be delivered on a one-way trip.

If I have a smart contract involving a date and timer with a resolution of 10 milliseconds, I have to ask, 'whose milliseconds, whos date, whose timer', because the timer will have ticked 4 times locally by the time the other side of the world even experiences the event the first time. And if I run another copy of the smart contract on the other side of the world, it will have the same problem, even if I do it at the 'same time' as the other, as measured from the frame of reference of the center of the planet. And if I asked them which one started first - they will both always be first, locally, from their own perspective, because that is what locally means in time.

Global distributed computing must contend with the effects of relativity, and I don't mean mere latency. I mean that we must contend with the fuzziness of the very concept of fine-grained time at that scale. We should have seen this already, recognized by the necessity of relativistic corrections for GPS satellites. They don't need adjusting because the clock has drifted due to inaccuracy in measuring, they need adjusting because the satellites are experiencing different amounts of time.

Our computer systems must be able to contend with a time system that cannot be measured universally, because each part of the universe experiences a different moment. The time-granularity of a given event is related to the area over which it occurs - and at Earth's scale, that means that any event crossing it has an innate fuzziness because the event is 42 milliseconds long everywhere even if it all happened in an instant at the origin.

What this means practically is that events cannot be tracked by comparing clocks to say that one event happened after another. We have to do the opposite - we have to calibrate our clocks by comparing events, because one event may have happened after another only from our perpsective, and even instantaneous events have a duration if they are spatially large. There's no point to any global tick less than 42 milliseconds long, because it is not global.

Of course, we can always choose a local frame of reference to agree upon, such as how we did with the center of the planet. This works up to a point, so long as you stay near the local origin. We've used it to get this far. But if we are to go any further, it will no longer do. And it will only get worse as we expand our computer networks into space.

Let's do something about this.

- Leo D., September, 2022