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: avoid overly eager balance lookup #341

Merged

Conversation

byte-bandit
Copy link
Collaborator

@byte-bandit byte-bandit commented Nov 28, 2023

Related Github tickets

Background

We see a lot of error logs when trying to verify validators balances on chains. This is because the established architecture allows to query at arbitrary times, even though Paloma always only uses the current time. The algorithm used to identify the closest block to the given time can lead to resulting in the latest block number, which might not be finalised yet.

For now, we just fall back to the latest block number - 1 in this case, which should work. In the future, we might want to strip out the entire block height search and always use the current block height, as it's using binary search to approximate the block and makes a decent amount of API calls while doing so.

Testing completed

  • test coverage exists or has been added/updated
  • tested in a private testnet

Breaking changes

  • I have checked my code for breaking changes

Copy link
Contributor

@taariq taariq left a comment

Choose a reason for hiding this comment

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

LGTM!

@taariq taariq merged commit 09e47e5 into palomachain:master Nov 28, 2023
2 checks passed
@taariq taariq deleted the feature/avoid-early-balance-lookup branch November 28, 2023 14:13
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