-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
(Continuing discussion from the PR)
Two nitpicks regarding the network message serialization format:
- If we use SSZ, we need a single base schema that embeds the payload message for network messages as otherwise receivers don't know how to decode it. However right now, the spec defines three message types:
Request: (
id: uint64
method_id: uint16
body: Request
)
Reponse: (
id: uint64
response_code: uint16
result: bytes
)
ErrorResponse: (
id: uint64
response_code: uint16
result: bytes
)
Response
and ErrorResponse
are identical, but Request
differs a little. It would also be nice to give them the same name and field names, because that's what implementations will use when they first decode a message (e.g. Message
with message_id
, request_id
, and body
). body
would be a bytes
that carries the SSZ serialized request/response/error. This adds an additional 4-byte prefix, but I think that's unavoidable.
- The spec says
The result member is OPTIONAL on errors, and MAY contain additional information about the error.
There aren't optional fields in SSZ right now, so it should just be a blank string if there's no information.