Skip to content

Commit fc0a0a9

Browse files
Merge branch 'libp2p:master' into master
2 parents b0f2429 + ab876fc commit fc0a0a9

29 files changed

+1620
-430
lines changed

.github/workflows/generated-pr.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Close Generated PRs
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
stale:
14+
uses: ipdxco/unified-github-workflows/.github/workflows/reusable-generated-pr.yml@v1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"skipOSes": ["windows", "macos"],
3-
"skipRace": true
3+
"skip32bit": true
44
}

.github/workflows/stale.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
name: Close and mark stale issue
1+
name: Close Stale Issues
22

33
on:
44
schedule:
55
- cron: '0 0 * * *'
6+
workflow_dispatch:
67

78
permissions:
89
issues: write
910
pull-requests: write
1011

1112
jobs:
1213
stale:
13-
uses: pl-strflt/.github/.github/workflows/reusable-stale-issue.yml@v0.3
14+
uses: ipdxco/unified-github-workflows/.github/workflows/reusable-stale-issue.yml@v1

backoff_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,17 @@ func TestBackoff_Clean(t *testing.T) {
9696
if err != nil {
9797
t.Fatalf("unexpected error post update: %s", err)
9898
}
99+
b.mu.Lock()
99100
b.info[id].lastTried = time.Now().Add(-TimeToLive) // enforces expiry
101+
b.mu.Unlock()
100102
}
101103

102-
if len(b.info) != size {
103-
t.Fatalf("info map size mismatch, expected: %d, got: %d", size, len(b.info))
104+
b.mu.Lock()
105+
infoLen := len(b.info)
106+
b.mu.Unlock()
107+
108+
if infoLen != size {
109+
t.Fatalf("info map size mismatch, expected: %d, got: %d", size, infoLen)
104110
}
105111

106112
// waits for a cleanup loop to kick-in

compat/compat.pb.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

floodsub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (fs *FloodSubRouter) AcceptFrom(peer.ID) AcceptStatus {
7171
return AcceptAll
7272
}
7373

74-
func (fs *FloodSubRouter) PreValidation([]*Message) {}
74+
func (fs *FloodSubRouter) Preprocess(from peer.ID, msgs []*Message) {}
7575

7676
func (fs *FloodSubRouter) HandleRPC(rpc *RPC) {}
7777

floodsub_test.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,11 @@ func TestReconnects(t *testing.T) {
268268
t.Fatal("timed out waiting for B chan to be closed")
269269
}
270270

271-
nSubs := len(psubs[2].mySubs["cats"])
272-
if nSubs > 0 {
271+
nSubs := make(chan int)
272+
psubs[2].eval <- func() {
273+
nSubs <- len(psubs[2].mySubs["cats"])
274+
}
275+
if <-nSubs > 0 {
273276
t.Fatal(`B should have 0 subscribers for channel "cats", has`, nSubs)
274277
}
275278

@@ -866,9 +869,14 @@ func TestImproperlySignedMessageRejected(t *testing.T) {
866869
t.Fatal(err)
867870
}
868871

869-
var adversaryMessages []*Message
872+
adversaryMessagesCh := make(chan []*Message)
873+
870874
adversaryContext, adversaryCancel := context.WithCancel(ctx)
871875
go func(ctx context.Context) {
876+
var adversaryMessages []*Message
877+
defer func() {
878+
adversaryMessagesCh <- adversaryMessages
879+
}()
872880
for {
873881
select {
874882
case <-ctx.Done():
@@ -885,6 +893,7 @@ func TestImproperlySignedMessageRejected(t *testing.T) {
885893

886894
<-time.After(1 * time.Second)
887895
adversaryCancel()
896+
adversaryMessages := <-adversaryMessagesCh
888897

889898
// Ensure the adversary successfully publishes the incorrectly signed
890899
// message. If the adversary "sees" this, we successfully got through
@@ -895,9 +904,13 @@ func TestImproperlySignedMessageRejected(t *testing.T) {
895904

896905
// the honest peer's validation process will drop the message;
897906
// next will never furnish the incorrect message.
898-
var honestPeerMessages []*Message
907+
honestPeerMessagesCh := make(chan []*Message)
899908
honestPeerContext, honestPeerCancel := context.WithCancel(ctx)
900909
go func(ctx context.Context) {
910+
var honestPeerMessages []*Message
911+
defer func() {
912+
honestPeerMessagesCh <- honestPeerMessages
913+
}()
901914
for {
902915
select {
903916
case <-ctx.Done():
@@ -915,6 +928,7 @@ func TestImproperlySignedMessageRejected(t *testing.T) {
915928
<-time.After(1 * time.Second)
916929
honestPeerCancel()
917930

931+
honestPeerMessages := <-honestPeerMessagesCh
918932
if len(honestPeerMessages) != 1 {
919933
t.Fatalf("got %d messages, expected 1", len(honestPeerMessages))
920934
}

go.mod

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
module github.com/libp2p/go-libp2p-pubsub
22

3-
go 1.21
3+
go 1.24
44

55
require (
66
github.com/benbjohnson/clock v1.3.5
77
github.com/gogo/protobuf v1.3.2
88
github.com/ipfs/go-log/v2 v2.5.1
99
github.com/libp2p/go-buffer-pool v0.1.0
10-
github.com/libp2p/go-libp2p v0.36.2
10+
github.com/libp2p/go-libp2p v0.39.1
1111
github.com/libp2p/go-libp2p-testing v0.12.0
1212
github.com/libp2p/go-msgio v0.3.0
13-
github.com/multiformats/go-multiaddr v0.13.0
13+
github.com/multiformats/go-multiaddr v0.14.0
1414
github.com/multiformats/go-varint v0.0.7
15+
go.uber.org/zap v1.27.0
1516
)
1617

1718
require (
@@ -29,85 +30,90 @@ require (
2930
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
3031
github.com/godbus/dbus/v5 v5.1.0 // indirect
3132
github.com/google/gopacket v1.1.19 // indirect
32-
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
33+
github.com/google/pprof v0.0.0-20250202011525-fc3143867406 // indirect
3334
github.com/google/uuid v1.6.0 // indirect
3435
github.com/gorilla/websocket v1.5.3 // indirect
3536
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
3637
github.com/huin/goupnp v1.3.0 // indirect
37-
github.com/ipfs/go-cid v0.4.1 // indirect
38+
github.com/ipfs/go-cid v0.5.0 // indirect
3839
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
3940
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
40-
github.com/klauspost/compress v1.17.9 // indirect
41-
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
42-
github.com/koron/go-ssdp v0.0.4 // indirect
43-
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
41+
github.com/klauspost/compress v1.17.11 // indirect
42+
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
43+
github.com/koron/go-ssdp v0.0.5 // indirect
44+
github.com/libp2p/go-flow-metrics v0.2.0 // indirect
4445
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
4546
github.com/libp2p/go-nat v0.2.0 // indirect
46-
github.com/libp2p/go-netroute v0.2.1 // indirect
47+
github.com/libp2p/go-netroute v0.2.2 // indirect
4748
github.com/libp2p/go-reuseport v0.4.0 // indirect
48-
github.com/libp2p/go-yamux/v4 v4.0.1 // indirect
49+
github.com/libp2p/go-yamux/v4 v4.0.2 // indirect
4950
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
5051
github.com/mattn/go-isatty v0.0.20 // indirect
51-
github.com/miekg/dns v1.1.62 // indirect
52+
github.com/miekg/dns v1.1.63 // indirect
5253
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
5354
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
5455
github.com/minio/sha256-simd v1.0.1 // indirect
5556
github.com/mr-tron/base58 v1.2.0 // indirect
5657
github.com/multiformats/go-base32 v0.1.0 // indirect
5758
github.com/multiformats/go-base36 v0.2.0 // indirect
58-
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
59+
github.com/multiformats/go-multiaddr-dns v0.4.1 // indirect
5960
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
6061
github.com/multiformats/go-multibase v0.2.0 // indirect
6162
github.com/multiformats/go-multicodec v0.9.0 // indirect
6263
github.com/multiformats/go-multihash v0.2.3 // indirect
63-
github.com/multiformats/go-multistream v0.5.0 // indirect
64+
github.com/multiformats/go-multistream v0.6.0 // indirect
6465
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
65-
github.com/onsi/ginkgo/v2 v2.20.0 // indirect
66+
github.com/onsi/ginkgo/v2 v2.22.2 // indirect
6667
github.com/opencontainers/runtime-spec v1.2.0 // indirect
6768
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
68-
github.com/pion/datachannel v1.5.8 // indirect
69+
github.com/pion/datachannel v1.5.10 // indirect
6970
github.com/pion/dtls/v2 v2.2.12 // indirect
70-
github.com/pion/ice/v2 v2.3.34 // indirect
71-
github.com/pion/interceptor v0.1.30 // indirect
72-
github.com/pion/logging v0.2.2 // indirect
71+
github.com/pion/dtls/v3 v3.0.4 // indirect
72+
github.com/pion/ice/v2 v2.3.37 // indirect
73+
github.com/pion/ice/v4 v4.0.6 // indirect
74+
github.com/pion/interceptor v0.1.37 // indirect
75+
github.com/pion/logging v0.2.3 // indirect
7376
github.com/pion/mdns v0.0.12 // indirect
77+
github.com/pion/mdns/v2 v2.0.7 // indirect
7478
github.com/pion/randutil v0.1.0 // indirect
75-
github.com/pion/rtcp v1.2.14 // indirect
76-
github.com/pion/rtp v1.8.9 // indirect
77-
github.com/pion/sctp v1.8.33 // indirect
78-
github.com/pion/sdp/v3 v3.0.9 // indirect
79-
github.com/pion/srtp/v2 v2.0.20 // indirect
79+
github.com/pion/rtcp v1.2.15 // indirect
80+
github.com/pion/rtp v1.8.11 // indirect
81+
github.com/pion/sctp v1.8.35 // indirect
82+
github.com/pion/sdp/v3 v3.0.10 // indirect
83+
github.com/pion/srtp/v3 v3.0.4 // indirect
8084
github.com/pion/stun v0.6.1 // indirect
85+
github.com/pion/stun/v3 v3.0.0 // indirect
8186
github.com/pion/transport/v2 v2.2.10 // indirect
87+
github.com/pion/transport/v3 v3.0.7 // indirect
8288
github.com/pion/turn/v2 v2.1.6 // indirect
83-
github.com/pion/webrtc/v3 v3.3.0 // indirect
89+
github.com/pion/turn/v4 v4.0.0 // indirect
90+
github.com/pion/webrtc/v4 v4.0.8 // indirect
8491
github.com/pkg/errors v0.9.1 // indirect
8592
github.com/pmezard/go-difflib v1.0.0 // indirect
86-
github.com/prometheus/client_golang v1.20.0 // indirect
93+
github.com/prometheus/client_golang v1.20.5 // indirect
8794
github.com/prometheus/client_model v0.6.1 // indirect
88-
github.com/prometheus/common v0.55.0 // indirect
95+
github.com/prometheus/common v0.62.0 // indirect
8996
github.com/prometheus/procfs v0.15.1 // indirect
90-
github.com/quic-go/qpack v0.4.0 // indirect
91-
github.com/quic-go/quic-go v0.46.0 // indirect
92-
github.com/quic-go/webtransport-go v0.8.0 // indirect
97+
github.com/quic-go/qpack v0.5.1 // indirect
98+
github.com/quic-go/quic-go v0.49.0 // indirect
99+
github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66 // indirect
93100
github.com/raulk/go-watchdog v1.3.0 // indirect
94101
github.com/spaolacci/murmur3 v1.1.0 // indirect
95-
github.com/stretchr/testify v1.9.0 // indirect
96-
github.com/wlynxg/anet v0.0.4 // indirect
102+
github.com/stretchr/testify v1.10.0 // indirect
103+
github.com/wlynxg/anet v0.0.5 // indirect
97104
go.uber.org/dig v1.18.0 // indirect
98-
go.uber.org/fx v1.22.2 // indirect
99-
go.uber.org/mock v0.4.0 // indirect
105+
go.uber.org/fx v1.23.0 // indirect
106+
go.uber.org/mock v0.5.0 // indirect
100107
go.uber.org/multierr v1.11.0 // indirect
101-
go.uber.org/zap v1.27.0 // indirect
102-
golang.org/x/crypto v0.26.0 // indirect
103-
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
104-
golang.org/x/mod v0.20.0 // indirect
105-
golang.org/x/net v0.28.0 // indirect
106-
golang.org/x/sync v0.8.0 // indirect
107-
golang.org/x/sys v0.24.0 // indirect
108-
golang.org/x/text v0.17.0 // indirect
109-
golang.org/x/tools v0.24.0 // indirect
110-
google.golang.org/protobuf v1.34.2 // indirect
108+
golang.org/x/crypto v0.32.0 // indirect
109+
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect
110+
golang.org/x/mod v0.23.0 // indirect
111+
golang.org/x/net v0.34.0 // indirect
112+
golang.org/x/sync v0.11.0 // indirect
113+
golang.org/x/sys v0.30.0 // indirect
114+
golang.org/x/text v0.22.0 // indirect
115+
golang.org/x/tools v0.29.0 // indirect
116+
google.golang.org/protobuf v1.36.4 // indirect
111117
gopkg.in/yaml.v3 v3.0.1 // indirect
112118
lukechampine.com/blake3 v1.3.0 // indirect
113119
)

0 commit comments

Comments
 (0)