Skip to content

refactor: split lavap into two distinct deployment modes and d…#2108

Merged
nimrod-teich merged 1 commit into
mainfrom
smart-router-lava-refactor-final
Nov 18, 2025
Merged

refactor: split lavap into two distinct deployment modes and d…#2108
nimrod-teich merged 1 commit into
mainfrom
smart-router-lava-refactor-final

Conversation

@avitenzer

Copy link
Copy Markdown
Collaborator

…ecouple smart router from blockchain dependencies

Description

Major architectural refactoring that splits lavap into two distinct deployment modes and decouples the smart router from blockchain dependencies.

Core Changes

1. Split lavap into two separate commands:

  • lavap rpcconsumer - Decentralized mode with blockchain pairing
  • lavap rpcsmartrouter - Centralized/enterprise mode with static providers

2. Disconnected rpcsmartrouter from blockchain:

  • No blockchain state tracking - Removed dependency on ongoing blockchain queries
  • No epoch management - Uses standalone epoch timer (15-minute default)
  • No on-chain pairing - Static providers configured via YAML instead
  • Optional blockchain connection - Only queries spec once during initialization (can use static spec files)
  • Ephemeral key mode - Can run without keyring/wallet using generated ephemeral keys
  • Approximate block height - Calculated from epoch timer instead of blockchain queries

Additional Improvements

  • Enhanced static provider validation: Added spec path validation and improved configuration handling for standalone mode
  • Improved session/epoch management: Refactored session epoch handling with callbacks for flexible block height sources
  • Better error handling: Streamlined error handling in relay functions, health commands, and E2E test scripts
  • E2E test infrastructure: Added error diagnostics, improved wait logic, and enhanced blockchain query handling
  • Code quality: Fixed linting issues, improved code readability, and reduced conditional nesting

Architecture Impact

Aspect rpcconsumer (Decentralized) rpcsmartrouter (Centralized)
Provider Discovery Blockchain pairing Static YAML configuration
Blockchain Dependency Required (ongoing) Optional (one-time spec query)
Epoch Management On-chain epochs Standalone timer
Trust Model Trustless verification Trust configured providers
Setup Requires wallet/keyring Can use ephemeral keys
Best For Public networks Enterprise/known infrastructure

…ecouple smart router from blockchain dependencies

Major architectural refactoring that splits lavap into two distinct deployment modes and decouples the smart router from blockchain dependencies.

Core Changes:

1. Split lavap into two separate commands:
   - lavap rpcconsumer - Decentralized mode with blockchain pairing
   - lavap rpcsmartrouter - Centralized/enterprise mode with static providers

2. Disconnected rpcsmartrouter from blockchain:
   - No blockchain state tracking - Removed dependency on ongoing blockchain queries
   - No epoch management - Uses standalone epoch timer (15-minute default)
   - No on-chain pairing - Static providers configured via YAML instead
   - Optional blockchain connection - Only queries spec once during initialization (can use static spec files)
   - Ephemeral key mode - Can run without keyring/wallet using generated ephemeral keys
   - Approximate block height - Calculated from epoch timer instead of blockchain queries

Additional Improvements:
- Enhanced static provider validation with spec path validation and improved configuration handling
- Improved session/epoch management with callbacks for flexible block height sources
- Better error handling in relay functions, health commands, and E2E test scripts
- E2E test infrastructure with error diagnostics and enhanced blockchain query handling
- Code quality improvements including fixed linting issues and reduced conditional nesting
@avitenzer avitenzer changed the title Refactor(lavap): split lavap into two distinct deployment modes and d… refactor: split lavap into two distinct deployment modes and d… Nov 18, 2025
@github-actions

github-actions Bot commented Nov 18, 2025

Copy link
Copy Markdown

Test Results

2 954 tests  +132   2 953 ✅ +132   32m 1s ⏱️ +48s
  126 suites +  2       1 💤 ±  0 
    7 files   ±  0       0 ❌ ±  0 

Results for commit f5c4067. ± Comparison against base commit 2279f66.

This pull request removes 32 and adds 164 tests. Note that renamed tests count towards both.
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestBasic
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestHasRequiredNodeResultsQuorumScenarios
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestHasRequiredNodeResultsQuorumScenarios/quorum_met_with_all_providers_sending_same_data
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestHasRequiredNodeResultsQuorumScenarios/quorum_met_with_same_data_from_min_providers
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestHasRequiredNodeResultsQuorumScenarios/quorum_not_met_with_different_data_from_providers
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestHasRequiredNodeResultsQuorumScenarios/quorum_not_met_with_different_data_from_providers#01
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestHasRequiredNodeResultsQuorumScenarios/quorum_not_met_with_mixed_data_(1_same,_2_different)
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestProcessingTimestampLifecycle
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestRelayError
github.com/lavanet/lava/v5/protocol/rpcconsumer ‑ TestRelayError/test_majority_of_error_body
…
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_CalculateCurrentEpoch
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_Callbacks
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_ContextCancellation
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_DifferentDurations
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_DifferentDurations/10_minutes
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_DifferentDurations/1_hour
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_DifferentDurations/2_hours
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_DifferentDurations/30_minutes
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_EpochProgression
github.com/lavanet/lava/v5/protocol/common ‑ TestEpochTimer_FixedEpochZeroTime
…

♻️ This comment has been updated with latest results.

@AnnaR-prog AnnaR-prog self-requested a review November 18, 2025 13:55
@nimrod-teich nimrod-teich merged commit c0b3e6e into main Nov 18, 2025
48 of 50 checks passed
@nimrod-teich nimrod-teich deleted the smart-router-lava-refactor-final branch November 18, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants