-
Notifications
You must be signed in to change notification settings - Fork 44
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
Update topic schema + add migration for weighted topics #9153
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like I'm missing some context here. The UI is still allowing me to select multiple topics when creating a contest which leads to this API error:
[08:28:59.887] WARN (utils.ts): BAD_REQUEST: [ZodError] contest.createContestMetadata: [
{
"code": "too_big",
"maximum": 1,
"type": "array",
"inclusive": true,
"exact": false,
"message": "Array must contain at most 1 element(s)",
"path": [
"topic_ids"
]
}
]
Why are we restricting contests to a single topic? Is that a necessary change to decouple stake from contests? I need some more context to understand what the proper functionality should be here.
I think in this case we should change it to allow selecting only one topic + removing "all". Also toggles for single option is not best solution. Probably we should go with CWSelectList in this case. @rbennettcw let me know if I can help out |
@timolegros Voting weight is now dependent on the token configuration of the associated topic (stake or ERC20). If there are multiple topics associated, then we won't know which token config to use for calculating voting weight. It was a decision made by product to restrict to 1 topic/token per contest regarding voting weight. @masvelio @timolegros I've already updated the UI to restrict to a single topic and remove the All button. See the last commit. Please pull the latest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clicked around, works fine
Wondering if we really need contest_topic now that the association is 0 or 1 at the topic level? We created this table to support multiple topics per contest, but if we need to enforce 1-1 we can simplify by. moving contest_id to topic as optional. Am I missing something? |
My concerns are:
|
It's all good, as long as we keep an eye on it for future refactoring. This is accidental complexity right now. |
Link to Issue
Closes: #9132
Description of Changes
Topics
schema to support weighted voting per topicTopics
table + apply 1-to-1 constraint for Contest to TopicTest Plan
Deployment Plan
N/A
Other Considerations
ContestTopics
table, but the surface area of that change would be quite large + the spec could change at any time.