Skip to content
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

[Monitoring] - More than one answer for a proposal question at Reality.eth #95

Open
juliopavila opened this issue Dec 11, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@juliopavila
Copy link
Collaborator

juliopavila commented Dec 11, 2022

Is your feature request related to a problem? Please describe.
More than one answer for a proposal question at Reality.eth

Describe the solution you'd like
We should first focus on sending a notification on every new answer.
We probably need a new sentinel and autotask triggered every time a LogNewQuestion is emitted where the user value is one of the Reality Modules (this new autotask must be given the question ID of the new question).
That autotask must create a sentinel that sends notifications on LogNewAnswer events for the question ID.

This requires #97

@juliopavila juliopavila added the enhancement New feature or request label Dec 11, 2022
@juliopavila juliopavila self-assigned this Dec 11, 2022
@asgeir-s
Copy link
Contributor

In detail:
For what we are working on in https://github.com/gnosis/zodiac/pull/91, the on_module_factory_events autotask will execute every time a new Reality Module is created.

What we now need is for this autotask, on_module_factory_events, to set up a new autotask (ProposalQuestionCreated-autotask) (and sentinel to trigger it) that will be triggered by ProposalQuestionCreated events from the Reality Module that created this autotask (the address of the Reality Module must be added to the new autotask via readFileAndReplace so that the correct filters can be added to the sentinel). You can see an example of how this can be done here: https://github.com/gnosis/zodiac-safe-app/blob/master/packages/backend/lib/defender/autotasks/on_new_question_from_module.ts / https://github.com/gnosis/zodiac-safe-app/blob/master/packages/backend/lib/defender/index.ts.

The ProposalQuestionCreated-autotask needs to set up a sentinel that sends a notification to Discord when a new LogNewAnswer event is emitted with the question ID from ProposalQuestionCreated event above. See here how: https://github.com/gnosis/zodiac-safe-app/blob/268b668f89af40e9d455efdc6078d0b19ba63be5/packages/backend/lib/defender/autotasks/on_new_question_from_module.ts#L28-L96

Overview

on_module_factory_events-autotask
Trigger: a new Reality Module it set up
Execution: setts up the ProposalQuestionCreated-autotask

ProposalQuestionCreated-autotask
Trigger: a new question from the Reality Module that created this autotask
Execution: sets up a sentinel that notifies about LogNewAnswer events from Reality.eth that matches the question ID.

This way, we get a notification in Discord for all LogNewAnswer events that are related to Reality Modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants