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/sync dev with v151 #325

Merged
merged 6 commits into from
May 3, 2024
Merged

Fix/sync dev with v151 #325

merged 6 commits into from
May 3, 2024

Conversation

aarmoa
Copy link
Collaborator

@aarmoa aarmoa commented May 2, 2024

  • Sync dev branch with changes from the latest release (v1.5.1)

Summary by CodeRabbit

  • Refactor

    • Updated compatibility with the latest version of the protobuf library across various components.
  • New Features

    • Added new derivative pairs and trading options in both Devnet and Mainnet environments.
  • Documentation

    • Updated system requirements for aiohttp and relaxed constraints for urllib3.
  • Tests

    • Adjusted test cases to align with the updated library usage.

Copy link
Contributor

coderabbitai bot commented May 2, 2024

Walkthrough

The update primarily adjusts compatibility with a new version of the protobuf library across various Python files, changing how JSON representations of messages are handled. Additionally, the project's dependency versions for aiohttp and urllib3 are modified, and new entries for derivative pairs are added to configuration files for different network environments.

Changes

File Path Change Summary
CHANGELOG.md, pyproject.toml Updated dependency versions and adapted to new protobuf standards.
pyinjective/composer.py, .../utils/grpc_api_... Replaced including_default_value_fields=True with always_print_fields_with_no_presence=True in various methods.
pyinjective/denoms_devnet.ini, pyinjective/denoms_mainnet.ini Added new derivative pairs and adjusted tick sizes in network configurations.
tests/test_composer.py Updated test functions to align with new protobuf parameters.

🐇💻
In the land of code, where the bits align,
A rabbit hopped, through lines so fine.
With a flick of its tail, updates unfurl,
Protobuf dances, new worlds swirl.
Cheers to changes, the rabbit's delight,
In the glow of the screen, it hops through the night. 🌌🌟


Recent Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between d921dca and ad3f2f6.
Files selected for processing (1)
  • tests/test_composer.py (31 hunks)
Additional Context Used
Ruff (7)
tests/test_composer.py (7)

24-24: Redefinition of unused inj_usdt_spot_market from line 13


24-24: Redefinition of unused btc_usdt_perp_market from line 10


24-24: Redefinition of unused first_match_bet_market from line 11


42-42: Redefinition of unused inj_token from line 12


43-43: Redefinition of unused inj_usdt_spot_market from line 13


1195-1195: Redefinition of unused test_msg_cancel_derivative_order from line 960


1359-1359: Redefinition of unused test_msg_external_transfer from line 1270

Additional comments not posted (20)
tests/test_composer.py (20)

205-205: Change in json_format.MessageToDict argument aligns with protobuf library update.


236-236: Change in json_format.MessageToDict argument aligns with protobuf library update.


277-277: Change in json_format.MessageToDict argument aligns with protobuf library update.


340-340: Change in json_format.MessageToDict argument aligns with protobuf library update.


406-406: Change in json_format.MessageToDict argument aligns with protobuf library update.


449-449: Change in json_format.MessageToDict argument aligns with protobuf library update.


496-496: Change in json_format.MessageToDict argument aligns with protobuf library update.


545-545: Change in json_format.MessageToDict argument aligns with protobuf library update.


582-582: Change in json_format.MessageToDict argument aligns with protobuf library update.


631-631: Change in json_format.MessageToDict argument aligns with protobuf library update.


659-659: Change in json_format.MessageToDict argument aligns with protobuf library update.


686-686: Change in json_format.MessageToDict argument aligns with protobuf library update.


789-789: Change in json_format.MessageToDict argument aligns with protobuf library update.


814-814: Change in json_format.MessageToDict argument aligns with protobuf library update.


866-866: Change in json_format.MessageToDict argument aligns with protobuf library update.


904-904: Change in json_format.MessageToDict argument aligns with protobuf library update.


956-956: Change in json_format.MessageToDict argument aligns with protobuf library update.


997-997: Change in json_format.MessageToDict argument aligns with protobuf library update.


1023-1023: Change in json_format.MessageToDict argument aligns with protobuf library update.


1087-1087: Change in json_format.MessageToDict argument aligns with protobuf library update.


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

Out of diff range and nitpick comments (1)
pyinjective/denoms_mainnet.ini (1)

754-755: Ensure consistency in decimal places for tick sizes across similar trading pairs.

While the changes are correct, maintaining consistency in the decimal places used for tick sizes across similar trading pairs can improve readability and reduce potential confusion.

Comment on lines +16 to +19
## [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.

Ensure consistency in formatting and spacing in the changelog entries.

## [1.5.1] - 2024-05-02
### Changed
- Updated calls to `json_format.MessageToDict` for compliance with the new version of the `protobuf` library
+## [1.5.1] - 2024-05-02
+### Changed
+- 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
## [1.5.1] - 2024-05-02
### Changed
- Updated calls to `json_format.MessageToDict` for compliance with the new version of the `protobuf` library
## [1.5.1] - 2024-05-02
### Changed
- Updated calls to `json_format.MessageToDict` for compliance with the new version of the `protobuf` library

Comment on lines +793 to +800
[0x25b545439f8e072856270d4b5ca94764521c4111dd9a2bbb5fbc96d2ab280f13]
description = 'Mainnet Spot PYTH/INJ'
base = 6
quote = 18
min_price_tick_size = 10000000
min_display_price_tick_size = 0.00001
min_quantity_tick_size = 100000
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.

Duplicate entry for 'Mainnet Spot PYTH/INJ'.

- [0x25b545439f8e072856270d4b5ca94764521c4111dd9a2bbb5fbc96d2ab280f13]
- description = 'Mainnet Spot PYTH/INJ'
- base = 6
- quote = 18
- min_price_tick_size = 10000000
- min_display_price_tick_size = 0.00001
- min_quantity_tick_size = 100000
- min_display_quantity_tick_size = 0.1

This entry appears to be a duplicate of another entry for 'Mainnet Spot PYTH/INJ' with the same parameters. Please verify if this duplication is intentional or an error.


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
[0x25b545439f8e072856270d4b5ca94764521c4111dd9a2bbb5fbc96d2ab280f13]
description = 'Mainnet Spot PYTH/INJ'
base = 6
quote = 18
min_price_tick_size = 10000000
min_display_price_tick_size = 0.00001
min_quantity_tick_size = 100000
min_display_quantity_tick_size = 0.1

Comment on lines +307 to +315
[0xdc44a6e8292dd72d05a1a145aa17501dd4d3543ab74a97fa163a758a71fc6d08]
description = 'Devnet Derivative rRdTb/USDT PERP'
base = 0
quote = 6
min_price_tick_size = 1000
min_display_price_tick_size = 0.001
min_quantity_tick_size = 0.01
min_display_quantity_tick_size = 0.01

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 settings for 'Devnet Derivative rRdTb/USDT PERP' have been compared with other similar derivative products in the denoms_devnet.ini file. The comparison reveals that the settings for 'Devnet Derivative rRdTb/USDT PERP' are largely consistent with several other derivatives, particularly in terms of base, quote, min_price_tick_size, and min_display_price_tick_size.

However, there is a notable variation in the min_quantity_tick_size and min_display_quantity_tick_size settings between 'Devnet Derivative rRdTb/USDT PERP' and most other derivatives. The 'rRdTb/USDT PERP' derivative has these settings at 0.01, whereas the majority of other derivatives have these settings at 0.001. This discrepancy might be intentional based on specific requirements for the 'rRdTb/USDT PERP' derivative, but it does stand out when compared to the settings of other derivatives.

Recommendations:

  • If the difference in min_quantity_tick_size and min_display_quantity_tick_size is intentional and justified by business or technical requirements, it may remain as is.
  • If consistency across derivatives is a priority, consider adjusting these settings to align with the majority of other derivatives in the configuration file.
Analysis chain

Confirm that the settings for 'Devnet Derivative rRdTb/USDT PERP' are consistent with similar derivative products.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Ensure consistency of settings for 'Devnet Derivative rRdTb/USDT PERP' with similar derivative products.

# Compare settings with other derivatives to ensure consistency.
gh issue list --search "rRdTb/USDT PERP settings comparison in denoms_devnet.ini"

Length of output: 83



Script:

#!/bin/bash
# Description: Extract settings of derivatives similar to 'Devnet Derivative rRdTb/USDT PERP' from the configuration file and compare them.

# Find the section for 'Devnet Derivative rRdTb/USDT PERP' and similar derivatives in the configuration file
grep -A 7 -B 2 "Devnet Derivative rRdTb/USDT PERP" pyinjective/denoms_devnet.ini
grep -A 7 -B 2 "PERP" pyinjective/denoms_devnet.ini | grep -v "Devnet Derivative rRdTb/USDT PERP"

Length of output: 11254

…fields_with_no_presence in json_format.MessageToDict
@aarmoa aarmoa merged commit 1d35d8d into dev May 3, 2024
12 checks passed
@aarmoa aarmoa deleted the fix/sync_dev_with_v151 branch May 3, 2024 13:11
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