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

Problem: v0.50.x is outdated #1722

Merged
merged 8 commits into from
Dec 18, 2024
Merged

Problem: v0.50.x is outdated #1722

merged 8 commits into from
Dec 18, 2024

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented Dec 17, 2024

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

for more info

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • Chores
    • Updated CHANGELOG.md to include new bug fix entries and reorganized existing entries for clarity.
    • Updated dependencies in go.mod to newer versions and alternative sources for improved functionality and security.

Copy link
Contributor

coderabbitai bot commented Dec 17, 2024

Walkthrough

This pull request involves updates to the project's CHANGELOG.md and go.mod files. The changes primarily focus on dependency management and changelog maintenance. In the CHANGELOG.md, a new bug fix entry for nonce management in Ethermint is added, and a security patch entry is relocated. The go.mod file sees significant updates, with multiple dependencies being replaced by forked or updated versions from the crypto-org-chain organization, including changes to Cosmos SDK, CometBFT, Ethereum, and Ethermint libraries.

Changes

File Change Summary
CHANGELOG.md - Added bug fix entry for nonce management in batch transactions (#1724)
- Moved security patch entry to "State Machine Breaking" section (#1722)
go.mod - Replaced multiple dependencies with forked/updated versions:
* Cosmos SDK
* Keyring
* CometBFT
* JWT library
* Ethereum
* Ethermint
* BTree library

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Mod as Module Dependencies
    participant Proj as Project Codebase

    Dev->>Mod: Update dependencies
    Mod-->>Dev: Provide new library versions
    Dev->>Proj: Replace dependencies in go.mod
    Dev->>Proj: Update CHANGELOG.md
    Proj-->>Dev: Reflect changes
Loading

Possibly related PRs

Suggested reviewers

  • calvinaco
  • yihuang
  • thomas-nguy

Poem

🐰 Hop, hop, through dependencies we go,
Updating modules with a scholarly glow
Forked libraries dance, versions take flight
Changelog whispers our technical might
Code evolves, with each rabbit-quick stride! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4297d68 and 8023321.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.56%. Comparing base (a3c2f70) to head (8023321).
Report is 25 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1722       +/-   ##
===========================================
+ Coverage   16.87%   35.56%   +18.68%     
===========================================
  Files          72      126       +54     
  Lines        6163    11915     +5752     
===========================================
+ Hits         1040     4237     +3197     
- Misses       5000     7254     +2254     
- Partials      123      424      +301     

see 71 files with indirect coverage changes

@mmsqe mmsqe marked this pull request as ready for review December 17, 2024 09:39
@mmsqe mmsqe requested a review from a team as a code owner December 17, 2024 09:39
@mmsqe mmsqe requested review from devashishdxt and thomas-nguy and removed request for a team December 17, 2024 09:39
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

🧹 Nitpick comments (3)
integration_tests/test_basic.py (3)

958-960: Consider using constants for magic numbers

The staking and token amounts are hardcoded. Consider defining these as constants at the module level for better maintainability and clarity.

+# Constants for token amounts
+VALIDATOR_STAKE_AMOUNT = 1000000000000000000  # 1 TCRO
+VALIDATOR_TOKEN_AMOUNT = 50000000000000000    # 0.05 TCRO
 
-    staked = 1000000000000000000
-    amt = 50000000000000000
-    coin = f"{staked}stake,{amt}basetcro"
+    coin = f"{VALIDATOR_STAKE_AMOUNT}stake,{VALIDATOR_TOKEN_AMOUNT}basetcro"

983-989: Consider parameterizing validator configuration

The validator creation parameters are hardcoded. Consider making them configurable for better test flexibility.

+    validator_config = {
+        "moniker": moniker,
+        "commission_rate": "1.0",
+        "commission_max_rate": "2.0",
+        "commission_max_change_rate": "0.1",
+    }
     res = cli1.create_validator(
         f"{staked}stake",
-        {
-            "moniker": moniker,
-        },
+        validator_config,
         gas_prices=DEFAULT_GAS_PRICE,
     )

1000-1004: Document commission rate values

The commission rate values are using a specific format (18 decimal places). Consider adding a comment explaining the format and why these specific values are used.

+    # Commission rates are in decimal format with 18 decimal places
+    # rate: 0.1 (10%)
+    # max_rate: 0.2 (20%)
+    # max_change_rate: 0.01 (1%)
     assert val["commission"]["commission_rates"] == {
         "rate": "100000000000000000",
         "max_rate": "200000000000000000",
         "max_change_rate": "10000000000000000",
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6dfde15 and 3a8e76f.

📒 Files selected for processing (1)
  • integration_tests/test_basic.py (2 hunks)
🔇 Additional comments (3)
integration_tests/test_basic.py (3)

949-961: LGTM: Node setup and initialization looks good

The initial setup of the test environment, including node creation and port configuration, follows the established patterns.


966-975: LGTM: JSON-RPC configuration is properly set up

The configuration of JSON-RPC endpoints follows security best practices by binding to localhost.


991-999: LGTM: Comprehensive validation checks

The test includes thorough validation of the validator's status, including checks for jailing status, bonding status, tokens, and moniker.

integration_tests/test_basic.py Outdated Show resolved Hide resolved
@mmsqe mmsqe marked this pull request as draft December 17, 2024 10:17
@mmsqe mmsqe marked this pull request as ready for review December 18, 2024 03:53
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

🧹 Nitpick comments (2)
integration_tests/test_basic.py (2)

962-964: Consider extracting magic numbers into named constants

The staking and transfer amounts are hardcoded. Consider defining these as named constants at the module level for better maintainability and clarity.

+# Constants for validator setup
+VALIDATOR_STAKE_AMOUNT = 1000000000000000000  # 1 TCRO
+VALIDATOR_INITIAL_TRANSFER = 50000000000000000  # 0.05 TCRO
+
 def test_join_validator(cronos):
     # ...
-    staked = 1000000000000000000
-    amt = 50000000000000000
+    staked = VALIDATOR_STAKE_AMOUNT
+    amt = VALIDATOR_INITIAL_TRANSFER

987-994: Consider parameterizing validator configuration

The validator creation uses hardcoded values for commission rates and other parameters. Consider making these configurable or extracting them into constants.

+# Constants for validator configuration
+DEFAULT_COMMISSION_RATE = "100000000000000000"  # 0.1
+DEFAULT_MAX_RATE = "200000000000000000"        # 0.2
+DEFAULT_MAX_CHANGE_RATE = "10000000000000000"  # 0.01
+
 def test_join_validator(cronos):
     # ...
     res = cli1.create_validator(
         f"{staked}stake",
         {
             "moniker": moniker,
+            "commission_rate": DEFAULT_COMMISSION_RATE,
+            "max_rate": DEFAULT_MAX_RATE,
+            "max_change_rate": DEFAULT_MAX_CHANGE_RATE,
         },
         gas_prices=DEFAULT_GAS_PRICE,
     )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a8e76f and 4297d68.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • go.mod (1 hunks)
  • integration_tests/test_basic.py (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • go.mod
🔇 Additional comments (3)
integration_tests/test_basic.py (3)

953-959: LGTM: Clear test setup with well-defined parameters

The initial setup of the test function is clear and follows good practices by:

  • Using descriptive variable names
  • Setting up a new node with unique ports
  • Properly initializing the test environment

980-984: Add error handling for node startup

The node startup process should include error handling in case the node fails to start or sync.


1010-1021: LGTM: Good use of helper function for status checking

The implementation of status checking and unbonding test is well-structured:

  • Uses a helper function for status verification
  • Properly waits for status changes
  • Verifies the unbonding process

@yihuang yihuang enabled auto-merge December 18, 2024 07:29
@yihuang yihuang added this pull request to the merge queue Dec 18, 2024
Merged via the queue into crypto-org-chain:main with commit 9946bd3 Dec 18, 2024
44 checks passed
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.

2 participants