Skip to content

Commit

Permalink
go.mods: rm libp2p; rm btcd replace (#11502)
Browse files Browse the repository at this point in the history
* go.mods: drop btcd replace; upgrade libp2p

* Replace deprecated call to btcd API for secp256k1 constant

* Fix comment describing sqrtPower calculation

* Change calculation of sqrtPower to standard order of operations

* rm libp2p peer & crypto uses

---------

Co-authored-by: Alex Coventry <coventry@smartcontract.com>
  • Loading branch information
jmank88 and coventry authored Dec 11, 2023
1 parent 500a4db commit 120bef7
Show file tree
Hide file tree
Showing 42 changed files with 204 additions and 836 deletions.
4 changes: 0 additions & 4 deletions charts/chainlink-cluster/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,6 @@ require (
)

replace (
// Fixes go mod tidy issue for ambiguous imports from go-ethereum
// See https://github.com/ugorji/go/issues/279
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.1

github.com/go-kit/log => github.com/go-kit/log v0.2.1

// replicating the replace directive on cosmos SDK
Expand Down
4 changes: 1 addition & 3 deletions core/internal/cltest/cltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/google/uuid"
"github.com/gorilla/securecookie"
"github.com/gorilla/sessions"
p2ppeer "github.com/libp2p/go-libp2p-core/peer"
"github.com/manyminds/api2go/jsonapi"
"github.com/onsi/gomega"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -141,11 +140,10 @@ func init() {
fmt.Printf("[gin] %-6s %-25s --> %s (%d handlers)\n", httpMethod, absolutePath, handlerName, nuHandlers)
}

defaultP2PPeerID, err := p2ppeer.Decode(configtest.DefaultPeerID)
err := DefaultP2PPeerID.UnmarshalString(configtest.DefaultPeerID)
if err != nil {
panic(err)
}
DefaultP2PPeerID = p2pkey.PeerID(defaultP2PPeerID)
}

func NewRandomPositiveInt64() int64 {
Expand Down
6 changes: 3 additions & 3 deletions core/internal/cltest/factories.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/google/uuid"
p2ppeer "github.com/libp2p/go-libp2p-core/peer"
ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types"
"github.com/stretchr/testify/require"
"github.com/urfave/cli"
"gopkg.in/guregu/null.v4"
Expand Down Expand Up @@ -55,8 +55,8 @@ func NewEIP55Address() ethkey.EIP55Address {
return e
}

func NewPeerID() p2ppeer.ID {
id, err := p2ppeer.Decode("12D3KooWL3XJ9EMCyZvmmGXL2LMiVBtrVa2BuESsJiXkSj7333Jw")
func NewPeerID() (id ragep2ptypes.PeerID) {
err := id.UnmarshalText([]byte("12D3KooWL3XJ9EMCyZvmmGXL2LMiVBtrVa2BuESsJiXkSj7333Jw"))
if err != nil {
panic(err)
}
Expand Down
25 changes: 1 addition & 24 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/btcsuite/btcd v0.23.4 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
Expand Down Expand Up @@ -145,7 +144,7 @@ require (
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/go-tpm v0.9.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 // indirect
github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/gorilla/sessions v1.2.2 // indirect
Expand Down Expand Up @@ -174,9 +173,6 @@ require (
github.com/huandu/skiplist v1.2.0 // indirect
github.com/huin/goupnp v1.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ipfs/go-cid v0.0.7 // indirect
github.com/ipfs/go-log v1.0.4 // indirect
github.com/ipfs/go-log/v2 v2.1.1 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
Expand All @@ -198,18 +194,13 @@ require (
github.com/leodido/go-urn v1.2.4 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-libp2p-core v0.8.5 // indirect
github.com/libp2p/go-libp2p-peerstore v0.2.7 // indirect
github.com/libp2p/go-openssl v0.0.7 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/minio/sha256-simd v0.1.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand All @@ -218,14 +209,6 @@ require (
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr v0.3.3 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multiaddr-net v0.2.0 // indirect
github.com/multiformats/go-multibase v0.0.3 // indirect
github.com/multiformats/go-multihash v0.0.14 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
Expand Down Expand Up @@ -263,8 +246,6 @@ require (
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect
github.com/smartcontractkit/wsrpc v0.7.2 // indirect
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand Down Expand Up @@ -335,10 +316,6 @@ require (
)

replace (
// Fix go mod tidy issue for ambiguous imports from go-ethereum
// See https://github.com/ugorji/go/issues/279
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.1

// replicating the replace directive on cosmos SDK
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

Expand Down
Loading

0 comments on commit 120bef7

Please sign in to comment.