-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Stake distribution logic error(sdk 0.27.1) #3018
Comments
I can't replicate any discrete problem here. If the block rewards (added to the global pool) were zero, that would be a problem, but that doesn't seem to happen with 10,000% inflation and total supply of a million (see testcase here). Have you withdrawn rewards for your validator? If you haven't yet, current pool rewards will be zero as it's calculated on-demand. If you are withdrawing rewards, make sure you don't do so too frequently or the amounts might be rounded down to zero. If you can provide a testcase or set of detailed instructions to replicate this issue we can debug further. |
same issue seen with my intranet(docker). we log all the variables about pool and delaccum. we see that all variables are blank. but the same environtment with inflation 1000 gives us proper variables seen. |
please include the exact CLI commands used to determine the problem |
genesis.json used : https://raw.githubusercontent.com/dlguddus/cosmos-testnets/master/genesis.jsonwithdraw cmdsudo gaiacli tx dist withdraw-rewards --from bharvest --is-validator --trust-node --chain-id gaia-9003kr withdraw resultCommitted at block 64 (tx hash: 299940FD84A0DF148DF5D9F29ED35CB2E9F2F34D1A1F6199911846885CBA2D98, response: {Code:0 Data:[] Log:Msg 0: Info: GasWanted:200000 GasUsed:4941 Tags:[{Key:[97 99 116 105 111 110] Value:[119 105 116 104 100 114 97 119 95 118 97 108 105 100 97 116 111 114 95 114 101 119 97 114 100 115 95 97 108 108] XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0} {Key:[115 111 117 114 99 101 45 118 97 108 105 100 97 116 111 114] Value:[99 111 115 109 111 115 118 97 108 111 112 101 114 49 99 118 115 54 102 50 110 114 100 119 113 97 57 101 116 55 48 118 112 108 53 116 109 53 54 117 120 52 122 57 53 109 97 51 100 104 54 56] XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}] Codespace: XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}) query account cmdsudo gaiacli query account cosmos1cvs6f2nrdwqa9et70vpl5tm56ux4z95mc9ezk5 --trust-node query account result{"type":"auth/Account","value":{"address":"cosmos1cvs6f2nrdwqa9et70vpl5tm56ux4z95mc9ezk5","coins":[{"denom":"photinos","amount":"10000000000"}],"public_key":{"type":"tendermint/PubKeySecp256k1","value":"A6tiOPUI7kr4vuVVH/k7YHiLANdaFkYtO7O71piLGWQW"},"account_number":"171","sequence":"2"}} |
If we try this with each node with 300,000 power(total 4 nodes), rewards coming in normally. So, I think it is relevant to the total power amount and blockly inflation amount. Therefore, in GoS, we have total power of several millions STAKE, so reward will be normal I expect |
I think there is likely something else going on here than a problem in the mechanism based on the results of the testnets. Likely has to do with your setup. Are you sure |
the address is in GoS genesis. GoS submition address. and sdk version is 0.27.1-0-gdfd00a6. We are using the official GoS genesis with only different name gaia-9003kr. different options(inflation 1000 or power 300,000) are working fine but with inflation100 & power 10,000 for 4 nodes doesnt work properly. beware that total power is 40,000 not millions. total blockly reward = 40000 × 100 / 8766 / 60 / 60 × 5 = 0.63 about 0.15 for each 10,000 power validator. 9.6 for 64 height. |
excelent finding! 157.78×40000/8766/60/60×5=0.9999 it is a strong evidence that sdk is doing a decimal truncation when total blockly inflation is less than 1. |
// get the provisions for a block based on the annual provisions rate from minter.go |
Yes, we do. At present this logic will not work if the amount of inflation per blocks is less than |
oh ok. now i see why truncate. then this is normal to see. |
I think the remaining action item here is perhaps to warn when this truncation would mean that inflation rewards are zero. |
Splitting to #3310. This is somewhat less of a concern with F1, which returns unpaid rewards where possible. |
Summary of Bug
No rewards are being added to pool
Steps to Reproduce
Nothing is being added to CurrentPoolRewards, and CurrentCommissionRewards when the inflation rate has been set to 10000% in genesis.json for Game of Stakes. But when set to 100,000%, it works fine.
If no rewards are being distributed to the pools at 10000 inflation, we cannot continue on with Game of Stakes as no stakes are being added to players, and on mainnet it becomes impossible to distribute rewards to validators and their delegators, causing critical loss in what could have been potential income.
For Admin Use
The text was updated successfully, but these errors were encountered: