1. 06 Mar, 2020 2 commits
  2. 05 Mar, 2020 1 commit
  3. 04 Mar, 2020 2 commits
  4. 03 Mar, 2020 2 commits
  5. 02 Mar, 2020 2 commits
  6. 19 Feb, 2020 1 commit
  7. 11 Feb, 2020 5 commits
  8. 10 Feb, 2020 4 commits
    • Yusef Napora's avatar
    • dependabot-preview[bot]'s avatar
    • dependabot-preview[bot]'s avatar
    • Yusef Napora's avatar
      Signed envelopes & routing records (#73) · 7b2888df
      Yusef Napora authored
      * add SignedEnvelope type
      
      * use struct for SignedEnvelope instead of exposing protobuf directly
      
      * doc comments for envelopes
      
      * tests for SignedEnvelopes
      
      * add helpers to make routing records for Host
      
      * fix doc comment
      
      * go fmt
      
      * add method to peerstore to retrieve signed routing records
      
      * update to match spec changes
      
      * just use nanoseconds
      
      * use proto3  &  rename fields to match spec changes
      
      * use proto3 for routing records
      
      * make envelope fields private & validate on unmarshal
      
      * use buffer pool for envelope signatures
      
      * tests for RoutingState
      
      * go fmt
      
      * rename Equals -> Equal, add some comments
      
      * use test helpers
      
      * get rid of unsigned RoutingState struct, only expose SignedRoutingState
      
      * 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.
      
      * whitespace
      
      * expose struct fields & remove accessors
      
      * use camelCase in protos for consistency
      
      * use multiformats uvarint for length-prefixes
      
      * remove payloadType check when unmarhaling
      
      * rm stray ref to golang/protobuf
      
      * define CertifiedAddrBook to avoid breaking API change
      
      * add events for updated addresses and routing state
      
      * remove SignedRoutingStateFromHost helper
      
      moving this to go-libp2p
      
      * add routing state records, extend peerstore API
      
      * fix: rebuild protos with new gogofaster generator
      
      * filter private addrs from signed routing records
      
      * envelope: use byte slices from pool; adjust interface.
      
      * move envelope to record package.
      
      * move protobuf files; adjust imports everywhere.
      
      * 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.
      
      * hoist Seq from PeerRecord to SignedEnvelope
      
      * test that PeerRecords can't be signed by wrong key
      
      * commit go.sum
      
      * add Seq field to envelope signature
      
      * fix proto_path in Makefile
      
      * fix import ordering
      
      * comments for PeerRecord proto message
      
      also removes the seq field from PeerMessage proto,
      since it was moved to the SignedEnvelope
      
      * use Record type for envelope payloads
      
      * rename SignedEnvelope -> Envelope, unmarshal payload in ConsumeEnvelope
      
      * return buffer to pool before early return
      
      * doc comments
      
      * rename CertifiedAddrBook methods, update comments
      
      * cache unmarshalled Record payload inside Envelope
      
      * doc comments
      
      * store reflect.Type when registering Record
      
      * Revert "return buffer to pool before early return"
      
      8d8da386f26482e06dc21989a6b5ade69f0a46d9
      
      misread this - unsigned will be nil if there's an
      error, so it was right the way it was
      
      * use a DefaultRecord for unregistered PayloadTypes
      
      instead of returning an error if we don't have a registered
      Record for a given PayloadType, we can have a catch-all
      DefaultRecord type that just preserves the original payload
      as a []byte
      
      * cleanup DefaultRecord code a bit
      
      - removes unused error return from blankRecordForPayloadType
      - just references instead of copying in DefaultRecord.UnmarshalRecord
        I figure this is likely safe, since we'll be unmarshalling from the
        payload of an Envelope, which shouldn't get altered after it's
        created.
      
      * use explicit payloadType in MakeEnvelopeWithRecord
      
      * Revert DefaultRecord commits
      
      ae3bc7bdfb657c232229229706854a56effca80b
      a26c845a766b45ceabd87c17c0801d191650f0d4
      
      * doc comments
      
      * move Seq field back to PeerRecord
      
      * make diffs optional in EvtLocalAddressesUpdated
      
      * more envelope tests
      
      * replace MakeEnvelope with record.Seal
      
      also:
      - add Domain and Codec fields to Record interface
      
      * fix import
      
      * add interface check
      
      * rename ProcessPeerRecord -> ConsumePeerRecord
      
      also, adds bool `accepted` return value
      
      * rename event field, add doc comment
      
      * peer record protobuf: fix field casing.
      
      * record protobuf: add docs and fix casing.
      
      * cleanup: group imports.
      
      * nit: split test/utils.go => test/{addrs,errors}.go.
      Co-authored-by: default avatarRaúl Kripalani <raul.kripalani@gmail.com>
      7b2888df
  9. 04 Feb, 2020 2 commits
  10. 16 Jan, 2020 1 commit
  11. 11 Jan, 2020 1 commit
  12. 20 Dec, 2019 1 commit
  13. 19 Dec, 2019 1 commit
  14. 17 Dec, 2019 1 commit
  15. 16 Dec, 2019 1 commit
  16. 14 Dec, 2019 1 commit
  17. 13 Dec, 2019 1 commit
  18. 11 Dec, 2019 2 commits
  19. 10 Dec, 2019 2 commits
    • Marcin Rataj's avatar
      feat: support encoding/decoding peer IDs as CIDs in text (#41) · ba9101b5
      Marcin Rataj authored
      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.
      ba9101b5
    • Marcin Rataj's avatar
      Merge branch 'master' into feat/parse-cid-as-pid · 4184c189
      Marcin Rataj authored
      License: MIT
      Signed-off-by: default avatarMarcin Rataj <lidel@lidel.org>
      4184c189
  20. 09 Dec, 2019 4 commits
  21. 07 Dec, 2019 3 commits