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

Implement invariants #90

Closed
RiccardoM opened this issue Jan 27, 2020 · 6 comments · Fixed by #135
Closed

Implement invariants #90

RiccardoM opened this issue Jan 27, 2020 · 6 comments · Fixed by #135
Assignees
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add status/specification This feature is currently in the specification process x/posts Post module x/profiles Module that allows to create and manage decentralized social profiles
Projects
Milestone

Comments

@RiccardoM
Copy link
Contributor

Currently there are no invariants set for the posts module nor the magpie module. I really think we should implement those as they allow to check for each block that the state is preserved correctly.

@RiccardoM RiccardoM added kind/enhancement Enhance an already existing feature; no "New feature" to add Module:Magpie x/posts Post module labels Jan 27, 2020
@RiccardoM RiccardoM added this to the v0.4.0 milestone Jan 27, 2020
@RiccardoM RiccardoM added this to To do in Desmos via automation Jan 27, 2020
@RiccardoM
Copy link
Contributor Author

RiccardoM commented Feb 4, 2020

Some possible invariants that might be useful to preserve are the following:

  • Make sure the LastPostID is always equals to the greatest PostID inserted.
    This should avoid the reproducing of Duplicate entries in children after post edit #63 in the future

  • Make sure that each post reaction refers to an existing post.
    This should avoid storing invalid reactions.

  • Make sure each post has a ParentID referring to an existing post.
    This should avoid storing invalid comments.

@RiccardoM RiccardoM added the status/specification This feature is currently in the specification process label Feb 4, 2020
@leobragaz
Copy link
Contributor

Also maybe:
Make sure that pollAnswers referring to an existing post with poll?

@RiccardoM RiccardoM removed the status/specification This feature is currently in the specification process label Feb 12, 2020
@RiccardoM RiccardoM added the status/specification This feature is currently in the specification process label Feb 12, 2020
@RiccardoM RiccardoM modified the milestones: v0.4.0, v0.5.0 Mar 10, 2020
@RiccardoM
Copy link
Contributor Author

If we change how ids are generated (#131), we could change the comments check to be:

  • Make sure that every post comment has a creation date after the parent post

@leobragaz
Copy link
Contributor

We could start implementing invariants after we fixed posts IDs

@RiccardoM
Copy link
Contributor Author

@bragaz Yeah I think that's the way to go. Maybe we can have id fixing into a PR and invariants into another one, both targeting 0.4.0? Do you think that could be possibile?

@leobragaz
Copy link
Contributor

This depends on when we decided to roll-out the new testnet.
I think it would be better anyway to target new IDs fixes to 0.4.0 and the invariants to 0.5.0.
This should give us the proper time to test them carefully.
But, if you think this should better added into 0.4.0 we can make it.

@leobragaz leobragaz self-assigned this Apr 20, 2020
@leobragaz leobragaz added the x/profiles Module that allows to create and manage decentralized social profiles label Apr 20, 2020
Desmos automation moved this from To do to Done May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add status/specification This feature is currently in the specification process x/posts Post module x/profiles Module that allows to create and manage decentralized social profiles
Projects
No open projects
Desmos
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants