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

fix/update_protobuf_version #324

Merged
merged 2 commits into from
May 2, 2024
Merged

fix/update_protobuf_version #324

merged 2 commits into from
May 2, 2024

Conversation

aarmoa
Copy link
Collaborator

@aarmoa aarmoa commented May 2, 2024

  • Updated calls to json_format.MessageToDict for compliance with the new version of the protobuf library

Summary by CodeRabbit

  • New Features

    • Added new derivatives and spot entities in both Devnet and Mainnet environments with updated financial parameters.
  • Bug Fixes

    • Adjusted data conversion settings to comply with the latest library standards, ensuring more accurate data handling in various system components.
  • Documentation

    • Updated version number in project documentation to reflect the latest release.
  • Refactor

    • Updated internal data handling parameters across multiple modules to enhance compatibility with new library versions.

…ges in the latest protobuf library version
Copy link
Contributor

coderabbitai bot commented May 2, 2024

Walkthrough

The version 1.5.1 update brings significant changes to the project, focusing on transitioning from including_default_value_fields to always_print_fields_with_no_presence in json_format.MessageToDict calls across multiple modules for compatibility with the new protobuf library. Additionally, denomination settings in different network environments have been updated and expanded.

Changes

File Path Change Summary
pyinjective/composer.py, pyinjective/utils/grpc_api_request_assistant.py, pyinjective/utils/grpc_api_stream_assistant.py, tests/test_composer.py Updated json_format.MessageToDict parameter to always_print_fields_with_no_presence.
pyinjective/denoms_devnet.ini, pyinjective/denoms_mainnet.ini Adjusted and added new denomination entries with updated tick sizes and quantities.
pyproject.toml Version updated from 1.5.0 to 1.5.1.
.github/workflows/run-tests.yml Updated versions of actions in the workflow.

🐇✨
A hop and a skip, the code does leap,
From fields of old, to new bounds we peep.
With every tick and every tock,
Our rabbit's work refines the clock.
Celebrate the change, for progress we cheer,
Version 1.5.1, the future is here! 🎉
🐇✨


Recent Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 7820edf and 481b846.
Files selected for processing (1)
  • .github/workflows/run-tests.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/run-tests.yml

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.

Copy link

socket-security bot commented May 2, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/[email protected] None 0 243 kB jtraglia

🚮 Removed packages: pypi/[email protected]

View full report↗︎

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

@@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [1.5.1] - 2024-05-02
### Changed
- Updated calls to `json_format.MessageToDict` for compliance with the new version of the `protobuf` library
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a space after the period in the sentence for better readability.

- - Updated calls to `json_format.MessageToDict` for compliance with the new version of the `protobuf` library
+ - Updated calls to `json_format.MessageToDict` for compliance with the new version of the `protobuf` library.

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.

Suggested change
- Updated calls to `json_format.MessageToDict` for compliance with the new version of the `protobuf` library
- Updated calls to `json_format.MessageToDict` for compliance with the new version of the `protobuf` library.

Comment on lines +766 to +773
[0x1af8fa374392dc1bd6331f38f0caa424a39b05dd9dfdc7a2a537f6f62bde50fe]
description = 'Mainnet Spot USDe/USDT'
base = 18
quote = 6
min_price_tick_size = 0.0000000000000001
min_display_price_tick_size = 0.0001
min_quantity_tick_size = 100000000000000000
min_display_quantity_tick_size = 0.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The output from the script indicates that the entity ID [0x1af8fa374392dc1bd6331f38f0caa424a39b05dd9dfdc7a2a537f6f62bde50fe] appears in numerous files across the repository. This suggests that the entity ID is not unique, which contradicts the expectation of uniqueness for such identifiers in the system.

Given this information, it is clear that there are issues with the uniqueness of the entity ID as it is used across multiple files and contexts within the codebase. This could potentially lead to conflicts or errors in the system where this ID is expected to uniquely identify an entity.

Conclusion:

  • The entity ID [0x1af8fa374392dc1bd6331f38f0caa424a39b05dd9dfdc7a2a537f6f62bde50fe] is not unique within the system as it appears in multiple files.
  • This could lead to potential conflicts or errors in the system.

Recommendation:

  • Review the usage of this entity ID across the system to ensure that it does not lead to unintended behavior or conflicts.
  • Consider assigning a unique ID to the new entity to avoid overlap with existing entities.
Analysis chain

New entity [0x1af8fa374392dc1bd6331f38f0caa424a39b05dd9dfdc7a2a537f6f62bde50fe] (USDe/USDT) added with detailed specifications. Confirm that the new entity's settings are appropriate for its market strategy and that the entity ID is unique within the system.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the uniqueness of the new entity ID and appropriateness of settings.

# Check for duplicate entity IDs.
rg --files-with-matches --type ini $'[0x1af8fa374392dc1bd6331f38f0caa424a39b05dd9dfdc7a2a537f6f62bde50fe]' | while read file; do
  # Test: Search for duplicate entity IDs to ensure uniqueness. Expect: No matches except current file.
  ast-grep --lang ini --pattern $'[0x1af8fa374392dc1bd6331f38f0caa424a39b05dd9dfdc7a2a537f6f62bde50fe]' "$file"
done

Length of output: 147



Script:

#!/bin/bash
# Description: Re-verify the uniqueness of the new entity ID.

# Corrected command to search for the entity ID across all files, not just .ini since 'ini' is not a recognized type by `rg`.
rg '[0x1af8fa374392dc1bd6331f38f0caa424a39b05dd9dfdc7a2a537f6f62bde50fe]' -l

Length of output: 50954

@aarmoa aarmoa merged commit 433303c into master May 2, 2024
12 checks passed
@aarmoa aarmoa deleted the fix/update_protobuf_version branch May 2, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant