Skip to content

Is MAX_LIMIT a bug? #625

@Ruborcalor

Description

@Ruborcalor

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#L8

There's basically two possibilities when you set MAX_LIMIT

  • You set 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 data
  • You set MAX_LIMIT too high (meaning you run out of gas at the max limit) which means you might as well not set any MAX_LIMIT at all

There 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions