IntersectMBO / cardano-db-sync

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

Found `XYZ` Script with mismatch between bytes and hash on `master` #1646

Closed ArturWieczorek closed 1 month ago

ArturWieczorek commented 6 months ago

Version number: 13.2.0.1 Git hash: 15656e42a09d7b9813729e8e284d622c77795714

There is an issue on master where after stopping service and starting it again it tries to fix scripts hashes:

Found some wrong values already. The oldest ones are (hash, bytes): [("8d73f125395466f1d68570447e4f4b87cd633c6728f3802b2dcfca20","5914
<SKIPPED> f565f4e465401ff0001")]
Found 17463 Script with mismatch between bytes and hash.

Here are logs examples:

db_sync_master_logs.txt

kderme commented 6 months ago

Thank you this was caused by commit 9e446341741db856e30b77edc32c59d120eda75b which is in master but not released and in particular https://github.com/IntersectMBO/cardano-db-sync/commit/9e446341741db856e30b77edc32c59d120eda75b#diff-23041e6f296ec26493d184b4167eb2d3070f4483fcbfe1d5048bef429b209f3bR115

kderme commented 5 months ago

Fixed at https://github.com/IntersectMBO/cardano-db-sync/pull/1648

ArturWieczorek commented 5 months ago

@kderme Kostas I still can see it on :

git last
commit d249be066beb22a918ed60b4952a2370aca5a28a (HEAD, tag: sancho-4.1.0, origin/kderme/update-schema)

./db-sync-node/bin/cardano-db-sync version
cardano-db-sync 13.2.0.1 - linux-x86_64 - ghc-8.10
git revision d249be066beb22a918ed60b4952a2370aca5a28a
[db-sync-node:Info:84] [2024-03-20 12:43:10.46 UTC] Found some wrong values already. The oldest ones are (hash, bytes): [("8d73f125395466f1d68570447e4f4b87cd633c6728f3802b2dcfca20",

...

[db-sync-node:Info:84] [2024-03-20 12:43:10.46 UTC] Found 2682 Script with mismatch between bytes and hash.
[db-sync-node:Info:84] [2024-03-20 12:43:10.47 UTC] Starting chainsync to fix Plutus Scripts. This will update database values in tables script.
[db-sync-node:Info:84] [2024-03-20 12:43:10.47 UTC] Starting fixing Plutus Scripts At (Block {blockPointSlot = SlotNo 6056613, blockPointHash = b0a50126abfbcb9d4f79751b258cf7dff7b4fa2696b24e8b5a407b4db1aff8f6})
[db-sync-node:Info:84] [2024-03-20 12:43:18.46 UTC] Finished chainsync to fix Plutus Scripts.
[db-sync-node.Mux:Notice:81] [2024-03-20 12:43:18.46 UTC] Bearer on ConnectionId {localAddress = LocalAddress "", remoteAddress = LocalAddress "preview/node.socket"} event: Miniprotocol (MiniProtocolNum 5) InitiatorDir terminated cleanly

Logs attached:

db_sync_sancho_4_1_0_node_8_9_0_logs.txt

dmitrystas commented 1 month ago

It looks like 13.3 has the same. After every (re)start in the log I see something like this

[db-sync-node:Info:94] [2024-07-27 15:25:40.74 UTC] There are 70182 Script. Need to scan them all.
[db-sync-node:Info:94] [2024-07-27 15:26:26.39 UTC] Found some wrong values already. The oldest ones are (hash, bytes): [("bec63c3fd14fdac7bd8deb0168c13a04c65955ee1c812b5df6481fe9","5909780100003323322332232323
[db-sync-node:Info:94] [2024-07-27 15:26:26.39 UTC] Found 63545 Script with mismatch between bytes and hash.
[db-sync-node:Info:94] [2024-07-27 15:26:26.40 UTC] Starting chainsync to fix Plutus Scripts. This will update database values in tables script.
[db-sync-node:Info:94] [2024-07-27 15:26:26.40 UTC] Starting fixing Plutus Scripts At (Block {blockPointSlot = SlotNo 130527375, blockPointHash = 29d6c17e33070ee03343cde278671b9d7b43771e3c85967378e71e2541de5733
[db-sync-node:Info:94] [2024-07-27 15:29:52.60 UTC] Finished chainsync to fix Plutus Scripts.
ArturWieczorek commented 1 month ago

I am on 13.4.0.0 and did not encounter this anymore - tried several times on different networks. Looks like fix is working so I am closing this one.