Skip to content
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

feat: set stargate querier accepted list #1083

Merged
merged 8 commits into from
Feb 23, 2023

Conversation

dadamu
Copy link
Contributor

@dadamu dadamu commented Feb 3, 2023

Description

This PR set stargate querier accepted list to enable wasm contract to query the allowed data from the chain query router.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@github-actions github-actions bot added kind/build Related to the build of the project x/CLI x/profiles Module that allows to create and manage decentralized social profiles x/relationships x/subspaces Issue on the x/subspaces module labels Feb 3, 2023
@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Base: 80.52% // Head: 80.76% // Increases project coverage by +0.23% 🎉

Coverage data is based on head (9d5a2e2) compared to base (58676fd).
Patch coverage: 85.00% of modified lines in pull request are covered.

❗ Current head 9d5a2e2 differs from pull request most recent head 6055c6e. Consider uploading reports for the commit 6055c6e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1083      +/-   ##
==========================================
+ Coverage   80.52%   80.76%   +0.23%     
==========================================
  Files         180      185       +5     
  Lines       15804    16618     +814     
==========================================
+ Hits        12726    13421     +695     
- Misses       2522     2610      +88     
- Partials      556      587      +31     
Impacted Files Coverage Δ
x/subspaces/types/permissions.go 77.77% <ø> (ø)
x/subspaces/types/codec.go 55.88% <43.75%> (-3.74%) ⬇️
x/subspaces/wasm/querier.go 56.52% <53.84%> (-0.79%) ⬇️
x/subspaces/types/genesis.go 96.00% <70.83%> (-4.00%) ⬇️
x/subspaces/legacy/v5/store.go 81.63% <72.72%> (-7.66%) ⬇️
x/subspaces/types/models_feegrant.go 78.94% <78.94%> (ø)
x/subspaces/keeper/alias_functions.go 80.76% <79.54%> (-0.49%) ⬇️
x/subspaces/keeper/grpc_query.go 82.69% <79.66%> (-1.21%) ⬇️
x/subspaces/types/msgs_feegrant.go 84.21% <84.21%> (ø)
x/subspaces/keeper/msg_server_feegrant.go 90.00% <90.00%> (ø)
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@RiccardoM RiccardoM force-pushed the paul/set-stargate-querier-accepted-list branch from d58b7b7 to 380f303 Compare February 7, 2023 20:34
@github-actions github-actions bot removed x/relationships x/CLI x/profiles Module that allows to create and manage decentralized social profiles x/subspaces Issue on the x/subspaces module kind/build Related to the build of the project labels Feb 7, 2023
@dadamu dadamu force-pushed the paul/set-stargate-querier-accepted-list branch from 1c511bd to 476143f Compare February 21, 2023 06:20
@@ -282,7 +282,7 @@ replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

// Our wasmd branch is: https://github.com/desmos-labs/wasmd v0.30.x-desmos
github.com/CosmWasm/wasmd => github.com/desmos-labs/wasmd v0.30.0-desmos.1
github.com/CosmWasm/wasmd => github.com/desmos-labs/wasmd v0.30.0-desmos.2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update to v0.30.0-desmos.2 to have custom AnyResolver to have the custom format of Any{} for desmos-bindings, see:
https://github.com/desmos-labs/wasmd/commit/8fa03330f6d5def43464166f60cb34e7de351cbd

And it also fixes the protoResponse pointer marshaling without reset issue, see:
https://github.com/desmos-labs/wasmd/commit/b5cfa16e978097b2e11835c175ec1818d61a52f8

@@ -63,7 +77,59 @@ func NewDesmosCustomQueryPlugin(
querier := wasmdesmos.NewQuerier(queriers)

return wasm.QueryPlugins{
Custom: querier.QueryCustom,
Stargate: wasmkeeper.AcceptListStargateQuerier(GetStargateAcceptedQueries(), grpcQueryRouter, cdc),
Copy link
Contributor Author

@dadamu dadamu Feb 22, 2023

Choose a reason for hiding this comment

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

Allowing all desmos custom moduels' querier for stargate feature. Our queries do not have non-deterministic issue.

Note: cosmos-sdk stargate querier has non-deterministic issue since some of the queries allow to retrieve historical data, like staking.HistoricalInfo. The result of historical queries will be influenced by validator pruning setting, as a result, occurs non-deterministic issue.

@github-actions github-actions bot added x/subspaces Issue on the x/subspaces module kind/build Related to the build of the project kind/ci Improve the CI/CD labels Feb 22, 2023
@dadamu dadamu force-pushed the paul/set-stargate-querier-accepted-list branch from cf66d6c to 25b6ab5 Compare February 23, 2023 06:17
@dadamu dadamu force-pushed the paul/set-stargate-querier-accepted-list branch from 25b6ab5 to 9d5a2e2 Compare February 23, 2023 06:18
@dadamu dadamu marked this pull request as ready for review February 23, 2023 06:18
@dadamu dadamu requested a review from a team as a code owner February 23, 2023 06:18
@RiccardoM RiccardoM self-requested a review February 23, 2023 13:29
Copy link
Contributor

@RiccardoM RiccardoM left a comment

Choose a reason for hiding this comment

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

Overall looks good, I only have one small comment.
Can you also please add a changelog entry as well?

@@ -23,7 +23,7 @@ func RandomizeGenState(simState *module.SimulationState) {
members := randomUserGroupsMembers(simState.Rand, simState.Accounts, groups)
acl := randomACL(simState.Rand, simState.Accounts, subspaces)
initialSubspaceID, subspacesData := getSubspacesDataEntries(subspaces, sections, groups)
grants := append(randomUserGrants(simState.Rand, simState.Accounts, subspaces), randomGroupGrants(simState.Rand, simState.Accounts, groups)...)
grants := append(randomUserGrants(simState.Rand, simState.Accounts, subspaces), randomGroupGrants(simState.Rand, groups)...)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was the code inside this simulation changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The previous simulation test is failed since the behaviour was wrong. The granter must be a subspace treasury instead of a random user address.

Copy link

@manu0466 manu0466 left a comment

Choose a reason for hiding this comment

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

Notting to add to Riccardo's comments.

@dadamu
Copy link
Contributor Author

dadamu commented Feb 23, 2023

@RiccardoM Updated changeset.

@RiccardoM RiccardoM added the automerge Automatically merge PR once all prerequisites pass label Feb 23, 2023
@mergify mergify bot merged commit 581e029 into master Feb 23, 2023
@mergify mergify bot deleted the paul/set-stargate-querier-accepted-list branch February 23, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all prerequisites pass kind/build Related to the build of the project kind/ci Improve the CI/CD x/subspaces Issue on the x/subspaces module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants