cosmos-sdk/docs/architecture
Ivan Gavran 9f543b1c3b
refactor: Small clarifications to authz docs and one error description (#11506)
## Description

This small PR is trying to clarify the documentation that I found ambiguous when reading it.
Furthermore, it makes one error message more precise ("non-negative" --> "positive").

In particular:
 - I clarified that the field `AcceptResponse.Accept` will be set to `true` when an authorization is accepted, but **will not** be set to `false` otherwise (instead, the function `Accept` will return an error).
 - I clarified that the field `AcceptResponse.Updated` will not always be populated: it will be `nil` unless there are real changes to the authorization
 - I changed the error message in the `send_authorization.go` function, when `IsAllPositive()` returns `false` from _spend limit cannot be negitive_ to _spend limit must be positive_. I emphasized the fact that spend limit must be positive in the documentation.

This is my first contribution to the Cosmos-SDK codebase so if I made some mistake the process (wrt the checklist), guide me patiently, pls.



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification: NOTE: does not apply, these are clarification changes
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules): NOTE: does not apply, these are clarification changes
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing): NOTE: does not apply, these are clarification changes
- [ ] added a changelog entry to `CHANGELOG.md`: NOTE: does not apply, these are clarification changes
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) NOTE: does not apply, these are clarification changes
- [x] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-04-03 09:50:51 +00:00
..
PROCESS.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
README.md docs: ADR 047: Extend Upgrade Plan - Initial Draft (#10602) 2022-02-18 09:09:44 +00:00
adr-002-docs-structure.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-003-dynamic-capability-store.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-004-split-denomination-keys.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-006-secret-store-replacement.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-007-specialization-groups.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-008-dCERT-group.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-009-evidence-module.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-010-modular-antehandler.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-011-generalize-genesis-accounts.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-012-state-accessors.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-013-metrics.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-014-proportional-slashing.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-016-validator-consensus-key-rotation.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-017-historical-header-module.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-018-extendable-voting-period.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-019-protobuf-state-encoding.md fixing typos (#11447) 2022-03-24 16:33:48 +01:00
adr-020-protobuf-transaction-encoding.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-021-protobuf-query-encoding.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-022-custom-panic-handling.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-023-protobuf-naming.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-024-coin-metadata.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-027-deterministic-protobuf-serialization.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-028-public-key-addresses.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-029-fee-grant-module.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-030-authz-module.md refactor: Small clarifications to authz docs and one error description (#11506) 2022-04-03 09:50:51 +00:00
adr-031-msg-service.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-032-typed-events.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-033-protobuf-inter-module-comm.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-034-account-rekeying.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-035-rosetta-api-support.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-036-arbitrary-signature.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-037-gov-split-vote.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-038-state-listening.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-039-epoched-staking.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-040-storage-and-smt-state-commitments.md chore: Rename store/v2 -> store/v2alpha1 (#11392) 2022-03-16 18:30:27 +00:00
adr-041-in-place-store-migrations.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-042-group-module.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-043-nft-module.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-044-protobuf-updates-guidelines.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
adr-045-check-delivertx-middlewares.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-046-module-params.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
adr-047-extend-upgrade-plan.md docs: ADR 047: Extend Upgrade Plan - Initial Draft (#10602) 2022-02-18 09:09:44 +00:00
adr-049-state-sync-hooks.md docs: ADR-049 state sync hooks (#10976) 2022-02-15 17:06:43 +00:00
adr-template.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00

README.md

order parent
false
order
false

Architecture Decision Records (ADR)

This is a location to record all high-level architecture decisions in the Cosmos-SDK.

An Architectural Decision (AD) is a software design choice that addresses a functional or non-functional requirement that is architecturally significant. An Architecturally Significant Requirement (ASR) is a requirement that has a measurable effect on a software systems architecture and quality. An Architectural Decision Record (ADR) captures a single AD, such as often done when writing personal notes or meeting minutes; the collection of ADRs created and maintained in a project constitute its decision log. All these are within the topic of Architectural Knowledge Management (AKM).

You can read more about the ADR concept in this blog post.

Rationale

ADRs are intended to be the primary mechanism for proposing new feature designs and new processes, for collecting community input on an issue, and for documenting the design decisions. An ADR should provide:

  • Context on the relevant goals and the current state
  • Proposed changes to achieve the goals
  • Summary of pros and cons
  • References
  • Changelog

Note the distinction between an ADR and a spec. The ADR provides the context, intuition, reasoning, and justification for a change in architecture, or for the architecture of something new. The spec is much more compressed and streamlined summary of everything as it stands today.

If recorded decisions turned out to be lacking, convene a discussion, record the new decisions here, and then modify the code to match.

Creating new ADR

Read about the PROCESS.

Use RFC 2119 Keywords

When writing ADRs, follow the same best practices for writing RFCs. When writing RFCs, key words are used to signify the requirements in the specification. These words are often capitalized: "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL. They are to be interpreted as described in RFC 2119.

ADR Table of Contents

Accepted

Proposed

Draft