Documentation ¶
Index ¶
- func GetLeader(txHash common.Hash, peerIDs peer.IDSlice, offset int64) (peer.ID, error)
- func NewSessionTransport(broadcaster broadcast.Broadcaster, ...) mp_tss.Transporter
- type AddCandidateEvent
- type AddSigningPartEvent
- type CandidateWaitingForLeaderState
- type DoneNonParticipantState
- type DoneState
- type ErrorState
- type LeaderWaitingForCandidatesState
- type PickingLeaderState
- type SessionIDToTxHash
- type SessionStore
- type SessionTransport
- type SigningSession
- func (s *SigningSession) Update(event SigningSessionEvent) error
- func (s *SigningSession) UpdateAddCandidateEvent(ev *AddCandidateEvent) error
- func (s *SigningSession) UpdateAddSigningPartEvent(ev *AddSigningPartEvent) error
- func (s *SigningSession) UpdateStartSignerEvent(ev *StartSignerEvent) error
- type SigningSessionEvent
- type SigningSessionResult
- type SigningSessionState
- type SigningSessionStore
- func (s *SigningSessionStore) GetSessionFromID(sessID types.AggregateSigningSessionID) (*SigningSession, bool)
- func (s *SigningSessionStore) GetSessionFromTxHash(txHash eth_common.Hash) (*SigningSession, bool)
- func (s *SigningSessionStore) NewSession(ctx context.Context, broadcaster broadcast.Broadcaster, txHash eth_common.Hash, ...) (*SigningSession, <-chan SigningSessionResult, error)
- func (s *SigningSessionStore) SetSessionID(txHash eth_common.Hash, sessID types.AggregateSigningSessionID)
- type SigningState
- type StartSignerEvent
- type TssSessions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLeader ¶
GetLeader returns the leader of the given transaction hash and peer.IDSlice. The offset is only used when there is an inactive leader. The initial offset should be 0, and incremented only while the leader does not respond.
func NewSessionTransport ¶
func NewSessionTransport( broadcaster broadcast.Broadcaster, sessionID mp_tss_types.AggregateSigningSessionID, partyIDStore *mp_tss.PartyIDStore, participants []peer.ID, ) mp_tss.Transporter
NewSessionTransport returns a new Transporter using reliable broadcast.
Types ¶
type AddCandidateEvent ¶
type AddCandidateEvent struct {
// contains filtered or unexported fields
}
func NewAddCandidateEvent ¶
func NewAddCandidateEvent( partyID *tss.PartyID, joinMsg types.JoinSessionMessage, ) *AddCandidateEvent
func (*AddCandidateEvent) SigningSessionEvent ¶
func (e *AddCandidateEvent) SigningSessionEvent()
EventType
type AddSigningPartEvent ¶
func NewAddSigningPartEvent ¶
func NewAddSigningPartEvent( from *tss.PartyID, data []byte, isBroadcast bool, ) *AddSigningPartEvent
func (*AddSigningPartEvent) SigningSessionEvent ¶
func (e *AddSigningPartEvent) SigningSessionEvent()
type CandidateWaitingForLeaderState ¶
type CandidateWaitingForLeaderState struct {
// contains filtered or unexported fields
}
CandidateWaitingForLeaderState is the state of a signing session where the non-leaders wait for the leader to start the signing party.
func NewCandidateWaitingForLeaderState ¶
func NewCandidateWaitingForLeaderState() (*CandidateWaitingForLeaderState, error)
NewCandidateWaitingForLeaderState returns a new CandidateWaitingForLeaderState.
func (*CandidateWaitingForLeaderState) SigningSessionState ¶
func (s *CandidateWaitingForLeaderState) SigningSessionState()
type DoneNonParticipantState ¶
type DoneNonParticipantState struct { }
DoneNonParticipantState is the state when the peer is not a participant and thus has no signature.
func NewDoneNonParticipantState ¶
func NewDoneNonParticipantState() *DoneNonParticipantState
NewDoneNonParticipantState returns a new DoneNonParticipantState.
func (*DoneNonParticipantState) SigningSessionState ¶
func (s *DoneNonParticipantState) SigningSessionState()
type DoneState ¶
type DoneState struct {
// contains filtered or unexported fields
}
DoneState is the state when the signing session is done and a signature is output.
func NewDoneState ¶
func NewDoneState(signature tss_common.SignatureData) *DoneState
NewDoneState returns a new DoneState.
func (*DoneState) SigningSessionState ¶
func (s *DoneState) SigningSessionState()
type ErrorState ¶
type ErrorState struct {
// contains filtered or unexported fields
}
ErrorState is the state when an error during signing occurs.
func NewErrorState ¶
func NewErrorState(err *tss.Error) *ErrorState
NewErrorState returns a new ErrorState.
func (*ErrorState) SigningSessionState ¶
func (s *ErrorState) SigningSessionState()
type LeaderWaitingForCandidatesState ¶
type LeaderWaitingForCandidatesState struct {
// contains filtered or unexported fields
}
LeaderWaitingForCandidatesState is the state of a signing session where the leader is waiting for candidates to join.
func NewLeaderWaitingForCandidatesState ¶
func NewLeaderWaitingForCandidatesState() (*LeaderWaitingForCandidatesState, error)
NewLeaderWaitingForCandidatesState returns a new LeaderWaitingForCandidatesState.
func (*LeaderWaitingForCandidatesState) SigningSessionState ¶
func (s *LeaderWaitingForCandidatesState) SigningSessionState()
type PickingLeaderState ¶
type PickingLeaderState struct {
// contains filtered or unexported fields
}
PickingLeaderState is the state of a signing session where each peer is picking the leader.
func NewPickingLeaderState ¶
func NewPickingLeaderState() *PickingLeaderState
NewPickingLeaderState returns a new PickingLeaderState.
func (*PickingLeaderState) SigningSessionState ¶
func (s *PickingLeaderState) SigningSessionState()
type SessionIDToTxHash ¶
type SessionIDToTxHash map[string]eth_common.Hash
SessionIDToTxHash maps session ID -> tx_hash, to get a session from session ID instead of tx_hash
type SessionStore ¶
type SessionStore struct {
Signing *SigningSessionStore
}
func NewSessionStore ¶
func NewSessionStore() *SessionStore
NewSessionStore returns a new SessionStore.
type SessionTransport ¶
type SessionTransport struct {
// contains filtered or unexported fields
}
SessionTransport is a transport for a specific session.
func (*SessionTransport) Receive ¶
func (mt *SessionTransport) Receive() chan mp_tss.ReceivedPartyState
Receive returns the channel for receiving messages from other parties. This can also be used to add messages to be handled from other parties.
func (*SessionTransport) Send ¶
func (mt *SessionTransport) Send( ctx context.Context, data []byte, routing *tss.MessageRouting, isResharing bool, ) error
Send sends a tss message with the provided routing data.
type SigningSession ¶
type SigningSession struct { TxHash eth_common.Hash MsgToSign *big.Int // contains filtered or unexported fields }
SigningSession is a session for signing a message, consisting of all of the states that are required to do so for 1 transaction.
func NewSigningSession ¶
func NewSigningSession( ctx context.Context, sessionStore *SigningSessionStore, broadcaster broadcast.Broadcaster, txHash eth_common.Hash, msgToSign *big.Int, threshold int, currentPeerID peer.ID, peerIDs peer.IDSlice, currentPartyID *tss.PartyID, partyIDStore *mp_tss.PartyIDStore, key keygen.LocalPartySaveData, ) (*SigningSession, <-chan SigningSessionResult, error)
func (*SigningSession) Update ¶
func (s *SigningSession) Update(event SigningSessionEvent) error
func (*SigningSession) UpdateAddCandidateEvent ¶
func (s *SigningSession) UpdateAddCandidateEvent( ev *AddCandidateEvent, ) error
func (*SigningSession) UpdateAddSigningPartEvent ¶
func (s *SigningSession) UpdateAddSigningPartEvent( ev *AddSigningPartEvent, ) error
func (*SigningSession) UpdateStartSignerEvent ¶
func (s *SigningSession) UpdateStartSignerEvent( ev *StartSignerEvent, ) error
type SigningSessionEvent ¶
type SigningSessionEvent interface {
SigningSessionEvent()
}
SigningSessionEvent is implemented by all events that are part of a signing session.
type SigningSessionResult ¶
type SigningSessionResult struct { Signature *tss_common.SignatureData Err *tss.Error }
SigningSessionResult is the result of a signing session.
func NewSigningSessionResult ¶
func NewSigningSessionResult( signature *tss_common.SignatureData, err *tss.Error, ) SigningSessionResult
NewSigningSessionResult returns a new SigningSessionResult.
func (*SigningSessionResult) HasSignature ¶
func (res *SigningSessionResult) HasSignature() bool
type SigningSessionState ¶
type SigningSessionState interface {
SigningSessionState()
}
SigningSessionState is the state of a signing session.
type SigningSessionStore ¶
type SigningSessionStore struct {
// contains filtered or unexported fields
}
SigningSessionStore keeps track of signing sessions.
func NewSigningSessionStore ¶
func NewSigningSessionStore() *SigningSessionStore
NewSigningSessionStore returns a new signing session store.
func (*SigningSessionStore) GetSessionFromID ¶
func (s *SigningSessionStore) GetSessionFromID( sessID types.AggregateSigningSessionID, ) (*SigningSession, bool)
GetSessionFromID returns the signing session for the given session ID.
func (*SigningSessionStore) GetSessionFromTxHash ¶
func (s *SigningSessionStore) GetSessionFromTxHash(txHash eth_common.Hash) (*SigningSession, bool)
GetSessionFromTxHash returns the signing session for the given transaction hash.
func (*SigningSessionStore) NewSession ¶
func (s *SigningSessionStore) NewSession( ctx context.Context, broadcaster broadcast.Broadcaster, txHash eth_common.Hash, msgToSign *big.Int, threshold int, currentPeerID peer.ID, peerIDs peer.IDSlice, currentPartyID *tss.PartyID, partyIDStore *mp_tss.PartyIDStore, key keygen.LocalPartySaveData, ) (*SigningSession, <-chan SigningSessionResult, error)
NewSession adds and returns a new signing session. This session does not have a session ID and must be set later with SetSessionID.
func (*SigningSessionStore) SetSessionID ¶
func (s *SigningSessionStore) SetSessionID(txHash eth_common.Hash, sessID types.AggregateSigningSessionID)
SetSessionID sets the session ID for the given signing session transaction hash.
type SigningState ¶
type SigningState struct {
// contains filtered or unexported fields
}
SigningState is the state of a signing session where all participants are signing.
func NewSigningState ¶
func NewSigningState(transport mp_tss.Transporter) *SigningState
NewSigningState returns a new SigningState.
func (*SigningState) SigningSessionState ¶
func (s *SigningState) SigningSessionState()
type StartSignerEvent ¶
type StartSignerEvent struct {
// contains filtered or unexported fields
}
func NewStartSignerEvent ¶
func NewStartSignerEvent( tssParams *tss.Parameters, transport mp_tss.Transporter, participants []peer.ID, ) *StartSignerEvent
func (*StartSignerEvent) SigningSessionEvent ¶
func (e *StartSignerEvent) SigningSessionEvent()
type TssSessions ¶
type TssSessions map[eth_common.Hash]*SigningSession
TssSessions maps a transaction hash to signing session