Skip to content

New Concept pages#250

Open
evanorti wants to merge 69 commits intomainfrom
concepts
Open

New Concept pages#250
evanorti wants to merge 69 commits intomainfrom
concepts

Conversation

@evanorti
Copy link
Contributor

New pages added:

  1. Accounts — Explains how identities work in the Cosmos SDK, including address derivation, balances, sequence numbers, and the different types of accounts used by modules and users.

  2. Transactions, Messages, and Queries — Describes how users interact with a chain through transactions that execute messages and queries that read state without modifying it.

  3. Lifecycle of a Block and Transaction — Explains the execution flow of the blockchain, including the block lifecycle (PreBlock → BeginBlock → transactions → EndBlock → Commit) and how transactions move from broadcast through validation and execution.

  4. Intro to Modules — Introduces the modular architecture of the SDK, explaining how modules encapsulate state, logic, messages, queries, genesis initialization, and block hooks.

  5. State, Storage, and Genesis — Explains how application state is stored in KV stores and multistores, how modules read and write state, and how the chain initializes its first state through genesis.

  6. Encoding — Describes how data is serialized using Protocol Buffers, how interface types are handled through Any and the interface registry, and how .proto files generate the Go types used by modules.

  7. Execution Context, Gas, and Events — Explains the runtime execution environment provided by sdk.Context, including block metadata, gas metering, event emission, and atomic execution.

  8. Intro to SDK Structure — Provides a conceptual map of how Cosmos SDK codebases are organized, explaining the purpose of directories like x/, app/, cmd/, and proto/.

  9. BaseApp Overview — Explains the role of BaseApp as the execution engine that connects CometBFT to modules, runs the AnteHandler, manages the store, and routes messages to module handlers.

  10. app.go Overview — Describes how a specific blockchain application is assembled by wiring BaseApp, keepers, modules, stores, and execution order together in app.go.

  11. CLI, gRPC, and REST API — Explains the external interfaces that allow users and applications to interact with a chain through command-line tools, gRPC services, and REST endpoints.

  12. Testing in the SDK — Introduces the main testing approaches used in Cosmos SDK development, including keeper unit tests, in-memory integration tests, and simulation-based testing used to validate state transitions and invariants.

evanorti and others added 30 commits March 5, 2026 14:08
Add two new concept pages under sdk/next/learn/concepts: accounts.mdx and transactions.mdx. accounts.mdx documents the account model (keys, seed phrases, addresses), account metadata (account number, sequence), replay protection, balances, account types (base, module, vesting), and how accounts authorize transactions. transactions.mdx explains transactions vs queries, transaction structure (messages, signatures, sequence, gas, fees), message definitions via protobuf, message execution and atomicity, block application, query behavior, and the optional unordered transaction mode in v0.53. These pages expand the SDK learning path and link to the transaction lifecycle content.
Add two new conceptual docs under sdk/next/learn/concepts: lifecycle.mdx (Transaction Lifecycle) and modules.mdx (Intro to Modules). lifecycle.mdx details the ABCI flow and BaseApp phases (InitChain, CheckTx/mempool, PrepareProposal, ProcessProposal, FinalizeBlock with PreBlock/BeginBlock/AnteHandler/message routing/atomic execution/EndBlock, Commit) and emphasizes deterministic execution. modules.mdx introduces module architecture, state, messages, queries, MsgServer and Keeper responsibilities, inter-module access, block hooks, genesis initialization, and the typical x/ module file layout. These pages provide foundational SDK concepts for building and reasoning about application logic and block/tx processing.
The sdk/next/ directory was created as a copy of sdk/v0.53/ but the
build/ subdirectory was not included, causing broken internal links
in the learn/ pages. Copy build/ from v0.53, rewrite internal links
to /sdk/next/, add noindex: true to all pages, and update .gitignore
to allow sdk/next/build/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@evanorti evanorti requested a review from ericHgorski March 12, 2026 19:35
Copy link
Contributor

@ericHgorski ericHgorski left a comment

Choose a reason for hiding this comment

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

Whats your process with the TODOs? Not sure If I should be bumping them or not. Otherwise LGTM! With some minor nits.

The result is a single constructor, `NewExampleApp`, that returns a fully wired, ready-to-run chain.

Most examples on this page come from the counter module example in the `example` repo, where `x/counter` is wired into a fuller chain. The minimal counter module example shows the smaller `app.go` delta needed to add `x/counter` to a stripped-down app.
{/* TODO: link to minimal counter module example when it is published in the docs */}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bump on TODO


For information on how modules define their genesis methods (`DefaultGenesis`, `ValidateGenesis`, `InitGenesis`, `ExportGenesis`) and initialization ordering, see [Intro to Modules](/sdk/next/learn/concepts/modules) and [Transaction Lifecycle](/sdk/next/learn/concepts/lifecycle).

{/* todo: link to genesis in tutorial */}
Copy link
Contributor

Choose a reason for hiding this comment

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

bump


The Cosmos SDK provides a layered testing approach that mirrors the architecture of the framework itself. Tests are organized into three levels, each testing a progressively larger slice of the application. This page uses the counter module example in the `example` repo, not the minimal counter module example, because the fuller module includes the testing surfaces needed for these examples.

{/* TODO: link to counter module example walkthrough when it is published in the docs */}
Copy link
Contributor

Choose a reason for hiding this comment

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

bump


The SDK provides a telemetry package built around OpenTelemetry, with legacy support for go-metrics. Modules can emit counters, gauges, and histograms from keeper methods to expose runtime behavior for monitoring.

{/* TODO: link to telemetry documentation */}
Copy link
Contributor

Choose a reason for hiding this comment

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

bump

Improve clarity and cross-linking across several sdk/next concept pages. Changes include: rename reference to "Cosmos SDK Architecture" in accounts, expand and clarify ordered vs unordered transaction behavior and link to the Transactions page; add a "Run a Local Node" link and shorten gRPC wording in CLI docs; add a Store link from Modules and add a Module Manager cross-link from SDK structure; remove TODO placeholders in BaseApp docs and mark the module-manager link; tidy Store formatting (code block language) and remove extra blank lines; update Testing page links for simd and the simd node tutorial and add the Telemetry link. These edits are editorial: clarifications, link additions, formatting fixes, and removal of inline TODOs.

thanks @ericHgorski for your review!!!!
@greptile-apps
Copy link

greptile-apps bot commented Mar 17, 2026

Greptile Summary

This PR adds 12 new Cosmos SDK concept reference pages covering accounts, transactions, lifecycle, modules, state/storage, encoding, context/gas/events, SDK structure, BaseApp, app.go, CLI/gRPC/REST, and testing. It also updates the accounts.mdx and transactions.mdx pages with improved links and formatting, and registers the new pages under a "Concepts" group in docs.json.

The content is thorough, technically accurate, and well cross-linked. There are four broken-link issues to address before merging:

  • cli-grpc-rest missing from docs.json: The new cli-grpc-rest.mdx page is not listed in the docs.json Concepts group, making it unreachable from the sidebar. Other pages (e.g., app-go.mdx) already link to it as the "next section."
  • Broken URL in lifecycle.mdx line 22: /sdk/next/concepts/sdk-structure is missing the learn path segment; should be /sdk/next/learn/concepts/sdk-structure.
  • Non-existent anchor in baseapp.mdx line 112: The link #antehandler-configuration does not correspond to any heading in app-go.mdx; the correct anchor is #mounting-stores-and-setting-hooks.
  • .mdx extension in URL in baseapp.mdx line 171: /sdk/next/learn/concepts/lifecycle.mdx#preblock should omit the .mdx extension.
  • Em-dashes in new docs pages: This PR also adds a CLAUDE.md rule prohibiting em-dashes in documentation, but the new concept pages contain numerous em-dash characters () across encoding.mdx, store.mdx, modules.mdx, lifecycle.mdx, baseapp.mdx, context-gas-events.mdx, and cli-grpc-rest.mdx.

Confidence Score: 3/5

  • Not safe to merge without fixing the missing docs.json entry and the three broken links.
  • The content quality and technical accuracy are high across all 12 new pages. However, one newly added page (cli-grpc-rest) is entirely absent from the sidebar navigation, three links will 404 or silently land on the wrong section, and the new no-em-dash rule is immediately violated in the same PR that introduces it. These are straightforward fixes that don't require content changes.
  • docs.json (missing nav entry), sdk/next/learn/concepts/baseapp.mdx (two broken links), sdk/next/learn/concepts/lifecycle.mdx (broken URL path), and all new .mdx files for em-dash cleanup.

Important Files Changed

Filename Overview
docs.json Adds the new "Concepts" group with 11 pages to the sidebar navigation, but omits cli-grpc-rest — a newly added page that is referenced by other concept pages as the "next section".
CLAUDE.md Adds a single documentation guideline: "Do not use emdashes when creating documentation." This rule is not followed in the new concept pages added in this same PR.
sdk/next/learn/concepts/lifecycle.mdx New page covering the block and transaction lifecycle (CheckTx, PrepareProposal, FinalizeBlock, Commit). Contains a broken URL on line 22 (/sdk/next/concepts/sdk-structure should be /sdk/next/learn/concepts/sdk-structure) and multiple em-dashes violating the new CLAUDE.md rule.
sdk/next/learn/concepts/encoding.mdx New page covering protobuf usage, transaction encoding, sign modes, and the interface registry. Contains two inline em-dashes (lines 78 and 98) that violate the new CLAUDE.md rule.
sdk/next/learn/concepts/baseapp.mdx New page explaining BaseApp's role as the ABCI implementation and execution engine. Contains two broken links: a non-existent anchor #antehandler-configuration (line 112) and a URL with a .mdx extension (line 171), plus several em-dashes violating the CLAUDE.md rule.
sdk/next/learn/concepts/app-go.mdx New page describing app.go construction: BaseApp creation, store key allocation, keeper initialization, ModuleManager, execution ordering, and lifecycle hooks. Content is detailed and accurate; no issues found.
sdk/next/learn/concepts/cli-grpc-rest.mdx New page covering CLI (AutoCLI), gRPC, REST via gRPC-gateway, and CometBFT RPC interfaces. Content is accurate and well-linked; contains em-dashes in table cells and prose that violate the new CLAUDE.md rule. This page is also missing from docs.json navigation.
sdk/next/learn/concepts/testing.mdx New page introducing the three-level testing strategy (keeper unit tests, integration tests, simulation tests) with concrete code examples from the counter module. No issues found.

Last reviewed commit: 8288a93

evanorti and others added 7 commits March 17, 2026 11:26
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Sr25519Type removed, add BLS

* Update modules.mdx

* Update grpc_rest.mdx

* Update store.mdx

* Update README.mdx

* Remove store tracing/metrics and update docs

Remove tracing and metrics plumbing from the store and app build paths: drop traceStore parameters and SetCommitMultiStoreTracer calls (NewSimApp, newTestnetApp, AppBuilder.Build, runtime Build, etc.), remove store tracing APIs (SetTracer, TracingEnabled, TraceContext, related fields) and remove metrics arguments from store/IAVL loaders and constructors (NewStore, LoadStore, LoadStoreWithInitialVersion, LoadStoreWithOpts).

Update documentation to reflect several module and API changes: mark x/crisis moved to contrib, x/nft moved to contrib, x/group moved to Enterprise, expand x/consensus README, add distribution CLI/grpc query examples, add mint MaxSupply notes, add gov hooks and voting-power API changes, and tidy events/store docs to remove deprecated tracing references. These changes simplify the codebase by removing legacy tracing/metrics integrations and update docs for module relocations and API evolutions.
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.

2 participants