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

docs: rewrite building module section (2/n) -- env + core services #22790

Merged
merged 6 commits into from
Dec 9, 2024

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Dec 6, 2024

Description

ref: #21429

Next up is runtime


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...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • 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.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

Release Notes

  • Documentation Updates
    • Expanded documentation for the runtime package, clarifying its role and introducing new sections on module and app wiring.
    • Added a section on "Core APIs for Modules" to enhance guidance for developers.
    • Updated module manager documentation to emphasize interface roles and error handling improvements.
    • Introduced new sections on Logger and Event Service in core documentation, improving understanding of Cosmos SDK functionalities.
    • Enhanced clarity on gas fees and management, detailing changes in terminology and structure.
    • Updated various documents to improve accuracy and clarity, including references to services and functionalities within the Cosmos SDK.

Copy link
Contributor

coderabbitai bot commented Dec 6, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces significant updates to the documentation of the Cosmos SDK, particularly focusing on the runtime package and its interaction with application modules. New sections have been added to clarify the roles of the runtime, module wiring, core APIs, and the Keeper architecture. Additionally, several documents have been refined to enhance clarity, correct references, and provide detailed descriptions of various services and functionalities within the SDK.

Changes

File Path Change Summary
docs/build/building-apps/00-runtime.md Expanded documentation on the runtime package, adding sections on application wiring, module wiring using depinject, and services available to modules. Reference link to Go code included.
docs/build/building-modules/00-intro.md Added a new section titled "Core APIs for Modules" outlining module APIs and services, with a link for further reading.
docs/build/building-modules/01-module-manager.md Updated descriptions of the module manager and AppModule interface, clarified the distinction between appmodule packages, and introduced new extension interfaces. Updated method signatures for BeginBlock and EndBlock.
docs/build/building-modules/05-protobuf-annotations.md Corrected document title casing, added a period for consistency, and clarified the removal of amino codec in version v0.50+.
docs/build/building-modules/06-keeper.md Clarified the role of Keepers, introduced appmodule.Environment struct, and refined explanations of the keeper type structure and method implementations.
docs/learn/advanced/02-core.md Updated the Core section with package references, added new sections on Logger and Event Service, and corrected module references.
docs/learn/advanced/04-store.md Added a new section on branching as a service, streamlined content on dbadapter.Store, and improved readability of existing sections.
docs/learn/beginner/04-gas-fees.md Refined introduction on gas purposes, updated terminology regarding gas meter access, and clarified the AnteHandler's role in transaction processing.

Possibly related issues

  • v0.52 Documentation #21429: The documentation updates in this PR align with the need to update documentation for version v0.52, particularly regarding module environments and core services.

Possibly related PRs

Suggested labels

C:server/v2, C:Confix, C:x/accounts

Suggested reviewers

  • sontrinh16
  • tac0turtle

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 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.

@julienrbrt julienrbrt marked this pull request as ready for review December 6, 2024 13:06
@julienrbrt julienrbrt requested a review from a team as a code owner December 6, 2024 13:06
@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Dec 6, 2024
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: 2

🧹 Outside diff range and nitpick comments (11)
docs/build/building-apps/00-runtime.md (2)

12-12: Fix typo in "reponsible"

Correct the spelling of "reponsible" to "responsible".

-Runtime is reponsible for wiring the modules together.
+Runtime is responsible for wiring the modules together.

12-12: Add explanation for depinject

Consider adding a brief explanation or link to documentation about what depinject is, as it's a key concept mentioned here without context.

docs/learn/advanced/02-core.md (2)

21-23: Improve grammar and clarity

Several grammatical improvements needed:

  1. Add a comma after "Historically"
  2. Use "a" instead of "an" before "sdk.Context"
  3. Consider rephrasing "in many cases" for better style
-Historically the SDK has used an sdk.Context
+Historically, the SDK has used a sdk.Context
🧰 Tools
🪛 LanguageTool

[misspelling] ~21-~21: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...-L29 ``` Historically the SDK has used an [sdk.Context](https://docs.cosmos.netwo...

(EN_A_VS_AN)


[style] ~22-~22: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others.
Context: ...is intended to replace an sdk.Context in many cases. sdk.Context will be deprecated in th...

(IN_MANY_STYLE_CASES)


27-28: Enhance logger documentation

The logger section could benefit from additional details about:

  1. Available log levels
  2. How module scoping works
  3. Best practices for logging
docs/build/building-modules/00-intro.md (2)

63-64: Fix grammar in Core APIs section

There are two grammar issues to fix:

  1. "defined" should be "define" after "to"
  2. "is" should be "are" as it refers to plural "capabilities"
-Those APIs are defined in the `cosmossdk.io/core/appmodule` package, and are used to defined the module capabilities, which is used by `runtime`
+Those APIs are defined in the `cosmossdk.io/core/appmodule` package, and are used to define the module capabilities, which are used by `runtime`
🧰 Tools
🪛 LanguageTool

[grammar] ~64-~64: The verb after “to” should be in the base form as part of the to-infinitive. A verb can take many forms, but the base form is always used in the to-infinitive.
Context: ...ore/appmodule` package, and are used to defined the module capabilities, which is used ...

(TO_NON_BASE)


65-66: Consider expanding Core APIs documentation

The link to learn more about Core APIs could be enhanced by:

  1. Adding a brief overview of what developers can expect to learn
  2. Mentioning key APIs that are commonly used
docs/build/building-modules/06-keeper.md (1)

58-72: Consider adding common services usage examples

While the section effectively explains the Environment struct and includes code references, it would be more helpful to include brief examples of commonly used services (e.g., StoreService, EventService) to provide practical context.

docs/learn/beginner/04-gas-fees.md (2)

45-47: Enhance clarity of the gas service note

Consider rephrasing to be more precise:

-The gas.Service does not give access to all the methods of the gas meter.
+The gas.Service provides limited access to the gas meter methods.
🧰 Tools
🪛 LanguageTool

[style] ~46-~46: Try using a synonym here to strengthen your writing.
Context: ...tern: :::note The gas.Service does not give access to all the methods of the gas me...

(GIVE_PROVIDE)


57-57: LGTM with a minor suggestion

The explanation is technically accurate. Consider adding "per-transaction" to explicitly state when the gas meter is reset: "...the main gas meter must be set to 0 per-transaction in the..."

docs/learn/advanced/04-store.md (1)

152-152: Consider listing manually implemented functions

While the explanation is accurate, it would be more helpful to explicitly list which "miscellaneous" functions are manually implemented in dbadapter.Store.

docs/build/building-modules/01-module-manager.md (1)

220-222: Fix grammar in module function descriptions

The phrase "each modules" is grammatically incorrect in multiple instances. It should be "each module" (singular).

Apply these corrections:

-function of each modules implementing
+function of each module implementing
🧰 Tools
🪛 LanguageTool

[uncategorized] ~220-~220: Loose punctuation mark.
Context: ... BeginBlock(ctx context.Context) error: At the beginning of each block, this fu...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~220-~220: Use a singular noun after the quantifier ‘each’, or change it to “all”.
Context: ...ock-beginblock-endblock.md) function of each modules implementing the `appmodule.HasBeginBlo...

(EACH_EVERY_NNS)


[uncategorized] ~221-~221: Loose punctuation mark.
Context: ... * EndBlock(ctx context.Context) error: At the end of each block, this function...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~221-~221: Use a singular noun after the quantifier ‘each’, or change it to “all”.
Context: ...ock-beginblock-endblock.md) function of each modules implementing the `appmodule.HasEndBlock...

(EACH_EVERY_NNS)


[uncategorized] ~222-~222: Loose punctuation mark.
Context: ...ontext) ([]abci.ValidatorUpdate, error)`: At the end of each block, this function...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~222-~222: Use a singular noun after the quantifier ‘each’, or change it to “all”.
Context: ...ock-beginblock-endblock.md) function of each modules implementing the `module.HasABCIEndBloc...

(EACH_EVERY_NNS)

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4caac04 and a9d6c67.

📒 Files selected for processing (8)
  • docs/build/building-apps/00-runtime.md (1 hunks)
  • docs/build/building-modules/00-intro.md (1 hunks)
  • docs/build/building-modules/01-module-manager.md (1 hunks)
  • docs/build/building-modules/05-protobuf-annotations.md (2 hunks)
  • docs/build/building-modules/06-keeper.md (3 hunks)
  • docs/learn/advanced/02-core.md (2 hunks)
  • docs/learn/advanced/04-store.md (2 hunks)
  • docs/learn/beginner/04-gas-fees.md (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/build/building-modules/05-protobuf-annotations.md
🧰 Additional context used
📓 Path-based instructions (7)
docs/build/building-apps/00-runtime.md (1)

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

docs/learn/advanced/04-store.md (1)

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

docs/build/building-modules/00-intro.md (1)

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

docs/build/building-modules/06-keeper.md (1)

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

docs/learn/beginner/04-gas-fees.md (1)

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

docs/build/building-modules/01-module-manager.md (1)

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

docs/learn/advanced/02-core.md (1)

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

🪛 LanguageTool
docs/build/building-modules/00-intro.md

[grammar] ~64-~64: The verb after “to” should be in the base form as part of the to-infinitive. A verb can take many forms, but the base form is always used in the to-infinitive.
Context: ...ore/appmodule` package, and are used to defined the module capabilities, which is used ...

(TO_NON_BASE)

docs/learn/beginner/04-gas-fees.md

[style] ~46-~46: Try using a synonym here to strengthen your writing.
Context: ...tern: :::note The gas.Service does not give access to all the methods of the gas me...

(GIVE_PROVIDE)

docs/build/building-modules/01-module-manager.md

[uncategorized] ~220-~220: Loose punctuation mark.
Context: ... BeginBlock(ctx context.Context) error: At the beginning of each block, this fu...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~220-~220: Use a singular noun after the quantifier ‘each’, or change it to “all”.
Context: ...ock-beginblock-endblock.md) function of each modules implementing the `appmodule.HasBeginBlo...

(EACH_EVERY_NNS)


[uncategorized] ~221-~221: Loose punctuation mark.
Context: ... * EndBlock(ctx context.Context) error: At the end of each block, this function...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~221-~221: Use a singular noun after the quantifier ‘each’, or change it to “all”.
Context: ...ock-beginblock-endblock.md) function of each modules implementing the `appmodule.HasEndBlock...

(EACH_EVERY_NNS)


[uncategorized] ~222-~222: Loose punctuation mark.
Context: ...ontext) ([]abci.ValidatorUpdate, error)`: At the end of each block, this function...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~222-~222: Use a singular noun after the quantifier ‘each’, or change it to “all”.
Context: ...ock-beginblock-endblock.md) function of each modules implementing the `module.HasABCIEndBloc...

(EACH_EVERY_NNS)

docs/learn/advanced/02-core.md

[typographical] ~20-~20: Consider adding a comma after ‘Historically’ for more clarity.
Context: ...ppmodule/v2/environment.go#L16-L29 ``` Historically the SDK has used an [sdk.Context](https...

(RB_LY_COMMA)


[misspelling] ~21-~21: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...-L29 ``` Historically the SDK has used an [sdk.Context](https://docs.cosmos.netwo...

(EN_A_VS_AN)


[style] ~22-~22: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others.
Context: ...is intended to replace an sdk.Context in many cases. sdk.Context will be deprecated in th...

(IN_MANY_STYLE_CASES)


[style] ~38-~38: Consider shortening or rephrasing this to strengthen your wording.
Context: ...useful for executing code that needs to make changes to the store, but may need to be rolled ba...

(MAKE_CHANGES)

🔇 Additional comments (2)
docs/build/building-modules/06-keeper.md (1)

8-8: LGTM!

The synopsis clearly explains the role of Keepers and how they interact with depinject and runtime.

docs/learn/advanced/04-store.md (1)

48-50: LGTM!

The explanation of branching and cache is clear, and the reference to core documentation provides a good path for further reading.

docs/build/building-apps/00-runtime.md Show resolved Hide resolved
Comment on lines 221 to 222
* `EndBlock(ctx context.Context) error`: At the end of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./06-preblock-beginblock-endblock.md) function of each modules implementing the `appmodule.HasEndBlocker` interface, in the order defined in `OrderEndBlockers`. The function returns an `abci` which contains the aforementioned events, as well as validator set updates (if any).
* `EndBlock(context.Context) ([]abci.ValidatorUpdate, error)`: At the end of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./06-preblock-beginblock-endblock.md) function of each modules implementing the `module.HasABCIEndBlock` interface, in the order defined in `OrderEndBlockers`. The function returns an `abci` which contains the aforementioned events, as well as validator set updates (if any).
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Clarify the distinction between EndBlock implementations

The documentation describes two different EndBlock methods without clearly explaining their distinct purposes or when to use each one. This might confuse readers.

Consider restructuring the EndBlock documentation to clearly distinguish between:

  1. The basic EndBlock implementation (error return type)
  2. The validator-updating EndBlock implementation ([]abci.ValidatorUpdate, error return type)

Add a note explaining when to use each variant, for example:

+* `EndBlock(ctx context.Context) error`: The basic implementation for modules that need end-of-block processing without validator updates.
+* `EndBlock(context.Context) ([]abci.ValidatorUpdate, error)`: Extended implementation for modules that need to update the validator set (typically used by the staking module).

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~221-~221: Loose punctuation mark.
Context: ... * EndBlock(ctx context.Context) error: At the end of each block, this function...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~221-~221: Use a singular noun after the quantifier ‘each’, or change it to “all”.
Context: ...ock-beginblock-endblock.md) function of each modules implementing the `appmodule.HasEndBlock...

(EACH_EVERY_NNS)


[uncategorized] ~222-~222: Loose punctuation mark.
Context: ...ontext) ([]abci.ValidatorUpdate, error)`: At the end of each block, this function...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~222-~222: Use a singular noun after the quantifier ‘each’, or change it to “all”.
Context: ...ock-beginblock-endblock.md) function of each modules implementing the `module.HasABCIEndBloc...

(EACH_EVERY_NNS)

Copy link
Member Author

Choose a reason for hiding this comment

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

The follow up will focus on this section (building-apps)

@julienrbrt julienrbrt changed the title docs: rewrite building module section (1/n) -- env + core services docs: rewrite building module section (2/n) -- env + core services Dec 6, 2024
docs/build/building-apps/00-runtime.md Outdated Show resolved Hide resolved
@julienrbrt julienrbrt added this pull request to the merge queue Dec 9, 2024
@akhilkumarpilli akhilkumarpilli removed this pull request from the merge queue due to a manual request Dec 9, 2024
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 and nitpick comments (7)
docs/learn/advanced/04-store.md (2)

48-50: Consider using absolute links for cross-references

The link to the core documentation should use an absolute path for consistency with other documentation links in the SDK. This helps prevent broken links when documentation is reorganized.

-Read more about it in the [core](./02-core.md#branch-service) documentation.
+Read more about it in the [core](/docs/learn/advanced/02-core.md#branch-service) documentation.

198-198: Improve sentence structure for clarity

The sentence could be restructured to be more complete and clearer.

-`KVStores` can be accessed in their corresponding modules by using the [`kvStoreService` and `memStoreService`](./02-core.md#kvstore-service).
+Modules can access their corresponding `KVStores` through the [`kvStoreService` and `memStoreService`](./02-core.md#kvstore-service).
🧰 Tools
🪛 LanguageTool

[style] ~198-~198: To form a complete sentence, be sure to include a subject.
Context: ...es/context.go#L339-L342 ``` KVStores can be accessed in their corresponding modu...

(MISSING_IT_THERE)

docs/learn/advanced/08-events.md (1)

101-113: Fix grammatical issues in Default Events section

Please apply the following corrections:

  1. Fix bullet point formatting by removing extra spaces
  2. Correct verb agreement in the tip section
 There are a few events that are automatically emitted for all messages, directly from `baseapp`.

-* `message.action`: The name of the message type.
-* `message.sender`: The address of the message signer.
-* `message.module`: The name of the module that emitted the message.
+* `message.action`: The name of the message type.
+* `message.sender`: The address of the message signer.
+* `message.module`: The name of the module that emitted the message.

 :::tip
 The module name is assumed by `baseapp` to be the second element of the message route: `"cosmos.bank.v1beta1.MsgSend" -> "bank"`.
 In case a module does not follow the standard message path, (e.g. IBC), it is advised to keep emitting the module name event.
-`Baseapp` only emits that event if the module have not already done so.
+`Baseapp` only emits that event if the module has not already done so.
 :::
🧰 Tools
🪛 LanguageTool

[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...ctly from baseapp. * message.action: The name of the message type. * `messag...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~106-~106: Loose punctuation mark.
Context: ... of the message type. * message.sender: The address of the message signer. * `m...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~107-~107: Loose punctuation mark.
Context: ...f the message signer. * message.module: The name of the module that emitted the...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~112-~112: “Module” is a singular noun. It appears that the verb form is incorrect.
Context: ...pp` only emits that event if the module have not already done so. ::: ## Subscribin...

(PCT_SINGULAR_NOUN_PLURAL_VERB_AGREEMENT)

docs/learn/advanced/17-context.md (1)

18-20: Improve clarity of the warning message

The warning message about sdk.Context usage could be more explicit about why direct usage should be avoided and what alternatives are available.

Consider revising to:

-The `sdk.Context` should not be used directly. `Runtime` is implementing the [core services](./02-core.md), which are using directly the `sdk.Context`.
+The `sdk.Context` should not be used directly by application developers. Instead, use the [core services](./02-core.md) provided by the `Runtime`, which internally manages the `sdk.Context`.
docs/learn/advanced/00-baseapp.md (2)

477-477: Enhance clarity of validator description

The sentence about validators is grammatically correct but could be more explicit about the voting process.

Consider revising to:

-Set the `VoteInfos` of the application, i.e. the list of validators whose _precommit_ for the previous block was included by the proposer of the current block.
+Set the `VoteInfos` of the application, which contains the list of validators whose _precommit_ votes for the previous block were included by the proposer of the current block.
🧰 Tools
🪛 LanguageTool

[grammar] ~477-~477: Did you mean to use ‘who’s’ here (the contracted form of ‘who’ and ‘is/has’)?
Context: ...pplication, i.e. the list of validators whose precommit for the previous block was ...

(WHOSE_WHO_S)


Line range hint 456-462: Enhance ExtendVote and VerifyVoteExtension documentation

The sections about ExtendVote and VerifyVoteExtension would benefit from more detailed explanations about:

  • Common use cases
  • Implementation examples
  • Security considerations

Consider adding expanded documentation with practical examples and security best practices for custom implementations.

Also applies to: 282-288

🧰 Tools
🪛 LanguageTool

[uncategorized] ~93-~93: Loose punctuation mark.
Context: ...ore important parameters: * voteInfos: This parameter carries the list of vali...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~97-~97: Loose punctuation mark.
Context: ...hing absent validators. * minGasPrices: This parameter defines the minimum gas ...

(UNLIKELY_OPENING_PUNCTUATION)

docs/build/building-modules/01-module-manager.md (1)

220-220: Fix grammar: Use singular form after 'each'

Change "function of each modules" to "function of each module".

-* `BeginBlock(ctx context.Context) error`: At the beginning of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#beginblock) and, in turn, calls the [`BeginBlock`](./06-preblock-beginblock-endblock.md) function of each modules implementing the `appmodule.HasBeginBlocker` interface, in the order defined in `OrderBeginBlockers`.
+* `BeginBlock(ctx context.Context) error`: At the beginning of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#beginblock) and, in turn, calls the [`BeginBlock`](./06-preblock-beginblock-endblock.md) function of each module implementing the `appmodule.HasBeginBlocker` interface, in the order defined in `OrderBeginBlockers`.
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a9d6c67 and 39c9a77.

📒 Files selected for processing (7)
  • docs/build/building-apps/00-runtime.md (1 hunks)
  • docs/build/building-modules/01-module-manager.md (1 hunks)
  • docs/learn/advanced/00-baseapp.md (2 hunks)
  • docs/learn/advanced/01-transactions.md (1 hunks)
  • docs/learn/advanced/04-store.md (3 hunks)
  • docs/learn/advanced/08-events.md (2 hunks)
  • docs/learn/advanced/17-context.md (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/learn/advanced/01-transactions.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/build/building-apps/00-runtime.md
🧰 Additional context used
📓 Path-based instructions (5)
docs/learn/advanced/08-events.md (1)

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

docs/learn/advanced/17-context.md (1)

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

docs/learn/advanced/00-baseapp.md (1)

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

docs/build/building-modules/01-module-manager.md (1)

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

docs/learn/advanced/04-store.md (1)

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

🪛 LanguageTool
docs/learn/advanced/08-events.md

[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...ctly from baseapp. * message.action: The name of the message type. * `messag...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~106-~106: Loose punctuation mark.
Context: ... of the message type. * message.sender: The address of the message signer. * `m...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~107-~107: Loose punctuation mark.
Context: ...f the message signer. * message.module: The name of the module that emitted the...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~112-~112: “Module” is a singular noun. It appears that the verb form is incorrect.
Context: ...pp` only emits that event if the module have not already done so. ::: ## Subscribin...

(PCT_SINGULAR_NOUN_PLURAL_VERB_AGREEMENT)

docs/learn/advanced/00-baseapp.md

[grammar] ~477-~477: Did you mean to use ‘who’s’ here (the contracted form of ‘who’ and ‘is/has’)?
Context: ...pplication, i.e. the list of validators whose precommit for the previous block was ...

(WHOSE_WHO_S)

docs/learn/advanced/04-store.md

[style] ~198-~198: To form a complete sentence, be sure to include a subject.
Context: ...es/context.go#L339-L342 ``` KVStores can be accessed in their corresponding modu...

(MISSING_IT_THERE)

🔇 Additional comments (4)
docs/learn/advanced/04-store.md (1)

152-152: LGTM!

Clear and accurate explanation of the dbadapter.Store implementation.

docs/learn/advanced/08-events.md (2)

80-82: LGTM: Clear explanation of EventManager access

The documentation accurately reflects the architectural change of accessing EventManager through the event service in the Environment struct.


Line range hint 84-95: LGTM: Well-structured examples

The documentation provides clear examples for both typed and legacy event emission, with appropriate code references.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...ctly from baseapp. * message.action: The name of the message type. * `messag...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~106-~106: Loose punctuation mark.
Context: ... of the message type. * message.sender: The address of the message signer. * `m...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~107-~107: Loose punctuation mark.
Context: ...f the message signer. * message.module: The name of the module that emitted the...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~112-~112: “Module” is a singular noun. It appears that the verb form is incorrect.
Context: ...pp` only emits that event if the module have not already done so. ::: ## Subscribin...

(PCT_SINGULAR_NOUN_PLURAL_VERB_AGREEMENT)

docs/build/building-modules/01-module-manager.md (1)

221-222: 🛠️ Refactor suggestion

Improve clarity: Distinguish between EndBlock implementations

  1. Fix grammar: Change "function of each modules" to "function of each module" in both descriptions.
  2. Clarify the distinction between the two EndBlock implementations to help readers understand when to use each variant.
-* `EndBlock(ctx context.Context) error`: At the end of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./06-preblock-beginblock-endblock.md) function of each modules implementing the `appmodule.HasEndBlocker` interface, in the order defined in `OrderEndBlockers`.
-* `EndBlock(context.Context) ([]abci.ValidatorUpdate, error)`: At the end of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./06-preblock-beginblock-endblock.md) function of each modules implementing the `appmodule.HasABCIEndBlock` interface, in the order defined in `OrderEndBlockers`. Extended implementation for modules that need to update the validator set (typically used by the staking module).
+* `EndBlock(ctx context.Context) error`: At the end of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./06-preblock-beginblock-endblock.md) function of each module implementing the `appmodule.HasEndBlocker` interface, in the order defined in `OrderEndBlockers`. This is the basic implementation for modules that need end-of-block processing without validator updates.
+* `EndBlock(context.Context) ([]abci.ValidatorUpdate, error)`: At the end of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./06-preblock-beginblock-endblock.md) function of each module implementing the `appmodule.HasABCIEndBlock` interface, in the order defined in `OrderEndBlockers`. This extended implementation is specifically for modules that need to update the validator set (typically used by the staking module).

Likely invalid or redundant comment.

@akhilkumarpilli akhilkumarpilli added this pull request to the merge queue Dec 9, 2024
Merged via the queue into main with commit 8ef35c3 Dec 9, 2024
73 of 74 checks passed
@akhilkumarpilli akhilkumarpilli deleted the julien/docs branch December 9, 2024 09:40
mergify bot pushed a commit that referenced this pull request Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants