Skip to content

Conversation

@mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Oct 6, 2024

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

to avoid invalid genesis ever since upgrade

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

Release Notes

  • New Features

    • Introduced new governance parameter management functions, enhancing proposal submission and validation processes.
    • Added a test suite for governance parameters, ensuring robust testing of expedited governance functionalities.
  • Improvements

    • Simplified upgrade handling logic by removing unnecessary parameters and enhancing error handling.
    • Streamlined parameter retrieval processes in integration tests for better clarity and efficiency.
  • Bug Fixes

    • Resolved issues related to governance parameter validation and query handling.
  • Documentation

    • Updated changelog to reflect detailed versioning and changes across various components.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 6, 2024

Walkthrough

The changes in this pull request encompass updates to the CHANGELOG.md, modifications to the application logic in app/app.go and app/upgrades.go, the introduction of a test suite in app/upgrades_test.go, and various enhancements to integration tests. Key updates include alterations to upgrade handler parameters, new governance parameter functions, and improvements in the testing framework for governance proposals. Additionally, several utility functions have been added to streamline governance interactions, while existing methods have been refactored for clarity and efficiency.

Changes

File Change Summary
CHANGELOG.md Updated with breaking changes, improvements, bug fixes, and versioning details.
app/app.go Modified RegisterUpgradeHandlers method to remove clientKeeper parameter.
app/upgrades.go Updated RegisterUpgradeHandlers method and added new functions for governance parameters management.
app/upgrades_test.go Introduced a test suite for governance parameters, including setup and multiple test cases.
integration_tests/cosmoscli.py Modified query_params method for clearer response handling; adjusted query_gravity_params method accordingly.
integration_tests/gravity_utils.py Simplified retrieval of gravity_id from query_gravity_params.
integration_tests/test_basic.py Added new functions for governance proposals and updated existing tests to use these functions.
integration_tests/test_gov_update_params.py Streamlined logic for submitting governance proposals and querying parameters.
integration_tests/test_gravity_2.py Adjusted querying of bridge activation status; added debugging print statements.
integration_tests/test_min_gas_price.py Simplified get_params function for parameter retrieval.
integration_tests/test_upgrade.py Enhanced upgrade testing framework with new functions and improved assertions.
integration_tests/utils.py Added new functions for submitting governance proposals and calculating expedited parameters; modified existing logic.

Possibly related PRs

Suggested reviewers

  • calvinaco
  • devashishdxt
  • yihuang

Poem

In the fields of code we hop,
With upgrades and tests, we never stop.
Governance flows like a gentle stream,
As we refine our blockchain dream.
With each new function, we take a leap,
In the world of Cosmos, our progress runs deep! 🐇✨


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.

@codecov
Copy link

codecov bot commented Oct 6, 2024

Codecov Report

Attention: Patch coverage is 72.97297% with 10 lines in your changes missing coverage. Please review.

Project coverage is 36.00%. Comparing base (f10363c) to head (c7d044a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/upgrades.go 72.97% 6 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1623      +/-   ##
==========================================
+ Coverage   35.86%   36.00%   +0.13%     
==========================================
  Files         123      123              
  Lines        9755     9791      +36     
==========================================
+ Hits         3499     3525      +26     
- Misses       5845     5851       +6     
- Partials      411      415       +4     
Files with missing lines Coverage Δ
app/upgrades.go 48.38% <72.97%> (+33.00%) ⬆️

@mmsqe mmsqe marked this pull request as ready for review October 7, 2024 01:19
@mmsqe mmsqe requested a review from a team as a code owner October 7, 2024 01:19
@mmsqe mmsqe requested review from JayT106 and yihuang and removed request for a team October 7, 2024 01:19
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: 13

🧹 Outside diff range and nitpick comments (13)
integration_tests/test_gov_update_params.py (3)

17-32: LGTM: Streamlined governance proposal submission process.

The changes significantly simplify the process of submitting governance proposals and querying parameters. The use of module_address("gov") for authority and submit_gov_proposal function improves code clarity and reduces potential errors.

Consider adding a comment explaining the purpose of removing merge_netsplit_block and shanghai_time from the parameters, as it might not be immediately clear why these specific fields are being deleted.


53-65: LGTM: Consistent improvements in governance proposal submission.

The changes in this function mirror the improvements made in test_evm_update_param, leading to a more streamlined and consistent approach across the file.

For consistency with the test_evm_update_param function, consider storing the result of cronos.cosmos_cli().query_params() in a variable before assertion. This would make it easier to debug if the assertion fails, as you could print the actual values.

Example:

queried_params = cronos.cosmos_cli().query_params()
assert queried_params == params

Line range hint 1-65: Overall improvements in test implementation and clarity.

The changes in this file significantly improve the implementation of governance-related tests. Key improvements include:

  1. Streamlined governance proposal submission process.
  2. More direct parameter querying and assertion.
  3. Consistent use of module_address("gov") for authority.
  4. Removal of unnecessary file I/O operations.

These changes align well with the PR objectives and maintain the core functionality of the tests while reducing complexity and potential points of failure.

Consider creating helper functions for common operations like parameter querying and assertion to further improve code reusability and maintainability across different test files.

integration_tests/cosmoscli.py (1)

Line range hint 1113-1123: LGTM! Consider adding type hints for improved readability.

The changes to the query_params method improve its flexibility by handling different response structures. This is a good improvement that makes the method more robust.

Consider adding type hints to improve code readability:

def query_params(self, module: str = "cronos", **kwargs) -> dict:
    res = json.loads(
        self.raw(
            "query",
            module,
            "params",
            home=self.data_dir,
            **kwargs,
        )
    )
    return res.get("params") or res
app/upgrades.go (1)

61-95: Enhance testing for error handling in UpdateExpeditedParams

The error handling code paths in UpdateExpeditedParams (lines 64, 73, 77, 92) are currently not exercised by tests. To ensure that the function behaves correctly under error conditions, consider adding tests that simulate these scenarios.

Let me know if you'd like help in creating these tests.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 64-64: app/upgrades.go#L64
Added line #L64 was not covered by tests


[warning] 73-73: app/upgrades.go#L73
Added line #L73 was not covered by tests


[warning] 77-77: app/upgrades.go#L77
Added line #L77 was not covered by tests


[warning] 92-92: app/upgrades.go#L92
Added line #L92 was not covered by tests

app/upgrades_test.go (2)

50-51: Use Constants for Magic Numbers

In line 50, a magic number is used for the MinDeposit amount:

suite.govParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(baseDenom, math.NewInt(2000000000000)))

Using raw numerical literals can make the code less readable and harder to maintain.

Define a constant for the deposit amount to enhance readability and maintainability:

+ const minDepositAmount = 2_000_000_000_000
  suite.govParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(baseDenom, math.NewInt(minDepositAmount)))

This clarifies the intent and makes future updates easier.


114-115: Error Handling Improvement

At lines 114-115, errors are checked using suite.Require().NoError, which will stop the test on failure.

suite.Require().NoError(suite.app.GovKeeper.Params.Set(suite.ctx, suite.govParams))
suite.Require().NoError(app.UpdateExpeditedParams(suite.ctx, suite.app.GovKeeper))

While this is acceptable, consider if using suite.Assert().NoError might be more appropriate to allow the test to continue and report multiple failures in a single run.

Evaluate whether switching to suite.Assert() aligns better with your testing strategy.

integration_tests/test_upgrade.py (4)

121-134: Parameterize hardcoded gas values in check_basic_tx

The function check_basic_tx uses hardcoded values for maxFeePerGas and maxPriorityFeePerGas. While this may be acceptable for testing purposes, consider parameterizing these values or referencing predefined constants to improve flexibility and readability.


195-196: Handle potential exceptions from do_upgrade before proceeding

After calling do_upgrade, the function check_basic_tx(c) is executed without checking if the upgrade was successful. To prevent misleading test results, consider adding error handling to ensure do_upgrade completes successfully before proceeding with further checks.


Line range hint 204-213: Improve robustness of error handling during contract deployment

The test expects a ValueError with a specific message when deploying the Random contract fails due to an "invalid memory address or nil pointer dereference". Relying on such a specific error message may not be robust across different environments or future changes.

Consider handling the error more generally or updating the contract deployment to prevent such low-level exceptions. For example, you could check for any exception during deployment and assert that an error was raised without depending on the exact message.


289-292: Clarify the expected exception when querying icaauth parameters

The code anticipates an AssertionError when querying icaauth parameters post-upgrade. If this behavior is intentional due to the parameters being unavailable or altered after the upgrade, consider adding a comment to explain why this exception is expected to aid future maintainability.

integration_tests/utils.py (2)

13-13: Group import statements according to PEP 8 guidelines

The import statement for Decimal should be grouped with other imports from the standard library to enhance readability and maintain consistency with PEP 8 style guidelines.

Consider repositioning the import to group it with other standard library imports.


179-179: Use logging instead of print statements

Using print statements for status messages is not recommended, especially in larger applications. The logging module provides more flexibility and control over logging levels and outputs.

Replace the print statement with a logging call:

-import print("check params have been updated now")
+import logging
+logging.info("Check params have been updated now")
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f10363c and c7d044a.

📒 Files selected for processing (12)
  • CHANGELOG.md (1 hunks)
  • app/app.go (1 hunks)
  • app/upgrades.go (3 hunks)
  • app/upgrades_test.go (1 hunks)
  • integration_tests/cosmoscli.py (2 hunks)
  • integration_tests/gravity_utils.py (1 hunks)
  • integration_tests/test_basic.py (3 hunks)
  • integration_tests/test_gov_update_params.py (3 hunks)
  • integration_tests/test_gravity_2.py (3 hunks)
  • integration_tests/test_min_gas_price.py (1 hunks)
  • integration_tests/test_upgrade.py (6 hunks)
  • integration_tests/utils.py (3 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
app/upgrades.go

[warning] 38-39: app/upgrades.go#L38-L39
Added lines #L38 - L39 were not covered by tests


[warning] 64-64: app/upgrades.go#L64
Added line #L64 was not covered by tests


[warning] 73-73: app/upgrades.go#L73
Added line #L73 was not covered by tests


[warning] 77-77: app/upgrades.go#L77
Added line #L77 was not covered by tests


[warning] 92-92: app/upgrades.go#L92
Added line #L92 was not covered by tests

🔇 Additional comments (20)
integration_tests/test_gov_update_params.py (2)

3-4: LGTM: Import statements updated appropriately.

The changes in import statements align well with the modifications in the test functions. Unnecessary imports have been removed, and new required imports have been added.


Line range hint 8-8: LGTM: Consistent update of function signatures.

The addition of the tmp_path parameter to both test functions is appropriate and consistent with the changes in their implementations. This update allows for better management of temporary resources during testing.

Also applies to: 45-45

integration_tests/test_min_gas_price.py (2)

63-64: Simplification of get_params function looks good, but verify impact.

The simplification of the get_params function improves code readability. However, please ensure this change doesn't affect the rest of the code that uses these parameters.

  1. Verify that cli.query_params("feemarket") now returns the parameters directly without needing to access a "params" key.
  2. Check if the removal of the dictionary comprehension (converting values to int/float) affects any calculations in test_dynamic_fee_tx and test_base_fee_adjustment.
  3. Consider adding a comment explaining this change, especially if it's part of a larger refactoring effort.

To verify the impact, please run the following script:

✅ Verification successful

Verification successful: get_params simplification is correct and does not impact other code.

The get_params function is no longer used elsewhere in test_min_gas_price.py, and the current implementation does not introduce any type-related issues.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check usage of get_params and potential type-related issues

# Test: Search for get_params usage
echo "Occurrences of get_params:"
rg "get_params\(" integration_tests/test_min_gas_price.py

# Test: Check for potential type-related issues
echo "\nPotential type-related issues:"
rg "params\[.+\]" integration_tests/test_min_gas_price.py

Length of output: 1105


63-64: Verify type consistency in test functions using get_params

The change in get_params may affect the test_dynamic_fee_tx and test_base_fee_adjustment functions. Both these functions use the params returned by get_params in the adjust_base_fee function, which performs integer arithmetic.

Please ensure that:

  1. The parameters returned by cli.query_params("feemarket") are of the correct type (integers) for use in adjust_base_fee.
  2. If the parameters are not integers, add necessary type conversions either in get_params or where the parameters are used.
  3. Run the tests to confirm that no type-related errors occur during the calculations.

To verify the types used in calculations, please run the following script:

✅ Verification successful

Review Comment Not Applicable: get_params Still Converts Parameters to Integers

The get_params function in integration_tests/test_min_gas_price.py still converts parameter values to integers using int(float(v)), as shown below:

params = cli.query_params("feemarket")
return {k: int(float(v)) for k, v in params.items()}

Since the integer conversion remains in place, the concerns about type consistency in the test functions do not apply at this time.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check types used in adjust_base_fee calculations

# Test: Examine adjust_base_fee function
echo "adjust_base_fee function:"
rg "def adjust_base_fee" -A 10 integration_tests/test_min_gas_price.py

# Test: Check usage of params in test functions
echo "\nUsage of params in test functions:"
rg "params\[.+\]" integration_tests/test_min_gas_price.py

Length of output: 1105


Script:

#!/bin/bash
# Description: Inspect types of parameters returned by cli.query_params("feemarket")

# Extract the line where params are assigned
rg "params\s*=\s*cli\.query_params" integration_tests/test_min_gas_price.py

# Inspect the return statement to see if values are converted to integers
rg "return\s*\{k:\s*int\(float\(v\)\)" integration_tests/test_min_gas_price.py

Length of output: 258

integration_tests/gravity_utils.py (1)

119-119: LGTM! Consider verifying API compatibility.

The simplification of accessing gravity_id directly from the query_gravity_params() result is a good change. It makes the code more straightforward and easier to read.

To ensure this change doesn't break compatibility with different versions of the API, please run the following verification script:

This script will help identify if there are any inconsistencies in how query_gravity_params() is implemented across different versions or files in the project.

✅ Verification successful

To address the issue with the previous script, please run the following verification script to accurately check the structure of query_gravity_params across different versions:

[/run_scripts]


To ensure that the removal of the "params" key in query_gravity_params does not impact other parts of the codebase, please run the following verification script:

[/run_scripts]


✅ Verification Successful: No Compatibility Issues Found

The gravity_id access has been updated correctly without affecting other parts of the codebase. No usages of query_gravity_params["params"] were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the structure of gravity params across different versions

# Test: Check the structure of gravity params in different versions
rg --type python -A 5 'def query_gravity_params' | grep -v 'def query_gravity_params'

Length of output: 118


Script:

#!/bin/bash
# Description: Verify the structure of gravity params across different versions

# Find all Python files and search for the 'query_gravity_params' function
fd --type f --extension py | xargs grep -A 5 'def query_gravity_params'

Length of output: 443


Script:

#!/bin/bash
# Description: Find all definitions and usages of `query_gravity_params` across the codebase

# Find all Python files
python_files=$(fd --type f --extension py)

# Search for the definition of `query_gravity_params`
echo "=== Function Definitions ==="
echo "$python_files" | xargs grep -H 'def query_gravity_params'

# Search for usages where "params" key is accessed
echo ""
echo "=== Usages Accessing 'params' Key ==="
echo "$python_files" | xargs grep -H 'query_gravity_params.*\["params"\]'

Length of output: 8172

integration_tests/test_gravity_2.py (3)

316-316: LGTM: Simplified parameter access

The change simplifies the access to the 'bridge_active' parameter, making the code more straightforward. This modification aligns with the overall goal of improving code readability while maintaining the same functionality.


335-335: LGTM: Consistent parameter access

This change is consistent with the previous modification at line 316, maintaining a uniform approach to accessing the 'bridge_active' parameter. This consistency improves the overall readability and maintainability of the test function.


357-357: LGTM: Completed consistent parameter access pattern

This change completes the pattern of simplified 'bridge_active' parameter access throughout the test_gravity_detect_malicious_supply function. It ensures consistency and improves the overall quality of the test implementation.

CHANGELOG.md (5)

Line range hint 3-3: LGTM: Unreleased section is present

The changelog includes an "UNRELEASED" section at the top, which is a good practice for tracking changes that will be included in the next release.

🧰 Tools
🪛 Markdownlint

27-27: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


Line range hint 5-8: State Machine Breaking change looks good

The change related to memiavl's initial version logic is clearly described and includes a reference to the relevant pull request (#1618).

🧰 Tools
🪛 Markdownlint

27-27: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


Line range hint 10-17: Improvements section is well-documented

The improvements section lists several changes with clear descriptions and references to their respective pull requests. This provides good traceability for the changes.

🧰 Tools
🪛 Markdownlint

27-27: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


Line range hint 19-25: Bug Fixes section is comprehensive

The bug fixes are well-documented with clear descriptions and references to the relevant pull requests. The inclusion of CVE-2021-39137 hotfix is particularly important for security.

🧰 Tools
🪛 Markdownlint

27-27: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


Line range hint 27-61: v1.0.7 release notes are detailed

The release notes for v1.0.7 provide a good overview of the improvements and bug fixes included in this version. The inclusion of backported fixes and the release of static-linked binaries for the Linux platform are notable improvements.

🧰 Tools
🪛 Markdownlint

27-27: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

app/app.go (1)

957-957: Verify the impact of removing app.IBCKeeper.ClientKeeper from RegisterUpgradeHandlers

The RegisterUpgradeHandlers method call has been modified to remove the app.IBCKeeper.ClientKeeper parameter. This change could affect how IBC-related upgrades are handled. Please ensure that this modification is intentional and doesn't break any existing functionality related to IBC upgrades.

To verify the impact of this change, please run the following script:

✅ Verification successful

[/run_scripts]


Removal of app.IBCKeeper.ClientKeeper Verified

The RegisterUpgradeHandlers method call has been successfully updated to remove the app.IBCKeeper.ClientKeeper parameter. No additional references to IBCKeeper.ClientKeeper were found in the codebase, indicating that this change is isolated and should not impact existing IBC upgrade functionalities.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any references to IBCKeeper.ClientKeeper in upgrade handlers

# Search for references to IBCKeeper.ClientKeeper in upgrade-related files
echo "Searching for IBCKeeper.ClientKeeper references in upgrade handlers:"
rg --type go 'IBCKeeper.ClientKeeper' app/upgrades

Length of output: 250


Script:

#!/bin/bash
# Description: Recursively search for any references to IBCKeeper.ClientKeeper in the codebase

echo "Recursively searching for IBCKeeper.ClientKeeper references in the entire codebase:"
rg --type go 'IBCKeeper.ClientKeeper'

Length of output: 214

app/upgrades.go (1)

20-20: Update function calls to match new RegisterUpgradeHandlers signature

The function RegisterUpgradeHandlers no longer accepts the clientKeeper parameter. Please ensure that all invocations of this function have been updated to reflect the new signature to prevent build errors.

You can verify by running:

✅ Verification successful

All calls to RegisterUpgradeHandlers have been correctly updated to the new signature.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all calls to `RegisterUpgradeHandlers` and check that they only pass `cdc` as an argument.

# Expected: All calls should match the new signature.

rg --type go 'RegisterUpgradeHandlers\(' -A 1 -B 1

Length of output: 339

integration_tests/test_upgrade.py (4)

115-118: Confirm the necessity of excluding header_hash_num in parameter comparison

In the assert_evm_params function, the header_hash_num field is deleted from the parameters before performing the assertion. Please verify if excluding header_hash_num is necessary for an accurate comparison. If so, consider adding a comment to explain why this field is omitted to aid future maintainability.


248-248: Verify the expected value of min_timeout_duration in icaauth parameters

The assertion checks if min_timeout_duration equals "3600s". Ensure that this is the expected value after the upgrade. If the upgrade alters this parameter, consider updating the expected value or adding comments to clarify the intended behavior.


281-292: Clarify the usage of gov_param and validate governance parameters post-upgrade

The governance parameters are captured before the upgrade and asserted afterward using assert_gov_params(cli, gov_param). Confirm that capturing gov_param at this point reflects the intended state for post-upgrade comparison. Additionally, ensure that assert_gov_params correctly validates any changes or preservations of governance parameters during the upgrade process.


292-292: Ensure assert_gov_params is correctly imported and utilized

The function assert_gov_params is used to validate governance parameters, but make sure it is correctly imported and implemented. Verify that it functions as intended and that all necessary parameters are being checked.

integration_tests/test_basic.py (1)

70-70: 🛠️ Refactor suggestion

⚠️ Potential issue

Avoid shadowing built-in function type and ensure correct field names.

  1. Rename variable type to prevent shadowing the built-in type function.

    Assigning to type shadows Python's built-in type, which can lead to confusion or unexpected behavior. Consider renaming it to msg_type for clarity.

  2. Verify the correct field name in the message dictionary.

    In the message, the key "signer" is used, whereas in other messages, "authority" is used. Check if /ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams expects "authority" instead of "signer". Consistent use of field names helps maintain code readability and correctness.

Apply the following diff to address these issues:

- type = "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams"
+ msg_type = "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams"

 submit_gov_proposal(
     cronos,
     tmp_path,
     messages=[
         {
-            "@type": type,
-            "signer": authority,
+            "@type": msg_type,
+            "authority": authority,
             "params": p,
         }
     ],
     deposit="5basetcro",
     expedited=True,
 )

Also applies to: 76-76

@mmsqe mmsqe added this pull request to the merge queue Oct 7, 2024
Merged via the queue into crypto-org-chain:main with commit fea4dec Oct 7, 2024
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