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 ¶
- Variables
- func GetRingAddressesAtBlock(sharedParams *sharedtypes.Params, app *apptypes.Application, blockHeight int64) []string
- func GetRingAddressesAtSessionEndHeight(app *apptypes.Application, targetSessionEndHeight uint64) []string
- func GetRingFromPubKeys(ringPubKeys []cryptotypes.PubKey) (*ring.Ring, error)
- func NewRingCache(deps depinject.Config) (_ crypto.RingCache, err error)
- func NewRingClient(deps depinject.Config) (_ crypto.RingClient, err error)
Constants ¶
This section is empty.
Variables ¶
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( sharedParams *sharedtypes.Params, 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 GetRingAddressesAtSessionEndHeight ¶ added in v0.0.3
func GetRingAddressesAtSessionEndHeight( app *apptypes.Application, targetSessionEndHeight uint64, ) []string
GetRingAddressesAtSessionEndHeight 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 relays. It takes into account both active delegations and pending undelegations that should still be part of the ring at the given session end 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 GetRingFromPubKeys ¶ added in v0.0.3
func GetRingFromPubKeys(ringPubKeys []cryptotypes.PubKey) (*ring.Ring, error)
GetRingFromPubKeys returns a ring constructed from the public keys provided.
func NewRingCache ¶
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 - client.SharedQueryClient
Types ¶
This section is empty.