Skip to content

Make txIndex not required for debug_storageRangeAt query #31344

@igorfardoc

Description

@igorfardoc

Rationale

Just wanted to use storageRangeAt rpc query and noticed that it is inconsistent with other query types and there is no way (seems to me) make it work after the last transaction in the latest block.
While in other queries (like debug_traceCall) txIndex field is optional, in storageRangeAt it is required, and since this field means "take state before transaction with index txIndex" in block, there is no way to query state after the latest transaction in the latest block (if field is optional, it is possible to just query with "latest" block and the state after the block is returned).
I thought maybe specifying "pending" block can work, but it does not seem like a proper way to do that.

Implementation

Make txIndex optional and if it is specified call StateAtTransaction function to get state from backend and if not, call StateAtBlock, same way as it is implemented in other api endpoints.

Please let me know if my proposal makes sense and if yes, I am ready to implement the change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions