Documentation ¶
Index ¶
- Constants
- Variables
- type Blame
- type Manager
- func (m *Manager) CheckMsgDuplication(round conversion.RoundInfo, id string) bool
- func (m *Manager) GetBlamePartyIDsLists(partiesID []string) ([]string, []string, error)
- func (m *Manager) GetBroadcastBlame(lastMessageType string) ([]Node, error)
- func (m *Manager) GetLastMsg() btss.Message
- func (m *Manager) GetUnicastBlame(lastMsgType string) ([]Node, error)
- func (m *Manager) SetLastMsg(lastMsg btss.Message)
- func (m *Manager) SetLastUnicastParty(partyID string, roundInfo string)
- func (m *Manager) SetPartyInfo(partyInfo *conversion.PartyInfo)
- func (m *Manager) TssMissingShareBlame(rounds int) ([]Node, bool, error)
- func (m *Manager) TssWrongShareBlame(wiredMsg *message.TaskMessage) (string, error)
- func (m *Manager) UpdateAcceptShare(round conversion.RoundInfo, id string)
- type Node
- type RoundMgr
- type ShareMgr
Constants ¶
const ( HashCheckFail = "hash check failed" TssTimeout = "Tss timeout" TssBrokenMsg = "tss share verification failed" InternalError = "fail to start the join party " )
Variables ¶
var ( ErrHashFromOwner = fmt.Errorf(" hash sent from data owner") ErrNotEnoughPeer = fmt.Errorf("not enough nodes to evaluate hash") ErrNotMajority = fmt.Errorf("message we received does not match the majority") ErrTssTimeOut = fmt.Errorf("error Tss Timeout") ErrHashCheck = fmt.Errorf("error in processing hash check") ErrHashInconsistency = fmt.Errorf("fail to agree on the hash value") )
Functions ¶
This section is empty.
Types ¶
type Blame ¶
type Blame struct { FailReason string `json:"fail_reason"` IsUnicast bool `json:"is_unicast"` BlameNodes []Node `json:"blame_peers,omitempty"` // contains filtered or unexported fields }
Blame is used to store the blame Peers and the fail reason
func (*Blame) AddBlameNodes ¶
AddBlameNodes add Nodes to the blame list
func (*Blame) AlreadyBlame ¶
type Manager ¶
func NewBlameManager ¶
func NewBlameManager(logger logrus.FieldLogger) *Manager
func (*Manager) CheckMsgDuplication ¶
func (m *Manager) CheckMsgDuplication(round conversion.RoundInfo, id string) bool
CheckMsgDuplication checks whether a participant is already in the acceptedShares list for the specified round
func (*Manager) GetBlamePartyIDsLists ¶
GetBlamePartyIDsLists returns the nodes partyID.id who are in and not in the partiesID list
func (*Manager) GetBroadcastBlame ¶
GetBroadcastBlame blames the node who cause the timeout in broadcast message
func (*Manager) GetLastMsg ¶
func (*Manager) GetUnicastBlame ¶
GetUnicastBlame blames the node who cause the timeout in unicast message
func (*Manager) SetLastMsg ¶
func (*Manager) SetLastUnicastParty ¶
func (*Manager) SetPartyInfo ¶
func (m *Manager) SetPartyInfo(partyInfo *conversion.PartyInfo)
func (*Manager) TssMissingShareBlame ¶
TssMissingShareBlame blames the node fail to send the shares to the node with batch signing, we need to put the accepted shares into different message group then search the missing share for each keysign message
func (*Manager) TssWrongShareBlame ¶
func (m *Manager) TssWrongShareBlame(wiredMsg *message.TaskMessage) (string, error)
TssWrongShareBlame blames the node who provide the wrong share
func (*Manager) UpdateAcceptShare ¶
func (m *Manager) UpdateAcceptShare(round conversion.RoundInfo, id string)
UpdateAcceptShare adds a participant who have accepted all shared information for the specified round
type Node ¶
type RoundMgr ¶
type RoundMgr struct {
// contains filtered or unexported fields
}
RoundMgr is used to record the confirmation of broadcast messages of each round. In the round of keygen and keysign, a participant needs to broadcast the hash of a broadcast message after receiving it
to ensure that the broadcast message received by the participant is consistent with that received by other participants.
func NewTssRoundMgr ¶
func NewTssRoundMgr() *RoundMgr
func (*RoundMgr) GetByRound ¶
GetByRound queries all senders of messages in the specified round. That is, query participants that normally send messages in the specified round.
type ShareMgr ¶
type ShareMgr struct {
// contains filtered or unexported fields
}
ShareMgr is used to manage the share request. When the current participant does not receive a broadcast message (or when the received broadcast message
is inconsistent with the majority of participants), the current participant requests the share of the broadcast message from the majority of participants in agreement.
func NewTssShareMgr ¶
func NewTssShareMgr() *ShareMgr
func (*ShareMgr) QueryAndDelete ¶
QueryAndDelete determines whether the share result is needed according to the 「requested」 when receiving the result from other participants, and it deletes the 「requested」at the same time.