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 protobuf definitions #8600

Merged
merged 4 commits into from
Sep 9, 2024
Merged

Conversation

penso
Copy link
Contributor

@penso penso commented Aug 7, 2024

What is the purpose of the change

Add a description of the overall background and high level changes that this PR introduces

This is adding missing protobuf definitions preventing Constellations from indexing, which would prevent anyone else as well.

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

Copy link
Contributor

coderabbitai bot commented Aug 7, 2024

Walkthrough

The recent changes introduce several new Protocol Buffers files and message types within the Osmosis ecosystem, focusing on asset transfer functionalities and governance mechanisms. Key updates include the addition of Protobuf definitions for asset management, events related to asset transfers, and new transaction methods. These modifications enhance the interoperability and robustness of the Osmosis blockchain, particularly in managing cross-chain transactions and asset governance processes.

Changes

Files Change Summary
proto/osmosis/bridge/v1beta1/*.proto Introduced multiple Protobuf files defining messages and enums for asset transfers, events, genesis state, and query services within the bridge module.
proto/osmosis/gamm/v1beta1/tx.proto Added new message types for creating liquidity pools, enhancing pool management capabilities.
proto/osmosis/lockup/tx.proto Introduced messages for unlocking period locks and tokens, expanding token management functionality.
proto/osmosis/protorev/v1beta1/tx.proto Added a message type for setting pool weights, enhancing control over liquidity pool management.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Bridge
    participant ExternalChain
    participant Osmosis

    User->>Bridge: InboundTransfer(assetID, amount)
    Bridge->>ExternalChain: ValidateTransfer(assetID, amount)
    ExternalChain-->>Bridge: TransferApproved
    Bridge->>Osmosis: MintTokens(assetID, amount)
    Osmosis-->>Bridge: TokensMinted
    Bridge-->>User: TransferSuccess
Loading
sequenceDiagram
    participant User
    participant LockupService

    User->>LockupService: MsgUnlockPeriodLock(owner, ID)
    LockupService-->>User: LockUnlocked
Loading
sequenceDiagram
    participant Admin
    participant ProtorevService

    Admin->>ProtorevService: MsgSetPoolWeights(poolWeights)
    ProtorevService-->>Admin: WeightsSet
Loading

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b67bf76 and dd56c41.

Files selected for processing (4)
  • CHANGELOG.md (1 hunks)
  • proto/osmosis/gamm/v1beta1/tx.proto (3 hunks)
  • proto/osmosis/lockup/tx.proto (3 hunks)
  • proto/osmosis/protorev/v1beta1/tx.proto (1 hunks)
Additional comments not posted (8)
proto/osmosis/lockup/tx.proto (2)

30-35: LGTM!

The code changes are approved.


55-59: LGTM!

The code changes are approved.

proto/osmosis/protorev/v1beta1/tx.proto (2)

177-179: LGTM!

The comment provides a valid justification for retaining the unused message definition.


181-186: LGTM!

The new message definition MsgSetPoolWeights follows the protobuf syntax and naming conventions. The fields have appropriate types and no default values, which is expected for a request message. The message name and field names are descriptive and follow the naming conventions.

proto/osmosis/gamm/v1beta1/tx.proto (3)

7-7: LGTM!

The code changes are approved.


30-45: LGTM!

The code changes are approved.


289-302: LGTM!

The code changes are approved.

CHANGELOG.md (1)

45-48: Changelog entry looks good!

The added changelog entry for v15.1.2 clearly communicates the bug fix for the state export feature not working properly in previous versions.


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

proto/osmosis/bridge/v1beta1/bridge.proto Outdated Show resolved Hide resolved
@penso penso changed the title Readd missing protobuf definitions Add missing protobuf definitions Aug 7, 2024
@mattverse mattverse self-assigned this Aug 7, 2024
Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

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

Is the issue that / and are these proto additions the ones that we have had in the past blocks but have been deleted thus cannot be queried / indexed?

@penso
Copy link
Contributor Author

penso commented Aug 7, 2024

Is the issue that / and are these proto additions the ones that we have had in the past blocks but have been deleted thus cannot be queried / indexed?

Yes, those proto messages are on chain, but no proto definitions allowing to decode them. Adding those definitions from this PR I was able to index old blocks, outside a few which I think never got protobuf files committed anywhere.

I was able to retrieve the ones in this PR going back in this repo Git history. Proto files should never be removed else you're preventing anyone to index/parse old blocks.

CHANGELOG.md Outdated Show resolved Hide resolved
@czarcas7ic
Copy link
Member

@penso thanks for this! A couples points / questions

  1. I don't understand why the bridge folder needs to come back. There were zero messages on chain that ever used any of these proto definitions, so it should not be required for any indexing.
  2. For the others, can we add some kind of copy pasta comment above each of these, saying XXX method is no longer used, but this is kept here for the purposes of indexing?

@mattverse mattverse added the V:state/breaking State machine breaking PR label Aug 8, 2024
@mattverse
Copy link
Member

Also, @penso Did you ever get to try querying old state with these added? Did it work? 👀

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!

@PaddyMc
Copy link
Collaborator

PaddyMc commented Aug 27, 2024

friendly ping here @penso, see: #8600 (comment)

@penso
Copy link
Contributor Author

penso commented Aug 27, 2024

Ah yeah a few things to fix, will do them today.

@penso
Copy link
Contributor Author

penso commented Sep 4, 2024

Fixed

@penso thanks for this! A couples points / questions

  1. I don't understand why the bridge folder needs to come back. There were zero messages on chain that ever used any of these proto definitions, so it should not be required for any indexing.
  2. For the others, can we add some kind of copy pasta comment above each of these, saying XXX method is no longer used, but this is kept here for the purposes of indexing?
  1. You are right, I removed the bridge folder and indexing went fine, I probably just copied too much for the sake of making sure it worked.

  2. Added

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, codebase verification and nitpick comments (1)
CHANGELOG.md (1)

Line range hint 1-1: Convert TODO into a trackable task/issue.

It's a good practice to capture TODO comments as trackable tasks/issues instead of leaving them in the code. Please create a task to track adding tests for this module.

@czarcas7ic
Copy link
Member

@penso thanks for addressing these!

@mattverse if you have time to give this a once over, if it looks good to you I think we are good to merge.

Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

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

This LGTM

@mattverse mattverse closed this Sep 9, 2024
@mattverse mattverse reopened this Sep 9, 2024
@mattverse mattverse merged commit ba5ecb1 into osmosis-labs:main Sep 9, 2024
1 check passed
@penso penso deleted the proto-missing branch September 9, 2024 22:45
@gilxgil
Copy link

gilxgil commented Sep 10, 2024

Thank you @penso we've been waiting for this patch for so long! #7675

PaddyMc added a commit that referenced this pull request Sep 17, 2024
mattverse pushed a commit that referenced this pull request Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V:state/breaking State machine breaking PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants