-
Notifications
You must be signed in to change notification settings - Fork 28
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
Problem: Missing traceable usable balance for account projection #666
Conversation
# Conflicts: # projection/account/account.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Overall LGTM! The logic is super clear!
Co-authored-by: Yang SONG <86600130+ysong42@users.noreply.github.com>
Co-authored-by: Yang SONG <86600130+ysong42@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving some quick comments on the account projection.
Will review other parts in details.
return recipienterr | ||
} | ||
for _, account := range event.Genesis.AppState.Bank.Balances { | ||
for _, accountBalance := range account.Coins { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to cater for vesting balance here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example using Crypto.org Chain mainnet genesis, you can see some of the account has DelayedVesting
and the balance will appear at Gensis.AppState.Bank.Balances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think Genesis.AppState.Bank.Balances
would be enough since catering DelayedVesting
would result in double counted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for the DelayedVesting
account, when it reached the vesting date, there will be coin*
event for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If those Coin is under DelayedVesting
, should we add them as UsableBalance
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, let me put some effort on it.
Co-authored-by: Calvin Lau <38898718+calvinaco@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me. Left 2 comments to follow-up the previously raised issues.
return recipienterr | ||
} | ||
for _, account := range event.Genesis.AppState.Bank.Balances { | ||
for _, accountBalance := range account.Coins { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If those Coin is under DelayedVesting
, should we add them as UsableBalance
here?
Hello @davcrypto , I was looking for something else and come across the CHANGELOG that the coin tracking events ( As a result, some old data on chain may not have those events actually, not sure if it will break your projection design? |
Thanks @calvinaco and your concern is correct. If events only existed after v0.43, blocks before that would break our assuming and result in a invalid value. We need to use Msg to index that if before v0.43 then. |
mentioned solution in #383 for later implementation |
No description provided.