Skip to content

JSON RPC API Key-Value Order  #558

Closed

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.

Activity

  1. ripatel-fd commented on Aug 10, 2023

    @ripatel-fd
    Contributor

    Hi @GustavAlbrecht - great question! Yes, the JSON dictionary ordering of the JSON-RPC API will be hardcoded in Firedancer. @asiegel-jt is developing a high-performance response serializer for this. The code for this is not yet public, but I'll update you on this issue once it is.

  2. locked and limited conversation to collaborators on Aug 10, 2023
  3. converted this issue into a discussion #575 on Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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