parallel-finance / parallel

A decentralized lending & staking protocol built on top of the Polkadot ecosystem.
https://parallel.fi
GNU General Public License v3.0
120 stars 35 forks source link

Fix stake-client v1 #356

Closed GopherJ closed 3 years ago

GopherJ commented 3 years ago

Description

Expected behaviour

Current behaviour

  1. when user stakes, the staked token cannot be upward transferred to the multi-sig account, caused by #345
  2. even if xcm succeeed, the token will not be used to nominate validators

Reproduce steps

  1. download heiko-dev.zip
  2. uncompress it to heiko-dev, go to heiko-dev and run docker-compose up -d --build, wait until every service works correctly (no restarting containers)
  3. run docker logs -f on the stake-para-alice container
  4. go to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/ and then set controller key to //Eve
  5. go to localhost:8080/#/staking and then use Bob_Stash to stake some tokens
  6. check logs of stake-para-alice container
  7. go to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/ to check 5DjYJStmdZ2rcqXbXGX7TW85JsrW6uG4y9MUcLq2BoPMpRA7's balance, if you stake 100, it should has 99.xx
  8. check if 5DjYJStmdZ2rcqXbXGX7TW85JsrW6uG4y9MUcLq2BoPMpRA7 nominated some validators
  9. go to localhost:8080/#/staking and then use Bob_Stash to unstake some tokens like 50
  10. go to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/ to see if the staked tokens will be unbonded, go to go to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9947#/ and check the liquidStaking's chainstate to ensure there is AccountProcessingUnstake
  11. when it's unbonded, check if the unbonded tokens go to 5DjYJStmdZ2rcqXbXGX7TW85JsrW6uG4y9MUcLq2BoPMpRA7 address
  12. when the unbonded tokens arrive at 5DjYJStmdZ2rcqXbXGX7TW85JsrW6uG4y9MUcLq2BoPMpRA7 account, check if it'll finally be cross chain transferred to 5EYCAe5iie3Jms55YSqwGAx8H5Yj4Xv84tWYmdbm1sB1EwtZ in parachain
  13. if yes then check if KSM will be given back to Bob_stash after that
GopherJ commented 3 years ago
  1. MIN_BOND_BALANCE is 100, also didn't bond all free balances
  2. AccountProcessingUnstake seems called after withdraw_unbonded
  3. ? nominate
  4. some RawEvent unable to be decoded
GopherJ commented 3 years ago

pls ensure all the following packages are latest ones

yz89 commented 3 years ago

When you reboot the docker-compose, you should purge the volume.

docker-compose down --remove-orphans
docker network prune
docker volume prune
GopherJ commented 3 years ago

heiko-dev.zip @yz89 here the updated package with logs for stake-relay.

I'm also building a new relaychain image which set 1era to 1 minute

@alannotnerd our faucet-account: 5HHMY7e8UAqR5ZaHGaQnRW5EDR8dP7QpAyjeBu6V7vdXxxbf

@yz89 I think you can add Alice Bob manually, because the latest parallelfinance/parallel-dapp:testnet is using the same frontend with https://testnet.parallel.fi, it's a production environment so there is no Alice Bob, but the advantage is that this docker image will always be updated

GopherJ commented 3 years ago

heiko-dev.zip