rings

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package rings provides the RingCache interface that is used to build rings for applications by either the application itself or a gateway. This ring is used to sign the relay requests. The RingCache is responsible for caching the rings for future use and invalidating the cache when the application's delegated gateways change.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRingsNotSecp256k1Curve                 = sdkerrors.Register(codespace, 1, "key is not a secp256k1 public key")
	ErrRingClientEmptyRelayRequestSignature   = sdkerrors.Register(codespace, 2, "empty relay request signature")
	ErrRingClientInvalidRelayRequest          = sdkerrors.Register(codespace, 3, "invalid relay request")
	ErrRingClientInvalidRelayRequestSignature = sdkerrors.Register(codespace, 4, "invalid relay request signature")
)

Functions

func GetRingAddressesAtBlock added in v0.0.2

func GetRingAddressesAtBlock(app *apptypes.Application, blockHeight int64) []string

GetRingAddressesAtBlock returns the active gateway addresses that need to be used to construct the ring in order to validate that the given app should pay for. It takes into account both active delegations and pending undelegations that should still be part of the ring at the given block height. The ring addresses slice is reconstructed by adding back the past delegated gateways that have been undelegated after the target session end height.

func NewRingCache

func NewRingCache(deps depinject.Config) (_ crypto.RingCache, err error)

NewRingCache returns a new RingCache instance. It requires a depinject.Config to be passed in, which is used to inject the dependencies of the RingCache.

Required dependencies: - polylog.Logger - client.DelegationClient - client.ApplicationQueryClient - client.AccountQueryClient

func NewRingClient

func NewRingClient(deps depinject.Config) (_ crypto.RingClient, err error)

NewRingClient returns a new ring client constructed from the given dependencies. It returns an error if the required dependencies are not supplied.

Required dependencies: - polylog.Logger - client.ApplicationQueryClient - client.AccountQueryClient

Types

This section is empty.

Jump to

Keyboard shortcuts

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