Skip to content

chore: upgrade libp2p package#240

Merged
b00f merged 2 commits into
pactus-project:mainfrom
mcmxcdev:chore/238-upgrade-libp2p-package
Jan 6, 2022
Merged

chore: upgrade libp2p package#240
b00f merged 2 commits into
pactus-project:mainfrom
mcmxcdev:chore/238-upgrade-libp2p-package

Conversation

@mcmxcdev

@mcmxcdev mcmxcdev commented Jan 5, 2022

Copy link
Copy Markdown

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

codecov Bot commented Jan 5, 2022

Copy link
Copy Markdown

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

mcmxcdev commented Jan 5, 2022

Copy link
Copy Markdown
Author

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

b00f commented Jan 5, 2022

Copy link
Copy Markdown
Collaborator

@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

mcmxcdev commented Jan 5, 2022

Copy link
Copy Markdown
Author

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