Documentation ¶
Index ¶
- Constants
- Variables
- func Equal(p1 *rarimo.Party, p2 *rarimo.Party) bool
- func GetContents(client *grpc.ClientConn, operations ...*rarimo.Operation) ([]merkle.Content, error)
- func GetContractUpgradeContent(client *grpc.ClientConn, op *rarimo.Operation) (merkle.Content, error)
- func GetFeeManagementContent(client *grpc.ClientConn, op *rarimo.Operation) (merkle.Content, error)
- func GetIdentityAggregatedTransferContent(op *rarimo.Operation) (merkle.Content, error)
- func GetIdentityDefaultTransferContent(op *rarimo.Operation) (merkle.Content, error)
- func GetOperations(client *grpc.ClientConn, ids ...string) ([]*rarimo.Operation, error)
- func GetProposer(parties []*rarimo.Party, sig string, sessionId uint64) rarimo.Party
- func GetSignersSet(acceptances map[string]struct{}, t int, sig string, sessionId uint64) map[string]struct{}
- func GetTransferContent(client *grpc.ClientConn, op *rarimo.Operation) (merkle.Content, error)
- type AcceptanceController
- type FinishController
- type IController
- type KeygenController
- type LocalSessionData
- func (data *LocalSessionData) GetAcceptanceController() IController
- func (data *LocalSessionData) GetFinishController() IController
- func (data *LocalSessionData) GetKeySignController() IController
- func (data *LocalSessionData) GetKeygenController() IController
- func (data *LocalSessionData) GetProposalController() IController
- func (data *LocalSessionData) GetRootSignController() IController
- func (data *LocalSessionData) Next() *LocalSessionData
- type ProposalController
- type SignatureController
Constants ¶
const MaxPoolSize = 32
Variables ¶
Functions ¶
func GetContents ¶
func GetFeeManagementContent ¶
func GetOperations ¶
func GetProposer ¶
GetProposer generates deterministic proposer based on linear congruential generator with seed from getHash(signature, sessionId)
func GetSignersSet ¶
func GetSignersSet(acceptances map[string]struct{}, t int, sig string, sessionId uint64) map[string]struct{}
GetSignersSet generates deterministic signers set based on received acceptances and linear congruential generator with seed from getHash(signature, sessionId)
func GetTransferContent ¶
Types ¶
type AcceptanceController ¶
type AcceptanceController struct {
// contains filtered or unexported fields
}
AcceptanceController is responsible for sharing and collecting acceptances for different types of session.
func (*AcceptanceController) Receive ¶
func (a *AcceptanceController) Receive(c context.Context, request *types.MsgSubmitRequest) error
Receive accepts acceptances from other parties and executes `iAcceptanceController.validate` function. If function returns positive result sender address will be added to the accepted list. Self acceptance will be added to the list after controller base logic execution. After context finishing it calls the `iAcceptanceController.finish` method to calculate the acceptance results.
func (*AcceptanceController) Run ¶
func (a *AcceptanceController) Run(c context.Context)
Run initiates sharing of the acceptances with other parties. Should be launched only in case of valid proposal (session processing should be `true`)
func (*AcceptanceController) Type ¶
func (a *AcceptanceController) Type() types.ControllerType
func (*AcceptanceController) WaitFor ¶
func (a *AcceptanceController) WaitFor()
WaitFor waits until controller finishes its logic. Context cancel should be called before. WaitFor should be called before.
type FinishController ¶
type FinishController struct {
// contains filtered or unexported fields
}
FinishController is responsible for finishing sessions. For example: submit transactions, update session entry, etc.
func (*FinishController) Next ¶
func (f *FinishController) Next() IController
func (*FinishController) Receive ¶
func (f *FinishController) Receive(context.Context, *types.MsgSubmitRequest) error
func (*FinishController) Run ¶
func (f *FinishController) Run(c context.Context)
Run initiates the report submitting for all parties that was included into Offenders set. After it executes the `iFinishController.finish` logic.
func (*FinishController) Type ¶
func (f *FinishController) Type() types.ControllerType
func (*FinishController) WaitFor ¶
func (f *FinishController) WaitFor()
WaitFor waits until controller finishes its logic. Context cancel should be called before.
type IController ¶
type IController interface { // Receive accepts all incoming requests Receive(ctx context.Context, request *types.MsgSubmitRequest) error // Run will execute controller logic in separate goroutine Run(ctx context.Context) // WaitFor should be used to wait while controller finishes after canceling context. WaitFor() // Next returns next controller depending on current state or nil if session ended. Next() IController Type() types.ControllerType }
IController interface represents the smallest independent part of flow.
type KeygenController ¶
type KeygenController struct {
// contains filtered or unexported fields
}
KeygenController is responsible for initial key generation. It can only be launched with empty secret storage and after finishing will update storage with generated secret.
func (*KeygenController) Receive ¶
func (k *KeygenController) Receive(c context.Context, request *types.MsgSubmitRequest) error
Receive accepts the keygen requests from other parties and delivers them to the `tss.KeygenParty`
func (*KeygenController) Run ¶
func (k *KeygenController) Run(c context.Context)
Run launches the `tss.KeygenParty` logic. After context canceling it will check the tss party result and execute `iKeygenController.finish` logic.
func (*KeygenController) Type ¶
func (k *KeygenController) Type() types.ControllerType
func (*KeygenController) WaitFor ¶
func (k *KeygenController) WaitFor()
WaitFor waits until controller finishes its logic. Context cancel should be called before.
type LocalSessionData ¶
type LocalSessionData struct { SessionId uint64 Processing bool SessionType types.SessionType Proposer rarimo.Party Set *core.InputSet NewSecret *secret.TssSecret Indexes []string Root string Acceptances map[string]struct{} OperationSignature string KeySignature string NewParties []*rarimo.Party Offenders map[string]struct{} Signers map[string]struct{} IsSigner bool }
LocalSessionData represents all necessary data from current session to be shared between controllers.
func NewSessionData ¶
func NewSessionData(ctx core.Context, id uint64, sessionType types.SessionType) *LocalSessionData
func (*LocalSessionData) GetAcceptanceController ¶
func (data *LocalSessionData) GetAcceptanceController() IController
GetAcceptanceController returns the acceptance controller for the provided session data For types.SessionType_DefaultSession the acceptance controller will be based on current parties set (all active and inactive parties). For types.SessionType_ReshareSession the acceptance controller will be based on current parties set (all active and inactive parties).
func (*LocalSessionData) GetFinishController ¶
func (data *LocalSessionData) GetFinishController() IController
GetFinishController returns the finish controller for the provided session data
func (*LocalSessionData) GetKeySignController ¶
func (data *LocalSessionData) GetKeySignController() IController
GetKeySignController returns the key signature controller based on the selected signers set.
func (*LocalSessionData) GetKeygenController ¶
func (data *LocalSessionData) GetKeygenController() IController
GetKeygenController returns the keygen controller for the provided session data For types.SessionType_KeygenSession the keygen controller will be based on current parties set (all parties should be inactive). For types.SessionType_ReshareSession the keygen controller will be based on current parties set (all active and inactive parties).
func (*LocalSessionData) GetProposalController ¶
func (data *LocalSessionData) GetProposalController() IController
GetProposalController returns the proposal controller for the provided session data For types.SessionType_DefaultSession the proposal controller will be based on current parties set (all active and inactive parties). For types.SessionType_ReshareSession the proposal controller will be based on current parties set (all active and inactive parties).
func (*LocalSessionData) GetRootSignController ¶
func (data *LocalSessionData) GetRootSignController() IController
GetRootSignController returns the root signature controller based on the selected signers set.
func (*LocalSessionData) Next ¶
func (data *LocalSessionData) Next() *LocalSessionData
type ProposalController ¶
type ProposalController struct {
// contains filtered or unexported fields
}
ProposalController is responsible for proposing and collecting proposals from proposer. Proposer will execute logic of defining the next session type and suggest data to suggest in session.
func (*ProposalController) Next ¶
func (p *ProposalController) Next() IController
Next will return acceptance controller if proposal sharing or receiving was successful, otherwise, it will return finish controller. WaitFor should be called before.
func (*ProposalController) Receive ¶
func (p *ProposalController) Receive(c context.Context, request *types.MsgSubmitRequest) error
Receive accepts proposal from other parties. It will check that proposal was submitted from the selected session proposer. After it will execute the `iProposalController.accept` logic.
func (*ProposalController) Run ¶
func (p *ProposalController) Run(c context.Context)
Run launches the sharing proposal logic in corresponding session in case of self party is a session proposer.
func (*ProposalController) Type ¶
func (p *ProposalController) Type() types.ControllerType
func (*ProposalController) WaitFor ¶
func (p *ProposalController) WaitFor()
WaitFor waits until controller finishes its logic. Context cancel should be called before.
type SignatureController ¶
type SignatureController struct {
// contains filtered or unexported fields
}
SignatureController is responsible for signing data by signature producers.
func (*SignatureController) Receive ¶
func (s *SignatureController) Receive(c context.Context, request *types.MsgSubmitRequest) error
Receive accepts the signature requests from other parties and delivers it to the `tss.SignParty. If sender is not present in current signers set request will not be accepted.
func (*SignatureController) Run ¶
func (s *SignatureController) Run(c context.Context)
Run launches the `tss.SignParty` logic. After context canceling it will check the tss party result and execute `iSignatureController.finish` logic.
func (*SignatureController) Type ¶
func (s *SignatureController) Type() types.ControllerType
func (*SignatureController) WaitFor ¶
func (s *SignatureController) WaitFor()
WaitFor waits until controller finishes its logic. Context cancel should be called before.