Skip to content

Comments

Problem: conflict of index uniqueness constrain violation on trace api#1753

Merged
mmsqe merged 4 commits intocrypto-org-chain:mainfrom
mmsqe:acc_minus
Feb 24, 2025
Merged

Problem: conflict of index uniqueness constrain violation on trace api#1753
mmsqe merged 4 commits intocrypto-org-chain:mainfrom
mmsqe:acc_minus

Conversation

@mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Feb 22, 2025

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

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 the Go runtime and dependency versions to enhance system stability and performance.
  • Tests

    • Enhanced upgrade tests by adding additional validations, including improved node restart and account verification procedures.
    • Introduced new testing functionality for data corrections with an option for dry runs and updated configuration references.

@codecov
Copy link

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1753       +/-   ##
===========================================
+ Coverage   16.87%   35.56%   +18.68%     
===========================================
  Files          72      126       +54     
  Lines        6163    11920     +5757     
===========================================
+ Hits         1040     4239     +3199     
- Misses       5000     7256     +2256     
- Partials      123      425      +302     

see 71 files with indirect coverage changes

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2025

Walkthrough

This pull request updates dependency versions and related hashes in both the go.mod and gomod2nix.toml files, bumps the Go version, and adjusts the commit reference for an upgrade test configuration. Additionally, it introduces a new method in the CosmosCLI class to fix data and extends the upgrade testing process by adding node control steps, delay, account querying, transaction tracing, and post-upgrade validation.

Changes

Files Change Summary
go.mod, gomod2nix.toml Updated Go version (1.23.1 → 1.23.3) and dependency versions for github.com/cosmos/cosmos-sdk and github.com/evmos/ethermint; updated corresponding hashes in gomod2nix.toml.
integration_tests/configs/upgrade-test-package.nix Updated the released1_3 variable commit hash from "e1d819c862b30f0ce978baf2addb12516568639e" to "dd3cea2df41732ef030a1f830244e340f3cf6bf0".
integration_tests/cosmoscli.py Added a new method changeset_fixdata(versiondb_dir, dry_run=False) in the CosmosCLI class to execute a changeset data-fix command, optionally in dry-run mode.
integration_tests/test_upgrade.py Enhanced the do_upgrade function by importing the time module, stopping a specific node, adding a delay, executing a version database data fix, restarting the node, querying account data with conversion and error expectation, sending a transaction with debugging trace, performing an upgrade to version "v1.4", and comparing pre- and post-upgrade traces.

Sequence Diagram(s)

sequenceDiagram
    participant TS as Test Script
    participant NC as Node Control
    participant CLI as CosmosCLI
    participant DB as Version Database

    TS->>NC: Stop node (cronos_777-1-node0)
    NC-->>TS: Confirm node stopped
    TS->>TS: Wait for 3 seconds
    TS->>CLI: Call changeset_fixdata(versiondb_dir, dry_run)
    CLI->>DB: Execute "changeset fixdata" command
    DB-->>CLI: Return data fix result
    TS->>NC: Restart node
    TS->>TS: Query account (Ethereum-to-Bech32 conversion)
    alt Account not found
        TS->>CLI: Send transaction & request debug trace
    end
    TS->>TS: Upgrade to v1.4 and assert EVM parameters
    TS->>NC: Request post-upgrade debug trace
    NC-->>TS: Return trace result
    TS->>TS: Compare pre- and post-upgrade traces
Loading

Possibly related PRs

Suggested reviewers

  • devashishdxt
  • calvinaco
  • yihuang

Poem

Oh, I'm a rabbit, hopping through code all day,
Making changes so fresh in a playful display.
Modules updated with a skip and a bound,
Fixing up data where new methods are found.
With a nod and a twitch of my ear so spry,
I celebrate fixes under the digital sky!
🐰✨


📜 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 635ecb5 and df21fdf.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • go.mod (3 hunks)
  • gomod2nix.toml (2 hunks)
  • integration_tests/configs/upgrade-test-package.nix (1 hunks)
  • integration_tests/cosmoscli.py (1 hunks)
  • integration_tests/test_upgrade.py (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: integration_tests (upgrade)
🔇 Additional comments (9)
integration_tests/configs/upgrade-test-package.nix (1)

22-23:

Details

❓ Verification inconclusive

Verify the commit hash update.

The commit hash for released1_3 has been updated. Please ensure this specific version contains the necessary changes for fixing the index uniqueness constraint violation.

Run the following script to verify the commit changes:


🏁 Script executed:

#!/bin/bash
# Description: Verify the changes in the new commit.

# Test: Check the commit message and changes
curl -s "https://api.github.com/repos/crypto-org-chain/cronos/commits/dd3cea2df41732ef030a1f830244e340f3cf6bf0" | jq -r '.commit.message'

Length of output: 250


Action Required: Confirm Inclusion of the Index Uniqueness Constraint Fix

  • The commit hash update for released1_3 now points to commit dd3cea2df41732ef030a1f830244e340f3cf6bf0, whose message reads:
  • There is no explicit reference to a fix for the index uniqueness constraint violation in the commit message.
  • Please verify that this commit indeed includes the necessary changes to address the index uniqueness issue. If it does not, consider updating the commit hash or including additional documentation that confirms the fix.
integration_tests/test_upgrade.py (3)

297-302: LGTM! Node control and data fix sequence.

The sequence of stopping the node, waiting, and fixing the data is well-structured to ensure data consistency during the upgrade.


304-312: Verify transaction behavior before upgrade.

The code sends a transaction and captures its trace for comparison after the upgrade. This helps ensure that the fix for the index uniqueness constraint violation doesn't affect transaction behavior.


327-328: LGTM! Transaction trace verification.

The code correctly verifies that transaction behavior remains consistent after the upgrade by comparing the traces.

integration_tests/cosmoscli.py (1)

1854-1857: LGTM! New method for fixing data inconsistencies.

The changeset_fixdata method provides a clean interface for fixing data in the version database, with a helpful dry-run option for testing the fix before applying it.

go.mod (2)

256-257:

Details

❓ Verification inconclusive

Verify dependency updates.

The cosmos-sdk and ethermint dependencies have been updated to newer versions. These updates might include fixes for the index uniqueness constraint violation.

Run the following script to check for breaking changes:

Also applies to: 275-275


🏁 Script executed:

#!/bin/bash
# Description: Check for breaking changes in the updated dependencies.

# Test: Check commit history for breaking changes
curl -s "https://api.github.com/repos/crypto-org-chain/cosmos-sdk/compare/v0.43.0-beta1.0.20241217090828-cfbca9fe8254...v0.43.0-beta1.0.20250224020346-25e0cb78f920" | jq -r '.commits[].commit.message'
curl -s "https://api.github.com/repos/crypto-org-chain/ethermint/compare/v0.6.1-0.20241217094803-acbe290991cc...v0.6.1-0.20250109075157-62042e2252f6" | jq -r '.commits[].commit.message'

Length of output: 502


Action Required: Manual Verification of Dependency Changes

The dependency updates in your go.mod file (lines 256-257 and 275) correctly update the cosmos-sdk and ethermint versions. However, the script provided to check for breaking changes (comparing commit histories via the GitHub API) did not produce any output and returned errors. This result makes it unclear whether any breaking changes were introduced or if the API call did not return the expected data.

  • go.mod Lines 256-257 & 275: Dependency versions have been updated as indicated.
  • Verification Script: The commit comparison API returned errors (jq: error... cannot iterate over null), suggesting that the change log check did not yield useful information.
  • Next Steps: Please manually verify these updates by reviewing the official release notes or changelogs for the updated cosmos-sdk and ethermint versions to ensure that any fixes for the index uniqueness constraint violation (or other breaking changes) are confirmed.

3-3:

Details

❓ Verification inconclusive

Verify Go version compatibility.

The Go version has been updated to 1.23.3. Please ensure all developers and CI systems are using this version.


🌐 Web query:

What is the latest version of Go?

💡 Result:

The latest version of Go as of February 2025 is Go 1.24.0, released on February 11, 2025[3]. This follows the previous major release, Go 1.23.0 (August 2024), which had multiple minor updates including security patches and bug fixes up to version 1.23.6[3].

Key details about recent versions:

  • Go 1.24.x: Current supported release series with security updates
  • Go 1.23.x: Now in maintenance mode with final patch versions like 1.23.6 (February 2025)[3]
  • Support policy: Each major release receives support until two newer versions exist[3]

To install the latest version:

go install golang.org/x/tools/gopls@latest

The Go team maintains backward compatibility while introducing toolchain improvements like automatic toolchain upgrades starting in Go 1.21[1][3]. Developers using older versions (like Go 1.19/1.20) should upgrade as gopls support for these ended in v0.16.x[1].

Citations:


Action: Confirm Go Version Alignment Across Environments

  • The go.mod file still declares go 1.23.3.
  • As of February 2025, the latest Go release is Go 1.24.0; the 1.23 series now only receives maintenance (with a final patch of 1.23.6).
  • Please verify whether the intent is to remain on the 1.23 series or to upgrade to 1.24.0. If staying with 1.23:
    • Consider bumping to the latest patch version (1.23.6) for security and bug fixes.
  • Ensure that all developers and CI systems are aligned with the intended Go version.
gomod2nix.toml (2)

177-179: Cosmos-SDK Dependency Update Verification
The dependency for github.com/cosmos/cosmos-sdk has been bumped to version "v0.43.0-beta1.0.20250224020346-25e0cb78f920" with the updated hash "sha256-Hf+IiBP+kroVm9rSA3RVRFT4mjgOKz13jX334vTL5lA=". Please ensure that this update is consistent with your corresponding go.mod changes and verify that it addresses any issues (such as the trace API uniqueness constraint conflict) that the PR aims to resolve.


266-267: Evmos/Ethermint Dependency Update Verification
The module github.com/evmos/ethermint now reflects version "v0.6.1-0.20250109075157-62042e2252f6" and its associated hash has been updated to "sha256-ZmkYPzUBw0pZyoYFckKMq6/yEdtVfWuV7XvEWxycMWg=". Confirm that this change aligns with other dependency updates and supports resolving the conflict outlined in the PR description.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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.

@mmsqe mmsqe marked this pull request as ready for review February 24, 2025 02:45
@mmsqe mmsqe requested a review from a team as a code owner February 24, 2025 02:45
@mmsqe mmsqe requested review from leejw51crypto and yihuang and removed request for a team February 24, 2025 02:45
@mmsqe mmsqe added this pull request to the merge queue Feb 24, 2025
Merged via the queue into crypto-org-chain:main with commit e1d336f Feb 24, 2025
36 checks passed
mmsqe added a commit to mmsqe/cronos that referenced this pull request Feb 24, 2025
crypto-org-chain#1753)

* Problem: conflict of index uniqueness constrain violation on trace api

* test

* update deps

* bump go
mmsqe added a commit that referenced this pull request Feb 27, 2025
* Problem: unable to resolve octokit action v2.0.0 (#1750)

for more info, https://github.com/crypto-org-chain/cronos/actions/runs/13386690642

* Problem: conflict of index uniqueness constrain violation on trace api (#1753)

* Problem: conflict of index uniqueness constrain violation on trace api

* test

* update deps

* bump go

* Problem: slices in ReadOptions is freed by gc while referenced in rocksdb (#1751)

* Problem: no deallocate read options

* doc

* sync deps

* add doc

* Problem: ReadOptions mutated by reference release in iterator fix is not included

* deps
@coderabbitai coderabbitai bot mentioned this pull request Sep 3, 2025
13 tasks
@coderabbitai coderabbitai bot mentioned this pull request Sep 25, 2025
13 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 4, 2025
13 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jan 13, 2026
13 tasks
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