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

Authz: create a list of properties to test #3

Closed
ivan-gavran opened this issue Aug 19, 2022 · 7 comments · Fixed by #4
Closed

Authz: create a list of properties to test #3

ivan-gavran opened this issue Aug 19, 2022 · 7 comments · Fixed by #4
Assignees

Comments

@ivan-gavran
Copy link
Contributor

ivan-gavran commented Aug 19, 2022

@ivan-gavran ivan-gavran self-assigned this Aug 19, 2022
@ivan-gavran ivan-gavran linked a pull request Aug 19, 2022 that will close this issue
@ivan-gavran
Copy link
Contributor Author

ivan-gavran commented Aug 23, 2022

Alongside those test scenarios, we discussed a bit more involved scenarios in the meeting today. Let's share them here in the comments first. @hvanz @andrey-kuprianov @rnbguy

@ivan-gavran
Copy link
Contributor Author

  1. A gives a generic grant to B.
  2. B, on behalf of A, gives a generic grant to C. (Now C is able to send messages on behalf of A)
  3. A revokes its grant to B.
    The question is: is the grant of C still valid? (I would expect so, but would like to check)

@rnbguy
Copy link
Member

rnbguy commented Aug 23, 2022

Trying to double spend by circular nested AuthzExec.

Transaction message from A
┌────────────────────────────────────────┐
│  A on behalf of B                      │
│ ┌────────────────────────────────────┐ │
│ │ B on behalf of A                   │ │
│ │ ┌────────────────────────────────┐ │ │
│ │ │ A on behalf of B               │ │ │
│ │ │ ┌────────────────────────────┐ │ │ │
│ │ │ │ B on behalf of A           │ │ │ │
│ │ │ │ ┌────────────────────────┐ │ │ │ │
│ │ │ │ │ A sends 10 tokens to B │ │ │ │ │
│ │ │ │ └────────────────────────┘ │ │ │ │
│ │ │ │                            │ │ │ │
│ │ │ └────────────────────────────┘ │ │ │
│ │ │                                │ │ │
│ │ └────────────────────────────────┘ │ │
│ │                                    │ │
│ │ ┌────────────────────────┐         │ │
│ │ │ A sends 10 tokens to B │         │ │
│ │ └────────────────────────┘         │ │
│ │                                    │ │
│ └────────────────────────────────────┘ │
│                                        │
└────────────────────────────────────────┘

@hvanz
Copy link
Member

hvanz commented Aug 23, 2022

I don't quite understand the diagram. Can you write it in TLA+? 😉😁

@rnbguy
Copy link
Member

rnbguy commented Aug 23, 2022

Let me share an actual protobuf msg in YAML.

'@type': /cosmos.authz.v1beta1.MsgExec
grantee: A
msgs:
  - '@type': /cosmos.authz.v1beta1.MsgExec
    grantee: B
    msgs:
      - '@type': /cosmos.authz.v1beta1.MsgExec
        grantee: A
        msgs:
          - '@type': /cosmos.authz.v1beta1.MsgExec
            grantee: B
            msgs:
              - '@type': /cosmos.bank.v1beta1.MsgSend
                from_address: A
                to_address: B
                amount:
                  - denom: token
                    amount: '10'
      - '@type': /cosmos.bank.v1beta1.MsgSend
        from_address: A
        to_address: B
        amount:
          - denom: token
            amount: '10'

@hvanz
Copy link
Member

hvanz commented Aug 24, 2022

In the spec (I'm not so sure about the code) the field msgs of MsgExec cannot be MsgExec. The type url of the message is defined for each authorization. So for the module bank only messages of type /cosmos.bank.v1beta1.MsgSend are allowed in MsgExec.

@rnbguy
Copy link
Member

rnbguy commented Aug 25, 2022

Sorry if we are only listing the scenarios that work with the current specification.

But yes, this will work with cosmos-sdk. I already tried it with Atomkraft. 🙂 GenericAuthorization allows any kind of transaction message.

@andrey-kuprianov andrey-kuprianov self-assigned this Aug 31, 2022
@andrey-kuprianov andrey-kuprianov removed their assignment Sep 7, 2022
@hvanz hvanz changed the title create a list of properties to test for Authz demo Authz: create a list of properties to test Oct 17, 2022
@ivan-gavran ivan-gavran reopened this Oct 31, 2022
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 a pull request may close this issue.

4 participants