Skip to content

Commit

Permalink
Upgrade libp2p v0.22.0 (#180)
Browse files Browse the repository at this point in the history
# Description

* upgrade libp2p to v0.22
* fix golang 1.19 build

# Changes include

- [x] Bugfix (non-breaking change that solves an issue)

# Breaking changes

* libp2p compatible across versions 

## Testing

- [x] I have tested this code with the official test suite
  • Loading branch information
0xcb9ff9 authored Feb 13, 2023
1 parent d19d400 commit ae617e5
Show file tree
Hide file tree
Showing 50 changed files with 257 additions and 591 deletions.
4 changes: 2 additions & 2 deletions command/loadbot/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
cmap "github.com/dogechain-lab/dogechain/helper/concurrentmap"
"github.com/dogechain-lab/dogechain/helper/tests"
txpoolOp "github.com/dogechain-lab/dogechain/txpool/proto"
"github.com/golang/protobuf/ptypes/any"
"github.com/umbracle/go-web3/jsonrpc"
"google.golang.org/protobuf/types/known/anypb"

"github.com/dogechain-lab/dogechain/types"
"github.com/umbracle/go-web3"
Expand Down Expand Up @@ -325,7 +325,7 @@ func (l *Loadbot) executeTxn(
}

addReq := &txpoolOp.AddTxnReq{
Raw: &any.Any{
Raw: &anypb.Any{
Value: txn.MarshalRLP(),
},
From: types.ZeroAddress.String(),
Expand Down
4 changes: 2 additions & 2 deletions command/secrets/init/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/dogechain-lab/dogechain/crypto"
"github.com/dogechain-lab/dogechain/secrets"
"github.com/dogechain-lab/dogechain/secrets/helper"
libp2pCrypto "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
libp2pCrypto "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions command/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"time"

"github.com/dogechain-lab/dogechain/command"
"github.com/golang/protobuf/ptypes/empty"
"github.com/spf13/cobra"
"google.golang.org/protobuf/types/known/emptypb"

"github.com/dogechain-lab/dogechain/command/helper"
"github.com/dogechain-lab/dogechain/server/proto"
Expand Down Expand Up @@ -56,5 +56,5 @@ func getSystemStatus(grpcAddress string) (*proto.ServerStatus, error) {
return nil, err
}

return client.GetStatus(context.Background(), &empty.Empty{})
return client.GetStatus(context.Background(), &emptypb.Empty{})
}
2 changes: 1 addition & 1 deletion consensus/ibft/ibft.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/dogechain-lab/dogechain/state"
"github.com/dogechain-lab/dogechain/types"
"github.com/hashicorp/go-hclog"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"go.uber.org/atomic"
"google.golang.org/grpc"
anypb "google.golang.org/protobuf/types/known/anypb"
Expand Down
2 changes: 1 addition & 1 deletion e2e/framework/testserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
txpoolProto "github.com/dogechain-lab/dogechain/txpool/proto"
"github.com/dogechain-lab/dogechain/types"
"github.com/hashicorp/go-hclog"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/umbracle/go-web3"
"github.com/umbracle/go-web3/jsonrpc"
"google.golang.org/grpc"
Expand Down
4 changes: 2 additions & 2 deletions e2e/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"time"

"github.com/dogechain-lab/dogechain/command"
"google.golang.org/protobuf/types/known/anypb"

"github.com/dogechain-lab/dogechain/crypto"
"github.com/dogechain-lab/dogechain/e2e/framework"
"github.com/dogechain-lab/dogechain/helper/tests"
txpoolOp "github.com/dogechain-lab/dogechain/txpool/proto"
"github.com/dogechain-lab/dogechain/types"
"github.com/golang/protobuf/ptypes/any"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -103,7 +103,7 @@ func TestCustomBlockGasLimitPropagation(t *testing.T) {
}

_, err = srv.TxnPoolOperator().AddTxn(context.Background(), &txpoolOp.AddTxnReq{
Raw: &any.Any{
Raw: &anypb.Any{
Value: signedTx.MarshalRLP(),
},
From: types.ZeroAddress.String(),
Expand Down
4 changes: 2 additions & 2 deletions e2e/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"github.com/dogechain-lab/dogechain/helper/tests"
txpoolOp "github.com/dogechain-lab/dogechain/txpool/proto"
"github.com/dogechain-lab/dogechain/types"
"github.com/golang/protobuf/ptypes/any"
"github.com/stretchr/testify/assert"
"github.com/umbracle/go-web3"
"github.com/umbracle/go-web3/jsonrpc"
"google.golang.org/protobuf/types/known/anypb"
)

func TestSignedTransaction(t *testing.T) {
Expand Down Expand Up @@ -339,7 +339,7 @@ func addStressTestTxns(
currentNonce++

msg = &txpoolOp.AddTxnReq{
Raw: &any.Any{
Raw: &anypb.Any{
Value: setNameTxn.MarshalRLP(),
},
From: types.ZeroAddress.String(),
Expand Down
14 changes: 7 additions & 7 deletions e2e/txpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"github.com/dogechain-lab/dogechain/txpool"
txpoolOp "github.com/dogechain-lab/dogechain/txpool/proto"
"github.com/dogechain-lab/dogechain/types"
"github.com/golang/protobuf/ptypes/any"
"github.com/stretchr/testify/assert"
"github.com/umbracle/go-web3"
"google.golang.org/protobuf/types/known/anypb"
)

var (
Expand Down Expand Up @@ -56,7 +56,7 @@ func generateTx(params generateTxReqParams) *types.Transaction {

func generateReq(params generateTxReqParams) *txpoolOp.AddTxnReq {
msg := &txpoolOp.AddTxnReq{
Raw: &any.Any{
Raw: &anypb.Any{
Value: generateTx(params).MarshalRLP(),
},
From: types.ZeroAddress.String(),
Expand Down Expand Up @@ -223,7 +223,7 @@ func TestTxPool_TransactionCoalescing(t *testing.T) {

generateReq := func(nonce uint64) *txpoolOp.AddTxnReq {
msg := &txpoolOp.AddTxnReq{
Raw: &any.Any{
Raw: &anypb.Any{
Value: generateTx(nonce).MarshalRLP(),
},
From: types.ZeroAddress.String(),
Expand Down Expand Up @@ -542,7 +542,7 @@ func TestTxPool_RecoverableError(t *testing.T) {
assert.NoError(t, err)

response, err := operator.AddTxn(context.Background(), &txpoolOp.AddTxnReq{
Raw: &any.Any{
Raw: &anypb.Any{
Value: signedTx.MarshalRLP(),
},
From: types.ZeroAddress.String(),
Expand Down Expand Up @@ -710,7 +710,7 @@ func TestTxPool_GreedyPackingStrategy(t *testing.T) {
assert.NoError(t, err)

response, err := operator.AddTxn(context.Background(), &txpoolOp.AddTxnReq{
Raw: &any.Any{
Raw: &anypb.Any{
Value: signedTx.MarshalRLP(),
},
From: types.ZeroAddress.String(),
Expand Down Expand Up @@ -823,7 +823,7 @@ func TestTxPool_ZeroPriceDev(t *testing.T) {
assert.NoError(t, err, "failed to sign transaction")

_, err = operator.AddTxn(ctx, &txpoolOp.AddTxnReq{
Raw: &any.Any{
Raw: &anypb.Any{
Value: tx.MarshalRLP(),
},
From: types.ZeroAddress.String(),
Expand Down Expand Up @@ -899,7 +899,7 @@ func TestTxPool_GetPendingTx(t *testing.T) {

// Add the transaction
response, err := operator.AddTxn(context.Background(), &txpoolOp.AddTxnReq{
Raw: &any.Any{
Raw: &anypb.Any{
Value: signedTx.MarshalRLP(),
},
From: types.ZeroAddress.String(),
Expand Down
109 changes: 45 additions & 64 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/dogechain-lab/dogechain
go 1.17

require (
github.com/btcsuite/btcd v0.22.0-beta
github.com/containerd/cgroups v1.0.2 // indirect
github.com/btcsuite/btcd v0.22.1
github.com/containerd/cgroups v1.0.4 // indirect
//github.com/umbracle/fastrlp v0.0.0-20220529195328-c1416904ae17
github.com/dogechain-lab/fastrlp v0.0.0-20220523073019-b0c60fc6bb7a
github.com/elastic/gosigar v0.14.2 // indirect
Expand All @@ -17,15 +17,13 @@ require (
github.com/hashicorp/golang-lru v0.5.4
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/vault/api v1.8.0
github.com/libp2p/go-libp2p v0.18.0
github.com/libp2p/go-libp2p-core v0.14.0
github.com/libp2p/go-libp2p-kbucket v0.4.7
github.com/libp2p/go-libp2p-noise v0.4.0
github.com/libp2p/go-libp2p-pubsub v0.6.1
github.com/miekg/dns v1.1.45 // indirect
github.com/libp2p/go-libp2p v0.22.0
github.com/libp2p/go-libp2p-kbucket v0.5.0
github.com/libp2p/go-libp2p-pubsub v0.8.2
github.com/miekg/dns v1.1.50 // indirect
github.com/multiformats/go-base32 v0.0.4 // indirect
github.com/multiformats/go-multiaddr v0.7.0
github.com/multiformats/go-multihash v0.1.0 // indirect
github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/prometheus/client_golang v1.13.0
github.com/ryanuber/columnize v2.1.2+incompatible
Expand All @@ -34,7 +32,7 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/umbracle/go-eth-bn256 v0.0.0-20190607160430-b36caf4e0f6b
github.com/umbracle/go-web3 v0.0.0-20220224145938-aaa1038c1b69
golang.org/x/crypto v0.0.0-20220214200702-86341886e292
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
google.golang.org/grpc v1.45.0
google.golang.org/protobuf v1.28.1
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce
Expand All @@ -45,24 +43,31 @@ require (
github.com/aws/aws-sdk-go v1.44.102
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/godbus/dbus/v5 v5.0.6 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/graph-gophers/graphql-go v1.4.0
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef
github.com/ipfs/go-cid v0.1.0 // indirect
github.com/ipfs/go-cid v0.2.0 // indirect
github.com/klauspost/compress v1.15.10
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 // indirect
github.com/valyala/fastjson v1.6.3 // indirect
go.uber.org/zap v1.20.0 // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/tools v0.1.9 // indirect
go.uber.org/zap v1.22.0 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
lukechampine.com/blake3 v1.1.7 // indirect
)

require go.uber.org/atomic v1.9.0
require go.uber.org/atomic v1.10.0

require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/marten-seemann/qtls-go1-19 v0.1.0 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/multiformats/go-multicodec v0.5.0 // indirect
)

require (
github.com/VictoriaMetrics/fastcache v1.6.0
Expand Down Expand Up @@ -95,56 +100,35 @@ require (
github.com/hashicorp/go-version v1.2.0 // indirect
github.com/hashicorp/vault/sdk v0.6.0 // indirect
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
github.com/huin/goupnp v1.0.2 // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.5.0 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/koron/go-ssdp v0.0.2 // indirect
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/koron/go-ssdp v0.0.3 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0
github.com/libp2p/go-conn-security-multistream v0.3.0 // indirect
github.com/libp2p/go-eventbus v0.2.1 // indirect
github.com/libp2p/go-flow-metrics v0.0.3 // indirect
github.com/libp2p/go-libp2p-asn-util v0.1.0 // indirect
github.com/libp2p/go-libp2p-blankhost v0.3.0 // indirect
github.com/libp2p/go-libp2p-connmgr v0.4.0 // indirect
github.com/libp2p/go-libp2p-discovery v0.6.0 // indirect
github.com/libp2p/go-libp2p-mplex v0.6.0 // indirect
github.com/libp2p/go-libp2p-nat v0.1.0 // indirect
github.com/libp2p/go-libp2p-peerstore v0.6.0 // indirect
github.com/libp2p/go-libp2p-pnet v0.2.0 // indirect
github.com/libp2p/go-libp2p-quic-transport v0.16.1 // indirect
github.com/libp2p/go-libp2p-resource-manager v0.1.5 // indirect
github.com/libp2p/go-libp2p-swarm v0.10.2 // indirect
github.com/libp2p/go-libp2p-tls v0.3.1 // indirect
github.com/libp2p/go-libp2p-transport-upgrader v0.7.1 // indirect
github.com/libp2p/go-libp2p-yamux v0.8.2 // indirect
github.com/libp2p/go-mplex v0.6.0 // indirect
github.com/libp2p/go-msgio v0.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect
github.com/libp2p/go-msgio v0.2.0 // indirect
github.com/libp2p/go-nat v0.1.0 // indirect
github.com/libp2p/go-netroute v0.2.0 // indirect
github.com/libp2p/go-openssl v0.0.7 // indirect
github.com/libp2p/go-reuseport v0.1.0 // indirect
github.com/libp2p/go-reuseport-transport v0.1.0 // indirect
github.com/libp2p/go-stream-muxer-multistream v0.4.0 // indirect
github.com/libp2p/go-tcp-transport v0.5.1 // indirect
github.com/libp2p/go-ws-transport v0.6.0 // indirect
github.com/libp2p/go-yamux/v3 v3.0.2 // indirect
github.com/lucas-clemente/quic-go v0.25.0 // indirect
github.com/marten-seemann/qtls-go1-16 v0.1.4 // indirect
github.com/marten-seemann/qtls-go1-17 v0.1.0 // indirect
github.com/marten-seemann/qtls-go1-18 v0.1.0-beta.1 // indirect
github.com/libp2p/go-openssl v0.1.0 // indirect
github.com/libp2p/go-reuseport v0.2.0 // indirect
github.com/libp2p/go-yamux/v3 v3.1.2 // indirect
github.com/lucas-clemente/quic-go v0.28.1 // indirect
github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
github.com/marten-seemann/qtls-go1-17 v0.1.2 // indirect
github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
Expand All @@ -155,8 +139,8 @@ require (
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.0.3 // indirect
github.com/multiformats/go-multistream v0.2.2 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multistream v0.3.3 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/oklog/run v1.0.0 // indirect
Expand All @@ -169,23 +153,20 @@ require (
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/raulk/clock v1.1.0 // indirect
github.com/raulk/go-watchdog v1.2.0 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.4.0 // indirect
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit ae617e5

Please sign in to comment.