How the validators are receiving money in their account.? How gas price amount get deduced from the user account to validator accounts. ? And how to check the balances of user account and validator account , before and after.?
1 Answers
How the validators are receiving money in their account?
Validators do not receive "money". In the Cosmos Hub (Gaia), which uses the x/distribution
module in the Cosmos-SDK. This module implements the F1 distribution spec. In this spec, it is defined that validators earn inflation rewards, part of the globally collected fees and a possible commission (if they charge it). So to answer your question, the hub does lazy accounting where it tracks how many rewards a validator and its delegates earn on a block-by-block basis.
Validators and their delegates can withdraw these rewards at any time.
How gas price amount get deduced from the user account to validator accounts?
Fees are deducted from the fee paying account during the AnteHandler
execution during DeliverTx
. Every tx has a dedicated fee payer -- typically the first signer of the tx.
And how to check the balances of user account and validator account , before and after?
There exist APIs, in addition to the CLI, that allows you to query the balance of an address. You can easily search or google for these APIs.

- 21
- 1
-
Can you direct me to the code base Where fee payment is happening. Is it happening via bank module coin transfer functionality? And as you mentioned that validator do not receive money then in that case whereas the fee goes? How coins transfer is happening under the hood? – Mr.100 Jan 21 '21 at 11:19
-
1. Is this not a part of development set up with startport starget. I have done a few transaction from user1 account and the account balances remain same. 2. Can you direct me to the code base of antehandler where this coin transfer happen from account. I beleive it is done via bank module function. 3. What is this pool you are talking about? Please elaborate. – Mr.100 Jan 21 '21 at 11:23
-
@mr.100 Fee deduction happens in the AnteHandler. You can find the exact decorator here https://github.com/cosmos/cosmos-sdk/blob/v0.40.1/x/auth/ante/fee.go#L73. – aleksbez Jan 21 '21 at 16:53
-
@aleksbex it is useful – Mr.100 Jan 21 '21 at 16:57
-
How to test this in starport based dev environment? – Mr.100 Jan 22 '21 at 11:02