osmosis
osmosis copied to clipboard
feat: add callback module for scheduled execution of wasm contracts
Closes: #XXX
What is the purpose of the change
Add a description of the overall background and high level changes that this PR introduces
(E.g.: This pull request improves documentation of area A by adding ....
Testing and Verifying
(Please pick one of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
- Added unit test that validates ...
- Added integration tests for end-to-end deployment with ...
- Extended integration test for ...
- Manually verified the change by ...
Documentation and Release Note
- [ ] Does this pull request introduce a new feature or user-facing behavior changes?
- [ ] Changelog entry added to
Unreleasedsection ofCHANGELOG.md?
Where is the change documented?
- [ ] Specification (
x/{module}/README.md) - [ ] Osmosis documentation site
- [ ] Code comments?
- [ ] N/A
Walkthrough
The pull request introduces a significant enhancement to the callback functionality within the application. Key changes include the addition of a CallbackKeeper in the AppKeepers struct, updates to various methods for managing parameters and genesis states, and the introduction of new files for testing and defining Protocol Buffers messages related to callbacks. The modifications span several files, including keeper implementations, module registrations, and end-to-end testing utilities, establishing a comprehensive framework for callback operations.
Changes
| File Path | Change Summary |
|---|---|
| app/keepers/keepers.go | Added CallbackKeeper to AppKeepers, updated InitNormalKeepers, initParamsKeeper, and KVStoreKeys methods. |
| app/keepers/modules.go | Added import for callback module and registered callback.AppModuleBasic{} in AppModuleBasics. |
| app/modules.go | Added imports for callback module, updated moduleAccountPermissions, appModules, and OrderInitGenesis functions. |
| cosmwasm/contracts/callback-test/.editorconfig | Created new .editorconfig file for coding style guidelines. |
| cosmwasm/contracts/callback-test/.gitignore | Added .gitignore file to specify ignored files and directories. |
| cosmwasm/contracts/callback-test/README.md | Introduced sample contract for testing the x/callback module, detailing new message types. |
| cosmwasm/contracts/callback-test/src/bin/schema.rs | Created schema.rs file to define API schema for the contract. |
| cosmwasm/contracts/callback-test/src/contract.rs | Implemented smart contract for callback testing with various entry points. |
| cosmwasm/contracts/callback-test/src/error.rs | Defined custom error type for the contract with various error conditions. |
| cosmwasm/contracts/callback-test/src/lib.rs | Enhanced modular organization by adding multiple modules. |
| cosmwasm/contracts/callback-test/src/msg.rs | Defined data structures and message types used in the contract. |
| cosmwasm/contracts/callback-test/src/state.rs | Defined data structure for managing contract state. |
| proto/osmosis/callback/v1beta1/callback.proto | Introduced Protocol Buffers message definitions for handling callbacks. |
| proto/osmosis/callback/v1beta1/errors.proto | Defined error codes related to callback operations. |
| proto/osmosis/callback/v1beta1/events.proto | Defined message types related to callback events. |
| proto/osmosis/callback/v1beta1/genesis.proto | Introduced GenesisState message for the callback module. |
| proto/osmosis/callback/v1beta1/query.proto | Defined query service for the callback module. |
| proto/osmosis/callback/v1beta1/tx.proto | Outlined messaging service for handling callbacks. |
| tests/e2e/testing/chain.go | Introduced a testing framework for simulating blockchain operations. |
| tests/e2e/testing/chain_ops.go | Added function for executing governance proposals in testing environment. |
| tests/e2e/testing/chain_ops_contract.go | Provided functions for interacting with smart contracts in testing context. |
| tests/e2e/testing/chain_ops_ibc.go | Introduced methods for managing IBC operations in testing framework. |
| tests/e2e/testing/chain_options.go | Defined configuration structure for setting up a test blockchain environment. |
| tests/e2e/testing/client.go | Defined gRPC client structure for interacting with the Osmosis application. |
| tests/e2e/testing/common.go | Introduced utility functions for end-to-end testing. |
| tests/e2e/testing/ibc_path.go | Provided framework for testing IBC paths in a Cosmos SDK environment. |
| tests/e2e/testing/types.go | Defined a new type for managing account data in the testing framework. |
| tests/e2e/testing/wasmd.go | Introduced mock implementations for testing the x/wasmd module. |
| x/callback/abci.go | Introduced functionality for managing and executing callbacks within the blockchain context. |
| x/callback/keeper/callback.go | Defined Keeper struct for managing callback functionalities. |
| x/callback/keeper/keeper.go | Introduced Keeper struct for managing state operations within the callback module. |
| x/callback/types/callback.go | Defined functions for creating and validating callback instances. |
| x/callback/types/genesis.go | Introduced functionality for managing the GenesisState object. |
| x/callback/types/params.go | Defined constants and functions for managing callback parameters. |
| x/callback/types/sudo_msg.go | Defined structures for handling callback messages in a contract context. |
| x/callback/utils/collcompat.go | Introduced utilities for managing key-value stores. |
| x/callback/utils/utils.go | Introduced utility functions for executing operations with a gas limit. |
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?
🪧 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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
Walkthrough
The changes in this pull request enhance the AppKeepers struct by integrating a new callback mechanism across multiple files. This includes updates to the keeper and module management files, the introduction of new smart contract testing files, and the definition of Protocol Buffers for callback functionalities. Additionally, a comprehensive end-to-end testing framework is established for the Osmosis application, focusing on various functionalities, including chain operations and contract interactions.
Changes
| File Path | Change Summary |
|---|---|
| app/keepers/keepers.go, app/keepers/modules.go, app/modules.go | Enhanced AppKeepers struct with CallbackKeeper, modified initialization methods, and updated imports. |
| cosmwasm/contracts/callback-test/.editorconfig, cosmwasm/contracts/callback-test/.gitignore, cosmwasm/contracts/callback-test/README.md | Added configuration and documentation files for testing the callback module. |
| cosmwasm/contracts/callback-test/src/bin/schema.rs, cosmwasm/contracts/callback-test/src/contract.rs, cosmwasm/contracts/callback-test/src/error.rs, cosmwasm/contracts/callback-test/src/lib.rs, cosmwasm/contracts/callback-test/src/msg.rs, cosmwasm/contracts/callback-test/src/state.rs | Defined smart contract structure and functionality for testing the callback module. |
| proto/osmosis/callback/v1beta1/*.proto | Defined message structures and services for handling callback functionalities. |
| tests/e2e/testing/*.go | Introduced end-to-end testing framework for various functionalities, including chain and contract operations. |
| x/callback/*.go | Implemented callback module functionality, including management of callbacks, CLI commands, and testing. |
Possibly related PRs
- #8759: The changes in this PR involve modifications to the
TestChainstruct and methods related to contract instantiation, which may indirectly relate to the callback functionality being integrated in the main PR, particularly if the callback mechanism is utilized within contract interactions. However, the connection is weak as it primarily focuses on rate limiting rather than callback management.
Suggested labels
V:state/compatible/no_backport, A:no-changelog
Suggested reviewers
- nicolaslara
- iboss-ptk
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?
🪧 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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
Walkthrough
This pull request introduces a new callback module into the application, affecting several components, including the core functionality, testing framework, and protocol buffer definitions. Key updates include the integration of a CallbackKeeper in the application structure, the creation of a smart contract for testing the module, and the definition of relevant Protocol Buffers for message handling. Additionally, a comprehensive testing framework for end-to-end blockchain functionalities is established, ensuring robust interaction with the new module.
Changes
| File Path | Summary of Changes |
|---|---|
| app/keepers/keepers.go, app/keepers/modules.go, app/modules.go | Added CallbackKeeper to AppKeepers, initialized in InitNormalKeepers, and integrated callback module. |
| cosmwasm/contracts/callback-test/* | Introduced a new smart contract for testing the callback module, including various supporting files and logic. |
| proto/osmosis/callback/v1beta1/* | Defined Protocol Buffers for the callback module, including messages, services, and error handling. |
| tests/e2e/testing/* | Established an end-to-end testing framework for the Osmosis application, focusing on blockchain functionalities. |
| x/callback/* | Implemented core functionality of the callback module, including execution logic, CLI commands, and tests. |
Possibly related PRs
- #8759: The changes in this PR involve modifications to the
TestChainstruct and methods related to contract instantiation and migration, which may indirectly relate to the integration of thecallbackmodule in the main PR, as both involve smart contract functionalities within the blockchain framework.
Suggested labels
V:state/compatible/no_backport, A:no-changelog
Suggested reviewers
- nicolaslara
- iboss-ptk
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?
🪧 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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
Nice, thanks for the PR, would love some more context added to the pull request, would you be able to add that?
Closing this as we need to wait for a gov prop and forum post to discuss, looking for to discussing more! :smile: