Block Events vs API Results #29
Closed
shahil-zhangada-cb
announced in
Announcements
Replies: 1 comment
-
Update: The assumptions made are correct, but the reason this occurred was due to missing another commission block event that would have made the equation equal. There can be multiple |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context: I am trying to understand how rewards are calculated and specifically trying to determine the amount of revenue a validator earns at a given block height.
TL;DR I am seeing some discrepancies when comparing the values produced from the block events vs values produced from the api.
I see that when we fetch block results using the
tendermint
sdk, we observe a lot of differentblock events
as well as events associated with thetx results
. However, I am seeing discrepancies when comparing the value found in the block event vs taking the difference between the outstanding rewards or outstanding commission when using the api.My assumption is that the rewards (or commission) earned at a block height can be found using the
/outstanding_rewards
(/commission
for validator commission) endpoint, and taking the difference between the response at n and n-1 then adding whatever was withdrawn at that block height.To summarize,
where the withdrawn reward can be found in the event of the txn result.
However, I am seeing a discrepancy when comparing the block event value for commission vs computing the difference in accumulated commissions. For instance, check out block height: 15462751
Block event at height
15462751
for validator:cosmosvaloper1cc99d3xcukhedg4wcw53j7a9q68uza707vpfe7
shows an amount of1641.630933931314725960uatom
.However, when fetching the accumulated commisison at 15462751 and 15462750, we get the following: 1354063626.271718375769517651 and 1354043358.515271327600369176, whose difference =
20,267.756447048169148475 uatom
, which !=1641uatom
from earlier.I am wondering if my formula for computing rewards/commission is incorrect or if there is something I am not accounting for. Should we trust the data from the endpoints over block events? Any guidance or clarification would be appreciated here. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions