Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

docs(docs/build/building-apps): update docs #23713

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

0x2d3c
Copy link
Contributor

@0x2d3c 0x2d3c commented Feb 15, 2025

update docs

Summary by CodeRabbit

  • Documentation

    • Security guide updated with improved error handling insights and clearer explanations regarding key management risks.
    • The upgrade documentation for v0.52 has been enhanced with detailed migration steps, including instructions for module replacements and updated transaction processing.
  • New Features

    • Introduced unordered transaction processing for greater flexibility.
    • Added new modules to support enhanced validations and protocol management, along with refined account management improvements.

@0x2d3c 0x2d3c requested a review from a team as a code owner February 15, 2025 14:41
Copy link
Contributor

coderabbitai bot commented Feb 15, 2025

📝 Walkthrough

Walkthrough

This pull request updates the Cosmos SDK documentation and upgrade guide. In the security documentation, the HasAnyAtPrefix function is modified to use errors.Is for error handling, and the risks of key malleability with prefix iteration are clarified. In the upgrade guide, significant changes are detailed for Cosmos SDK v0.52, including removals (e.g. x/params, x/crisis), additions (e.g. x/validate, x/protocolpool), and updates to function signatures across modules to accommodate a new context interface and migration strategies.

Changes

File(s) Change Summary
docs/build/building-apps/.../04-security-part-1.md Updated the error handling in the HasAnyAtPrefix function to leverage errors.Is instead of a direct comparison, and enhanced the documentation to explain the security implications of key malleability in prefix iteration.
docs/build/building-apps/.../0.52.md Revised the upgrade guide for Cosmos SDK v0.52: removed modules such as x/params and x/crisis; introduced new modules like x/validate and x/protocolpool; updated function signatures (e.g., for ProposalHandler and genesis methods in x/{module_name}/module.go) to reflect context changes and migration requirements.

Suggested labels

T:Docs, backport/v0.52.x

Suggested reviewers

  • julienrbrt
  • tac0turtle
  • akhilkumarpilli

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
docs/build/building-apps/upgrades/0.52.md (1)

429-498: 🛠️ Refactor suggestion

Removal of AppModuleBasic: Merging into Unified AppModule Structure
The comprehensive changes merging AppModuleBasic into AppModule simplify the module’s entry point. Note the following:

  • The Name() function now belongs solely to AppModule.
  • Both legacy codec registration and genesis validation functions have been adjusted accordingly.
    Double-check that all module consumers have been updated to reflect these changes and that the removal of the embedded basic module does not break backward compatibility.
🧹 Nitpick comments (2)
docs/build/building-apps/upgrades/0.52.md (2)

180-188: AppConfig Update: Introducing SkipStoreKeys for Modules Without Keys
Adding the SkipStoreKeys field improves configurability for modules that do not require a KV store. Consider providing an example in the documentation to illustrate when this field should be used.


383-383: Typo Correction: Fix Spelling Mistake
The pipeline indicates a typo on line 383 where "fot" should be "for". Please update the text accordingly to maintain professionalism and readability.

- ... cost fot the development team ...
+ ... cost for the development team ...
🧰 Tools
🪛 GitHub Actions: Spell Check

[warning] 383-383: Typo found: 'fot' should be 'for'.

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a01cb3b and 056198c.

📒 Files selected for processing (2)
  • docs/build/building-apps/04-security-part-1.md (1 hunks)
  • docs/build/building-apps/upgrades/0.52.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.md`: "Assess the documentation for misspellings, gramm...

**/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

  • docs/build/building-apps/04-security-part-1.md
  • docs/build/building-apps/upgrades/0.52.md
🪛 GitHub Actions: Spell Check
docs/build/building-apps/upgrades/0.52.md

[warning] 383-383: Typo found: 'fot' should be 'for'.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary
🔇 Additional comments (11)
docs/build/building-apps/upgrades/0.52.md (10)

98-105: Client Wiring Update: Added Builder Methods for Address/Validator/Consensus Codecs
The added method calls (WithAddressCodec(), WithValidatorAddressCodec(), WithConsensusAddressCodec(), along with prefix settings) clearly enhance client configuration by replacing global constructs. Ensure that these changes are consistently reflected in your overall client setup documentation.


110-112: Server Command Options Update: Transition to Typed Start Command Options
Replacing the anonymous function with server.StartCmdOptions[servertypes.Application] standardizes the server command initialization. Verify that downstream code references the new type safely.


126-131: Module Manager Registration Update: Simplifying Legacy Manager Usage
Changing from the deprecated BasicModuleManager to directly invoking registration on app.ModuleManager simplifies the module management. Confirm that no residual references to the BasicModuleManager remain elsewhere in the codebase.


200-206: Protobuf Options Revision: Updating Any Type Mapping
The change to map google/protobuf/any.proto to github.com/cosmos/gogoproto/types/any reflects recent package relocations and promotes consistency in protobuf code generation.


223-225: Module Import Refactoring: Updating govtypes Path
Switching the import path for govtypes to cosmossdk.io/x/gov/types aligns the module imports with the new structure, facilitating future maintenance.


246-248: Interface Registry Update: Function Signature Adjustment
Modifying the RegisterInterfaces function signature to use registry.InterfaceRegistrar modernizes the registration process. Ensure that any dependent modules are likewise updated to accept the new interface.


256-258: Amino Codec Registry Update: Embracing New Registrar Interface
Updating the RegisterLegacyAminoCodec function signature to accept a registry.AminoRegistrar clarifies responsibilities and paves the way for a gradual migration away from legacy codecs.


266-268: MsgSimulatorFn Signature Change: Enhanced Error-Handling
The update of the MsgSimulatorFn signature—now returning an error and eschewing sdk.Context in favor of an address.Codec as a parameter—improves simulation robustness, making error handling explicit.


277-281: Depinject AppConfig Import Update: Reflecting Module Reorganization
The change to import from cosmossdk.io/depinject/appconfig instead of the old core path aligns dependency injection with the new module organization.


291-299: Genesis Interfaces Update: Transitioning to Context-Based Signatures
The adjustments in both InitGenesis and ExportGenesis functions, replacing sdk.Context with context.Context (and adding error returns), modernize the genesis process and error management.

docs/build/building-apps/04-security-part-1.md (1)

275-283: Error Handling Improvement in HasAnyAtPrefix Function
The update to use errors.Is(err, ErrNoValuesInRange) instead of a plain error comparison enables more flexible and reliable error handling in the key iteration logic. This improvement is crucial for accurately detecting the absence of values and preventing false positives in security checks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant