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

Skip reconciliation when interesting account is missing #291

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

septerr
Copy link
Contributor

@septerr septerr commented Jan 8, 2021

Motivation

  1. There is a bug in our reconciliation logic around missing accounts. When an interesting account is configured, the reconciler may stop with an error like below:

Error: unable to get computed balance for &{Address:0000000001 SubAccount:<nil>, Metadata:map[]}: &{Symbol: ICP Decimals:8 Metadata:map[]}: block nil

The reconciler reconciles interesting accounts at every block height. But, there is no entry for an account in balance storage until it is encountered in a block. So, when the reconciler tries to reconcile an interesting account, it hasn't encountered yet, it stops with an account missing error (ErrAccountMissing).

  1. The error message for ErrAccountMissing incorrectly says "block nil".

Solution

  1. Updated the reconciliation logic to skip reconciliation for missing accounts.
  2. Fixed error message.

@septerr septerr requested a review from patrick-ogrady January 8, 2021 16:38
Copy link
Contributor

@patrick-ogrady patrick-ogrady left a comment

Choose a reason for hiding this comment

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

🚀

@patrick-ogrady patrick-ogrady merged commit 6ae170f into master Jan 8, 2021
@patrick-ogrady patrick-ogrady deleted the missing-account branch January 8, 2021 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants