Closed ethanfrey closed 2 years ago
Looking at the Cosmos SDK a bit, it seems the bank has a separate call to delegate coins (rather than send/burn) that allows the use of vesting tokens: https://github.com/cosmos/cosmos-sdk/blob/c14b101a7a3ea6b126261a9e2d7b9a937140ceba/x/bank/keeper/keeper.go#L112-L118
We will likely need to modify this somehow (using staking adaptor?) to accept the poe staking via delegate.
This may also require larger architecture changes in the contracts as well... good to investigate more
Kind of... it explains the account itself, not the interaction with bank: https://docs.cosmos.network/v0.42/modules/auth/05_vesting.html#delegating refers to "upstream caller" which would be bank I think.
So basically, we need to look at bank.
I have a spiked a solution that we can discuss.
Do vesting accounts explicitly enable staking module? Or explicitly disable bank module? (This has implications for using with wasm)
We discussed this already. Both modules work together. Staking module is not using default bank send but a delegate/ undelegate method
Do we need to pay fees in gentx? (eg global fee module)
With the global fee module enabled, Yes
Can a vesting account cover fees with the still-vesting tokens (likely not, but let's check)?
No, tx fails with insufficient funds
based on above, how to we make genesis vesting that can cover gentx to stake
The the total balance amount needs to be > vesting amount so that some liquid tokens are available. For example:
tgrade add-genesis-account tgrade1... 200000000utgd --vesting-amount=100000000utgd ...
Great work and report back.
I think this issue can be closed. It would be great to make the above comment more findable
Update:
based on above, how to we make genesis vesting that can cover gentx to stake
Sorry, I modified the system test to confirm the fees are working but commented before testing with genTx. When I tried this now with /contrib/local/ scripts then the account has no liquid tokens during gentx executen phase to pay the fees. Need to 👀 .
ok found the issue. and can confirm now it works as described earlier. 😅 https://github.com/confio/tgrade/blob/220_vesting-create-validator/contrib/local/setup_tgrade.sh#L53
All done on the backend side
After discussion with validators, we will use standard cosmos-sdk vesting accounts for them. We must ensure this works and test this in the 0.6 testnet.
tgrade tx stake ...
Questions: