availproject / bridge-ui

UI for the Avail bridge
https://bridge.availproject.org/
8 stars 12 forks source link

Clock skew handling #35

Open vibhurajeev opened 3 months ago

vibhurajeev commented 3 months ago

In the countdown introduced in this commit, https://github.com/availproject/bridge-ui/commit/7feb7ffac04a7f2d93e789bd15e0b98a448b1d43, the calculation could be affected clock skew between the source providing the timestamp for block and the system clock where the code is being executed.

One proposed solution is to compare Date.now() with last block timestamp, so at max, the difference would be 20s.