Documentation ¶
Index ¶
- Constants
- Variables
- func GetSessionCtx(ctx context.Context, sessionType types.SessionType) context.Context
- func GetTssPartyKey(account string) *big.Int
- func Initialize(cfg config.Config)
- func PartyIds(parties []*rarimo.Party) tss.SortedPartyIDs
- func SetInRegistry(ctxKey ContextKey, key RegistryKey, value any)
- type Bounds
- type BoundsManager
- type Context
- func (c *Context) Client() *grpc.ClientConn
- func (c *Context) Context() context.Context
- func (c *Context) Core() *connectors.CoreConnector
- func (c *Context) Listener() net.Listener
- func (c *Context) Log() *logan.Entry
- func (c *Context) PG() *pg.Storage
- func (c *Context) Pool() *pool.Pool
- func (c *Context) SecretStorage() secret.Storage
- func (c *Context) Swagger() *config.SwaggerInfo
- func (c *Context) Tendermint() *http.HTTP
- func (c *Context) Timer() *timer.Timer
- type ContextKey
- type ISession
- type InputSet
- type RegistryKey
- type RequestAuthorizer
- type SessionManager
- func (s *SessionManager) AddSession(sessionType types.SessionType, session ISession)
- func (s *SessionManager) ID(sessionType types.SessionType) (uint64, bool)
- func (s *SessionManager) NewBlock(height uint64) error
- func (s *SessionManager) Receive(ctx context.Context, request *types.MsgSubmitRequest) error
Constants ¶
View Source
const ( DefaultSessionDuration = 15 DefaultSessionProposalDuration = 2 DefaultSessionAcceptanceDuration = 2 DefaultSessionSignDuration = 6 KeygenSessionDuration = 13 KeygenSessionKeygenDuration = 10 )
Default: 0-2 proposal 3-5 acceptance 6-12 sign 13-15 finish Keygen: 0-10 11-13 finish Reshare 0-2 proposal 3-5 acceptance 6-30 keygen 31-37 sign 38-44 sign 45-47 finish
View Source
const ContextTypeKey = "context_key"
Variables ¶
View Source
var ( ErrSignerNotAParty = goerr.New("signer not a party") ErrInvalidSignature = goerr.New("invalid signature") )
View Source
var ( ErrInvalidSessionID = goerr.New("invalid session ID") ErrInvalidSessionType = goerr.New("invalid session type") )
View Source
var ( ContextKeyBySessionType = map[types.SessionType]ContextKey{ types.SessionType_DefaultSession: DefaultSessionContextKey, types.SessionType_ReshareSession: ReshareSessionContextKey, types.SessionType_KeygenSession: KeygenSessionContextKey, } )
Functions ¶
func GetSessionCtx ¶
func GetTssPartyKey ¶
func Initialize ¶
func SetInRegistry ¶
func SetInRegistry(ctxKey ContextKey, key RegistryKey, value any)
Types ¶
type BoundsManager ¶
type BoundsManager struct { SessionStart uint64 SessionEnd uint64 SessionDuration uint64 // contains filtered or unexported fields }
BoundsManager is responsible for managing controllers bounds
func NewBoundsManager ¶
func NewBoundsManager(start uint64, sessionType types.SessionType) *BoundsManager
func (*BoundsManager) Current ¶
func (b *BoundsManager) Current() *Bounds
func (*BoundsManager) NextController ¶
func (b *BoundsManager) NextController(t types.ControllerType) *Bounds
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func DefaultGlobalContext ¶
func DefaultSessionContext ¶
func DefaultSessionContext(sessionType types.SessionType) Context
func (*Context) Client ¶
func (c *Context) Client() *grpc.ClientConn
func (*Context) Core ¶
func (c *Context) Core() *connectors.CoreConnector
func (*Context) SecretStorage ¶
func (*Context) Swagger ¶
func (c *Context) Swagger() *config.SwaggerInfo
func (*Context) Tendermint ¶
type ContextKey ¶
type ContextKey uint
const ( GlobalContextKey ContextKey = iota DefaultSessionContextKey ContextKey = iota KeygenSessionContextKey ContextKey = iota )
type ISession ¶
type ISession interface { ID() uint64 End() uint64 Receive(ctx context.Context, request *types.MsgSubmitRequest) error // NewBlock is a receiver for timer.Timer NewBlock(height uint64) NextSession() ISession }
ISession represents session component that is responsible for launching first session controller, managing controllers execution and creating next sessions.
type InputSet ¶
type InputSet struct { IsActive bool GlobalPubKey string N, T int Parties []*rarimo.Party VerifiedParties []*rarimo.Party UnverifiedParties []*rarimo.Party LastSignature string }
InputSet defines data set (parties, params, etc.) to be used in session
func NewInputSet ¶
func NewInputSet(client *grpc.ClientConn) *InputSet
type RegistryKey ¶
type RegistryKey uint
const ( PGKey RegistryKey = iota SecretKey LogKey ClientKey CoreKey PoolKey TimerKey TendermintKey ListenerKey SwaggerKey )
type RequestAuthorizer ¶
type RequestAuthorizer struct {
// contains filtered or unexported fields
}
RequestAuthorizer is responsible for authorizing requests using defined InputSet parties
func NewRequestAuthorizer ¶
func NewRequestAuthorizer(parties []*rarimo.Party, log *logan.Entry) *RequestAuthorizer
func (*RequestAuthorizer) Auth ¶
func (r *RequestAuthorizer) Auth(request *types.MsgSubmitRequest) (*rarimo.Party, error)
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager is responsible for managing session execution
func NewSessionManager ¶
func NewSessionManager() *SessionManager
func (*SessionManager) AddSession ¶
func (s *SessionManager) AddSession(sessionType types.SessionType, session ISession)
func (*SessionManager) ID ¶
func (s *SessionManager) ID(sessionType types.SessionType) (uint64, bool)
func (*SessionManager) NewBlock ¶
func (s *SessionManager) NewBlock(height uint64) error
func (*SessionManager) Receive ¶
func (s *SessionManager) Receive(ctx context.Context, request *types.MsgSubmitRequest) error
Click to show internal directories.
Click to hide internal directories.