multiple metadata messages in a single UDP packet#99
multiple metadata messages in a single UDP packet#99janscheres wants to merge 1 commit intoXTXMarkets:mainfrom
Conversation
|
Ignore the CI checks, there is some issues with running CI on external contributions which we didn't address as there are not many. |
|
Am I understanding correctly that there is no way to know what the length of req.req.Pack would be (for example from the kind) ? What I'm currently thinking is that I will have to add a length (I think uint16) to the header so a packet would now look like: So we can properly decode packets. |
Some protocol messages are fixed size, some are variable size so we don't know length before decoding.
length is not needed if we keep decoding messages until we reach the end of UDP packet. Each individual message will not decode more than needed. Non related to this specific question. When approaching such protocol changes you have to take into account this has to be deployed to a live system without downtime.
For easier testing you can have a branch with 2 commits. First commit switches decoders, second one switches encoders but both commits have to pass CI to ensure it is safe to roll out to production. |
|
Thanks for the advice. I've not had to think about rolling out changes to prod without downtime much yet in my life, but what you said makes a lot of sense and I'll keep it in mind in future :) I've made changes to the go and cpp decoders now (I dont know c well....) (force pushed to maintain cleanliness of commit history, I have locally stashed the changes I made to the go encoder for later) |
|
if you check how ProtocolMessage and SignedProtocolMessage unpack works you will see it enforces the buffer to be fully consumed. |
|
from what i understand, all of those needed updating right? Ive done that now :) |
2fadbd2 to
8ef7419
Compare
Issue #27
I am not completely sure about the intended behaviour with regards to MTU but I have implemented what I understood from the issue.
So far I have just modified
processRequests()Still todo:
cpp/shard/Shard.cppto handle several messages in one packetcpp/cdc/CDC.cpp^^parseResponse()andprocessRawResponse()^^I will try get round to these when I have some time :)
Please let me know if you have any suggestions or if i made any mistakes.