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

Check for invariants - epic #157

Open
alpe opened this issue Sep 17, 2021 · 0 comments
Open

Check for invariants - epic #157

alpe opened this issue Sep 17, 2021 · 0 comments

Comments

@alpe
Copy link
Contributor

alpe commented Sep 17, 2021

This issue is to discuss an on chain safety net that secures tokens and important data

Background:

In the Cosmos-SDK modules can register for a callback to verify that their state is consistent. On any failure the chain is stopped by a panic (in the crisis end blocker). These operations run with an infinite gas meter and do ensure data integrity.

I think we have a similar use case in our contracts. For example
the amount locked in the valset contract must not be < sum of all staked amounts and pending claims.

Steps can be

  • Identify and document relevant conditions that will always be true

  • define how a callback should be handled by a contract:

    • should it check it's owns state only or also be able to query other contracts/ native modules?
    • how would the callback message look like?
    • runs in a read only context
  • Add a new privilege to tgrade (check_invariants for example) with sudo call to registered contracts

    • should we integrate with crisis or do in own end blocker?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant