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 libp2p package #240

Merged
merged 2 commits into from
Jan 6, 2022
Merged

chore: upgrade libp2p package #240

merged 2 commits into from
Jan 6, 2022

Conversation

mcmxcdev
Copy link
Contributor

@mcmxcdev mcmxcdev commented Jan 5, 2022

Description

  • upgrade go-libp2p and its related libs
  • update method calls due to go-libp2p version upgrade
  • remove duplicate sync import in network.go
  • run go mod tidy
  • update go version in testing.yml to 1.17
  • update docker container to use alpine 3.15

Please note that lp2pdiscovery is updated to use the mdns_legacy module which keeps compatibility with the current code.
There is also mdns which should probably be used instead when refactoring the code.

Related issue(s)

Closes #238

Checklist

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • My code follows the code style of this project.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • CHANGELOG is updated.

- upgrade go-libp2p and its related libs
- update method calls due to go-libp2p version upgrade
- remove duplicate sync import in network.go
- run go mod tidy
@codecov
Copy link

codecov bot commented Jan 5, 2022

Codecov Report

Merging #240 (ed27457) into main (01ca59d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #240   +/-   ##
=======================================
  Coverage   81.49%   81.49%           
=======================================
  Files         125      125           
  Lines        5052     5052           
=======================================
  Hits         4117     4117           
  Misses        690      690           
  Partials      245      245           

@mcmxcdev
Copy link
Contributor Author

mcmxcdev commented Jan 5, 2022

make docker is probably failing due to https://github.com/lucas-clemente/quic-go only supporting go 1.16 and higher I assume, while the docker image is using go 1.15

make unit_test is passing for me locally, but fails in the CI, any idea why? It might also be related to the newer go version locally than in the CI.

I probably caused these incompatibilities by running go mod tidy?

@b00f
Copy link
Collaborator

b00f commented Jan 5, 2022

@mhatvan

You can update alpine version inside dockerfile to support go version 17:

FROM alpine:3.15 as builder

RUN apk add --no-cache git go gmp-dev build-base g++ openssl-dev
RUN go version
...

About the mDNS legacy version, they have plan to remove it. Look at here: https://github.com/libp2p/go-libp2p/pull/1192/files
It's better to not use it anymore.

I probably caused these incompatibilities by running go mod tidy?

Shouldn't be. Updating go version in workflow should fix it: https://github.com/zarbchain/zarb-go/blob/01ca59d44f778a7fbeb2de02debbddcd91909f91/.github/workflows/testing.yml#L15

go-version: 1.17.x

- update alpine docker container to use 3.15
@mcmxcdev
Copy link
Contributor Author

mcmxcdev commented Jan 5, 2022

About the mDNS legacy version, they have plan to remove it. Look at here: libp2p/go-libp2p#1192 (files)
It's better to not use it anymore.

I tried to update the respective code but don't know how exactly. I would hand this over to you.

@b00f b00f merged commit 971a011 into pactus-project:main Jan 6, 2022
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.

Upgrading libp2p package
2 participants