You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Activity
ripatel-fd commentedon Aug 10, 2023
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.