nspcc-dev / neo-go

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

Potential bug in search range bounds of BlockUploader #3621

Closed AnnaShaleva closed 1 month ago

AnnaShaleva commented 1 month ago

Current Behavior

Here's the example of BlockUploader logs copy-pasted from Grafana:

2024-10-17 11:25:48.013 Chain block height: 4816543
2024-10-17 11:26:27.201 failed to fetch the latest missing block index from container: search of index files failed for batch with indexes from 4820000 to 4830000: error during object IDs iteration: context deadline exceeded    
2024-10-17 11:26:56.790 failed to fetch the latest missing block index from container: search of index files failed for batch with indexes from -260000 to -250000: error during object IDs iteration: context deadline exceeded    
2024-10-17 11:27:27.765 Chain block height: 4816549 
2024-10-17 11:27:57.275 Chain block height: 6533916

One of the lines contains unexpected negative block indexes: indexes from -260000 to -250000. It's a no-op, something is wrong.

Expected Behavior

No negative indexes in the output.

Possible Solution

Check all conditions of all cycles.

AnnaShaleva commented 1 month ago

Not related to this issue.