Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix query overflow: don't subtract one when height is zero #2861

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

avahowell
Copy link
Contributor

No description provided.

@@ -99,7 +99,8 @@ impl Info {
//
// Try to do this behavior by querying at height = latest-1.
0 => {
let height = self.storage.latest_snapshot().version() - 1;
let version = self.storage.latest_snapshot().version();
let height = if version == 0 { version } else { version - 1 }
Copy link
Member

Choose a reason for hiding this comment

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

alternatively, saturating_sub works too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ooh good idea

@avahowell avahowell temporarily deployed to smoke-test July 21, 2023 19:52 — with GitHub Actions Inactive
@avahowell avahowell merged commit 3e75034 into main Jul 21, 2023
8 checks passed
@avahowell avahowell deleted the fix-overflow branch July 21, 2023 20:32
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.

2 participants