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: check-tx blocks consensus #1660

Merged
merged 6 commits into from
Oct 28, 2024

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Oct 23, 2024

support optional NewConnSyncLocalClientCreator

👮🏻👮🏻👮🏻 !!!! 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

  • Improvements

    • Added support for registering payees and counterparty payees in the relayer precompile.
    • Enhanced transaction verification with support for asynchronous transaction checks.
    • Updated dependencies, including cometbft to version 0.38.13, to improve performance and security.
  • Documentation

    • Updated CHANGELOG to include a new "UNRELEASED" section, documenting recent changes and improvements.

These updates aim to enhance functionality, improve transaction handling, and maintain comprehensive documentation for users.

try `NewConnSyncLocalClientCreator`
@yihuang yihuang changed the title Problem: check tx blocks consensus Problem: check-tx blocks consensus Oct 23, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.17%. Comparing base (27f1a59) to head (9ecf926).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1660   +/-   ##
=======================================
  Coverage   35.17%   35.17%           
=======================================
  Files         123      123           
  Lines       11740    11740           
=======================================
  Hits         4129     4129           
  Misses       7197     7197           
  Partials      414      414           

Copy link
Contributor

coderabbitai bot commented Oct 28, 2024

Walkthrough

The pull request introduces updates across several files, including the addition of a new "UNRELEASED" section in CHANGELOG.md to document improvements in asynchronous transaction checking. The go.mod file has been updated for dependency management, including version updates and replacements for several packages. Similarly, gomod2nix.toml reflects changes in module dependencies. Lastly, a modification in testground/benchmark/benchmark/stateless.py adds the --async-check-tx flag to the command for starting the cronosd node.

Changes

File Change Summary
CHANGELOG.md New section "UNRELEASED" added; noted feature for registering payees linked to PR #1665; improvements for async transaction checks linked to PR #1660; cometbft update linked to PR #1664.
go.mod Updated Go toolchain from go1.22.3 to go1.23.1; various dependency updates and replacements.
gomod2nix.toml Updated versions and hashes for multiple Go modules, including github.com/evmos/ethermint.
testground/benchmark/benchmark/stateless.py Added --async-check-tx flag to cronosd startup command.

Possibly related PRs

Suggested reviewers

  • calvinaco
  • devashishdxt
  • mmsqe

Poem

🐰 In the meadow, changes bloom,
With async checks, we clear the gloom.
Dependencies dance, versions align,
In our code, the stars brightly shine.
Hopping forward, we embrace the new,
A brighter path for all to pursue! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 02c1a1c and 9ecf926.

⛔ 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)
  • gomod2nix.toml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • CHANGELOG.md
  • go.mod
  • gomod2nix.toml

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.

@yihuang yihuang marked this pull request as ready for review October 28, 2024 03:02
@yihuang yihuang requested a review from a team as a code owner October 28, 2024 03:02
@yihuang yihuang requested review from JayT106 and devashishdxt and removed request for a team October 28, 2024 03:02
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

🧹 Outside diff range and nitpick comments (2)
testground/benchmark/benchmark/stateless.py (1)

289-289: Document the async-check-tx feature flag.

The --async-check-tx flag appears to be a new feature for asynchronous transaction checking. Please update the documentation to explain:

  1. The purpose and behavior of this flag
  2. When it should be used
  3. Any performance implications or trade-offs
go.mod (1)

Line range hint 277-285: Address TODO comments in dependency replacements

There are several TODO comments indicating temporary solutions:

  1. Remove deprecated jwt-go: Remove dgrijalva/jwt-go go-mod replace cosmos/cosmos-sdk#13134
  2. Fix upstream vulnerabilities: Remove go.mod replace line for gin-gonic/gin cosmos/cosmos-sdk#10409

Consider creating tracking issues for these items to ensure they're addressed in future updates.

Would you like me to create GitHub issues to track these TODOs?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 7dd3362 and 02c1a1c.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • CHANGELOG.md (1 hunks)
  • go.mod (1 hunks)
  • gomod2nix.toml (1 hunks)
  • testground/benchmark/benchmark/stateless.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🔇 Additional comments (6)
testground/benchmark/benchmark/stateless.py (2)

289-289: Verify the impact of async transaction checking on benchmark results.

The addition of --async-check-tx flag could significantly affect transaction processing behavior and benchmark measurements. Please ensure that:

  1. The benchmark results with this flag are compared against the baseline (without the flag)
  2. Any performance differences are documented

Consider adding a configuration option to toggle this flag during benchmarks to facilitate comparison testing.


289-289: Verify the behavior of async transaction checking.

Since this is a test environment, we should verify that the async transaction checking behaves correctly:

  1. Ensure transactions are still processed correctly
  2. Verify error handling works as expected
  3. Check for any potential race conditions
✅ Verification successful

Based on the search results, I can now provide a final response:

Async transaction checking is a supported experimental feature with proper implementation

The code search reveals that:

  1. The async-check-tx flag is properly implemented in Ethermint's server code as an experimental feature
  2. The feature is integrated with the standard transaction processing pipeline:
    • Has proper flag registration in server startup
    • Integrates with the ante handler chain for transaction verification
    • Works alongside existing transaction validation mechanisms
  3. The test environment uses this feature as part of a controlled test setup, which is appropriate for performance testing

The implementation appears to be properly integrated into the transaction processing pipeline while maintaining all necessary validation steps. The experimental flag is appropriately documented and logged when enabled.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for related test cases and error handling
# Test: Look for test files that verify async transaction checking
rg -g "**/*_test*" -A 5 "async.*check.*tx"

# Test: Look for error handling related to async transaction checking
rg -g "**/*.go" -A 5 "async.*check.*tx.*err"

Length of output: 91


Script:

#!/bin/bash
# Let's try different search patterns and look more broadly at the codebase

# Search for any mentions of async check tx in configuration or documentation
rg -g "!{.git,vendor}/*" "async-check-tx"

# Look for any transaction checking related code
rg -g "**/*.{go,py}" "CheckTx"

# Look specifically in the benchmark directory
fd . testground/benchmark -t f -x cat {} \; 

# Check if there are any test files related to transaction processing
fd test testground/benchmark -t f

Length of output: 307288


Script:

#!/bin/bash
# Let's look for async transaction checking related code and tests
# Search for async transaction checking in Python files
rg -g "*.py" "async.*check.*tx" testground/benchmark/

# Search for async transaction checking in Go files
rg -g "*.go" "async.*check.*tx"

# Look for any test files that might verify transaction behavior
fd test testground/benchmark -t f -x cat {} \;

# Look for any transaction verification or error handling code
rg -g "*.{go,py}" "(verify|check).*tx"

Length of output: 5528

go.mod (3)

Line range hint 3-5: LGTM: Go toolchain update to 1.22.3

The update to Go 1.22.3 is recommended as it includes important security fixes and bug fixes.


276-276: Track ethermint dependency update

The update to ethermint v0.6.1-0.20241028015856-e567c5ad3acf should be monitored for any breaking changes or performance impacts.


Line range hint 6-70: Verify compatibility with updated dependencies

The dependency updates, particularly for ethermint and cosmos-sdk packages, should be thoroughly tested to ensure compatibility.

✅ Verification successful

Dependencies are properly aligned with ecosystem requirements

The dependency updates in go.mod are well-coordinated across the Cosmos ecosystem. The key dependencies like cosmos-sdk, ethermint, and their sub-modules are all using compatible versions. The extensive usage patterns shown in the codebase demonstrate proper integration of these dependencies.

Reasoning:

  1. The codebase shows extensive and proper usage of both cosmos-sdk and ethermint dependencies across multiple packages
  2. The imports follow consistent patterns and use standard interfaces from these dependencies
  3. No conflicting version requirements or compatibility issues are visible in the import statements
  4. The dependency structure maintains compatibility with both Cosmos SDK and Ethereum standards as shown by the imports
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any compatibility issues in the dependency graph

# Test: Check for any dependency conflicts
go mod verify

# Test: Check for any indirect dependency issues
go mod tidy -v

Length of output: 172


Script:

#!/bin/bash
# Let's analyze the dependencies and their usage in the codebase

# Check for any references to ethermint APIs
rg --type go "github.com/evmos/ethermint" -A 2

# Check for cosmos-sdk version usage patterns
rg --type go "github.com/cosmos/cosmos-sdk" -A 2

# Look for any potential compatibility markers or version constraints
rg -l "// requires cosmos-sdk.*" --type go
rg -l "// requires ethermint.*" --type go

# Check for any compatibility notes in documentation
fd -e md | xargs rg -i "compatibility|requirement"

Length of output: 251921

gomod2nix.toml (1)

265-266: Verify ethermint dependency update.

The ethermint module update appears to be a minor version bump. Please ensure this update includes the necessary changes to support the NewConnSyncLocalClientCreator feature mentioned in the PR objectives.

@yihuang yihuang requested a review from mmsqe October 28, 2024 03:33
@yihuang yihuang added this pull request to the merge queue Oct 28, 2024
@yihuang yihuang removed this pull request from the merge queue due to a manual request Oct 28, 2024
@yihuang yihuang added this pull request to the merge queue Oct 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 28, 2024
@yihuang yihuang added this pull request to the merge queue Oct 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 28, 2024
@yihuang yihuang added this pull request to the merge queue Oct 28, 2024
Merged via the queue into crypto-org-chain:main with commit 6de40de Oct 28, 2024
44 checks passed
@yihuang yihuang deleted the async-check-tx branch October 28, 2024 06:58
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