-
Notifications
You must be signed in to change notification settings - Fork 522
Streamline Stargate/gRPC querier interfaces #2093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| // RejectStargateQuerier is a querier that rejects all stargate queries. | ||
| // | ||
| // Use AcceptListStargateQuerier instead to create a list of accepted query types. | ||
| func RejectStargateQuerier(ctx sdk.Context, request *wasmvmtypes.StargateQuery) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is breaking since it changes the signature of a public function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's breaking. I would assume that most people don't use the RejectStargateQuerier directly, since it's the default anyways, but not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github only finds copies, no usage: https://github.com/search?q=RejectStargateQuerier&type=code
So probably a good change to include in 0.55
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2093 +/- ##
==========================================
- Coverage 42.99% 42.99% -0.01%
==========================================
Files 85 85
Lines 11601 11600 -1
==========================================
- Hits 4988 4987 -1
- Misses 6166 6167 +1
+ Partials 447 446 -1
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| return nil, wasmvmtypes.UnsupportedRequest{Kind: "Stargate queries are disabled on this chain"} | ||
| } | ||
|
|
||
| var _ stargateQuerierFn = RejectStargateQuerier // just a type check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM 👍
|
Thanks for the reviews. Feel free to merge whenever you consider it useful for 0.55. |
|
@Mergifyio backport releases/v0.6x |
✅ Backports have been created
|
* Change RejectStargateQuerier from factory function to free function * Clarify error message to help contract developers * Streamline and improve documentation for RejectGrpcQuerier * Pull out function signatures * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> (cherry picked from commit 146cdea)
Streamline Stargate/gRPC querier interfaces (backport #2093)
* Make validateAddress cheaper if canonicalization fails (#2193) (cherry picked from commit cdb72b1) * feat(data): Make sure Aliases in DenomUnit is not nil (cherry picked from commit 69c38a5) * chore(comment): Add code comments (cherry picked from commit 1eaf666) * chore(test): Add test (cherry picked from commit 8473fea) * chore(comment): Improve comment clarity in query_plugins.go (cherry picked from commit e3df21e) * Restore file permission (cherry picked from commit 9eb5dd8) * Rename message args 💅 (#2207) * Rename args to `msg` consistently in WasmEngine interface * Rename file to wasm_engine.go "Wasmer" is an implementation detail that can change at any time (cherry picked from commit 1756d2d) * Use gas overflow error for ToWasmVMGas (cherry picked from commit dda8ea3) * Streamline Stargate/gRPC querier interfaces (#2093) * Change RejectStargateQuerier from factory function to free function * Clarify error message to help contract developers * Streamline and improve documentation for RejectGrpcQuerier * Pull out function signatures * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> (cherry picked from commit 146cdea) * Lower `DefaultMaxCallDepth` (#2244) * Lower DefaultMaxCallDepth * Add changelog entry * Fix test * Bump cosmos-sdk v0.53.0 (#2250) * Bump cosmos-sdk v0.53.0 * remove crisis module * fix simulations * Suppress lint errors * Fix golangci-lint warnings * Remove unnecessary loop copy * Updates * [autofix.ci] apply automated fixes * fix: Disable IAVL prunning to prevent dangling goroutines in tests * fix: Try to use newer golangci * Increase resources for lint * Update golangci-lint (#2269) * Remove deprecated golangci-lint configs * Update golangci-lint * Apply linter fixes --------- Co-authored-by: Christoph Otter <chris@confio.gmbh> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Tomasz Kulik <tomek.kulik2@gmail.com> * Prepare changelog for release (#2274) * Prepare changelog for release * Update * Update wasmvm (cherry picked from commit d5d9860) * Fix tests (cherry picked from commit 8404057) * Update dockerfile (cherry picked from commit c51b4e4) * Fix * Improve readability * Fix * Restructure error handling * Add comments * Add setup cost for IBC operations * Fix tests * Use ExpectedJSONSize function --------- Co-authored-by: Christoph Otter <chris@confio.gmbh> Co-authored-by: BigtoC <taitocdt@gmail.com> Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Tomasz Kulik <tomek.kulik2@gmail.com>
This PR aims to improve readbility of the Stargate/gRPC querier interfaces and implementations. It helped me reason about what chains need to do to override defaults. Hope it helps someone.