Skip to content

op-node: update to latest libp2p, update deps, Go 1.19 linting [bedrock]#3194

Merged
mslipper merged 2 commits intodevelopfrom
update-p2p
Aug 10, 2022
Merged

op-node: update to latest libp2p, update deps, Go 1.19 linting [bedrock]#3194
mslipper merged 2 commits intodevelopfrom
update-p2p

Conversation

@protolambda
Copy link
Contributor

@protolambda protolambda commented Aug 9, 2022

This fully updates the op-node dependencies, including an update from libp2p v0.18.1 to v0.21.0, and libp2p-core v0.15.0 to v0.19.1.

In this range of libp2p updates a lot of packages were moved into their monorepo, and the libp2p crypto package uses a version of btcec now that wraps the decred crypto lib (much faster secp256k1 in Go). This required some updates in the way we configure libp2p and load/handle p2p keys.

These updates help move away from indirect dependencies that were broken in Go 1.19, enabling the newest Go ci linting to work again (I was unable to run old lint tooling on Go 1.19 due to the dependency error) + Go 1.19 linting is fixed (they have some doc format rules now).

Fix ENG-2556

@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2022

⚠️ No Changeset found

Latest commit: ee9cc05

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mergify
Copy link
Contributor

mergify bot commented Aug 9, 2022

This PR changes implementation code, but doesn't include a changeset. Did you forget to add one?

@tynes
Copy link
Contributor

tynes commented Aug 9, 2022

For some reason, the devnet is flaky - I was not experiencing this before but now it sometimes hangs

@protolambda
Copy link
Contributor Author

rebased, hope devnet CI is less flaky now

"time"

"github.com/btcsuite/btcd/btcec/v2"
decredSecp "github.com/decred/dcrd/dcrec/secp256k1/v4"
Copy link
Contributor

@tynes tynes Aug 9, 2022

Choose a reason for hiding this comment

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

Why decred, btcd and geth ecc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Summary of the secp256k1 Go crypto situation:

  • libp2p updated from btcd/btcec to btcd/btcec v2
  • btcd/btcec v1 wrapped Go ecdsa
  • btcd/btcec v2 wraps decred
  • decred is faster, and thus btcd updated
  • btcd earlier also went from monolithic releases to per-module go releases, and had versioning mistakes in v1. These were fixed with beta versions / new releases eventually, but end-users started looking to update to v2.
  • geth uses a C library for secp256k1, and uses Go ecdsa curve types to integrate that into Go (but use their own instance of the curve definitions, same values, but not same memory address, making shallow equality checks not work...)
  • decred has functions to convert to Go ecdsa types
  • After type casting the general libp2p pubkey/privkey interface to a concrete type, it can be casted to the underlying types (btcd, decred) to use their functionality to convert to Go ecdsa, and then you can swap the curve instance to point to the one by geth for the shallow equality checks in the Geth discovery v5 package to work.

@mslipper mslipper merged commit 320155d into develop Aug 10, 2022
@mslipper mslipper deleted the update-p2p branch August 10, 2022 15:04
roninjin10 pushed a commit that referenced this pull request Aug 26, 2022
…ck] (#3194)

* op-node: go 1.19 linting, update libp2p deps

* specs/meta: update go linting instructions
maurelian pushed a commit that referenced this pull request Sep 15, 2022
…ck] (#3194)

* op-node: go 1.19 linting, update libp2p deps

* specs/meta: update go linting instructions
sam-goldman pushed a commit that referenced this pull request Sep 15, 2022
…ck] (#3194)

* op-node: go 1.19 linting, update libp2p deps

* specs/meta: update go linting instructions
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