security

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package security provides functionality for managing the security aspects of the distributed validation system, including request storage and operator state

Package security provides types and functionality for handling security-related operations in the distributed validation system

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatorReactor added in v0.3.1

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

AggregatorReactor handles the collection and aggregation of response signatures from operators, interfacing between the DVS system and the aggregator service

func CreateAggregatorReactor added in v0.3.1

func CreateAggregatorReactor(
	aggClient aggtypes.Aggregator,
	dvsRequestIndexer requestindex.DvsRequestIndexer,
	privValidator types.PrivValidator,
	dvsState *DVSState,
	logger log.Logger,
	eventManager *EventManager,
) *AggregatorReactor

CreateAggregatorReactor initializes a new AggregatorReactor with all required dependencies to handle signature collection and aggregation operations

func (*AggregatorReactor) HandleSignatureCollectionRequest added in v0.3.1

func (ar *AggregatorReactor) HandleSignatureCollectionRequest(requestHash avsitypes.DVSRequestHash) error

HandleSignatureCollectionRequest processes a signature collection request by retrieving the original request, signing the response, and submitting it to the aggregator for collection and validation

type AggregatorResponse added in v0.3.1

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

AggregatorResponse encapsulates the result of an aggregation operation, containing both the original request hash and the validated response

type DVSReactor

type DVSReactor struct {
	ProxyApp proxy.AppConns
	// contains filtered or unexported fields
}

func CreateDVSReactor

func CreateDVSReactor(
	config config.PellConfig,
	proxyApp proxy.AppConns,
	dvsRequestIndexer requestindex.DvsRequestIndexer,
	dvsReader reader.DVSReader,
	dvsState *DVSState,
	logger log.Logger,
	eventManager *EventManager,
) (DVSReactor, error)

CreateDVSReactor creates a new DVSReactor instance

func (*DVSReactor) HandleDVSRequest added in v0.3.1

func (dvs *DVSReactor) HandleDVSRequest(request avsitypes.DVSRequest) error

HandleDVSRequest handles the DVS request

func (*DVSReactor) OnRequestAfterAggregated added in v0.3.1

func (dvs *DVSReactor) OnRequestAfterAggregated(requestHash avsitypes.DVSRequestHash,
	validatedResponse aggtypes.ValidatedResponse) error

OnRequestAfterAggregated is called after the request is aggregated

func (*DVSReactor) SaveDVSRequestResult

func (dvs *DVSReactor) SaveDVSRequestResult(res *avsitypes.DVSRequestResult, first bool) error

SaveDVSRequestResult saves the DVS request result

type DVSReqResponse

type DVSReqResponse struct {
	Request  avsitypes.DVSRequest
	Response *types.ValidatedResponse
	Receipt  *ResponsePostRequest
}

DVSReqResponse represents the complete lifecycle of a DVS request, including the original request, its validated response, and confirmation receipt

type DVSState

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

DVSState maintains the current state of a DVS node, including operator identity and request storage

func NewDVSState

func NewDVSState(cfg *config.PellConfig, requestStore RequestStore, storeDir string) (*DVSState, error)

NewDVSState creates a new DVSState instance initialized with the operator's identity and a storage implementation

func (*DVSState) StoreRequest added in v0.3.1

func (dvsState *DVSState) StoreRequest(req *DVSReqResponse) error

StoreRequest delegates the request saving operation to the underlying store

type EventManager added in v0.3.1

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

EventManager coordinates communication between different components of the system by managing event subscriptions and routing events to appropriate handlers

func NewEventManager added in v0.3.1

func NewEventManager(logger log.Logger) *EventManager

NewEventManager creates a new EventManager instance with the provided logger and initializes an internal event bus for communication

func (*EventManager) SetAggregatorReactor added in v0.3.1

func (em *EventManager) SetAggregatorReactor(aggregatorReactor *AggregatorReactor)

SetAggregatorReactor assigns the aggregator reactor component to the EventManager allowing it to forward signature collection events to the aggregation subsystem

func (*EventManager) SetDVSReactor added in v0.3.1

func (em *EventManager) SetDVSReactor(dvsReactor *DVSReactor)

SetDVSReactor assigns the DVS reactor component to the EventManager allowing it to forward relevant events to the DVS subsystem

func (*EventManager) StartListening added in v0.3.1

func (em *EventManager) StartListening()

StartListening begins asynchronous event processing by subscribing to relevant event types and dispatching them to the appropriate handlers

type PersistentStore added in v0.3.1

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

PersistentStore implements RequestStore using a persistent database backend for reliable storage of DVS requests and responses

func NewPersistentStore added in v0.3.1

func NewPersistentStore(dir string) (*PersistentStore, error)

NewPersistentStore creates a new PersistentStore instance with a LevelDB backend in the specified directory

func (*PersistentStore) FetchRequest added in v0.3.1

func (s *PersistentStore) FetchRequest(id string) (*RequestProcessRequest, error)

FetchRequest retrieves a previously stored request from the database based on the provided identifier

func (*PersistentStore) StoreRequest added in v0.3.1

func (s *PersistentStore) StoreRequest(req *DVSReqResponse) error

StoreRequest persists a DVS request and its response to the database using the request data as the key

type RequestPostRequest

type RequestPostRequest struct {
	Response types.ValidatedResponse
}

RequestPostRequest contains the validated aggregated response to be posted back to the requestor

type RequestProcessRequest

type RequestProcessRequest struct {
	Request avsitypes.DVSRequest
}

RequestProcessRequest encapsulates a DVS request that needs to be processed by the validation system

type RequestStore added in v0.3.1

type RequestStore interface {
	StoreRequest(req *DVSReqResponse) error
	FetchRequest(id string) (*RequestProcessRequest, error)
}

RequestStore defines the interface for storing and retrieving DVS requests providing persistence capabilities for the validation system

type ResponsePostRequest

type ResponsePostRequest struct{}

ResponsePostRequest represents a confirmation request after a response has been successfully posted to the network

type ResponseProcessRequest

type ResponseProcessRequest struct {
	Response       []byte
	ResponseDigest []byte
}

ResponseProcessRequest contains the processed response data and its digest following validation of a DVS request

Jump to

Keyboard shortcuts

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