verify

package
v0.5.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseQueueSubmit = iota
	ResponseQueueRegister
	ResponseQueueOther
)
View Source
const BLST_SUCCESS = 0x0

Variables

This section is empty.

Functions

func VerifySignature

func VerifySignature(obj types.HashTreeRoot, d types.Domain, pkBytes, sigBytes []byte) (bool, error)

func VerifySignatureBytes

func VerifySignatureBytes(msg [32]byte, sigBytes, pkBytes []byte) (ok bool, err error)

Types

type ProcessManagerMetrics

type ProcessManagerMetrics struct {
	VerifyTiming   *prometheus.HistogramVec
	RunningWorkers *prometheus.GaugeVec
}

type Request

type Request struct {
	Signature [96]byte
	Pubkey    [48]byte
	Msg       [32]byte
	// Unique identifier of payload
	// if needed to be passed back in response
	ID       int
	Response *StoreResp
}

VerifyReq is a request structure used in communication between api calls and fixed set of worker goroutines it's using return channel pattern, meaning that after sent the sender locks on that channel to get the response

type Resp

type Resp struct {
	ID     int
	Type   int8
	Commit bool
	Err    error
}

Resp response structure - potential candidate for structure pool as it's almost constant size

type StoreResp

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

func NewRespC

func NewRespC(numAll int) (s *StoreResp)

func (*StoreResp) Close

func (s *StoreResp) Close(id int, err error)

func (*StoreResp) Done

func (s *StoreResp) Done() chan error

func (*StoreResp) Error

func (s *StoreResp) Error() (err error)

func (*StoreResp) IsClosed

func (s *StoreResp) IsClosed() bool

func (*StoreResp) Send

func (s *StoreResp) Send(r Resp)

func (*StoreResp) SkipOne

func (s *StoreResp) SkipOne()

func (*StoreResp) SuccessfullIndexes

func (s *StoreResp) SuccessfullIndexes() []int64

type VerificationManager

type VerificationManager struct {
	VerifySubmitBlockCh       chan Request
	VerifyRegisterValidatorCh chan Request
	VerifyOtherCh             chan Request
	// contains filtered or unexported fields
}

func NewVerificationManager

func NewVerificationManager(l log.Logger, verifySize uint) *VerificationManager

func (*VerificationManager) AttachMetrics

func (rm *VerificationManager) AttachMetrics(m *metrics.Metrics)

func (*VerificationManager) Enqueue

func (rm *VerificationManager) Enqueue(ctx context.Context, sig [96]byte, pubkey [48]byte, msg [32]byte) (err error)

func (*VerificationManager) GetVerifyChan

func (rm *VerificationManager) GetVerifyChan(stack uint) chan Request

func (*VerificationManager) RunVerify

func (rm *VerificationManager) RunVerify(num uint)

func (*VerificationManager) VerifyChan

func (rm *VerificationManager) VerifyChan() chan Request

func (*VerificationManager) VerifyParallel

func (rm *VerificationManager) VerifyParallel()

Jump to

Keyboard shortcuts

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