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

[bug] Depositing to an empty pool results in consensus failure #89

Closed
PaddyMc opened this issue Dec 9, 2020 · 2 comments
Closed

[bug] Depositing to an empty pool results in consensus failure #89

PaddyMc opened this issue Dec 9, 2020 · 2 comments
Assignees

Comments

@PaddyMc
Copy link
Contributor

PaddyMc commented Dec 9, 2020

Description

After creating a pool then withdrawing all the tokens, when trying to add more tokens the chain halts

Error

runtime error: index out of range [0] with length 0

How to reproduce

Compiling

  • make install

Initializing chain

  • liquidityd init testing --chain-id testing

  • liquidityd keys add validator --keyring-backend test

  • liquidityd add-genesis-account $(liquidityd keys show validator --keyring-backend test -a) 1000000000stake,1000000000token

  • liquidityd gentx validator --chain-id testing --keyring-backend test

  • liquidityd collect-gentxs

  • liquidityd start > liquidityd.log 2>&1 &

  • sleep 10

Creating pool

  • liquidityd tx liquidity create-pool 1 100000000stake,100000000token --from validator --keyring-backend test --chain-id testing -y

Deposit

  • liquidityd tx liquidity deposit 1 100000000stake,100000000token --from validator --keyring-backend test --chain-id testing -y

Withdraw

  • liquidityd tx liquidity withdraw 1 2000000cosmos1hdkmddemx6ttqdugxh2aqy6qjsw6lwu40pvmdv --from validator --chain-id testing --keyring-backend test -y

Deposit command that fails

  • liquidityd tx liquidity deposit 1 100000000stake,100000000token --from validator --keyring-backend test --chain-id testing -y

Log

⬇️ this contains the log after running the commands ⬇️

failDepositWithNoFundsInPool.log

cat failDepositWithNoFundsInPool.log | grep CONSENSUS to see the error without noise 👍

@dongsam
Copy link
Contributor

dongsam commented Dec 10, 2020

I fixed it in this PR, thank you for writing a detailed issue!

@dongsam dongsam self-assigned this Dec 10, 2020
@PaddyMc
Copy link
Contributor Author

PaddyMc commented Dec 10, 2020

No problem at all, happy to help

Great job fixing this issue so quickly 😄

@PaddyMc PaddyMc closed this as completed Dec 10, 2020
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

No branches or pull requests

2 participants