inspect: resurrect the inspect command#9655
Conversation
EDIT: Updated, see [comment below]( #6785 (comment)) This change adds a sketch of the `Debug` mode. This change adds a `Debug` struct to the node package. This `Debug` struct is intended to be created and started by a command in the `cmd` directory. The `Debug` struct runs the RPC server on the data directories: both the state store and the block store. This change required a good deal of refactoring. Namely, a new `rpc.go` file was added to the `node` package. This file encapsulates functions for starting RPC servers used by nodes. A potential additional change is to further factor this code into shared code _in_ the `rpc` package. Minor API tweaks were also made that seemed appropriate such as the mechanism for fetching routes from the `rpc/core` package. Additional work is required to register the `Debug` service as a command in the `cmd` directory but I am looking for feedback on if this direction seems appropriate before diving much further. closes: #5908
|
Just to confirm here, the idea's to backport this to v0.34 and v0.37, right? |
At the moment the goal was to get this up and running with main. It could certainly be backported with a bit of extra work in a non-breaking way if it's important to do so. The changes introduced in v0.36 to remove the package global state in favor of using a type with methods implemented on it is, makes the backport a bit trickier but, again, it can be done definitely if it's important. @tac0turtle, can you help judge how important it is to backport this to v0.34? |
|
I would say it's a nice to have. As we want to encourage users to upgrade, back porting everything enables them to stick around on the older versions for longer. |
|
Opening this as a full PR to the tip of |
thanethomson
left a comment
There was a problem hiding this comment.
It looks like this PR pulled in a whole bunch of other unrelated changes to the RPC system as well?
cmwaters
left a comment
There was a problem hiding this comment.
Nice cleanup as well.
As this PR has a few different additions (not just inspect but modifications to rpc and Canceled instead of Cancelled, make sure you document all of them in the changelog.
Other than a few minor documentation things I see nothing wrong with the PR semantically
Co-authored-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Callum Waters <cmwaters19@gmail.com>
cmwaters
left a comment
There was a problem hiding this comment.
Looks like you need to appease the linter and add a entry to the changelog. Other than that looks good
|
does setting the db into readonly mode for this provide extra performance benefits? |
|
@tac0turtle Unlikely. I checked |
| // hash, app hash, block height and time. | ||
| // More: https://docs.tendermint.com/main/rpc/#/Info/status | ||
| func Status(ctx *rpctypes.Context) (*ctypes.ResultStatus, error) { | ||
| // More: https://docs.tendermint.com/master/rpc/#/Info/status |
There was a problem hiding this comment.
Don't know why this was changed back to master
There was a problem hiding this comment.
It would've been preferable to have this PR as 3 distinct PRs, each making just one substantial change:
- The refactoring of the RPC to remove the global state
- The refactoring of the indexing functionality
- Implementation of the inspect command
That would've made these changes easier to reason about and quicker to review overall.
| // hash, app hash, block height and time. | ||
| // More: https://docs.tendermint.com/main/rpc/#/Info/status | ||
| func Status(ctx *rpctypes.Context) (*ctypes.ResultStatus, error) { | ||
| // More: https://docs.tendermint.com/master/rpc/#/Info/status |
There was a problem hiding this comment.
| // More: https://docs.tendermint.com/master/rpc/#/Info/status | |
| // More: https://docs.tendermint.com/main/rpc/#/Info/status |
|
Is there a chance this could get backported to 0.34? |
It's possible but complicated. There is a breaking change included here that makes it impossible to perform the simple mechanical backport. I had asked above about how pressing it was to backport this, has anything changed with respect to its priority? |
|
I'm building a query only like node and this would help. I can fork the rpc package and pull out what I need as well. |
WIP: resurrect the inspect command from #6785
PR checklist
CHANGELOG_PENDING.mdupdated, or no changelog entry neededdocs/) and code comments, or nodocumentation updates needed