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

Safe upgrades: Add healthcheck function and call it when upgrading a contract #116

Open
tensojka opened this issue Jul 22, 2024 · 4 comments
Assignees

Comments

@tensojka
Copy link
Contributor

Checking that an upgrade is correct and is compatible with the currently deployed governance state. This will check that for example AMM contract is being upgraded with an AMM contract and not by a token contract.

Generic governance upgrades are inherently risky, because it’s an upgrade of the contract itself. Before application of a passed generic proposal, a test will be run that library calls a health check function on the governance (or core protocol, governance token,...) contract to ensure that it’s truly a contract of the same type (of version higher than current to ensure no incompatibilities).

@tensojka tensojka added this to the Milestone 9 - Safe Upgrades milestone Jul 22, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Aug 1, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Aug 1, 2024
@scobi7
Copy link
Collaborator

scobi7 commented Aug 1, 2024

Aug 1st - wrote a check_if_healthy function and am currently testing it. Not fully functioning but fix should be easy.

Also side note, I'm using the old staking curve and functions to test because the old staking curve functions were used in proposals and its easier to test this way.

scobi7 added a commit to scobi7/konoha that referenced this issue Aug 2, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Aug 5, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Aug 5, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Aug 5, 2024
@scobi7
Copy link
Collaborator

scobi7 commented Aug 5, 2024

Only issue at the moment is figuring out how to call check_if_healthy on the separate testing file. I am not sure that the tests are correctly calling it, but I've tested with hard coding and it works.

scobi7 added a commit to scobi7/konoha that referenced this issue Aug 6, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Aug 6, 2024
@scobi7
Copy link
Collaborator

scobi7 commented Aug 6, 2024

Checks are working correctly, I'm just having some weird contract deployment error iff it returns false. (Requested contract address ContractAddress(PatriciaKey(StarkFelt("0x0000000000000000000000000000000000000000000000000000000000000000"))) is not deployed.)

@tensojka
Copy link
Contributor Author

tensojka commented Aug 6, 2024

Can you open a pull request?

scobi7 added a commit to scobi7/konoha that referenced this issue Aug 7, 2024
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

2 participants