Commit Graph

246 Commits

Author SHA1 Message Date
Marten Seemann
1092414cf9
remove the ConnHandler (#214) 2021-10-18 05:34:50 -07:00
web3-bot
96585e594a
sync: update CI config files (#216)
* add version.json file

* add .github/workflows/releaser.yml

* add .github/workflows/release-check.yml

* add .github/workflows/tagpush.yml

Co-authored-by: web3-bot <web3-bot@users.noreply.github.com>
2021-10-18 05:31:30 -07:00
Marten Seemann
7d7e514fe4
make go-compat post a comment on the PR (#213) 2021-09-12 16:11:24 +02:00
Marten Seemann
5f1ff676b2
remove the Process from the Network interface (#212) 2021-09-08 03:34:53 -07:00
Marten Seemann
60a3d1748e
pass the peer ID to SecureInbound in the SecureTransport and SecureMuxer (#211)
The peer ID may be empty. This will be the common case. In that case,
connections from any peer are accepted.
2021-09-08 03:34:32 -07:00
Marten Seemann
094b0d3f8b
save the role (client, server) in the simultaneous connect context (#210) 2021-08-24 13:30:29 +01:00
web3-bot
8a10694282
sync: update CI config files (#209)
* bump go.mod to Go 1.16 and run go fix

* run go mod tidy

* run gofmt -s

* update .github/workflows/automerge.yml

* update .github/workflows/go-test.yml

* update .github/workflows/go-check.yml

Co-authored-by: web3-bot <web3-bot@users.noreply.github.com>
2021-08-22 08:55:33 -07:00
Steven Allen
ea6cbf9ff2
feat: remove unused metrics (#208)
This drops the opensensus dependency. Nobody uses this, from what I can
tell.

fixes #58
2021-07-23 08:21:59 -07:00
Steven Allen
6e24b97081
feat: keep addresses for longer (#207)
There's really no reason to expire these after 10 minutes as opposed to
30. Given that our default DHT refresh interval is 10 minutes, setting
this to 30 reduces the chances that we'll "forget" peers.
2021-07-22 14:50:17 -07:00
Marten Seemann
1262f60147
remove deprecated key stretching struct / function (#203)
This was needed for secio.
2021-07-22 12:28:42 -07:00
Marten Seemann
d28ef6339a
remove deprecated Bytes method from the Key interface (#204) 2021-07-22 12:18:09 -07:00
Marten Seemann
6cef973b92
remove deprecated functions in the peer package (#205) 2021-07-22 12:17:36 -07:00
Marten Seemann
e952b3702c
remove deprecated constructor for the insecure transport (#206) 2021-07-22 12:16:57 -07:00
Steven Allen
8c04ed1323
feat: add helper functions for working with addr infos (#202)
Specifically, move them _here_ from the peerstore. That way
packages (like the DHT) that currently directly rely on the peerstore,
can just use go-libp2p-core.

Moved from f7f22569f7/peerstore.go (L79-L93)

With some small modifications.
2021-07-21 13:09:49 -07:00
Steven Allen
ef6e277df7
fix: make timestamps strictly increasing (#201)
* fix: make timestamps strictly increasing

On Linux, this is almost always the case. Windows, however, doesn't have
nanosecond accuracy.

We make the timestamp sequence numbers strictly increasing by returning
the last timestamp + 1 where necessary.

* apply code review

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* use a lock

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2021-07-16 15:02:22 -07:00
Steven Allen
e5b674066c
ci: use github-actions for compatibility testing (#200) 2021-07-12 21:38:08 -07:00
web3-bot
aec4faac4d
sync: update CI config files (#189)
* disable Travis

* set Go version to 1.15 and run go mod tidy

* add .github/workflows/automerge.yml

* add .github/workflows/go-test.yml

* add .github/workflows/go-check.yml

* chore: tidy submodule

* chore: give vet something to vet

* test: disable timing dependent bandwidth test unless we're on linux

Co-authored-by: web3-bot <web3-bot@users.noreply.github.com>
Co-authored-by: Steven Allen <steven@stebalien.com>
2021-07-12 17:25:09 -07:00
Marten Seemann
d0fb9ba964
remove minimum Go version from README (#199) 2021-07-07 11:46:25 -07:00
Cory Schwartz
525a0b1301
remove flaky tests (#194) 2021-04-14 21:36:15 -07:00
vyzo
286b97aee3
reduce default timeouts to 15s (#192) 2021-04-05 12:45:14 -07:00
Marten Seemann
becdceadda
fix benchmark of key verifications (#190) 2021-03-30 16:14:00 -07:00
Marten Seemann
ea8b36912f
fix staticcheck errors (#191)
* run go mod tidy

* omit receiver name if unused

* remove unused type testkey in tests

* fix duplicate import of go-multiaddr

* fix use of deprecated peer.IDB58{Encode,Decode}

* use bytes.Equal instead of bytes.Compare

* fix unnecessary assigments to blank identifier

* use time.Until instead of t.Sub(time.Now())

* fix use of deprecated go-multihash.ID

* add missing error check in envelope test

* fix error check in tests
2021-03-30 16:13:36 -07:00
Steven Allen
cfab100b7b
doc: document Close on Transport (#188)
fixes libp2p/go-libp2p#999
2021-03-29 08:41:49 -07:00
Whyrusleeping
11f3c3ac0c
add a helper function to go directly from a string to an AddrInfo (#184)
* add a helper function to go directly from a string to an AddrInfo

* Update peer/addrinfo.go

Co-authored-by: Will <will.scott@protocol.ai>

Co-authored-by: Will <will.scott@protocol.ai>
2021-02-22 09:55:28 -08:00
vyzo
ca38e17432 mind the dot.
Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
2021-02-19 12:32:44 +02:00
vyzo
29aaf384cf context option for simultaneous connect 2021-02-19 12:32:44 +02:00
Aarsh Shah
412dbb3544
Event for user's NAT Device Type: Tell user if the node is behind an Easy or Hard NAT (#173)
* event for NAT device type


Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2021-02-18 14:17:27 +05:30
vyzo
faf23c3b17 address aarshian nitpicks 2021-02-17 11:25:32 +02:00
vyzo
980a554aa5 make UseTransient context option take a reason argument, for consistency with other options 2021-02-17 11:25:32 +02:00
vyzo
a21b06e646 abstract Conn Stat interface for threading 2021-02-17 11:25:32 +02:00
vyzo
ac2ecf385a Update network/context.go
Co-authored-by: Yusef Napora <yusef@protocol.ai>
2021-02-17 11:25:32 +02:00
vyzo
8e949a777f add ErrTransientConn error 2021-02-17 11:25:32 +02:00
vyzo
7eee7c00a6 add support for transient connections 2021-02-17 11:25:32 +02:00
Aarsh Shah
410e6bdbd0
more docs for stream fncs (#183) 2021-02-16 12:08:51 -08:00
Steven Allen
adcd724744
refactor: use a helper type to decode AddrInfo from JSON (#178)
This saves us a bunch of error prone manual decode/encode logic.

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2021-02-16 12:06:38 -08:00
Aarsh Shah
31daef6c63
fix stream docs (#182) 2021-02-15 17:09:00 +05:30
Aarsh Shah
6cea734154
context to force direct dial (#181) 2021-02-15 13:20:04 +05:30
Aarsh Shah
a7d9ced9f9
Secure Muxer Interface (#180) 2021-02-14 17:45:11 +05:30
Marten Seemann
83ac1d370d
add a context to OpenStream and NewStream (#172)
* add a context to MuxedConn.OpenStream

* add a context to Conn.NewStream
2020-12-19 09:36:59 +07:00
Max Inden
a39b84ea2e
sec/insecure/insecure.go: Fix typo (#167)
`SecureInbound` secures an inbound and not an outbound connection.
2020-09-18 19:38:38 +02:00
Steven Allen
d6afc690e1
add CloseRead/CloseWrite on streams (#166)
* add CloseRead/CloseWrite on streams

This changes the behavior of `Close` to behave as one would expect: it closes
the stream. The new methods, CloseWrite/CloseRead allow for closing the stream in
a single direction.

Note: This _does not_ implement CancelWrite/CancelRead as our stream muxer
_protocols_ don't support that.

fixes #9

* remove stream util helpers

FullClose and AwaitEOF were introduced to work around the fact that calling
Close on a stream only closed the write half. All users must adapt their code
to the new interfaces, so this change is intentionally breaking.
2020-09-01 17:29:54 -07:00
Tarun Bansal
b77fd280f2
Fix typo in docs (#163)
There was a typo in doc for `ProtocolID` alias
2020-08-08 14:40:23 +03:00
Raúl Kripalani
98f9714258
upgrade deps. (#161) 2020-07-30 10:39:34 +01:00
Raúl Kripalani
9cf214f501 go mod tidy. 2020-06-05 12:30:24 +01:00
Raúl Kripalani
21efed7519
experimental introspection support (#159)
Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2020-06-05 12:24:56 +01:00
vyzo
0d53a5522e
connmgr: add IsProtected interface (#158) 2020-06-03 22:08:48 +03:00
Raúl Kripalani
264788628f
eventbus: add wildcard subscription type; getter to enumerate known types (#153) 2020-05-20 18:52:50 +01:00
Raúl Kripalani
30bf48c8d6
events: add a generic DHT event. (#154) 2020-05-20 13:12:54 +01:00
dependabot-preview[bot]
acf0d3d15a
build(deps): bump github.com/multiformats/go-multiaddr from 0.2.1 to 0.2.2 (#152) 2020-05-18 11:43:10 +01:00
Raúl Kripalani
a1c90aa3df
decaying tags: support removal and closure. (#151) 2020-05-15 09:27:13 +01:00