nspcc-dev / neo-go

Go Node and SDK for the Neo blockchain
MIT License
123 stars 79 forks source link

Too generic BlockFetcher error logs #3629

Closed AnnaShaleva closed 3 weeks ago

AnnaShaleva commented 3 weeks ago

Current Behavior

Start BlockFetcher over some malformed blocks uploaded to NeoFS and see the errors:

2024-10-21T12:20:54.203+0300    INFO    persisted to disk       {"blocks": 1931, "keys": 26128, "headerHeight": 92239, "blockHeight": 92239, "took": "70.73025ms"}
2024-10-21T12:20:57.035+0300    ERROR   failed to read block    {"error": "EOF"}
2024-10-21T12:20:57.036+0300    INFO    shutting down NeoFS BlockFetcher service        {"force": true}
2024-10-21T12:17:15.619+0300    ERROR   failed to objectGet block       {"error": "header: status: code = 1024 message = zero object ID"}
2024-10-21T12:17:15.619+0300    INFO    shutting down NeoFS BlockFetcher service        {"force": true}
2024-10-21T12:17:15.619+0300    ERROR   failed to objectGet block       {"error": "header: status: code = 1024 message = zero object ID"}

It's not clear what's the index or ID of the block that is wrong.

Expected Behavior

Errors contain object ID or block index or index file index so that it's possible to debug and fix these error cases.

Possible Solution

We need more detailed errors for BlockFetcher service where possible.