Skip to content

feat: support multiple --use-static-spec sources with aggregation#2225

Merged
nimrod-teich merged 1 commit into
mainfrom
feat/multi-source-static-spec
Feb 17, 2026
Merged

feat: support multiple --use-static-spec sources with aggregation#2225
nimrod-teich merged 1 commit into
mainfrom
feat/multi-source-static-spec

Conversation

@nimrod-teich

@nimrod-teich nimrod-teich commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Allow --use-static-spec flag to be specified multiple times, aggregating
specs from local files, directories, GitHub, and GitLab repositories.
When the same chain ID appears in multiple sources, the later source
completely replaces the earlier spec (full replacement, not merge).

Changes:

  • Change --use-static-spec from String to StringArray flag type
  • Add spec aggregation logic with last-wins override semantics
  • Support comma-separated local file paths (file1.json,file2.json)
  • Add helper functions for loading all specs from various sources
  • Add comprehensive tests for aggregation behavior
  • Remove unused GetSpecsFromPath function

Multiple local files can be specified either as separate flags or comma-separated:
--use-static-spec file1.json --use-static-spec file2.json
--use-static-spec file1.json,file2.json

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...

  • read the contribution guide
  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the main branch
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers 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...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

@codecov

codecov Bot commented Feb 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 27.61194% with 97 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
protocol/statetracker/state_tracker.go 0.00% 66 Missing ⚠️
utils/keeper/spec.go 75.00% 7 Missing and 5 partials ⚠️
protocol/rpcprovider/rpcprovider.go 12.50% 7 Missing ⚠️
utils/specfetcher/api.go 0.00% 5 Missing ⚠️
protocol/rpcsmartrouter/rpcsmartrouter.go 0.00% 4 Missing ⚠️
protocol/rpcconsumer/rpcconsumer.go 0.00% 3 Missing ⚠️
Flag Coverage Δ
consensus 8.62% <67.92%> (+0.05%) ⬆️
protocol 34.49% <1.23%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
protocol/common/cobra_common.go 0.00% <ø> (ø)
protocol/rpcconsumer/rpcconsumer.go 0.00% <0.00%> (ø)
protocol/rpcsmartrouter/rpcsmartrouter.go 4.53% <0.00%> (ø)
utils/specfetcher/api.go 39.39% <0.00%> (-7.04%) ⬇️
protocol/rpcprovider/rpcprovider.go 8.89% <12.50%> (ø)
utils/keeper/spec.go 27.36% <75.00%> (+27.36%) ⬆️
protocol/statetracker/state_tracker.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Feb 17, 2026

Copy link
Copy Markdown

Test Results

    7 files  ± 0     86 suites  ±0   31m 30s ⏱️ +18s
3 459 tests +27  3 458 ✅ +27  1 💤 ±0  0 ❌ ±0 
3 685 runs  +27  3 684 ✅ +27  1 💤 ±0  0 ❌ ±0 

Results for commit ef61664. ± Comparison against base commit 41b2987.

This pull request removes 4 and adds 31 tests. Note that renamed tests count towards both.
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/regular_provider_with_spec_path_should_not_fail_with_spec_path_error
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/regular_provider_without_spec_path_should_not_fail_with_spec_path_error
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/static_provider_with_spec_path_should_not_fail_early_validation
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/static_provider_without_spec_path_should_fail
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/regular_provider_with_spec_paths_should_not_fail_with_spec_path_error
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/regular_provider_without_spec_paths_should_not_fail_with_spec_path_error
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/static_provider_with_empty_spec_paths_should_fail
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/static_provider_with_multiple_spec_paths_should_not_fail_early_validation
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/static_provider_with_spec_paths_should_not_fail_early_validation
github.com/lavanet/lava/v5/protocol/rpcprovider ‑ TestStaticProvider_RequiresSpecPath/static_provider_without_spec_paths_should_fail
github.com/lavanet/lava/v5/utils/keeper ‑ TestExpandSpecWithDependencies
github.com/lavanet/lava/v5/utils/keeper ‑ TestExpandSpecWithDependencies/expand_existing_spec
github.com/lavanet/lava/v5/utils/keeper ‑ TestExpandSpecWithDependencies/expand_non-existent_spec
github.com/lavanet/lava/v5/utils/keeper ‑ TestGetAllSpecsFromFile
…

♻️ This comment has been updated with latest results.

Allow --use-static-spec flag to be specified multiple times, aggregating
specs from local files, directories, GitHub, and GitLab repositories.
When the same chain ID appears in multiple sources, the later source
completely replaces the earlier spec (full replacement, not merge).

Changes:
- Change --use-static-spec from String to StringArray flag type
- Add spec aggregation logic with last-wins override semantics
- Support comma-separated local file paths (file1.json,file2.json)
- Add helper functions for loading all specs from various sources
- Add comprehensive tests for aggregation behavior
- Remove unused GetSpecsFromPath function

Multiple local files can be specified either as separate flags or comma-separated:
  --use-static-spec file1.json --use-static-spec file2.json
  --use-static-spec file1.json,file2.json

Co-authored-by: Cursor <cursoragent@cursor.com>
@nimrod-teich nimrod-teich force-pushed the feat/multi-source-static-spec branch from 86f14a1 to ef61664 Compare February 17, 2026 14:08
@nimrod-teich nimrod-teich changed the title feat: support multiple --use-static-spec sources with last-wins override feat: support multiple --use-static-spec sources with aggregation Feb 17, 2026
@nimrod-teich nimrod-teich merged commit 1ed0795 into main Feb 17, 2026
32 of 33 checks passed
@nimrod-teich nimrod-teich deleted the feat/multi-source-static-spec branch February 17, 2026 14:59
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.

2 participants