JSON RPC API Key-Value Order #575
Replies: 1 comment 2 replies
-
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. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions