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

Add missing proto files for indexing #8754

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Add missing proto files for indexing #8754

merged 2 commits into from
Oct 7, 2024

Conversation

mattverse
Copy link
Member

Closes: #XXX

What is the purpose of the change

Re: #8600

After some investigation, I've found out that the proto changes in gamm will require separate migration code ( see https://github.com/osmosis-labs/osmosis/blob/main/proto/osmosis/gamm/v1beta1/balancerPool.proto#L2-L5) for more details.

Will change the proto packages , run up a node to confirm that changing gamm package for proto in subsequent PR

Testing and Verifying

This change is a trivial rework / code cleanup without any test coverage.

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

@mattverse mattverse added the V:state/compatible/no_backport State machine compatible PR, depends on prior breaks label Oct 5, 2024
Copy link
Contributor

coderabbitai bot commented Oct 5, 2024

Walkthrough

The pull request updates the CHANGELOG.md to document recent changes, including new entries in the "State Breaking," "Config," and "State Compatible" sections. Additionally, it modifies proto/osmosis/lockup/tx.proto by adding new message types and uncommenting an existing message. Similarly, proto/osmosis/protorev/v1beta1/tx.proto sees the introduction of a new message and the deprecation of another while retaining it for backward compatibility. The overall structure of the protocol remains intact.

Changes

File Change Summary
CHANGELOG.md Updated to include new entries in "Unreleased" section: "State Breaking," "Config," and "State Compatible."
proto/osmosis/lockup/tx.proto Added MsgUnlockPeriodLock and MsgUnlockTokens messages; uncommented MsgSetRewardReceiverAddressResponse.
proto/osmosis/protorev/v1beta1/tx.proto Added MsgSetPoolWeights message; deprecated MsgSetBaseDenomsResponse but retained for indexers.

Possibly related PRs

Suggested labels

A:no-changelog


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.

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

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

🧹 Outside diff range and nitpick comments (4)
proto/osmosis/lockup/tx.proto (3)

122-122: LGTM. Consider adding documentation.

The uncommented MsgSetRewardReceiverAddressResponse message looks good. It's a simple and appropriate structure for a response message.

Consider adding a comment to explain the purpose of this message and when it's used in the protocol. This will improve the overall documentation of the protobuf file.


124-129: LGTM. Consider enhancing deprecation documentation.

The addition of the MsgUnlockPeriodLock message is appropriate. It's correctly marked as deprecated and kept for indexing purposes.

To improve clarity for developers, consider adding more detailed documentation:

  1. Explain why this message is deprecated.
  2. Provide information on what should be used instead.
  3. If possible, include a timeline or version for when this message might be removed.

This additional context will help maintainers and users understand the status and future of this message type.


131-133: LGTM, but consider improving consistency and clarity.

The addition of the MsgUnlockTokens message is appropriate for maintaining indexing capabilities. However, there are a few points to consider:

  1. This message is implicitly deprecated due to its position under the DEPRECATED comment. For consistency with MsgUnlockPeriodLock, consider adding an explicit deprecation comment to this message as well.

  2. Unlike MsgUnlockPeriodLock, this message doesn't include an ID field. If this is intentional, it might be worth adding a comment explaining the difference.

  3. As with the previous message, consider adding more detailed documentation about its deprecated status, alternatives, and potential removal timeline.

Apply these suggestions to improve consistency and clarity:

 // DEPRECATED
 // Following messages are deprecated but kept to support indexing.
 message MsgUnlockPeriodLock {
   string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
   uint64 ID = 2;
 }
 
+// DEPRECATED
 message MsgUnlockTokens {
   string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
 }

Also, consider adding comments to explain why MsgUnlockTokens doesn't have an ID field if this is intentional.

CHANGELOG.md (1)

Line range hint 1-85: Suggestions for improving the changelog

While the changelog is comprehensive, consider the following improvements:

  1. Add a brief explanation or context for some of the more technical changes, especially in the API breaks and state breaking sections.
  2. Include links to relevant documentation or upgrade guides for major features like SuperCharged Liquidity and CosmWasm Pool Module.
  3. Provide more details on the potential impact of the ProtoRev changes on existing users.
  4. Consider adding a "Upgrade Instructions" section with a link to detailed upgrade documentation for node operators and developers.

These additions would make the changelog more informative and user-friendly, especially for those who may not be familiar with all aspects of Osmosis development.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f0a195f and 4703797.

⛔ Files ignored due to path filters (2)
  • x/lockup/types/tx.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • x/protorev/types/tx.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
📒 Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • proto/osmosis/lockup/tx.proto (1 hunks)
  • proto/osmosis/protorev/v1beta1/tx.proto (1 hunks)
🔇 Additional comments (8)
proto/osmosis/lockup/tx.proto (1)

122-133: Overall changes look good, with minor suggestions for improvement.

The changes in this file are primarily focused on maintaining backwards compatibility for indexing purposes. The uncommented MsgSetRewardReceiverAddressResponse and the addition of deprecated messages MsgUnlockPeriodLock and MsgUnlockTokens are appropriate for this goal.

Key points:

  1. The changes don't introduce any significant issues or alterations to the existing protocol.
  2. The deprecated messages are clearly marked and separated, which is good for maintainability.
  3. There are some minor inconsistencies in documentation and structure between the deprecated messages.

To improve the overall quality of the file:

  1. Consider adding more detailed documentation for all new and uncommented messages.
  2. Ensure consistency in how deprecated messages are marked and documented.
  3. If possible, provide more context about the deprecation status, alternatives, and potential removal timeline for deprecated messages.

These changes align well with the PR objectives of adding missing proto files for indexing and don't introduce any new features or user-facing behavior changes.

CHANGELOG.md (7)

Line range hint 1-5: Major release with significant changes and new features

This release (v19.0.0) introduces several new modules and features, including:

  • SuperCharged Liquidity
  • CosmWasm Pool Module
  • ProtoRev changes
  • TokenFactory before send hooks

These additions significantly enhance the functionality of Osmosis, but users and developers should be aware of the potential impact on existing systems.


Line range hint 7-9: Security update: Upgraded wasmvm to address vulnerability

The upgrade to wasmvm 1.2.3 addresses the security vulnerability CWA-2023-002. This is a critical security update that all users should apply.


Line range hint 11-20: New features and modules added

The release includes several major new features:

  1. x/concentrated-liquidity module for SuperCharged Liquidity
  2. x/cosmwasmpool module for custom liquidity pools
  3. Changes to ProtoRev, including payment schedule modifications
  4. TokenFactory before send hooks

These additions provide new capabilities for Osmosis, but users should be cautious and thoroughly test their integrations with these new features.


Line range hint 22-38: API breaks and potential migration required

This release includes several API breaks that may require updates to existing integrations:

  • Changes to query endpoints and responses
  • Modifications to message structures
  • Updates to keeper interfaces

Developers should carefully review these changes and update their code accordingly. It's recommended to test thoroughly in a non-production environment before upgrading.


Line range hint 40-54: State breaking changes

The release includes several state breaking changes, such as:

  • Changes to ProtoRev logic
  • Updates to x/gamm and x/poolmanager modules
  • Modifications to x/mint and x/incentives modules

These changes may affect the blockchain's state and require careful consideration during the upgrade process. Node operators should follow the upgrade instructions closely.


Line range hint 56-60: Dependency updates

The release includes updates to key dependencies:

  • wasmd upgraded to 0.31
  • Cosmwasm security patch
  • IBC-go update

Ensure that your environment is compatible with these updated dependencies before upgrading.


Line range hint 62-85: Miscellaneous improvements and bug fixes

The release includes various improvements and bug fixes, such as:

  • CLI enhancements
  • Performance optimizations
  • Bug fixes in multiple modules

These changes should improve the overall stability and usability of Osmosis, but users should still test thoroughly after upgrading.

Comment on lines +179 to +185
message MsgSetPoolWeights {
// admin is the account that is authorized to set the pool weights.
string admin = 1;
// pool_weights is the list of pool weights to set.
PoolWeights pool_weights = 2;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add missing options and field annotations to MsgSetPoolWeights

The new message MsgSetPoolWeights lacks the option declarations and field annotations that are present in other message definitions within the file. This may lead to inconsistent behavior or serialization issues. For consistency and correctness, please add the amino.name and cosmos.msg.v1.signer options, and annotate the fields appropriately.

Here is a suggested fix:

 message MsgSetPoolWeights {
+  option (amino.name) = "osmosis/MsgSetPoolWeights";
+  option (cosmos.msg.v1.signer) = "admin";

   // admin is the account that is authorized to set the pool weights.
-  string admin = 1;
+  string admin = 1 [
+    (gogoproto.moretags) = "yaml:\"admin\"",
+    (cosmos_proto.scalar) = "cosmos.AddressString"
+  ];

   // pool_weights is the list of pool weights to set.
-  PoolWeights pool_weights = 2;
+  PoolWeights pool_weights = 2 [
+    (gogoproto.moretags) = "yaml:\"pool_weights\"",
+    (gogoproto.nullable) = false
+  ];
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// MsgSetPoolWeights defines the Msg/SetPoolWeights request type.
message MsgSetPoolWeights {
// admin is the account that is authorized to set the pool weights.
string admin = 1;
// pool_weights is the list of pool weights to set.
PoolWeights pool_weights = 2;
}
// MsgSetPoolWeights defines the Msg/SetPoolWeights request type.
message MsgSetPoolWeights {
option (amino.name) = "osmosis/MsgSetPoolWeights";
option (cosmos.msg.v1.signer) = "admin";
// admin is the account that is authorized to set the pool weights.
string admin = 1 [
(gogoproto.moretags) = "yaml:\"admin\"",
(cosmos_proto.scalar) = "cosmos.AddressString"
];
// pool_weights is the list of pool weights to set.
PoolWeights pool_weights = 2 [
(gogoproto.moretags) = "yaml:\"pool_weights\"",
(gogoproto.nullable) = false
];
}

Copy link
Member

@czarcas7ic czarcas7ic left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

What happens if you send such a message? Does it just error (as expected), I believe so.

Can you sanity check if this is state compatible post merge.

@ValarDragon
Copy link
Member

Oh were not backporting so my comment isn't important. Forgot were doing a release soon

@mattverse mattverse closed this Oct 7, 2024
@mattverse mattverse reopened this Oct 7, 2024
@mattverse mattverse merged commit db3c52e into main Oct 7, 2024
1 check passed
@mattverse mattverse deleted the mattverse/fix-proto branch October 7, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/lockup V:state/compatible/no_backport State machine compatible PR, depends on prior breaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants