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

feat: Add non atomic multimsg #19350

Merged
merged 58 commits into from
Apr 15, 2024
Merged

feat: Add non atomic multimsg #19350

merged 58 commits into from
Apr 15, 2024

Conversation

likhita-809
Copy link
Contributor

@likhita-809 likhita-809 commented Feb 5, 2024

Description

Closes: #13911


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

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

  • New Features

    • Enhanced transaction capabilities with the introduction of the NonAtomicExec method.
    • Comprehensive support for the AccountsModule across tests and configurations.
  • Refactor

    • Adjusted initialization processes to incorporate the AccountsKeeper for smoother interactions.
    • Updated import paths and mock functions to improve testing.
  • Tests

    • Expanded testing frameworks to include the AccountsModule for enhanced coverage.
    • Added test cases and utilities for the NonAtomicExec method.
  • Chores

    • General codebase maintenance to support new features and refactors.

Copy link
Contributor

coderabbitai bot commented Feb 5, 2024

Walkthrough

The update introduces a new NonAtomicExec method across various components to enable asynchronous, non-atomic execution of multiple messages within transactions. This enhancement allows individual messages in a batch to fail independently without impacting the entire transaction, providing detailed error information for each failure. The changes are extensive, covering API interfaces, server configurations, test suites, and module integrations, reinforcing the system's transaction handling capabilities.

Changes

File Path Pattern Change Summary
api/cosmos/auth/v1beta1/tx_grpc.pb.go Added NonAtomicExec method to interfaces and structs in the specified file.
client/rpc/rpc_test.go, server/api/server_test.go, simapp/app.go, simapp/app_config.go, simapp/app_di.go Integrated cosmossdk.io/x/accounts into various tests and app configurations.
tests/integration/auth/keeper/msg_server_test.go, tests/integration/bank/app_test.go, tests/integration/distribution/appconfig.go, tests/integration/evidence/app_config.go, tests/integration/example/example_test.go Introduced test cases and configurations for handling asynchronous message execution and accounts-related scenarios.
x/auth/keeper/keeper.go, x/accounts/keeper.go Updated message execution handling and introduced new types and methods for non-atomic message execution.

Assessment against linked issues

Objective Addressed Explanation
Introduce async multimsg endpoint allowing individual message failures within batches (#13911) The implementation of NonAtomicExec aligns with the requirement to handle message batches where individual messages can fail independently.
Return detailed errors for failed messages in the batch (#13911) The changes include error handling enhancements to provide detailed feedback on individual message failures within a batch.

The code changes effectively fulfill the objectives outlined in the linked issue, enhancing the system's flexibility in managing transaction processing.


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@github-actions github-actions bot added C:x/distribution distribution module related C:x/auth C:x/group labels Feb 5, 2024
@testinginprod
Copy link
Contributor

Do add test cases for impersonation

x/auth/depinject.go Outdated Show resolved Hide resolved
@testinginprod
Copy link
Contributor

testinginprod commented Feb 12, 2024

I don't tlike the "async" nomenclature as messages are not being executed asynchronously. They're being executed in a non atomic way.

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.

Review Status

Actionable comments generated: 0

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between 0bf0e76 and 9a2b204.
Files selected for processing (6)
  • tests/integration/auth/keeper/msg_server_test.go (1 hunks)
  • x/accounts/keeper.go (8 hunks)
  • x/auth/keeper/keeper.go (5 hunks)
  • x/auth/testutil/expected_keepers_mocks.go (2 hunks)
  • x/auth/types/expected_keepers.go (2 hunks)
  • x/auth/vesting/testutil/expected_keepers_mocks.go (2 hunks)
Files skipped from review as they are similar to previous changes (6)
  • tests/integration/auth/keeper/msg_server_test.go
  • x/accounts/keeper.go
  • x/auth/keeper/keeper.go
  • x/auth/testutil/expected_keepers_mocks.go
  • x/auth/types/expected_keepers.go
  • x/auth/vesting/testutil/expected_keepers_mocks.go

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.

Review Status

Actionable comments generated: 0

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between 9a2b204 and cb8d634.
Files selected for processing (1)
  • x/auth/keeper/keeper.go (5 hunks)
Files skipped from review as they are similar to previous changes (1)
  • x/auth/keeper/keeper.go

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: 1

simapp/app.go Show resolved Hide resolved
Copy link
Contributor

@testinginprod testinginprod left a comment

Choose a reason for hiding this comment

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

LGTM, one nit

Copy link
Member

@sontrinh16 sontrinh16 left a comment

Choose a reason for hiding this comment

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

beside these below, LGTM!!!

x/accounts/keeper_test.go Show resolved Hide resolved
x/accounts/utils_test.go Show resolved Hide resolved
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: 1

@github-actions github-actions bot removed the C:CLI label Apr 11, 2024
@likhita-809
Copy link
Contributor Author

are we good to merge this @testinginprod ?

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

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

Actionable comments outside the diff hunks (1)
x/bank/testutil/expected_keepers_mocks.go (1)

[!TIP]
Codebase Verification

The search results indicate that the method IsAccountsModuleAccount is still referenced in multiple files within the codebase, including keeper.go, various mock files in testutil, and account.go. This suggests that the method is still actively used and expected by other parts of the system.

Given this information, the removal of the IsAccountsModuleAccount method from the expected_keepers_mocks.go in the x/bank module could potentially lead to issues if the method is expected to be mocked during testing of components that interact with the x/bank module.

Therefore, it is crucial to ensure that the removal of this method does not disrupt any existing functionalities or dependencies that rely on this method being mocked. Further investigation or reconsideration of the removal might be necessary to avoid potential integration issues.

Analysis chain

Line range hint 1-1: Verify the removal of IsAccountsModuleAccount does not affect other modules that might rely on this functionality.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for any remaining references to IsAccountsModuleAccount in the codebase.
rg --type go "IsAccountsModuleAccount"

Length of output: 2117

@likhita-809
Copy link
Contributor Author

can we get this merged @tac0turtle

@tac0turtle tac0turtle added this pull request to the merge queue Apr 15, 2024
Merged via the queue into main with commit 07c0aa7 Apr 15, 2024
63 of 65 checks passed
@tac0turtle tac0turtle deleted the likhita/nonatomic-multimsg branch April 15, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: nonatomic multimsg
4 participants