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

refactor: add pagination to the all pools query #5141

Open
p0mvn opened this issue May 10, 2023 · 6 comments
Open

refactor: add pagination to the all pools query #5141

p0mvn opened this issue May 10, 2023 · 6 comments

Comments

@p0mvn
Copy link
Member

p0mvn commented May 10, 2023

          Just a note here, under QueryDescriptor I think we need to add hasPagination to true. This will add the corresponding flags and such, but I don't think its properly paginates out of the box (there is no osmocli query that currently uses it, and any paginated query we actually rely on uses to old cli setup).

Originally posted by @czarcas7ic in #5091 (comment)

@deividaspetraitis
Copy link
Contributor

Hey @p0mvn, is it still relevant? I would be happy to take a look on it.

@p0mvn
Copy link
Member Author

p0mvn commented Apr 6, 2024

I believe it is still relevant and would appreciate you giving this a shot.

However, please keep in mind that we cannot break existing queries. We will have to define a new version as to avoid breaking the integrators

@deividaspetraitis
Copy link
Contributor

deividaspetraitis commented Apr 6, 2024 via email

@deividaspetraitis
Copy link
Contributor

deividaspetraitis commented Apr 9, 2024

hey @p0mvn, what is the right place to ask for some guidance? I was checking Discord but seemed to be quite silent.
I was trying to run a node locally and while I was able to do so by following this README it seems osmosisd there is outdated and does not support querying pools and if I would try to run more recent version I would get following error:

2:22PM INF ABCI Handshake App Info hash= height=0 module=consensus protocol-version=0 software-version=23.0.11
2:22PM INF ABCI Replay Blocks appHeight=0 module=consensus stateHeight=0 storeHeight=0
2:22PM INF InitChain chainID=osmo-test-4 initialHeight=3215230 module=server
2:22PM INF initializing blockchain state from genesis.json module=server
panic: unknown field "option" in v1.Vote

goroutine 23 [running]:
github.com/cosmos/cosmos-sdk/codec.(*ProtoCodec).MustUnmarshalJSON(0x0?, {0xc112416000?, 0x0?, 0x0?}, {0x1038f9870?, 0xc000f4c230?})
        github.com/cosmos/cosmos-sdk@v0.47.8/codec/proto_codec.go:187 +0x3b
github.com/cosmos/cosmos-sdk/x/gov.AppModule.InitGenesis({{{0x10393dad8, 0xc00054b8e0}, {0x0, 0x0, 0x0}}, 0xc0006530e0, {0x103916ce0, 0xc000adcb40}, {0x1039256a8, 0xc0007300c0}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.47.8/x/gov/module.go:306 +0x94

Official guide it seems needs to be updated, since some links does not work such as for example https://github.com/osmosis-labs/networks/raw/main/osmo-test-5/genesis.tar.bz2.

I might be mixing up things here, in such case my appologies for my ignorance,I am still trying to get more with the project and the concepts. The main question is still, how I can run a node with more recent version of osmosisd enabling me play around while working on this task.

Edit1:

After messing around I have found testnets which seems promising solving my issue.

Edit2:

Alright, by following testnets guide I was able to run a node and query pools. Horray! I guess I still leave this comment as a reference in case someone encounters same issue until links to proper guides are fixed.

@czarcas7ic
Copy link
Member

@deividaspetraitis Really appreciate you laying out with links and edits of where you had been led incorrectly from our documentation. It is quite outdated. I forwarded this to part of the team and hopefully we can get it updated soon

@deividaspetraitis
Copy link
Contributor

hey @czarcas7ic, I am about to return back to this task, at his point I have managed to update all pools CLI command ( query poolmanager all-pools ) to accept pagination. Right now I am looking at the server side, where it looks like (q Querier) AllPools is being called for fetching all the pools from every pool module registered. I was wondering, is there any elegant approach you would like to suggest in order to implement pagination for combining data from multiple sources ( registered modules )?
While the most straightforward approach would be to apply pagination on sortedPools I am not sure it exactly expected as a solution since obviously it's not the most effective one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Triage 🔍
Development

No branches or pull requests

4 participants