-
Notifications
You must be signed in to change notification settings - Fork 359
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
Is MAX_LIMIT
a bug?
#625
Comments
It is not to limit or optimize your gas usage. It is mostly to disallow any kind of overloading nodes performing such queries, and DOSing them. Remember that those queries are not run on google cloud or another AWS, they are calculated on validators machines, and we want make every single block reasonably small. Removing the limit of how much data you can query for means, that you can make single execution with bigger computation cost (indirectly represented by gas cost) that we expect the whole block to be. You can argue if 30 is fair limit, or it can be bigger - I don't know about that. But having a limit is just saving us from freezing the blockchain. |
Hey thanks for your reply! So what I understood is that you add i.e. even though the gas limit for queries is 300_000, you want to further restrict certain queries to a smaller max amount of gas like 50_000. My question now is why not lower the actual gas limit for queries? The current approach is not enforceable because people can clone the code and remove the Is it that you want to leave the option for queries to consume 300_000 gas when necessary, while still building a culture around designing queries to consume less gas? |
Hello there!
I'm trying to understand why
MAX_LIMIT
is defined for limiting the querying of accounts: https://github.com/CosmWasm/cw-plus/blob/main/contracts/cw20-base/src/enumerable.rs#L8There's basically two possibilities when you set
MAX_LIMIT
MAX_LIMIT
too low (meaning you could have set a higher limit without running out of gas) which means you are unnecessarily restricting the rate at which you can read dataThere is technically a third option where you perfectly calibrate
MAX_LIMIT
but doesn't work in practice because the gas costs may fluctuate.So what is the point of setting a
MAX_LIMIT
; why not let the querier decide the limit for themselves? Is it to intentionally throttle the data throughput? Thanks!The text was updated successfully, but these errors were encountered: