Commit Graph

172 Commits

Author SHA1 Message Date
Yusef Napora
5f6b601ac9 hoist Seq from PeerRecord to SignedEnvelope 2020-01-17 10:42:26 -05:00
Yusef Napora
59348dea5a test that PeerRecords can't be signed by wrong key 2020-01-17 10:42:26 -05:00
Yusef Napora
2e8cabcc87 rename RoutingStateRecord -> PeerRecord
also removes embedded reference to Envelope from the record,
as that was confusing.

as a result, the CertifiedAddrBook now accepts/returns
record.SignedEnvelope instead of a specialized type.
2020-01-17 10:42:26 -05:00
Yusef Napora
ae465aa5b8 define CertifiedAddrBook to avoid breaking API change 2020-01-17 10:42:26 -05:00
Raúl Kripalani
bb547efe8c move protobuf files; adjust imports everywhere. 2020-01-17 10:42:26 -05:00
Raúl Kripalani
123324dc1b move envelope to record package. 2020-01-17 10:42:26 -05:00
Raúl Kripalani
6028ba0bba envelope: use byte slices from pool; adjust interface. 2020-01-17 10:42:26 -05:00
Yusef Napora
0bcca67988 remove SignedRoutingStateFromHost helper
moving this to go-libp2p
2020-01-17 10:42:26 -05:00
Yusef Napora
8a8390e4f7 add events for updated addresses and routing state 2020-01-17 10:42:26 -05:00
Yusef Napora
74bb6bbf1e filter private addrs from signed routing records 2020-01-17 10:42:26 -05:00
Yusef Napora
1168b4d715 rm stray ref to golang/protobuf 2020-01-17 10:42:26 -05:00
Yusef Napora
ae469c6801 remove payloadType check when unmarhaling 2020-01-17 10:42:26 -05:00
Yusef Napora
305fff1b3c fix: rebuild protos with new gogofaster generator 2020-01-17 10:42:26 -05:00
Yusef Napora
fb521c6433 use camelCase in protos for consistency 2020-01-17 10:42:26 -05:00
Yusef Napora
ff5ddb3846 use multiformats uvarint for length-prefixes 2020-01-17 10:42:26 -05:00
Yusef Napora
272731be60 expose struct fields & remove accessors 2020-01-17 10:42:26 -05:00
Yusef Napora
347316f262 whitespace 2020-01-17 10:42:26 -05:00
Yusef Napora
00306a4903 rm batching SignedRoutingStates accessor in peerstore
the datastore peerstore implementation doesn't support batched reads, so
it's no more efficient to get a bunch of states at once than it
is to call SignedRoutingState multiple times.
2020-01-17 10:42:26 -05:00
Yusef Napora
bf3693255b get rid of unsigned RoutingState struct, only expose SignedRoutingState 2020-01-17 10:42:26 -05:00
Yusef Napora
a56dc2cb55 use test helpers 2020-01-17 10:42:26 -05:00
Yusef Napora
cf19665533 rename Equals -> Equal, add some comments 2020-01-17 10:42:26 -05:00
Yusef Napora
c8a9a5eafe go fmt 2020-01-17 10:42:26 -05:00
Yusef Napora
7d10658fce tests for RoutingState 2020-01-17 10:42:26 -05:00
Yusef Napora
be36d83110 use buffer pool for envelope signatures 2020-01-17 10:42:26 -05:00
Yusef Napora
3724a31efe make envelope fields private & validate on unmarshal 2020-01-17 10:42:26 -05:00
Yusef Napora
a8a530e24f use proto3 for routing records 2020-01-17 10:42:26 -05:00
Yusef Napora
cf0cfa5750 use proto3 & rename fields to match spec changes 2020-01-17 10:42:26 -05:00
Yusef Napora
f583d3c4ce just use nanoseconds 2020-01-17 10:42:26 -05:00
Yusef Napora
d75c257932 update to match spec changes 2020-01-17 10:42:26 -05:00
Yusef Napora
f01458e2e6 add method to peerstore to retrieve signed routing records 2020-01-17 10:42:26 -05:00
Yusef Napora
c016eb5a80 go fmt 2020-01-17 10:42:26 -05:00
Yusef Napora
2ebfd9d4f2 fix doc comment 2020-01-17 10:42:26 -05:00
Yusef Napora
791e33fcce add helpers to make routing records for Host 2020-01-17 10:42:26 -05:00
Yusef Napora
8d61036c08 add routing state records, extend peerstore API 2020-01-17 10:42:26 -05:00
Yusef Napora
71be7ba804 tests for SignedEnvelopes 2020-01-17 10:42:26 -05:00
Yusef Napora
cc866a8a18 doc comments for envelopes 2020-01-17 10:42:26 -05:00
Yusef Napora
133f891544 use struct for SignedEnvelope instead of exposing protobuf directly 2020-01-17 10:42:26 -05:00
Yusef Napora
f4c9da5023 add SignedEnvelope type 2020-01-17 10:42:26 -05:00
Raúl Kripalani
52a4260be5 Introduce routability and protocol events; cache unmarshalled RSA keys (#105)
* event: Add autonat events (#25)

* add events for identify (#26)

* implement caching for rsaKey.Bytes()

* store marshalled protobuf in cache for RsaPublicKey.Bytes()

* fix(crypto): fix build when openssl is enabled

* add godocs to routability events.

Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
Co-authored-by: Whyrusleeping <why@ipfs.io>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
Co-authored-by: Steven Allen <steven@stebalien.com>
2020-01-16 02:29:26 +01:00
Steven Allen
0ad6b1c741
Merge pull request #52 from mhchia/patch-1
fix: get `remoteID` from pb message in plaintext
2020-01-11 09:17:07 +01:00
Steven Allen
4c2606ef48
Merge pull request #103 from Mikerah/master
Update README.md
2019-12-20 16:15:28 +01:00
Mikerah
f86f7e0ef7
Update README.md 2019-12-19 09:57:16 -05:00
Steven Allen
2ee848f4f1
Merge pull request #102 from libp2p/dependabot/go_modules/github.com/ipfs/go-cid-0.0.4
build(deps): bump github.com/ipfs/go-cid from 0.0.3 to 0.0.4
2019-12-17 12:44:27 +01:00
dependabot-preview[bot]
94fac75dea
build(deps): bump github.com/ipfs/go-cid from 0.0.3 to 0.0.4
Bumps [github.com/ipfs/go-cid](https://github.com/ipfs/go-cid) from 0.0.3 to 0.0.4.
- [Release notes](https://github.com/ipfs/go-cid/releases)
- [Commits](https://github.com/ipfs/go-cid/compare/v0.0.3...v0.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 11:20:22 +00:00
Steven Allen
6f2516674a
Merge pull request #100 from Mikerah/patch-1
typo fix
2019-12-14 09:08:25 +01:00
Mikerah
e5d371f86c
typo fix 2019-12-13 15:24:15 -05:00
Steven Allen
f7f724862d
Merge pull request #98 from libp2p/dependabot/go_modules/github.com/multiformats/go-multiaddr-0.2.0
build(deps): bump github.com/multiformats/go-multiaddr from 0.1.2 to 0.2.0
2019-12-11 14:59:31 +01:00
dependabot-preview[bot]
ee9d9da3cf
build(deps): bump github.com/multiformats/go-multiaddr
Bumps [github.com/multiformats/go-multiaddr](https://github.com/multiformats/go-multiaddr) from 0.1.2 to 0.2.0.
- [Release notes](https://github.com/multiformats/go-multiaddr/releases)
- [Commits](https://github.com/multiformats/go-multiaddr/compare/v0.1.2...v0.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-11 11:34:55 +00:00
Marcin Rataj
ba9101b589
feat: support encoding/decoding peer IDs as CIDs in text (#41)
What:

1. Supports decoding CIDs (of libp2p keys) as peer IDs 
   (https://github.com/libp2p/specs/issues/216)
2. Continues to encode peer IDs as base58 multihashes by default.
3. Adds functions for converting between peer IDs and CIDs.
4. Deprecates IDB58{Decode,Encode}, replacing them with {Decode,Encode}.

Why:

1. We _need_ to support multibase somehow, so we can put peer IDs in domains.
2. This makes peer IDs fully self describing. That is, the CID itself indicates that it's a hash of a libp2p public key.
3. It's much easier to upgrade wire protocols than text. This change punts
pids-as-cids on the wire down the road but that's something we can revisit if it ever becomes relevant. 

See https://github.com/libp2p/specs/issues/111 for context.

Deviations from that issue:

* This _retains_ the current peer ID inlining of ed25519 keys. That turned out to be a nightmare, one I'd like to punt a bit more down the road.
* Likewise, this _punts_ the question of embedding the multi-hash algorithm in the public key.
2019-12-10 17:51:54 +01:00
Marcin Rataj
4184c18976
Merge branch 'master' into feat/parse-cid-as-pid
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2019-12-10 13:33:41 +01:00