mlabs-haskell / tx-village

Opinionated Rust/Haskell ecosystem of libraries and tools to work with Cardano smart contracts
https://mlabs-haskell.github.io/tx-village/
Apache License 2.0
4 stars 0 forks source link

Add sync progress tracking #60

Closed szg251 closed 3 months ago

szg251 commented 3 months ago

Sync progress tracking is composed of two things:

The first one is straightforward. We only log every 0.1 increment of sync percentage, by keeping the last logged percentage in memory. The second one is not completely built in, the user has to integrate it, as the library has no direct access to the database. It's still a pretty simple process.

szg251 commented 3 months ago

I have one suspicion: I have a feeling that the SyncProgress event can come before transaction events of the same block. If this is the case, we could end up in a situation, where

  1. SyncProgress handled, db sync state updated
  2. Program killed before transaction handling would finish
  3. When app restarted, we the app already considers the block to be synced
  4. We end up skipping some txs

I have to verify these

szg251 commented 3 months ago

I think this makes sense. What's the behaviour if we give it an invalid slot/block hash tho?

It just stops without saying anything... it should be solved. I'm afraid the behaviour is defined in Oura, but I have to take a deeper look