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 logic for whether we're currently catching up #698

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

jessepinho
Copy link
Contributor

It's currently backwards.

Comment on lines +31 to +33
getWalletServices: vi.fn(() =>
Promise.resolve({ indexedDb: mockIndexedDb }),
) as MockServices['getWalletServices'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes a TypeScript complaint

@jessepinho jessepinho marked this pull request as ready for review March 6, 2024 19:37
@@ -9,7 +9,7 @@ export const status: Impl['status'] = async (_, ctx) => {
if (!fullSyncHeight) throw new Error('Last block synced not in db');

return {
catchingUp: fullSyncHeight === latestBlockHeight,
catchingUp: fullSyncHeight !== latestBlockHeight,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah good catch. It's an edge case (maybe an error somewhere else if so), but should we do:

catchingUp: fullSyncHeight < latestBlockHeight,

Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/penumbra-zone/penumbra/blob/d3bbe4c920dd03981ed883d347ed579dae6af363/crates/view/src/service.rs#L326-L334
rust view service also returns catchingUp=false if the difference is only 1 block

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, nice find

@jessepinho jessepinho merged commit 71e2c5d into main Mar 7, 2024
6 checks passed
@jessepinho jessepinho deleted the jessepinho/catch-up-bugfix branch March 7, 2024 18: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.

3 participants