You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use cosmoshub subgraph on hosted service to index rewards and proposer_rewards events happening while distributing rewards to validators https://docs.cosmos.network/v0.50/build/modules/distribution#beginblocker.
High level description of events happening rewards is event which happens every block and this is basically reward for attestation, since there are 180 active validators there should be around 180 rewards events per block proposer_reward is an event which happens every block but only once, since there is only 1 block proposer chosen before block happens.
Unfortunately even if I am trying to track both events - I am ending up in a situation like both tracked events are resolved to proposer_reward. This can be easily reproduced using example in your documentation -> https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards
Even if query per every block should return around 180 events (since we are not sure validators are always 100% responsive) it is returning only 1 event per block.
As you can see in attached output - even if we index rewards event there is only one per block - which is not true since there is always around 180 and we can confirm by querying the network NODE_RPC_ADDRESS/block_results?height=17860023 (If node was not historical it may be hard to achieve so old data, but every block returns around 180 events of this type)
What is more validator address related to this indexed rewards event points to an address which did a proposal in this block. So looks like rewards event is trying to point proposer_reward what can be true since there was only one event of that type in this block (and in every other block as well there is only 1).
And the second problem is that if we index proposed_reward and try to extract reward attribute we miss value. Key of this attribute should be 'reward' according to https://docs.cosmos.network/v0.50/build/modules/distribution#beginblocker
But after some of my tests it looks like it's under 'amount' attribute. Not sure if subgraph is wrong or cosmos documentation is outdated.
Block data from firehose looks fine for this. Looks like it could be an issue in the Graph node end. I'll try to dry-run the logic to find what's the root cause behind this.
Hi @cometcrafter, how is it going? :)
Using the graph for Cosmos I've also realized MsgWithdrawDelegatorReward is not present after indexing, meaning that the graph is also failing to catch this one.
Bug report
Hi guys,
I was trying to use cosmoshub subgraph on hosted service to index
rewards
andproposer_rewards
events happening while distributing rewards to validators https://docs.cosmos.network/v0.50/build/modules/distribution#beginblocker.High level description of events happening
rewards
is event which happens every block and this is basically reward for attestation, since there are 180 active validators there should be around 180rewards
events per blockproposer_reward
is an event which happens every block but only once, since there is only 1 block proposer chosen before block happens.Unfortunately even if I am trying to track both events - I am ending up in a situation like both tracked events are resolved to
proposer_reward
. This can be easily reproduced using example in your documentation -> https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewardsEven if query per every block should return around 180 events (since we are not sure validators are always 100% responsive) it is returning only 1 event per block.
My subgraph.yaml:
My mapping.ts:
My schema:
Example query:
Output from query:
Problems:
rewards
event there is only one per block - which is not true since there is always around 180 and we can confirm by querying the networkNODE_RPC_ADDRESS/block_results?height=17860023
(If node was not historical it may be hard to achieve so old data, but every block returns around 180 events of this type)What is more validator address related to this indexed
rewards
event points to an address which did a proposal in this block. So looks likerewards
event is trying to pointproposer_reward
what can be true since there was only one event of that type in this block (and in every other block as well there is only 1).proposed_reward
and try to extract reward attribute we miss value. Key of this attribute should be 'reward' according to https://docs.cosmos.network/v0.50/build/modules/distribution#beginblockerBut after some of my tests it looks like it's under 'amount' attribute. Not sure if subgraph is wrong or cosmos documentation is outdated.
Thanks in advance, if needed I can provide more information but I think it should be clear what is the issue and can be easily reproduced even by using example: https://github.com/graphprotocol/graph-tooling/tree/main/examples/cosmos-validator-rewards.
Relevant log output
No response
IPFS hash
No response
Subgraph name or link to explorer
https://thegraph.com/hosted-service/subgraph/wojciechowskip/cosmoshub-4
Some information to help us out
OS information
None
The text was updated successfully, but these errors were encountered: