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

Chore: Upgrade Ristretto #4343

Closed
wants to merge 1 commit into from
Closed

Conversation

jimjbrettj
Copy link
Contributor

Changes

We were receiving this output when building
#9 29.99 go: warning: github.com/dgraph-io/[email protected]: retracted by module author: we retract v1.0.0 because v0.2.0 is not backwards compatible with v1.0.0. #9 29.99 go: to switch to the latest unretracted version, run: #9 29.99 go get github.com/dgraph-io/ristretto@latest

however, so this PR upgrades to the latest nonretracted version and makes it compatible with the new version

Tests

go test -tags integration github.com/ChainSafe/gossamer

Issues

@@ -10,7 +10,7 @@ require (
github.com/cockroachdb/pebble v1.1.2
github.com/cosmos/go-bip39 v1.0.0
github.com/dgraph-io/badger/v4 v4.4.0
github.com/dgraph-io/ristretto v1.0.0
Copy link
Member

Choose a reason for hiding this comment

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

we are downgrading the ristretto version, should we not upgrade to v2.0.0?

Copy link
Contributor

Choose a reason for hiding this comment

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

The hint in the warning is misleading in this case, since go get github.com/dgraph-io/ristretto@latest will only fetch versions below v2. Go modules with major versions above 1 need to have a different import path (in this case github.com/dgraph-io/ristretto/v2).

Turns out we already have github.com/dgraph-io/ristretto/v2 as an indirect dependency in go.mod. It came in with the upgrade of github.com/dgraph-io/badger/v4 a few days ago.

So what we should do in this PR is add v2 to the import paths in all files that use Ristretto and run go mod tidy to remove the reference to github.com/dgraph-io/ristretto and change the reference to github.com/dgraph-io/ristretto/v2 to a direct dependency.

FWIW, when I just did that on current development, I did not need the code updates in this PR.

@haikoschol
Copy link
Contributor

replaced by #4347

@haikoschol haikoschol closed this Nov 27, 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.

3 participants