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
Flux messages are quite large. For example an apprunningmessage:
constfluxAppRunningMsg={type: 'fluxapprunning',version: 1,name: 'Ipshow',hash: '4da0ce332a5e8634b7a22132f4962ff4defdd2a7c3e047494728bbe1208fb3a8',// hash of application specifics that are runningip: "12.12.12.12",broadcastedAt: 1708252932172,runningSince: 1708252932172,};
This gets converted to json, then used as the payload for another signed flux message. For eg:
Then the above message gets converted to JSON before being sent on the wire. The size of the above message is 497 bytes.
If we were to use structures, the same message would only be 187 bytes that is only 38% of the original messages size.
Something like the following:
fluxapprunning message
type uint8 1 bytes
version uint8 1 bytes
name uint8Array 32 bytes max
hash uint8Array 32 bytes
ip uint32 4 bytes
broadcast uint32 4 bytes
running uint32 4 bytes
total 78 bytes max.
generic fluxnode signed message
version uint8 1 bytes
timestamp uint32 4 bytes
pubkey uint8Array 65 bytes
signature uint8Array 65 bytes (as buffer, 88 bytes otherwise)
data uint8Array 74 bytes (fluxapprunning max message size)
total 213 bytes or (187 for app name ipshow) vs 497 when serializing JSON
It wouldn't be too much work to create the serializer / deserializer - then just swap out the JSON serializer.
The text was updated successfully, but these errors were encountered:
Flux messages are quite large. For example an
apprunningmessage
:This gets converted to json, then used as the payload for another signed flux message. For eg:
Then the above message gets converted to JSON before being sent on the wire. The size of the above message is
497 bytes
.If we were to use structures, the same message would only be
187 bytes
that is only 38% of the original messages size.Something like the following:
It wouldn't be too much work to create the serializer / deserializer - then just swap out the JSON serializer.
The text was updated successfully, but these errors were encountered: