mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
03356fc7b5
* add resyncing functionality * add more validation to status message * lint and build * jim's review * preston's review * clean up * remove log * remove no sync * change again * change back * remove spaces * Update shared/slotutil/slottime.go Co-Authored-By: Raul Jordan <raul@prysmaticlabs.com> * Apply suggestions from code review Co-Authored-By: Raul Jordan <raul@prysmaticlabs.com> * fix refs * raul's review * goimports * goimports * add counter * removed condition * change back * gaz Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
18 lines
475 B
Go
18 lines
475 B
Go
package p2p
|
|
|
|
import (
|
|
"encoding/base64"
|
|
|
|
pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb"
|
|
"github.com/prysmaticlabs/prysm/shared/hashutil"
|
|
)
|
|
|
|
// Content addressable ID function.
|
|
//
|
|
// Loosely defined as Base64(sha2(data)) until a formal specification is determined.
|
|
// Pending: https://github.com/ethereum/eth2.0-specs/issues/1528
|
|
func msgIDFunction(pmsg *pubsub_pb.Message) string {
|
|
h := hashutil.FastSum256(pmsg.Data)
|
|
return base64.URLEncoding.EncodeToString(h[:])
|
|
}
|