Deprecate oracle message and query handlers - #3944
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3944 +/- ##
==========================================
- Coverage 59.51% 58.49% -1.02%
==========================================
Files 2326 2230 -96
Lines 198890 188144 -10746
==========================================
- Hits 118367 110054 -8313
+ Misses 69279 67698 -1581
+ Partials 11244 10392 -852
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
PR SummaryMedium Risk Overview The msg server and query server implementations are stubbed to return Tests and integration coverage are aligned with the new behavior: integration YAML scenarios assert deprecation on Reviewed by Cursor Bugbot for commit 796d09b. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Clean, well-scoped deprecation: both oracle msg handlers and all ten gRPC query handlers now return the newly registered ErrOracleDeprecated, legacy SDK routes are dropped (safe — runMsgs prefers the msg service router and RegisterRoutes skips empty routes), and the tests were rewritten to seed keeper state directly. No correctness bugs found; the remaining notes are about deprecation leftovers (gasless carve-out, simulation ops, orphaned NewHandler, repurposed integration files).
Findings: 0 blocking | 7 non-blocking | 2 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- The oracle gasless carve-out in
app/antedecorators/gasless.gois now permanently open.oracleVoteIsGaslesstreats a vote as gasless wheneverGetAggregateExchangeRateVotefinds nothing — and nothing writes an aggregate vote anymore, so theErrAggregateVoteExistbranch is dead and every well-formedMsgAggregateExchangeRateVoteis fee-free and then always fails withErrOracleDeprecated.CheckAndSetSpamPreventionCounterbounds this to one tx per validator per block, so it is not a serious spam vector, but the carve-out now only buys free blockspace for a message that can never succeed. Consider dropping the oracle branch fromIsTxGasless(and the now-vestigialSpammingPreventionDecorator/VoteAloneDecorator) in the same change. - Callers do not uniformly get the deprecation error the PR describes.
GaslessDecoratorpropagates theIsTxGaslesserror, so a vote from a non-feeder is rejected in ante withErrNoVotingPermission/ErrNoValidatorFoundbefore reaching the msg server, andSpammingPreventionDecorator.CheckOracleSpammingstill writes the spam-prevention counter (mem store) on CheckTx for every incoming vote. Worth aligning if "explicit deprecation result" is the goal. x/oracle/simulation/operations.gostill returns weighted operations forMsgAggregateExchangeRateVoteandMsgDelegateFeedConsent, andAppModule.WeightedOperationsstill wires them in. Both callapp.Deliver, which now returnsErrOracleDeprecated, so the operation returns a non-nil error and any simulation run fails. These operations should return no-ops (orWeightedOperationsshould return nil) alongside the handler deprecation.- Both oracle integration files were repurposed into near-duplicate deprecation checks (
set_feeder_test.yamlfor msgs,verify_penalty_counts.yamlfor queries) whileMidBlocker/EndBlockerstill run penalty accounting andSlashAndResetCounterson chain. That end-to-end path now has no integration coverage. Slashing is inert today only becauseDefaultSlashFraction/DefaultMinValidPerWindoware zero — worth a note in the PR description that the deprecation relies on that. - 2 suggestion(s)/nit(s) flagged inline on specific lines.
- 1 non-blocking pre-existing issue(s) listed below under pre-existing issues.
Pre-existing issues
- [suggestion]
x/oracle/client/rest/query.gobuilds legacycustom/oracle/...queries, butAppModule.LegacyQuerierHandleralready returnednilon the base branch, so those REST endpoints were registered against a nil querier and were already non-functional. This PR makes them fail cleanly instead of nil-panicking;RegisterRESTRoutescould be dropped entirely as follow-up.
| return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) | ||
| } | ||
| // Route returns an empty legacy message route. | ||
| func (AppModule) Route() sdk.Route { return sdk.Route{} } |
There was a problem hiding this comment.
[suggestion] With the route removed, oracle.NewHandler in x/oracle/handler.go no longer has any production caller — its only remaining references are handler_test.go (and types.RouterKey is now unreferenced too). That leaves exported production code alive solely to satisfy tests, and module_test.go/TestOracleHandlerRejectsUnknownMessage then assert against a code path nothing routes to. Either delete NewHandler + RouterKey and drop the handler tests, or keep the route wired — the half-state is the part that will confuse the next reader.
| @@ -1,45 +1,13 @@ | |||
| - name: Test penalty counts for oracle process | |||
| - name: Test oracle queries are deprecated | |||
There was a problem hiding this comment.
[suggestion] This file is now named verify_penalty_counts but verifies query deprecation, which makes it a near-duplicate of set_feeder_test.yaml's new content and leaves nothing covering the penalty-counter/end-blocker path it used to exercise. Suggest renaming it (e.g. queries_deprecated.yaml) or folding both checks into one file, so the filename still tells you what broke when it fails.
Summary
ErrOracleDeprecatederror from both oracle message handlersWhy
The oracle module is deprecated, but its Cosmos message and query services still accepted incoming requests. Keeping the gRPC services registered while returning a stable module error gives callers an explicit deprecation result and prevents further oracle message state mutations. The legacy SDK routes are no longer registered.
Impact
Incoming aggregate exchange-rate votes, feeder delegation messages, and oracle queries now fail with oracle error code 25 (
oracle module is deprecated). Internal keeper state and state-machine behavior remain available for compatibility and testing.Validation
go test -race ./x/oracle/...go test ./app -run '^$'go vet ./x/oracle/...gofmt,goimports, andgit diff --checkon all touched files