Conversation
…nd adjust for direct RPC mode - Consolidated provider configurations into a single smartrouter config file. - Removed outdated WebSocket handling and legacy provider-specific YAML generation. - Transitioned to direct RPC mode, simplifying connection strategy and bypassing intermediate processes. - Improved path handling with quoted variables to ensure correctness and robustness. - Updated logs and final output to reflect the new configuration structure and direct RPC endpoints. Took 1 hour 19 minutes
…nd adjust for direct RPC mode - Consolidated provider configurations into a single smartrouter config file. - Removed outdated WebSocket handling and legacy provider-specific YAML generation. - Transitioned to direct RPC mode, simplifying connection strategy and bypassing intermediate processes. - Improved path handling with quoted variables to ensure correctness and robustness. - Updated logs and final output to reflect the new configuration structure and direct RPC endpoints.
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan Review Summary by QodoRefactor: Remove smart router and switch to direct RPC mode
WalkthroughsDescription• Removed the entire protocol/rpcsmartrouter package including relay state machine, subscription managers, upstream pools, and error mapper • Removed direct RPC connection types and logic from protocol/lavasession, including DirectRPCSessionConnection struct and related methods • Removed selectedProvider parameter from GetSessions() and related methods across consumer session manager, RPC consumer, and tests • Removed direct RPC endpoint probing and health checking functionality • Cleaned up consumer session manager to simplify provider selection logic • Removed smart router-specific metrics test implementations and dual test runner patterns • Added Prometheus collector registration helper function with graceful handling of already-registered collectors • Updated 30+ test cases to use new 10-parameter GetSessions() function signature • Fixed proposal metadata length issue in spec client CLI by using title instead of full description • Removed smart router references from documentation across multiple files (flags, interfaces, timeout, relay processor, chain parser, etc.) • Reformatted and updated descriptions in 40+ spec JSON files with consistent 4-space indentation • Removed smart router-specific testing documentation from mock RPC and REST server README files • Removed legacy setup scripts, WRS test framework, and standalone state tracker Diagramflowchart LR
A["Smart Router<br/>Components"] -->|Removed| B["rpcsmartrouter<br/>Package"]
C["Direct RPC<br/>Connection Logic"] -->|Removed| D["lavasession<br/>Types"]
E["Consumer Session<br/>Manager"] -->|Simplified| F["Provider Selection<br/>Logic"]
G["Test Code"] -->|Updated| H["10-param<br/>GetSessions"]
I["Documentation"] -->|Cleaned| J["Smart Router<br/>References"]
K["Spec Files"] -->|Reformatted| L["JSON Formatting<br/>& Descriptions"]
File Changes1. protocol/lavasession/consumer_session_manager_test.go
|
Code Review by Qodo
1. Extra spaces before comment
|
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 186 files with indirect coverage changes 🚀 New features to boost your workflow:
|
| require.NoError(t, err) | ||
| csm.validAddresses = []string{} // set valid addresses to zero | ||
| css, err := csm.GetSessions(ctx, 1, cuForFirstRequest, NewUsedProviders(nil), servicedBlockNumber, "", nil, common.NO_STATE, 0, "", "") // get a session | ||
| csm.validAddresses = []string{} // set valid addresses to zero |
There was a problem hiding this comment.
1. Extra spaces before comment 📘 Rule violation ⚙ Maintainability
consumer_session_manager_test.go contains excessive spaces before an inline comment on a modified line, which is not gofmt-clean. This can cause formatting churn and indicates the file was not properly formatted after edits.
Agent Prompt
## Issue description
A modified Go test line uses excessive spaces before an inline comment, which is not `gofmt`-clean.
## Issue Context
This line was changed in the PR and should be normalized to standard Go formatting.
## Fix Focus Areas
- protocol/lavasession/consumer_session_manager_test.go[485-485]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| // Use the title as metadata instead of the full description, which can | ||
| // exceed MaxMetadataLen when many spec files are combined. | ||
| metadata := proposal.Proposal.Title | ||
| submitPropMsg, err := govv1.NewMsgSubmitProposal([]sdk.Msg{msgExecLegacy}, deposit, from.String(), metadata, proposal.Proposal.Title, proposal.Proposal.Description, isExpedited) |
There was a problem hiding this comment.
2. Oversized proposal summary 🐞 Bug ✓ Correctness
x/spec/client/cli/tx.go now passes proposal.Proposal.Description as the MsgSubmitProposal summary, but ParseSpecAddProposalJSON concatenates Description across multiple input files, making this field grow without bound and potentially causing spec-add proposal submissions to fail validation or become too large.
Agent Prompt
### Issue description
`spec-add` proposal submission uses `proposal.Proposal.Description` as the `summary` argument to `govv1.NewMsgSubmitProposal`. When multiple proposal files are passed, `ParseSpecAddProposalJSON` concatenates all descriptions, so the `summary` becomes unbounded and can cause proposal submission failures or overly large transactions.
### Issue Context
- Multi-file parsing concatenates descriptions.
- `NewMsgSubmitProposal(..., metadata, title, summary, ...)` expects `summary` to be a short human-readable summary.
### Fix Focus Areas
- x/spec/client/cli/tx.go[123-133]
- x/spec/client/utils/utils.go[25-56]
### Suggested fix
- Keep `metadata := proposal.Proposal.Title` (or `""`) if needed.
- Change the `summary` argument to a bounded string (e.g., a constant like `"Add spec(s)"`, or a truncated version of the description to a safe max length), and keep the full long-form text inside the actual `SpecAddProposal` content where it belongs.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Title: refactor: remove smart router and switch to direct RPC mode
Body:
Summary
protocol/rpcsmartrouterpackage and all related code (relay state machine, subscription managers, upstream pools, error mapper, etc.)cmd/lavapbinary, standalone state tracker, direct RPC connection logic, and associated tests