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

Cosmos minted denoms not picked up #230

Closed
nhannamsiu opened this issue Jun 10, 2021 · 1 comment · Fixed by coinbase/mesh-sdk-go#358
Closed

Cosmos minted denoms not picked up #230

nhannamsiu opened this issue Jun 10, 2021 · 1 comment · Fixed by coinbase/mesh-sdk-go#358
Labels
bug Something isn't working

Comments

@nhannamsiu
Copy link

Describe the bug
Rosetta API assumes all balances should be initialized at genesis so it can iterate over these denoms and calculate balance changes.
When a new denom not available at genesis added, the CLI will throw error unable to get previous account balance for [account] [symbol].
Our cosmos chain is a DEX. It's natural to have new denoms as trading markets are added.

To Reproduce

  1. Refactor cosmos simd app to have ability to mint new coins.
  2. Start the chain and mint some coins with denom not available at genesis.
  3. Start rosetta gateway.
  4. Setup config file and run rosetta-cli --configuration-file=rosetta-config.json check:data

Expected behavior
From our perspective, it sounds reasonable to just add new denom with 0 balance if it's not detected in previous block instead of throwing error on this.

Additional context

  1. Pick up the previous block in the error thrown by rosetta-cli, for example 95.
  2. Run simd query bank balances inj14au322k9munkmx5wrchz9q30juf5wjgz2cfqku --height=95
  3. Run simd query bank balances inj14au322k9munkmx5wrchz9q30juf5wjgz2cfqku --height=96

This should show the new denom minted at block 96 and not available at parent block 95.

Simplified stack trace and error log

# AddingBlock() > UpdateBalance() > existingValue() > AccountBalance(): throw errors on missing balance on previous block

Error: unable to process blocks: unable to process block: account balance response does not contain currency {
 "symbol": "share1",
 "decimals": 0
}: could not get {
 "symbol": "share1",
 "decimals": 0
} currency balance for {
 "address": "inj14au322k9munkmx5wrchz9q30juf5wjgz2cfqku"
}: unable to get currency balance: unable to get previous account balance for {"address":"inj14au322k9munkmx5wrchz9q30juf5wjgz2cfqku"} {"symbol":"share1","decimals":0} at {"index":95,"hash":"0B97F30BF83AFE1757442784C2027ED7E8FFCE597396248BCE9E77B124A19ADE"}: unable to add block to storage C3FBCF6C3B8016AACE5A5D2217E90E905764A738F7861ECA812E1685F36F97B7:96: unable to sync to 709
@fkneeland-figure
Copy link

@nhannamsiu has there been any further work on this issue? I am working on a cosmos based blockchain and am seeing this same issue when I mint new coins that aren't in the genesis file and then attempt to run rosetta tests.

I get an unable to sync to 193 where 193 is the block containing the newly minted token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants