Open
Conversation
d504dc6 to
7bef701
Compare
45b6f32 to
ada3215
Compare
027eb50 to
c04c913
Compare
b35cc46 to
8d10d7d
Compare
…e normalization, metrics, and test tooling This squashes the full `wrs_algo_feature` history into a single change-set on top of `origin/main`. - Replace legacy tier-based provider selection with a weighted-random selection (WRS) path, including: - stake-based weighting, normalization tweaks, and guardrails against invalid/NaN weights - block-availability / requested-block gating and related tuning - deterministic RNG hooks and stronger concurrency/edge-case test coverage - Add Phase-2 adaptive normalization for latency/sync parameters (P10–P90 + global T-Digest), plus config/tuning changes. - Expand consumer/provider selection observability: - richer selection stats and logging (incl. NaN/Inf sanitization) - missing Prometheus metric registrations + latest-provider-block metric fixes - selection-via-header support and related endpoint/header plumbing - Improve rpcprovider test-mode behavior for deterministic latest_block/head-gap and availability failure simulation; preserve test LatestBlock behavior. - Add/extend scripts and local tooling for WRS analysis and reproducible test scenarios: - WRS analysis helpers + e2e scripts/test data - `wrs_tests/` local framework (stake/latency/availability/sync) and analyzers - Misc hardening/cleanup: - avoid nil ParsedInput panic in parser flow - log timestamp precision tweaks, gofmt, and assorted test/config updates - remove comments - refactor: remove provider optimizer exploration feature - wrs_tests: add local WRS test framework and static stake support - feat(analyze): add log analysis script for provider selection metrics - feat(setup): add init script for static and backup provider configuration - refactor(provideroptimizer): add context parameter to provider selection methods - consumer: add probe-update-weight CLI flag - refactor(weighted_selector): enhance total stake calculation for consistent normalization - Enable nanosecond precision in log timestamps - feat(wrs): Fix Test 3 sync testing with deterministic baseline approach - provideroptimizer: remove block-availability penalty - feat: Add support for provider selection via header in session management - fix: simplify consumer startup message in init script - fix: lava_consumer_latest_provider_block metric showing 0 - fix: Register missing metrics (latestBlockMetric, qosMetric, providerReputationMetric) with Prometheus - feat: Enable QoS optimizer improvements in init script - feat(provider_setup): enhance ETH RPC configuration and validation - refactor(provider_optimizer): update provider selection metrics logging - feat(metrics): improve validation and handling of adaptive bounds - test: Optimize Test 3 startup by using tendermintrpc-only provider config - feat: add Test 3 init script and metrics analysis tool - feat: enhance WRS logging and metrics with parameter contributions - feat(metrics): enhance provider selection logging and validation - feat(metrics): add sanitizeFloat function to handle NaN/Inf values - feat(metrics): enhance provider selection metrics and tracking - chore: upgrade T-Digest library to caio/go-tdigest v5.0.0 - chore: add tdigest dependency for Phase 2 adaptive normalization - feat: enable Phase 2 adaptive normalization (P10-P90 with global T-Digest) - chore: lower availability threshold from 90% to 80% - feat: implement square root scaling for stake normalization - feat: implement Phase 2 P10-P90 adaptive normalization for sync parameter - refactor: improve adaptive normalization - constants, bounds, and logging - feat: implement Phase 2 P10-P90 hybrid adaptive normalization for latency - e2e optimizer: per-provider test inputs + preserve test LatestBlock under DR - feat(metrics): enhance provider selection metrics tracking - rpcprovider test_mode: availability probability with grpc failure - rpcprovider test_mode: deterministic head/gap latest_block + delay controls - chore: gofmt - feat(provideroptimizer): add selection statistics for provider selection - test(provideroptimizer): add weighted selector edge-case + concurrency tests - fixes after rebase - test(provideroptimizer): stabilize availability selection test - test(provideroptimizer): cover NaN/Inf weight configs - fix(provideroptimizer): harden weighted selector weight validation - fix: prevent divide-by-zero panic in WeightedSelector initialization - tune(provideroptimizer): lower default MinSelectionChance - fix(provideroptimizer): align selector normalization with clamp - fix(provideroptimizer): correct requestedBlock Poisson gating - feat: Implement block availability calculation for provider selection - Updated tests - Updated default weights - Removed dead code - Enhance tests with deterministic behavior and error handling improvements - Refactor provider optimizer to support deterministic seed for testing - Enhance WeightedSelector with customizable random number generation - Refactor provider optimizer initialization to remove unused parameter - Refactor provider selection mechanism to remove tier-based logic and enhance weighted selection - test: Enhance provider optimizer tests for statistical validation - test: Refine provider optimizer tests for deterministic behavior - test: Enhance provider optimizer tests for extreme latency scenarios - test: Update provider optimizer tests for weighted selection logic - refactor: Remove legacy tier-based selection and streamline provider optimization - feat: Implement weighted provider selection system - protocol/parser: avoid nil ParsedInput panic in generic parser flow - chore: Update lava_consumer_static_with_backup.yml for provider configuration Co-authored-by: Cursor <cursoragent@cursor.com>
8d10d7d to
d3d9d64
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!in the type prefix if API or client breaking changemainbranchReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...