prysm-pulse/shared/p2p/p2p.go
Preston Van Loon 991ee7e81b "Super sync" and naive p2p reputation (#2550)
* checkpoint on super sync with reputation

* ensure handling only expected peers msg

* exclusive of finalized block

* skip block saved already

* clean up struct

* remove 2 more fields

* _

* everything builds, but doesnt test yet

* lint

* fix p2p tests

* space

* space

* space

* fmt

* fmt
2019-05-09 16:02:24 -05:00

35 lines
1.1 KiB
Go

// Package p2p handles peer-to-peer networking for Ethereum Serenity clients.
//
// There are three types of p2p communications.
//
// - Direct: two peer communication
// - Floodsub: peer broadcasting to all peers
// - Gossipsub: peer broadcasting to localized peers
//
// This communication is abstracted through the Feed, Broadcast, and Send.
//
// Pub/sub topic has a specific message type that is used for that topic.
//
// Read more about gossipsub at https://github.com/vyzo/gerbil-simsub
package p2p
import peer "github.com/libp2p/go-libp2p-peer"
// AnyPeer represents a Peer ID alias for sending to any available peer(s).
const AnyPeer = peer.ID("AnyPeer")
// TagReputation is a libp2p tag for identifying reputation.
const TagReputation = "prysm-reputation"
// Use this file for interfaces only!
// Adapter is used to create middleware.
//
// See http://godoc.org/github.com/prysmaticlabs/prysm/shared/p2p#Server.RegisterTopic
type Adapter func(Handler) Handler
// Handler is a callback used in the adapter/middleware stack chain.
//
// See http://godoc.org/github.com/prysmaticlabs/prysm/shared/p2p#Server.RegisterTopic
type Handler func(Message)