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

fix: tag cosmos-sdk to enable async pruning #8923

Merged
merged 2 commits into from
Jan 7, 2025
Merged

Conversation

PaddyMc
Copy link
Collaborator

@PaddyMc PaddyMc commented Jan 7, 2025

What is the purpose of the change

Because of a replace directive in our go mod, we don't use async pruning. This PR updates the store replace to point to a newly created tag v1.1.1-v0.50.11-v28-osmo see: https://github.com/osmosis-labs/cosmos-sdk/releases/tag/store/v1.1.1-v0.50.11-v28-osmo

Testing and Verifying

  • Review code and debug through to ensure async pruning is enabled and ensure state compat.
    e.g
> [Breakpoint 3] github.com/cosmos/iavl.newNodeDB() /home/ghost/go/pkg/mod/github.com/cosmos/iavl@v1.2.2/nodedb.go:122 (hits goroutine(1):1 total:1) (PC: 0x46bac37)
   117:			versionReaders:      make(map[int64]uint32, 8),
   118:			storageVersion:      string(storeVersion),
   119:			chCommitting:        make(chan struct{}, 1),
   120:		}
   121:	
=> 122:		if opts.AsyncPruning {
   123:			ndb.done = make(chan struct{})
   124:			go ndb.startPruning()
   125:		}
   126:	
   127:		return ndb
(dlv) p opts
github.com/cosmos/iavl.Options {
	Sync: false,
	InitialVersion: 0,
	Stat: *github.com/cosmos/iavl.Statistics nil,
	FlushThreshold: 100000,
	AsyncPruning: false,}
### create a profile of the cpu
curl --output profile.out http://localhost:6060/debug/pprof/profile\?seconds\=30

### inspect the profile using the browser localhost:9999
go tool pprof -http :9999 -edgefraction 0 -nodefraction 0 -nodecount 100000 profile.out

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Important Notice

This PR modifies an in-repo Go module. It is one of:

  • osmomath
  • osmoutils
  • x/ibc-hooks
  • x/epochs

The dependent Go modules, especially the root one, will have to be
updated to reflect the changes. Failing to do so might cause e2e to fail.

Please follow the instructions below:

  1. Open https://github.com/osmosis-labs/osmosis/actions/workflows/go-mod-auto-bump.yml
  2. Provide the current branch name
  3. On success, confirm if an automated commit corretly updated the go.mod and go.sum files

Please let us know if you need any help.

@PaddyMc PaddyMc added A:backport/v28.x backport patches to v28.x branch V:state/compatible/backport State machine compatible PR, should be backported labels Jan 7, 2025
Copy link
Contributor

coderabbitai bot commented Jan 7, 2025

Walkthrough

The pull request involves updating the CHANGELOG.md file with a new entry for version v28.0.1 in the "State Compatible" section. The change documents a fix related to tagging the osmosis-labs/cosmos-sdk store (pull request #8923) to enable asynchronous pruning. This is a documentation update that tracks a specific improvement in the project's dependencies.

Changes

File Change Summary
CHANGELOG.md Added a new entry under v28.0.1 "State Compatible" section referencing PR #8923 about tagging cosmos-sdk store to enable async pruning

Note: No code changes or modifications to exported/public entities were made in this pull request.


📜 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 2beed45 and 823afcf.

⛔ Files ignored due to path filters (4)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
  • osmoutils/go.mod is excluded by !**/*.mod
  • osmoutils/go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: go-split-test-files
  • GitHub Check: e2e
  • GitHub Check: osmosisd-linux-arm64
  • GitHub Check: osmosisd-darwin-arm64
  • GitHub Check: osmosisd-linux-amd64
  • GitHub Check: osmosisd-darwin-amd64
  • GitHub Check: check-proto
  • GitHub Check: Run golangci-lint
  • GitHub Check: test
  • GitHub Check: Summary
🔇 Additional comments (2)
CHANGELOG.md (2)

59-59: LGTM! The changelog entry follows the standard format.

The entry correctly documents:


Line range hint 1-1000: Verify the async pruning functionality.

Since this change enables async pruning by updating the cosmos-sdk store tag, we should verify that async pruning is working as expected.

✅ Verification successful

Async pruning is correctly implemented via SDK store tag update

The async pruning functionality is implemented at the SDK level and enabled through the cosmos-sdk store tag update. This is a state-compatible change that affects how pruning is performed without modifying the state itself. The feature is properly documented in the changelog for both v24.0.1 and v23.0.12-iavl-v1, and no additional configuration is required as it's handled automatically by the SDK version update.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the async pruning configuration and tag version

# Check if the new tag is being used in go.mod
echo "Checking cosmos-sdk version and replace directive..."
rg "github.com/osmosis-labs/cosmos-sdk" --type go

# Check if async pruning is enabled in app.toml
echo "Checking async pruning configuration..."
rg "pruning.*async" --type toml

Length of output: 287


Script:

#!/bin/bash
# Search for PR #7994 content and IAVL/pruning related changes

# Look for the PR content
echo "Searching for PR #7994 content..."
rg "#7994" -A 5 -B 5

# Search for IAVL v1 and pruning related changes
echo "Searching for IAVL and pruning related files..."
fd -t f -e go -e toml . | rg -i "iavl|pruning|store"

# Check for any pruning configuration in config files
echo "Checking configuration files..."
fd -t f -e toml . | xargs rg "pruning"

# Look for store version/tag changes
echo "Checking store version changes..."
rg "store.*v1" --type go

Length of output: 2576


Script:

#!/bin/bash
# Search for IAVL v1 implementation details and upgrade handlers

# Look for IAVL v1 related files
echo "Searching for IAVL v1 implementation..."
rg -g "*.go" -l "iavl.*v1"

# Search for upgrade handlers related to IAVL/pruning
echo "Searching for upgrade handlers..."
rg -g "*.go" "func.*Upgrade.*Handler" -A 10 -B 2

# Look for any IAVL store configuration
echo "Checking for IAVL store configuration..."
find . -type f -exec grep -l "iavl" {} \;

# Check for any pruning configuration in app setup
echo "Checking app setup for pruning configuration..."
rg -g "*.go" "NewBaseApp|pruning" app/

Length of output: 26813


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
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Super confusing we ran in to this

@ValarDragon ValarDragon merged commit 5fe6bd9 into main Jan 7, 2025
1 check passed
@ValarDragon ValarDragon deleted the fix/async-pruning branch January 7, 2025 14:54
mergify bot pushed a commit that referenced this pull request Jan 7, 2025
* fix: tag cosmos-sdk to enable async pruning

* chore: update CHANGELOG.md

(cherry picked from commit 5fe6bd9)
PaddyMc added a commit that referenced this pull request Jan 7, 2025
* fix: tag cosmos-sdk to enable async pruning

* chore: update CHANGELOG.md

(cherry picked from commit 5fe6bd9)

Co-authored-by: PaddyMc <paddymchale@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v28.x backport patches to v28.x branch V:state/compatible/backport State machine compatible PR, should be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants