Skip to content

Conversation

@webmaster128
Copy link
Member

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.

// 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) {
Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 42.99%. Comparing base (939a837) to head (4d27351).
Report is 47 commits behind head on main.

Files with missing lines Patch % Lines
x/wasm/keeper/query_plugins.go 33.33% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
x/wasm/keeper/query_plugins.go 58.97% <33.33%> (-0.09%) ⬇️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@chipshort chipshort left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Copy link
Contributor

@pinosu pinosu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM 👍

@webmaster128
Copy link
Member Author

Thanks for the reviews. Feel free to merge whenever you consider it useful for 0.55.

@pinosu pinosu merged commit 146cdea into main Mar 19, 2025
18 of 19 checks passed
@pinosu pinosu deleted the streamline-RejectStargateQuerier branch March 19, 2025 09:53
@chipshort
Copy link
Contributor

@Mergifyio backport releases/v0.6x

@mergify
Copy link
Contributor

mergify bot commented May 8, 2025

backport releases/v0.6x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 8, 2025
* 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)
chipshort added a commit that referenced this pull request May 8, 2025
Streamline Stargate/gRPC querier interfaces (backport #2093)
pinosu added a commit that referenced this pull request Jun 24, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants