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

bump: CometBFT to update txindex pruning strategy #84

Merged
merged 2 commits into from
Dec 17, 2024
Merged

bump: CometBFT to update txindex pruning strategy #84

merged 2 commits into from
Dec 17, 2024

Conversation

beer-1
Copy link
Member

@beer-1 beer-1 commented Dec 3, 2024

Description

Previously, we did not prune the tx.height, tx.hash, or block.height, even though we set [txindex].retain-height to a non-zero value. This resulted in the continuous accumulation of transaction indexing data. To prevent the need for state synchronization every few days, we've decided to remove the practice of indefinitely increasing transaction indexing data.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Updated dependencies for improved functionality and compatibility.
    • Transitioned to a maintained alternative for JWT handling due to deprecation of an older module.
    • Updated github.com/gin-gonic/gin to address a vulnerability.
  • Bug Fixes

    • Addressed issues related to outdated dependencies to enhance stability.

@beer-1 beer-1 self-assigned this Dec 3, 2024
@beer-1 beer-1 requested a review from a team as a code owner December 3, 2024 09:52
Copy link

coderabbitai bot commented Dec 3, 2024

Walkthrough

The pull request includes significant updates to the go.mod file, primarily focusing on dependency version changes and module replacements. The Go toolchain version has been upgraded from go1.22.7 to go1.23.0. Several dependencies, including github.com/cometbft/cometbft, github.com/cosmos/iavl, and github.com/golang-jwt/jwt/v4, have had their versions updated to ensure compatibility and functionality. Additionally, there is a note regarding the deprecation of github.com/dgrijalva/jwt-go, advising a transition to a maintained alternative.

Changes

File Change Summary
go.mod - Updated Go toolchain from go1.22.7 to go1.23.0
- Updated github.com/cometbft/cometbft from v0.0.0-20241104064728-ef8cadf1bed8 to v0.0.0-20241209060054-203460274117
- Updated github.com/cosmos/iavl to version v1.1.4
- Updated github.com/golang-jwt/jwt/v4 to version v4.4.2
- Updated github.com/gin-gonic/gin to version v1.9.1 to address a vulnerability
- Note on deprecation of github.com/dgrijalva/jwt-go and transition to github.com/golang-jwt/jwt/v4

Possibly related PRs

  • bump wasm versions #62: This PR updates the go.mod file, including changes to the github.com/cosmos/iavl dependency, which is also updated in the main PR.
  • bump deps #78: This PR updates the go.mod file and includes a change to the Go version, which aligns with the Go version update in the main PR.
  • bump: initia deps #83: This PR updates the go.mod file with changes to the github.com/cometbft/cometbft dependency, which is also referenced in the main PR.

🐰 In the meadow, hop and play,
New versions come to brighten the day!
Dependencies fresh, all in a row,
With updates that help our project grow.
So here’s to the code, let’s give a cheer,
For every change brings us near! ✨


🪧 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. (Experiment)
  • @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.

@beer-1 beer-1 changed the title bump: cometbft to update txindex prune strategy bump: CometBFT to update txindex pruning strategy Dec 3, 2024
@beer-1 beer-1 requested a review from Vritra4 December 4, 2024 07:13
Copy link

@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 (3)
go.mod (3)

286-286: Consider upstreaming custom changes for maintainability

Using a custom fork can lead to maintenance challenges. If possible, consider contributing your txindex pruning enhancements back to the upstream github.com/cometbft/cometbft repository. This will help reduce technical debt and benefit the wider community.


Line range hint 291-291: Monitor pending PRs for module replacements

The replacement of github.com/strangelove-ventures/cometbft-client with github.com/initia-labs/cometbft-client is temporary until the linked PR is merged. Keep track of the PR status and update the replacement accordingly once it's merged to maintain alignment with the upstream.


Line range hint 294-294: Re-evaluate the gRPC version downgrade

You have downgraded google.golang.org/grpc to version v1.65.0 due to an issue with cosmos/relayer. Check if the issue has been resolved in newer versions of gRPC to benefit from the latest features, performance improvements, and security patches.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4e27f9e and 6bec7ee.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod (1 hunks)
🔇 Additional comments (2)
go.mod (2)

287-287: Verify compatibility with custom IBC-Go module

You have replaced github.com/cosmos/ibc-go/v8 with github.com/initia-labs/ibc-go/v8. Ensure that this custom version is compatible with your codebase and that any custom changes are thoroughly tested.

Run the following script to check for any potential issues:

✅ Verification successful

Let me gather more information about the specific changes in the custom IBC-Go fork to better assess compatibility.


Let me check one more thing to verify if there are any significant modifications in the custom fork by examining the commit hash.


Based on the gathered information, I can now provide the final response:

Custom IBC-Go fork appears compatible with standard usage patterns

The custom fork maintains standard IBC-Go v8 interfaces as evidenced by:

  • All imports in the codebase use standard IBC-Go paths and types
  • The fork adds a post-update handler without breaking existing functionality
  • Core IBC components (transfer, ICA, hooks) are used in a standard way
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usages of the IBC-Go module and verify compatibility.

# List all files importing the IBC-Go module
rg 'github.com/cosmos/ibc-go/v8' --files-with-matches

# Confirm the custom module is correctly referenced
grep -rn 'github.com/initia-labs/ibc-go/v8' go.mod

Length of output: 590


Script:

#!/bin/bash
# Check the differences in imports and usage patterns
rg "github.com/cosmos/ibc-go/v8" -A 2 app/app.go app/modules.go

# Check for any potential breaking changes or custom implementations
rg "github.com/cosmos/ibc-go/v8" -A 2 app/ibc-hooks/

# Check go.sum for version information
grep "github.com/initia-labs/ibc-go/v8" go.sum

Length of output: 5062


Script:

#!/bin/bash
# Get the repository information and commit details
gh repo view github.com/initia-labs/ibc-go --json description,defaultBranch
gh api repos/initia-labs/ibc-go/commits/19c0b4ad450d --jq '.commit.message'

Length of output: 1321


286-286: Ensure the custom CometBFT module includes txindex pruning changes

You have replaced github.com/cometbft/cometbft with a custom fork github.com/initia-labs/cometbft at a specific commit. Verify that this custom module includes the necessary txindex pruning functionality to address the transaction indexing data accumulation issue.

Run the following script to confirm that the txindex pruning changes are present in the custom module:

@beer-1 beer-1 merged commit 0b25b17 into main Dec 17, 2024
7 checks passed
@beer-1 beer-1 deleted the bump/deps branch December 17, 2024 03:05
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