api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MethodPathDomains

func MethodPathDomains() map[string][]string

MethodPathDomains returns the bounded `path` label domain per RPC method whose request payload determines path (matching getMethodPath's switch). Methods not in the map emit only path="default". Used by metrics seeding so absent()-style alerts have defined values for every (method, path, result) tuple at cold start, not just (method, "default", result).

Types

type RPCRouter

type RPCRouter struct {
	Node rpc.Node
	// contains filtered or unexported fields
}

func NewRPCRouter

func NewRPCRouter(
	cfg RPCRouterConfig,
	node rpc.Node,
	signer sign.Signer,
	dbStore database.DatabaseStore,
	memoryStore memory.MemoryStore,
	actionGateway action_gateway.ActionAllower,
	runtimeMetrics metrics.RuntimeMetricExporter,
	logger log.Logger,
) *RPCRouter

func (*RPCRouter) ObservabilityMiddleware

func (r *RPCRouter) ObservabilityMiddleware(c *rpc.Context)

func (*RPCRouter) RateLimitMiddleware

func (r *RPCRouter) RateLimitMiddleware(c *rpc.Context)

RateLimitMiddleware enforces a per-connection request-count token bucket. It complements the per-frame byte budget enforced by FrameRateLimiter at the connection layer: bytes guard bandwidth, this guards RPC throughput so a flood of small requests cannot bypass the byte cap.

On overrun the request fails with an RPC error and the connection stays open; the byte limiter is the layer that closes connections.

type RPCRouterConfig

type RPCRouterConfig struct {
	NodeVersion  string
	MinChallenge uint32
	MaxChallenge uint32

	AppRegistryEnabled        bool
	MaxParticipants           int
	MaxSessionDataLen         int
	MaxAppMetadataLen         int
	MaxRebalanceSignedUpdates int
	MaxSessionKeyIDs          int
	MaxSessionKeysPerUser     int

	RateLimitPerSec float64
	RateLimitBurst  float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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