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
JSON isn't optimal for storing tx data since it doesn't preserve the order of keys and after decoding and getting a dict out of it, we need to order it first.
Better to use one of the following alternatives:
MessagePack
Faster than JSON for both encoding and decoding, while preserving the original structure, including key order.
Protocol Buffers (Protobuf)
Is a language-neutral and platform-neutral binary serialization format. Extremely efficient and supports schema definition, which ensures data consistency and improves compatibility. Highly optimized for performance and lower payload sizes.
Protobuf requires defining a .proto schema file and generating code, so it’s a bit more setup-heavy, but given that we already use it as part of CometBFT, we should probably switch to this.
The text was updated successfully, but these errors were encountered:
JSON isn't optimal for storing tx data since it doesn't preserve the order of keys and after decoding and getting a dict out of it, we need to order it first.
Better to use one of the following alternatives:
Faster than JSON for both encoding and decoding, while preserving the original structure, including key order.
Example code:
Is a language-neutral and platform-neutral binary serialization format. Extremely efficient and supports schema definition, which ensures data consistency and improves compatibility. Highly optimized for performance and lower payload sizes.
Protobuf requires defining a .proto schema file and generating code, so it’s a bit more setup-heavy, but given that we already use it as part of CometBFT, we should probably switch to this.
The text was updated successfully, but these errors were encountered: