Skip to content

chore: get latest version in store after legacy pruning#1

Open
PaddyMc wants to merge 2 commits intofix/continue-pruning-if-version-is-not-foundfrom
fix/get-latest-version-in-store-after-legacy-pruning
Open

chore: get latest version in store after legacy pruning#1
PaddyMc wants to merge 2 commits intofix/continue-pruning-if-version-is-not-foundfrom
fix/get-latest-version-in-store-after-legacy-pruning

Conversation

@PaddyMc
Copy link
Owner

@PaddyMc PaddyMc commented Mar 26, 2025

Description

Currently if legacy pruning fails it sets the firstVersion to latestLegacyVersion + 1

That works under the assumption that if legacy pruning fails that the non-legacy node is the first version is available in the store, this is not the case, and the code will then linearly iterate until it finds the next version, which could be a long wait.

Context

please read cosmos#1063 for context on this issue

What this function does

  • A binary search to find the latest non-legacy version in the store
  • This is a monkey patch and should only run once per node pruning session then the cached first version should be kept per node pruning session

What should actually happen

  • Pruning should succeed for legacy node
  • We should still search for the latest none-legacy node

How to make this prod read

  • Add tests for this

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