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

Problem: no permissions system in cronos #795

Merged
merged 30 commits into from
Feb 10, 2023

Conversation

thomas-nguy
Copy link
Collaborator

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

add the abilities to define admins that has priviledge to execute some admin functions

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

@thomas-nguy thomas-nguy requested a review from a team as a code owner December 19, 2022 07:56
@thomas-nguy thomas-nguy requested review from mmsqe and adu-crypto and removed request for a team December 19, 2022 07:56
@thomas-nguy thomas-nguy marked this pull request as draft December 19, 2022 07:56
@codecov
Copy link

codecov bot commented Dec 19, 2022

Codecov Report

Merging #795 (1de67b7) into main (62aab4c) will decrease coverage by 0.30%.
The diff coverage is 17.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #795      +/-   ##
==========================================
- Coverage   36.76%   36.47%   -0.30%     
==========================================
  Files          55       56       +1     
  Lines        3979     4058      +79     
==========================================
+ Hits         1463     1480      +17     
- Misses       2345     2407      +62     
  Partials      171      171              
Impacted Files Coverage Δ
versiondb/client/dump.go 0.00% <0.00%> (ø)
versiondb/extsort/sort.go 41.66% <ø> (ø)
x/cronos/keeper/grpc_query.go 0.00% <0.00%> (ø)
x/cronos/keeper/msg_server.go 15.71% <0.00%> (-1.21%) ⬇️
x/cronos/types/codec.go 0.00% <0.00%> (ø)
x/cronos/types/keys.go 0.00% <0.00%> (ø)
x/cronos/types/messages.go 11.97% <0.00%> (-2.42%) ⬇️
x/cronos/keeper/permissions.go 100.00% <100.00%> (ø)

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is quite a big change -- could there first be a PR that just updates x/cronos's https://github.com/crypto-org-chain/cronos/tree/main/x/cronos/spec , so it's clearer what this is trying to do / what problem this is trying to solve? (I assume the spec won't be up to date if this is added?)

@thomas-nguy
Copy link
Collaborator Author

yes, you are totally right. I have created a PR to update the spec there
#801

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few nits for considerations. Should the cronos module and/or protos be bumped to v2?

proto/cronos/query.proto Show resolved Hide resolved
proto/cronos/query.proto Show resolved Hide resolved
x/cronos/keeper/msg_server.go Outdated Show resolved Hide resolved
x/cronos/keeper/permissions.go Show resolved Hide resolved
x/cronos/keeper/permissions.go Show resolved Hide resolved
@thomas-nguy thomas-nguy force-pushed the thomas/add-permissions branch 3 times, most recently from bdb04dd to 0729b81 Compare January 30, 2023 01:33
@thomas-nguy thomas-nguy force-pushed the thomas/add-permissions branch 2 times, most recently from 677b98e to cf858d2 Compare January 30, 2023 09:36
Copy link
Collaborator

@mmsqe mmsqe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proto-check-breaking is red, you might try buf mod update

@thomas-nguy thomas-nguy requested review from tomtau and mmsqe and removed request for adu-crypto January 31, 2023 07:43
@thomas-nguy thomas-nguy force-pushed the thomas/add-permissions branch 2 times, most recently from d8e8a8a to 3b12c18 Compare February 6, 2023 05:43
@thomas-nguy
Copy link
Collaborator Author

mmm seems that golangci-lint is failing after the change 7f12ef1#diff-107e910e9f2ebfb9a741fa10b2aa7100cc1fc4f5f3aca2dfe78b905cbd73c0d2

any clue @yihuang ?

Makefile Outdated Show resolved Hide resolved
@yihuang
Copy link
Collaborator

yihuang commented Feb 10, 2023

mmm seems that golangci-lint is failing after the change 7f12ef1#diff-107e910e9f2ebfb9a741fa10b2aa7100cc1fc4f5f3aca2dfe78b905cbd73c0d2

any clue @yihuang ?

strange, I can run locally though, there are some errors about sdkerrors deprecation.

app/ante/ante.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@yihuang yihuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not the ante handler return error instead of panic?
do we still need the CronosAdmin in parameters?

@thomas-nguy
Copy link
Collaborator Author

CronosAdmin is still needed for the sake of decentralisation. It is defined by governance and only the CronosAdmin can add/delete/update permissions

@yihuang
Copy link
Collaborator

yihuang commented Feb 10, 2023

CronosAdmin is still needed for the sake of decentralisation. It is defined by governance and only the CronosAdmin can add/delete/update permissions

oh, i thought the set permissios stuff is supposed to be controlled by gov

@thomas-nguy
Copy link
Collaborator Author

its controlled by the new MsgUpdatePermissions that only admin can use

@thomas-nguy thomas-nguy enabled auto-merge (squash) February 10, 2023 10:30
@thomas-nguy thomas-nguy merged commit 9567c36 into crypto-org-chain:main Feb 10, 2023
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

Successfully merging this pull request may close these issues.

4 participants