Skip to main content

Overview

Profiles enable multi-tenancy in Lasso by providing isolated routing configurations with independent chains, providers, rate limits, and metrics. Each (profile, chain) pair runs in an isolated supervision tree while sharing provider infrastructure for efficiency.

Profile Structure

Profiles are YAML files in config/profiles/ with frontmatter metadata:

Frontmatter Fields

name (required)
  • Display name for the profile
  • Used in dashboard and logs
slug (required)
  • URL-safe identifier
  • Used in API routes: /rpc/profile/:slug/:chain
  • Must be unique across all profiles
rps_limit (optional)
  • Requests per second limit
  • Default: 100
burst_limit (optional)
  • Maximum burst size for rate limiting
  • Default: 500

Profile-Scoped Configuration

Each profile can configure:

Chains

Multiple blockchain networks with independent provider sets:

Providers

Provider configuration per chain:
Provider Fields:

Environment Variables

Provider URLs support ${ENV_VAR} substitution:
Unresolved environment variables (literal ${VAR_NAME} in URLs) will crash at startup. This prevents silent failures.

Monitoring Configuration

Per-chain health monitoring settings:

Selection Configuration

Provider eligibility filtering:

WebSocket Configuration

Subscription management and failover:

Profile Isolation

Each (profile, chain) pair runs in an isolated supervision tree:

Isolated Resources

Per (profile, chain):
  • Independent circuit breaker state
  • Isolated metrics and benchmarking
  • Separate rate limits
  • Dedicated WebSocket subscriptions
  • Independent routing decisions

Shared Resources

To optimize resource usage, provider infrastructure is shared across profiles: Shared across profiles (keyed by instance_id):
  • Provider instances (same URL + chain = same instance)
  • Circuit breakers (HTTP and WebSocket)
  • WebSocket connections
  • Block height tracking
  • Health probes
Instance ID derivation:
Two profiles using https://eth.llamarpc.com for Ethereum will share:
  • The same WebSocket connection
  • The same circuit breakers
  • The same block height data
But maintain separate:
  • Routing policies
  • Metrics aggregation
  • Rate limits

URL Routing

Profiles are accessed via URL paths:

Profile-Specific Routes

Default Profile Routes

Routes without /profile/:profile use the “default” profile:
The “default” profile must exist in config/profiles/default.yml. Lasso validates this at startup.

Profile Loading

Profiles are loaded at application startup:

Configuration Backend

File Backend (default):
  • Loads from config/profiles/*.yml
  • Hot-reload not supported (requires restart)
Database Backend (SaaS extension, not in OSS):
  • Dynamic profile management
  • Hot-reload support
  • Multi-tenant isolation

Example Profiles

Production Profile

High rate limits, premium providers:

Development Profile

Lower rate limits, free public providers:

Analytics Profile

Archival data, specific method routing:

Provider Capabilities

Profiles can declare provider capabilities for method filtering and error classification:
Capability Features: Method Filtering:
  • unsupported_categories: Block entire RPC method categories
  • unsupported_methods: Block specific method names
Parameter Validation:
  • max_block_range: Maximum block range for eth_getLogs
  • max_block_age: Maximum block age for state queries
  • block_age_methods: Methods subject to max_block_age
Error Classification:
  • Per-provider error rules evaluated top-to-bottom
  • First match wins
  • Affects retry behavior and circuit breaker penalties
See Provider Selection for how capabilities affect the filter pipeline.

Profile Validation

Lasso validates profiles at startup:

Required Validations

Default Profile Exists:
Environment Variables Resolved:
Chain Configuration Valid:

Profile Status

Get profile information at runtime:

Profile Lifecycle

Startup

  1. ConfigStore.load_all_profiles() loads YAML files
  2. Catalog.build_from_config() creates provider instance mappings
  3. start_shared_infrastructure() starts instance supervisors and probes
  4. start_all_chains() starts (profile, chain) supervisors

Runtime

Profiles are read-only at runtime. Configuration changes require application restart.

Shutdown

Graceful shutdown drains in-flight requests:
  • 30-second grace period for in-flight requests
  • Circuit breaker state preserved in ETS (survives GenServer restarts)
  • Benchmark metrics persisted to disk

Next Steps

Routing Strategies

Configure provider selection strategies

Provider Selection

Understand the 7-stage filter pipeline

Circuit Breakers

Configure fault tolerance thresholds

Architecture

Explore the OTP supervision tree