From 8d44633e860fb8c9c12e03411953ac19ce581249 Mon Sep 17 00:00:00 2001 From: Barrie Byron Date: Fri, 17 Sep 2021 12:19:02 -0400 Subject: [PATCH 1/3] fix:(doc x/authz/spec/01_concepts.md) fix typo and minor edits fixed a typo and made some minor edits while I was in here let's add the "hey, at a glance you might think this is auth, but no, it's authz" note for clarity --- x/authz/spec/01_concepts.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/x/authz/spec/01_concepts.md b/x/authz/spec/01_concepts.md index 1aeb68650d3c..142b5edb122b 100644 --- a/x/authz/spec/01_concepts.md +++ b/x/authz/spec/01_concepts.md @@ -10,17 +10,19 @@ order: 1 on behalf of one account to other accounts. The design is defined in the [ADR 030](../../../architecture/adr-030-authz-module.md). Grant is an allowance to execute a Msg by the grantee on behalf of the granter. -Authorization is an interface which must be implemented by a concrete authorization logic to validate and execute grants. They are extensible and can be defined for any Msg service method even outside of the module where the Msg method is defined. See the `SendAuthorization` example in the next section for more details. +Authorization is an interface that must be implemented by a concrete authorization logic to validate and execute grants. Authorizations are extensible and can be defined for any Msg service method even outside of the module where the Msg method is defined. See the `SendAuthorization` example in the next section for more details. + +**Note:** The authz module is different from the [auth](https://docs.cosmos.network/v0.44/modules/auth/) (authentication) module that is responsible for specifying the base transaction and account types. +++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/x/authz/authorizations.go#L11-L25 ## Built-in Authorizations -Cosmos-SDK `x/authz` module comes with following authorization types +The Cosmos SDK `x/authz` module comes with following authorization types. ### SendAuthorization -`SendAuthorization` implements the `Authorization` interface for the `cosmos.bank.v1beta1.MsgSend` Msg. It takes a `SpendLimit` that specifies the maximum amount of tokens the grantee can spend, which is updated as the tokens are spent. +`SendAuthorization` implements the `Authorization` interface for the `cosmos.bank.v1beta1.MsgSend` Msg. It takes a `SpendLimit` that specifies the maximum amount of tokens the grantee can spend. The `SpendLimit` is updated as the tokens are spent. +++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/proto/cosmos/bank/v1beta1/authz.proto#L10-L19 @@ -30,7 +32,7 @@ Cosmos-SDK `x/authz` module comes with following authorization types ### GenericAuthorization -`GenericAuthorization` implements the `Authorization` interface, that gives unrestricted permission to execute the provided Msg on behalf of granter's account. +`GenericAuthorization` implements the `Authorization` interface that gives unrestricted permission to execute the provided Msg on behalf of granter's account. +++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/proto/cosmos/authz/v1beta1/authz.proto#L14-L19 @@ -40,4 +42,4 @@ Cosmos-SDK `x/authz` module comes with following authorization types ## Gas -In order to prevent DoS attacks, granting `StakeAuthorizaiton`s with `x/authz` incur gas. `StakeAuthorizaiton` allows you to authorize another account to delegate, undelegate, or redelegate to validators. The authorizer can define a list of validators they will allow and/or deny delegations to. The SDK will iterate over these lists and charge 10 gas for each validator in both of the lists. +In order to prevent DoS attacks, granting `StakeAuthorizaiton`s with `x/authz` incurs gas. `StakeAuthorization` allows you to authorize another account to delegate, undelegate, or redelegate to validators. The authorizer can define a list of validators they allow or deny delegations to. The Cosmos SDK will iterate over these lists and charge 10 gas for each validator in both of the lists. From 59403f040787a56ef1695ecb0ffe7c6a5e5ed743 Mon Sep 17 00:00:00 2001 From: Barrie Byron Date: Mon, 20 Sep 2021 10:24:05 -0400 Subject: [PATCH 2/3] Update x/authz/spec/01_concepts.md yes! Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> --- x/authz/spec/01_concepts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/authz/spec/01_concepts.md b/x/authz/spec/01_concepts.md index 142b5edb122b..ed24c07f0563 100644 --- a/x/authz/spec/01_concepts.md +++ b/x/authz/spec/01_concepts.md @@ -12,7 +12,7 @@ on behalf of one account to other accounts. The design is defined in the [ADR 03 Grant is an allowance to execute a Msg by the grantee on behalf of the granter. Authorization is an interface that must be implemented by a concrete authorization logic to validate and execute grants. Authorizations are extensible and can be defined for any Msg service method even outside of the module where the Msg method is defined. See the `SendAuthorization` example in the next section for more details. -**Note:** The authz module is different from the [auth](https://docs.cosmos.network/v0.44/modules/auth/) (authentication) module that is responsible for specifying the base transaction and account types. +**Note:** The authz module is different from the [auth](../modules/auth/) (authentication) module that is responsible for specifying the base transaction and account types. +++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/x/authz/authorizations.go#L11-L25 From 1bcd3844d606cc3879f85b50e4f0a930d2cee393 Mon Sep 17 00:00:00 2001 From: Barrie Byron Date: Mon, 20 Sep 2021 10:58:57 -0400 Subject: [PATCH 3/3] Update 01_concepts.md thanks for catching this typo @ryanchristo --- x/authz/spec/01_concepts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/authz/spec/01_concepts.md b/x/authz/spec/01_concepts.md index ed24c07f0563..20ec9a7b6abb 100644 --- a/x/authz/spec/01_concepts.md +++ b/x/authz/spec/01_concepts.md @@ -28,7 +28,7 @@ The Cosmos SDK `x/authz` module comes with following authorization types. +++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/x/bank/types/send_authorization.go#L25-L40 -- `spent_limit` keeps track of how many coins are left in the authorization. +- `spend_limit` keeps track of how many coins are left in the authorization. ### GenericAuthorization