commons

package
v0.0.0-...-84dde57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesCompare

func BytesCompare(a, b []byte) bool

func ExtractIPFromMultiaddr

func ExtractIPFromMultiaddr(addr ma.Multiaddr) (net.IP, error)

func GetAddressFromPrivateKey

func GetAddressFromPrivateKey(privateKey *ecdsa.PrivateKey) common.Address

it takes a private key as input and returns the corresponding Ethereum address.

func GetCallerName

func GetCallerName() string

func GetNow

func GetNow() string

func PeersToBytes

func PeersToBytes(p []peer.ID) []byte

func Secp256k1CompressedBytesToEthAddress

func Secp256k1CompressedBytesToEthAddress(compressedBytes []byte) common.Address

it takes compressed bytes representing a secp256k1 public key as input and returns the corresponding Ethereum address.

Types

type Broadcast

type Broadcast byte
const (
	UNDEFINED_br Broadcast = iota
	Publish
	Stream
	Gossip
)

type ComChannels

type ComChannels byte
const (
	UNDEFINED_cc ComChannels = iota
	// builder channels
	SignatureCh
	BlockKeyCh
	BundleCh
	PreconfCh
	// searcher channels
	BidCh
	CommitmentCh
)

type ConnectionEvent

type ConnectionEvent struct {
	PeerID   peer.ID
	PeerType PeerType
	Event    Event
}

type Event

type Event int
const (
	UndefinedE Event = iota
	Connected
	Disconnected
)

type MsgMode

type MsgMode byte
const (
	UNDEFINED_sm MsgMode = iota
	ToBuilders
	ToSearchers
)

type PeerType

type PeerType byte
const (
	UNDEFINED_pt PeerType = iota
	Builder
	Searcher
)

func (PeerType) String

func (p PeerType) String() string

type ReportEvent

type ReportEvent struct {
	PeerID peer.ID
	Reason ReportType
}

ReportEvent represents an event involving a reported issue

type ReportType

type ReportType byte
const (
	UNDEFINED_rt ReportType = iota
	BadSignatureMsg
	BadBlockKeyMsg
	BadBundleMsg
	BadPreconfMsg
)

TODO: additional reporting types might be necessary, consult the team

func (ReportType) String

func (r ReportType) String() string

type Topic

type Topic byte
const (
	UNDEFINED_to Topic = iota
	TopicB2B
	TopicB2S
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址