Closed
Description
openedon Dec 30, 2019
Summary
The sdk.Router interface should be generalized to allow for more stateful router implementations.
Problem Definition
The basic default router included in baseapp is a stateless router i.e. the mapping from path strings to handlers is static and defined in the application codebase (in the app.go). However, the requirement to remain stateless is limiting in that it restricts the ability to do more complex modifications of routes.
Some examples of advanced router functionality that need statefulness:
- Allowing governance or permissioned entities to enable or disable msg routes (requires to be able to read current state of param store)
- Allowing governance to switch the handler that a specific route points to for upgrade purposes
Proposal
- Update the sdk.Router interface's
.Route()
function to take in ansdk.Context
as an argument - Keep the
baseapp.Router
implementation as the stateless design it is right now - Baseapp uses
baseapp.Router
by default unless intentionally passed a new router by an application'sapp.go
- Add
baseapp.WithRouter()
function to allow anapp.go
to pass in its own router implementation.
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment