regen-network / indexer

:rocket: Blockchain indexer and database
Other
2 stars 0 forks source link

How to handle executor result for accepted and executed proposals? #42

Open ryanchristo opened 1 year ago

ryanchristo commented 1 year ago

Summary

The indexer fetches the proposal from the previous block upon processing EventProposalPruned. The executor result of the proposal may be different then what is provided in the response given this was the proposal state one block prior to being pruned. If a proposal is successfully executed, the executor result should be updated before the proposal is stored in the database, but how we determine this is not clear and may require updates the group module.

Proposal successfully executed and pruned from state:

cosmos.group.v1.EventProposalPruned |           10 |      0 |       0 |         1 | 2023-09-06 15:33:49+00 | e07c31be6fb6324bd11268de8be19922038a0eb2943135f090592e761bb0febc |           1 | PROPOSAL_STATUS_SUBMITTED | regen1afk9zr2hn2jsac63h4hm60vl9z3e5u69gndzf7c99cqge3vzwjzs475lmr |          | {regen1l2pwmzk96ftmmt5egpjulyqtneygmmzndf7csk} | 2023-09-06 15:33:28.999267+00 |             1 |                    1 | {"no_count": "0", "yes_count": "0", "abstain_count": "0", "no_with_veto_count": "0"} | 2023-09-06 15:33:48.999267+00 | PROPOSAL_EXECUTOR_RESULT_NOT_RUN | []

Link: https://github.com/regen-network/indexer/actions/runs/6099145918/job/16550608226#step:8:92

ryanchristo commented 1 year ago

Similar to #43, one solution would be updating the event to include the final state of the executor result (which we would also need to double check if its updated prior to being pruned in the same block). This would only solve future events and historical events would still not include the executor result.

ryanchristo commented 1 year ago

Marking this as a bug because the indexer is providing inaccurate information.