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

Validate genesis error: credit batch supply is incorrect #1660

Closed
4 tasks
ryanchristo opened this issue Dec 5, 2022 · 5 comments
Closed
4 tasks

Validate genesis error: credit batch supply is incorrect #1660

ryanchristo opened this issue Dec 5, 2022 · 5 comments
Assignees
Labels
Type: Bug Something isn't working

Comments

@ryanchristo
Copy link
Member

ryanchristo commented Dec 5, 2022

Summary of Bug

After exporting mainnet state and running the validate-genesis command, the following error is returned:

supply is incorrect for 11 credit batch, expected 265.00, got 264.95000: invalid coins

After exporting redwood state and running the validate-genesis command, the following error is returned:

supply is incorrect for 7 credit batch, expected 1000.000000, got 998.000000: invalid coins

Version

v4.1.5 / release/v5.0.x / main

Steps to Reproduce

  • export regen mainnet state
  • run regen validate-genesis

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ryanchristo ryanchristo added the Type: Bug Something isn't working label Dec 5, 2022
@ryanchristo ryanchristo changed the title Mainnet genesis supply is incorrect validation error Validate genesis error: credit batch supply is incorrect Dec 6, 2022
@ryanchristo
Copy link
Member Author

ryanchristo commented Dec 6, 2022

Updated to include same error occurring with exported redwood state.

@aleem1314 aleem1314 self-assigned this Dec 6, 2022
@ryanchristo
Copy link
Member Author

Here is the credit batch throwing the error:

Tradable Balances + Escrowed Balances = Tradable Supply
0.1 + 1.90 + 5 + 225.95 + 10 = 242.95

Retired Balances = Retired Supply
0.05 + 2 + 1 + 1 + 2 + 16 = 22.05

Tradable Supply + Retired Supply = Total Supply
242.95 + 22.05 = 265

From what I can tell with this information, it looks like there is not an issue with the supply itself but rather an issue with the math in the invariant check. I used a different export of mainnet than what the devnet used, so will double check...

@ryanchristo
Copy link
Member Author

ryanchristo commented Dec 7, 2022

Using a more recent mainnet export (also what was used when testing and when I encountered the error):

{
  "tradable_amount": "232.95",
  "retired_amount": "32.05",
  "cancelled_amount": "0"
}

Tradable Balances + Escrowed Balances = Tradable Supply
0.1 + 9.99975 + 1.90 + 5 + 205.90 + 10 + 0.00025 = 232.9 - !!! does not match tradable supply

Retired Balances = Retired Supply
0.05 + 2 + 1 + 10 + 1 + 2 + 16 = 32.05

Tradable Supply + Retired Supply = Total Supply
232.9 + 32.05 = 264.95 - !!! does not match total supply

@ryanchristo
Copy link
Member Author

ryanchristo commented Dec 7, 2022

Worth noting that I have not checked with existing mainnet because balances by batch is a new query so no easy way to get the balances on v4.0. I can confirm that I received the same error with the same export before upgrading though.

@ryanchristo
Copy link
Member Author

With the msg send fix and migrations in place, I think it's safe to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants