Skip to content

Conversation

rlaisqls
Copy link
Contributor

Added len(intervals) == 0 check in doBlockSnapshotsRangeCheck() function.
Returns descriptive error instead of panicking when no snapshot files exist.

# Before
$ ./build/bin/erigon seg integrity --datadir ~/Library/Erigon --failFast
...
panic: runtime error: index out of range [0] with length 0

# After
$ ./build/bin/erigon seg integrity --datadir ~/Library/Erigon --failFast
...
Error: no snapshot files found in /Users/.../Erigon/snapshots for type: headers

resolve #17227

@sudeepdino008
Copy link
Member

hi. Thanks.
btw similar check is needed in checkIfStateSnapshotsPublishable

@rlaisqls rlaisqls force-pushed the fix/publishable-no-snapshots-error branch from 40656ac to 23400b9 Compare October 11, 2025 04:25
@rlaisqls
Copy link
Contributor Author

Thank you, I’ve updated the code to include a similar check in checkIfStateSnapshotsPublishable.

Copy link
Member

@sudeepdino008 sudeepdino008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sudeepdino008 sudeepdino008 enabled auto-merge (squash) October 14, 2025 10:40
@sudeepdino008 sudeepdino008 merged commit 03332af into erigontech:main Oct 14, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

publishable: return proper error when there's no snapshots files

2 participants