abnormal

package
v0.0.0-...-5cda5f8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashCheckFail       = "hash check failed"
	TssTimeout          = "Tss timeout"
	TssSyncFail         = "signers fail to sync before keygen/keysign"
	TssBrokenMsg        = "tss share verification failed"
	InternalError       = "fail to start the join party "
	GenerateNewKeyError = "fail to generate new key"
	SignatureError      = "fail to signature message"
)

Variables

View Source
var (
	ErrHashFromOwner     = errors.New(" hash sent from data owner")
	ErrNotEnoughPeer     = errors.New("not enough nodes to evaluate hash")
	ErrNotMajority       = errors.New("message we received does not match the majority")
	ErrTssTimeOut        = errors.New("error Tss Timeout")
	ErrHashCheck         = errors.New("error in processing hash check")
	ErrHashInconsistency = errors.New("fail to agree on the hash value")
)

Functions

This section is empty.

Types

type Abnormal

type Abnormal struct {
	FailReason   string  `json:"fail_reason"`
	IsUnicast    bool    `json:"is_broadcast"`
	Nodes        []*Node `json:"abnormal_peers,omitempty"`
	AbnormalLock sync.RWMutex
}

func NewAbnormal

func NewAbnormal(reason string, nodes []*Node) *Abnormal

func (*Abnormal) SetAbnormal

func (a *Abnormal) SetAbnormal(reason string, nodes []*Node, isUnicast bool)

func (*Abnormal) String

func (a *Abnormal) String() string

type Manager

type Manager struct {
	Abnormal *Abnormal

	PartyIDtoP2PID map[string]peer.ID
	// contains filtered or unexported fields
}

func NewAbnormalManager

func NewAbnormalManager() *Manager

func (*Manager) CheckMsgDuplication

func (m *Manager) CheckMsgDuplication(round RoundInfo, id string) bool

func (*Manager) GetAbnormal

func (m *Manager) GetAbnormal() *Abnormal

func (*Manager) GetAbnormalNodePubKeys

func (m *Manager) GetAbnormalNodePubKeys() []string

func (*Manager) GetLastMsg

func (m *Manager) GetLastMsg() tss.Message

func (*Manager) GetRoundMgr

func (m *Manager) GetRoundMgr() *RoundMgr

func (*Manager) GetShareMgr

func (m *Manager) GetShareMgr() *ShareMgr

func (*Manager) SetLastMsg

func (m *Manager) SetLastMsg(lastMsg tss.Message)

func (*Manager) SetLastUnicastPeer

func (m *Manager) SetLastUnicastPeer(peerID peer.ID, roundInfo string)

func (*Manager) SetPartyInfo

func (m *Manager) SetPartyInfo(party tss.Party, partyIDMap map[string]*tss.PartyID)

func (*Manager) TssCulpritsNodes

func (m *Manager) TssCulpritsNodes() []string

func (*Manager) UpdateAcceptShare

func (m *Manager) UpdateAcceptShare(round RoundInfo, id string)

type Node

type Node struct {
	Pubkey    string `json:"pubkey"`
	Data      []byte `json:"data"`
	Signature []byte `json:"signature,omitempty"`
}

func NewNode

func NewNode(pk string, data, sig []byte) *Node

func (*Node) Equal

func (n *Node) Equal(node *Node) bool

type PartyInfo

type PartyInfo struct {
	Party      tss.Party
	PartyIDMap map[string]*tss.PartyID
}

type RoundInfo

type RoundInfo struct {
	Index         int
	RoundMsg      string
	MsgIdentifier string
}

type RoundMgr

type RoundMgr struct {
	// contains filtered or unexported fields
}

func NewTssRoundMgr

func NewTssRoundMgr() *RoundMgr

func (*RoundMgr) Get

func (tr *RoundMgr) Get(key string) *messages.WireMessage

func (*RoundMgr) GetByRound

func (tr *RoundMgr) GetByRound(roundInfo string) []string

func (*RoundMgr) Set

func (tr *RoundMgr) Set(key string, msg *messages.WireMessage)

type ShareMgr

type ShareMgr struct {
	// contains filtered or unexported fields
}

func NewTssShareMgr

func NewTssShareMgr() *ShareMgr

func (*ShareMgr) QueryAndDelete

func (sm *ShareMgr) QueryAndDelete(key string) bool

func (*ShareMgr) Set

func (sm *ShareMgr) Set(key string)

Jump to

Keyboard shortcuts

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