IntersectMBO / cardano-db-sync

A component that follows the Cardano chain and stores blocks and transactions in PostgreSQL
Apache License 2.0
292 stars 161 forks source link

epoch_param wrong on preview network after Conway HF #1804

Closed Scitz0 closed 3 months ago

Scitz0 commented 3 months ago

OS Linux

Versions The db-sync version (eg cardano-db-sync --version): cardano-db-sync 13.3.0.0 - linux-x86_64 - ghc-8.10 git revision d21895fec3a9445493b6ff4aa61b8dcb5153de1e

PostgreSQL version: 16

Build/Install Method The method you use to build or install cardano-db-sync: release binary

Run method The method you used to run cardano-db-sync (eg Nix/Docker/systemd/none): systemd

Additional context It seems that epoch_param table is not correctly populated on preview network after Conway HF. IT was synced to tip before HF event occured. As an example, there might be other

psql cexplorer -c "SELECT epoch_no, drep_deposit, drep_activity FROM epoch_param where epoch_no = (select max(epoch_no) from block);"
 epoch_no | drep_deposit | drep_activity
----------+--------------+---------------
      648 |            0 |             0
vs
cardano-cli latest query tip --testnet-magic 2 | jq -r .epoch
648
cardano-cli latest query protocol-parameters --testnet-magic 2 | jq -r '.dRepDeposit, .dRepActivity'
500000000
20

Problem Report Parameters are not correctly populated in dbsync epoch_param table.

Scitz0 commented 3 months ago

Seems not to be a general issue. Though I have seen it on multiple instances. What could cause this behavior?

kderme commented 3 months ago

It seems similar to https://github.com/IntersectMBO/cardano-db-sync/issues/1777 where the EnableFutureGenesis from DBSync config was not enabled. However in 13.3.0.0 it is enabled by default so the issue would appear only if it was manually disabled EnableFutureGenesis : false

Scitz0 commented 3 months ago

Ok thanks, I can see that this is set in DBSync config to false. Thanks for clearing that up. Does db need to be resynced from genesis to fix this?

Scitz0 commented 3 months ago

Would it be enough to copy content from this table from a health instance to this one if I set value correct and restart? Or does it have impact on other tables as well?

Scitz0 commented 3 months ago

Never mind, I solved it with snapshot restore, closing issue.