Skip to content

add passthrough router#3430

Merged
cody-littley merged 2 commits into
mainfrom
cjl/passthrough-router
May 15, 2026
Merged

add passthrough router#3430
cody-littley merged 2 commits into
mainfrom
cjl/passthrough-router

Conversation

@cody-littley
Copy link
Copy Markdown
Contributor

@cody-littley cody-littley commented May 13, 2026

Describe your changes and provide context

When integrating routers with composite.Store, I realized there was an edge case we hadn't considered. There are test apps (e.g. SimApp) that use different module names than expected. In order to keep those test apps working, I needed to introduce the PassthroughRouter, which skips all module name checking. We can use the passthrough router when operating with a single database backend, since we really only care about restricting module names during migration.

Testing performed to validate your change

unit tests


Note

Medium Risk
Changes routing behavior for MemiavlOnly/FlatKVOnly to stop validating module names, which could alter error surfaces and allow unexpected store names to reach the backend. Scope is localized to the migration router layer and covered by new unit tests.

Overview
Adds a new PassthroughRouter that forwards Read, ApplyChangeSets, Iterator, and GetProof directly to provided accessors (and returns explicit errors when iteration/proofs are unsupported).

Updates BuildRouter to use this passthrough behavior in MemiavlOnly and FlatKVOnly modes (instead of ModuleRouter name checks) to keep compatibility with apps that use nonstandard store names, and generalizes flatkv wiring by accepting flatkv.Store rather than *flatkv.CommitStore. Includes comprehensive unit tests asserting name-agnostic forwarding and error propagation.

Reviewed by Cursor Bugbot for commit a77ea81. Bugbot is set up for automated code reviews on this repo. Configure here.

@cody-littley cody-littley self-assigned this May 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 14, 2026, 1:19 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.36%. Comparing base (2203f0c) to head (a77ea81).

Files with missing lines Patch % Lines
sei-db/state_db/sc/migration/router_builder.go 88.23% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3430      +/-   ##
==========================================
+ Coverage   59.28%   59.36%   +0.08%     
==========================================
  Files        2118     2113       -5     
  Lines      175556   174387    -1169     
==========================================
- Hits       104078   103528     -550     
+ Misses      62407    61851     -556     
+ Partials     9071     9008      -63     
Flag Coverage Δ
sei-chain-pr 80.53% <95.00%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
sei-db/state_db/sc/migration/migration_manager.go 95.48% <ø> (ø)
sei-db/state_db/sc/migration/passthrough_router.go 100.00% <100.00%> (ø)
sei-db/state_db/sc/migration/router_builder.go 52.31% <88.23%> (+1.98%) ⬆️

... and 50 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cody-littley cody-littley added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit 2fb47af May 15, 2026
42 checks passed
@cody-littley cody-littley deleted the cjl/passthrough-router branch May 15, 2026 15:11
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