txpipe / oura

The tail of Cardano
https://txpipe.github.io/oura
Apache License 2.0
257 stars 71 forks source link

Bug: Timestamp is 19 seconds off #50

Closed gitmachtl closed 2 years ago

gitmachtl commented 2 years ago

Testnet Example: The output for block 3226895 is reported with the timestamp 1641849006. If i convert this back into an actual date like date --date="@1641849006" i get the date Mon, 10 Jan 2022 22:10:06. DB-Sync/Explorers report Mon, 10 Jan 2022 22:10:25

So there is a 19 seconds offset. And its for all the reported blocks. So either i am converting it wrong, or there is a Bug?

mark-stopka commented 2 years ago

Probably mistake in well known info...

https://github.com/txpipe/oura/blob/d9dc5421f2237464531a7c1759cb86db0afdd5c0/src/framework.rs#L33

gitmachtl commented 2 years ago

Its also off 19 seconds on mainnet.

scarmuega commented 2 years ago

Event timestamps are inferred from the slot number of the block, but there seems to be some ambiguity on how to translate the interval length between blocks (~20 secs ATM). I found this comment by @KtorZ very insightful:

https://github.com/CardanoSolutions/ogmios/issues/3#issuecomment-619786434

TBH, I'm not happy with the current approach in Oura. I'll do some reverse engineering on db-sync to understand the logic it uses.