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

update dependency on libp2p from 0.14.4 to 0.38.1 #327

Merged
merged 3 commits into from
Jan 18, 2025

Conversation

hayarobi
Copy link
Member

=== commit message

  • Fixed code that was not backward compatible due to the interface change.
  • Fixed failed unit tests.
  • Regenerate mock classes with newer gomock version.
  • Improved documents of code generations of mock classes.

@hayarobi hayarobi added check hardfork Run sync test with the PR refactoring labels Nov 28, 2023
@kroggen
Copy link
Member

kroggen commented Nov 28, 2023

The branch from #328 can be merged together with this one into a new branch to run the sync test

So both can be tested at the same time

@hayarobi
Copy link
Member Author

The branch from #328 can be merged together with this one into a new branch to run the sync test

So both can be tested at the same time

I will rebase my commits on #328 and add some more fixes. The default security policy of libp2p looks stronger, so it prevent connection to node of old versions of libp2p.

@kroggen kroggen mentioned this pull request Dec 1, 2023
@hayarobi
Copy link
Member Author

hayarobi commented Dec 5, 2023

There found critical backward incompatibility in libp2p-v0.32.1. I will try to apply intermediate version for smooth upgrade. This PR will be closed, and I will make new PR.

@kroggen
Copy link
Member

kroggen commented Dec 5, 2023

So this means that the update will be made via 2 releases?

@hayarobi
Copy link
Member Author

hayarobi commented Dec 6, 2023

Maybe, or not.
Current version of libp2p requires security layer such as TLS, but the version of libp2p in Aergo doesn't provide it.

I reviewed the libp2p source and decided that there was no way to make the security layer optional. So, at first, the idea was to release an intermediate version that optionally supported the security layer, wait for all nodes accessing the public chain to be replaced with that release, and then release a new version with a current libp2p that requires only security layer.

But, I found some intercepter interfaces of libp2p after that. Today, I plan to investigate that intercepters a little more to see if there is a way to control security settings. If this is possible, it would likely be possible with one release.

@hayarobi hayarobi force-pushed the feature/updateLibP2P branch 2 times, most recently from 8bb7de5 to ca26f63 Compare December 11, 2023 03:00
- Fixed code that was not backward compatible due to the interface change.
- Fixed failed unit tests.
- Regenerate mock classes with newer gomock version.
- Improved documents of code generations of mock classes.
@hayarobi hayarobi force-pushed the feature/updateLibP2P branch from ca26f63 to 43484a6 Compare January 9, 2025 03:43
@@ -7,7 +7,7 @@ package transport

import (
"context"
secio "github.com/libp2p/go-libp2p-secio"
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem"
Copy link
Member

Choose a reason for hiding this comment

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

maybe this line can be moved down, together with the others of libp2p

@@ -10,7 +10,7 @@ import (
"time"

"github.com/aergoio/aergo/v2/types"
core "github.com/libp2p/go-libp2p-core"
core "github.com/libp2p/go-libp2p/core"
Copy link
Member

Choose a reason for hiding this comment

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

"core" at the left is optional

@@ -1,6 +1,7 @@
package p2p

import (
"github.com/libp2p/go-libp2p/core/crypto"
Copy link
Member

Choose a reason for hiding this comment

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

this can be moved down, together with similar imports

@@ -9,7 +9,7 @@ import (
"time"

"github.com/aergoio/aergo/v2/p2p/p2pcommon"
core "github.com/libp2p/go-libp2p-core"
core "github.com/libp2p/go-libp2p/core"
Copy link
Member

Choose a reason for hiding this comment

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

core no longer needed at the left

@hayarobi hayarobi changed the title update dependency on libp2p from 0.4.0 to 0.32.1 update dependency on libp2p from 0.14.4 to 0.38.1 Jan 9, 2025
@hayarobi
Copy link
Member Author

hayarobi commented Jan 9, 2025

Time has passed. During that time, golang has been released twice more version to 1.23. And, libp2p has also been released up to 0.38.1. If this branch is sync with develop, the commit graph becomes too cluttered and difficult to read. So I rebased this branch based on the develop branch.

Copy link
Member

@kroggen kroggen left a comment

Choose a reason for hiding this comment

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

sync tests passed. ready to be merged

@kroggen kroggen merged commit c79cd74 into develop Jan 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
check hardfork Run sync test with the PR refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants