Commit Graph

287 Commits

Author SHA1 Message Date
Marten Seemann
2dc986f623
deprecate peer.Encode in favor of peer.ID.String (#275) 2022-07-07 14:41:03 -07:00
Marten Seemann
9a9bf42889
deprecate peer.ID.Pretty (#273)
1. It's an alias for peer.ID.String
2. fmt.Stringer is the idiomatic way to get a string representation in Go.
2022-07-07 14:59:05 +00:00
Marco Munizaga
acfb38a4ec
Update version.json 2022-07-05 16:49:41 -07:00
Marco Munizaga
8814b31902
Remove btcsuite/btcd dep (#272) 2022-07-05 16:49:17 -07:00
Marco Munizaga
4dee347e6f
Release v0.19.0 (#271) 2022-06-30 15:32:27 -07:00
Marco Munizaga
a8ab35bed5
Add endpoint parameter to the OpenConnection method for ResourceManager (#257) 2022-06-30 11:25:49 -07:00
Marco Munizaga
1d0e2c7795
Release v0.18.0 (#270) 2022-06-30 11:24:45 -07:00
Marco Munizaga
7a9d49416a
Add canonical peer status logging with sampling (#269)
* Add canonical peer status log

* Use %q formatting

* Use underscore for consistency
2022-06-30 11:18:49 -07:00
Marten Seemann
77522c6e95
canonicallog: reduce log level to warning (#268) 2022-06-26 09:00:18 -07:00
Marco Munizaga
b430f5b3a6
Only log once if we failed to convert from netAddr (#264) 2022-06-24 07:46:19 -07:00
Marten Seemann
0c14794e0d
remove deprecated mux package (#265) 2022-06-24 05:57:41 -07:00
Masih H. Derkani
58f60d8483
chore: upgrade to go-cid to v0.2.0 (#262)
Upgrade the go-cid dependency
2022-06-23 04:30:09 -07:00
Marten Seemann
b399c77768
remove the peer.Set (#261) 2022-06-22 01:10:31 -07:00
Marco Munizaga
3c35ffc872
Bump version (#259)
* Bump version

* Match gocompat
2022-06-17 09:54:42 -07:00
Marco Munizaga
31262b0447
Add canonical log for misbehaving peers (#258)
* Add canonical logging for misbehaving peers

* Add component and use manet.FromNetAddr

* Fix log test
2022-06-17 09:09:23 -07:00
Marten Seemann
fa28eefcc8
release v0.16.1 (#255) 2022-05-25 06:17:44 -07:00
Marten Seemann
041d78f639
force usage of github.com/btcsuite/btcd v0.22.1 or newer (#254) 2022-05-25 06:06:10 -07:00
Marten Seemann
9923194ef3
release v0.16.0 (#251) 2022-05-24 05:37:17 -07:00
Marten Seemann
13e0150958
remove OpenedStream and ClosedStream from Notifiee interface (#250)
* remove TODO for PeerConnected and PeerDisconnected from Notifiee

This is now done via the event bus.

* remove OpenedStream and ClosedStream from Notifiee
2022-05-24 04:48:47 -07:00
Marten Seemann
02cbdcc419
deprecate Negotiator.NegotiateLazy (#249) 2022-04-22 13:02:18 -07:00
Brian Meek
374bb62823
update btcec dependency (#247) 2022-04-20 02:00:42 -07:00
Marten Seemann
8293d284f2
release v0.15.1 (#246) 2022-04-18 12:59:35 -07:00
Steven Allen
648dc3fba2
feat: harden encoding/decoding functions against panics (#243)
* feat: harden encoding/decoding functions against panics

Part of https://github.com/libp2p/go-libp2p/issues/1389

These kinds of functions:

1. Handle user input.
2. Often have out-of-bounds, null pointer, etc bugs.
3. Have completely isolated logic where local panics are unlikely to
   cause memory corruption elsewhere.

* test: add a panic catcher test
2022-04-18 12:40:37 -07:00
Marten Seemann
f8e1087b8e
release v0.15.0 (#242) 2022-04-11 11:19:13 -07:00
web3-bot
f927693924
sync: update CI config files (#241)
* bump go.mod to Go 1.17 and run go fix

* update .github/workflows/automerge.yml

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

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

* remove unneeded nil check in ECDSAPublicKey.Verify

Co-authored-by: web3-bot <web3-bot@users.noreply.github.com>
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-04-10 02:38:48 -07:00
Marcin Rataj
2a28e1d32f
fix: switch to go-multicodec mappings (#240)
The mappings in go-cid were maintained by hand and are invalid.
More details in https://github.com/ipfs/go-cid/pull/137

This is switching to go-multicodec which has correct mappings
that are generated, not written by hand.

Co-authored-by: Daniel Martí <mvdan@mvdan.cc>
2022-03-31 16:04:14 +02:00
Eclésio Junior
4a03a820b3
chore: add String() method to IDSlice type (#238) 2022-03-20 22:35:19 -07:00
Marten Seemann
243f8b9e3c
release v0.14.0 (#235) 2022-01-16 23:41:20 -08:00
vyzo
e4c76cf7cd
Network Resource Manager interface (#229)
* add resource manager interfaces

* add scope accessors to streams and conns

* add ResourceManager accessor to the Network interface

* allow initially unattached streams.

* introduce service scopes, canonicalize ownership interface through setters

* make system scope explicit

* make memory stat an int64

* make the system scope a generic resource scope, introduce the DMZ

* fix typo

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

* fix typo

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

* rename DMZ to transient scope, remove OpenConnection from PeerScope

* remove ncopy param from GrowBuffer

* remove protocols from OpenStream

The stream is unnegotiated state until the actual protocol has been determined.

* document nil receiver contract, fix protocol scope protocol accessor method

* remove nil receiver contract requirement

* flesh out stat struct

* turn resource manager scope accessors into viewers

* interface refiniments

1. Introduce transactions in all scopes
2. Limit the view of stream/connection scope for users, to avoid the Done footgun
3. Move OpenStream to the resource manager

* add Buffer interface

* fix typo

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

* fix typo

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

* fix typo

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

* rename user scopes to plain names, management scopes as such

* rename BeginTxn to BeginTransaction

* RIP Buffers

* make ErrResourceLimitExceeded a temporary error; move rcmgr errors with the other errors.

* unexport TemporaryError

* null resource manager stub

* unexport the null stubs, make entry point a variable

* don't rely on typed nils but instead use actual null object instances

So that we don't confuse the hell out of everyone!

* add Scope to the CapableConn interface

* rename ConnectionScope to ConnScope for consistency

* fix typo

* rename ConnectionManagementScope to ConnManagementScope

* add the ConnManagementScope to Upgrader.Upgrade

* fix argument name

* godocs for ResourceManager

* introduce MemoryStatus indicator in ReserveMemory

* use uint8 for MemoryStatus

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

* rework reservation interface to pass priority instead of returning memory status

so that we don't have to undo reservations if there is too much pressure.

* improve comment

* fix typo

* export the NullScope

* Stream.SetProtocol can return an error

It needs to attach the protocol to the protocol scope, which may fail.

* merge the mux package into network

* pass the PeerScope to Multiplexer.NetConn

* Update network/rcmgr.go

Co-authored-by: raulk <raul@protocol.ai>

* Update network/rcmgr.go

Co-authored-by: raulk <raul@protocol.ai>

* Update network/rcmgr.go

Co-authored-by: raulk <raul@protocol.ai>

* Update network/rcmgr.go

Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>

* remove reference to deprecated mux.MuxedConn

* rename transaction to span

* indicate bytes in ReserveMemory

* break ResourceManager View methods into Viewer interface.

* add experimental interface warning

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
Co-authored-by: raulk <raul@protocol.ai>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2022-01-16 23:15:05 -08:00
Marten Seemann
8dd07b859a
update gopkg.in/yaml.v2 to v2.2.8 (#233) 2022-01-08 22:27:00 -08:00
Marten Seemann
a3dd401efe
introduce a transport.Upgrader interface (#232)
* introduce a transport.Upgrader interface

* remove deprecated Upgrader methods
2022-01-04 00:36:44 -08:00
Marten Seemann
621b073458
remove the transport.AcceptTimeout (#231) 2021-12-21 00:39:30 -08:00
Marten Seemann
0a19838993
remove the DialTimeout (#230)
The timeout should be a configuration option for the swarm, not a global
variable.
2021-12-19 22:27:21 -08:00
star
a61ab2c0f1
remove duplicate io.Closer on Network interface (#228) 2021-12-16 05:21:31 -08:00
web3-bot
2711d5a459
sync: update CI config files (#225)
* update .github/workflows/go-test.yml

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

* update .github/workflows/releaser.yml

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

Co-authored-by: web3-bot <web3-bot@users.noreply.github.com>
2021-12-13 12:19:25 +01:00
Marten Seemann
6d5c680ce8
release v0.13.0 (#227) 2021-12-12 03:58:57 -08:00
Marten Seemann
ed7a5ab432
rename network.Stat to Stats, introduce ConnStats (#226) 2021-12-12 02:58:02 -08:00
Marten Seemann
975f71b238
release v0.12.0 (#223) 2021-12-01 23:56:06 -08:00
Richard Ramos
98db48ef81
generate ecdsa public key from an input public key (#219) 2021-12-01 23:24:12 -08:00
Marten Seemann
b18a4c9c56
add RemovePeer method to PeerMetadata, Metrics, ProtoBook and Keybook (#218) 2021-10-24 03:17:52 -07:00
Marten Seemann
8bf73f7e2f
release v0.11.0 (#217) 2021-10-18 09:14:25 -07:00
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