Skip to content

JSON RPC API Key-Value Order  #558

@GustavAlbrecht

Description

@GustavAlbrecht

Hi,
will the order of key-value pairs in the JSON responses from the API be specified or deterministic by code? I know the standard does not prescribe such behaviour but i think it could be valuable, since Solana might produce a lot of data and parsing could become faster, less resource intensive and more simple especially when one just wants to have some pairs. I'm specifically talking about the anatomy of a transaction object returned by methods like getBlock().

For example if i would like to compute the average cost of an instruction in a block i could use a parser that simply iterates over the keys in a loop until "fee" is found, parse the value, find "instructions", count that array.... If i would use a generic parser that uses a dictionary type i could run into trouble on certain machines given the potential amount of data.

How such an order would like i would simply put the low data key-value pairs in the front and big data pairs at the back.

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