Skip to content

Conversation

@mukminn
Copy link

@mukminn mukminn commented Jan 11, 2026

Summary

Avoid a potential panic in DatabaseProvider::remove_blocks_above when no header static files exist yet.

Motivation

The code currently uses �xpect(...) on get_highest_static_file_block(Headers), which can panic in a fresh/static-file-less environment. This change makes the operation a no-op for static file pruning when there is nothing to prune.

Changes

  • Handle None from get_highest_static_file_block(Headers) by skipping header pruning.
  • Add a regression test to ensure the method does not panic in this scenario.

@mukminn
Copy link
Author

mukminn commented Jan 11, 2026

CI is green. This avoids a potential panic when pruning headers in environments without any header static files yet, and includes a regression test.

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.

1 participant