Open nazar-pc opened 3 months ago
Hi Nazar, thanks for opening this.
Do you want to submit a PR improving the doc with the information you learned?
Regarding https://github.com/paritytech/parity-scale-codec support, Codec
is pub
and therefore can be implemented by a third party lib right?
Do you want to submit a PR improving the doc with the information you learned?
Those are my assumptions, I'm not sure they are 100% accurate.
therefore can be implemented by a third party lib right?
Absolutely, but there are two implementations already, so maybe more are welcome?
I'd prefer leaving third party implementations on separate repos where it's maintainers could update them without me having to review them, but I'd be more than happy to update the README.md
to link for them, wdyt Nazar?
Makes sense to me
Request/response is a powerful primitive, but could use a better description regarding codec requirements.
I looked at example
json
andcbor
implementations and looks like codec is single-use (I guess a new stream is used for each request/response).Then I looked into why codec is required to be clonable assuming it can be reused for different streams, but turns out it is cloned every time, limiting reuse of previously allocated buffers (that both
json
andcbor
allocated in read methods every time from scratch.Would be great if someone with good knowledge of this protocol improved documentation about codec requirements and maybe improved reviewed code looking at efficiency improvements.
For now I'll just follow mentioned codecs as examples.
P.S. Would be great to see https://github.com/paritytech/parity-scale-codec support as well, I'm happy to send a PR if it is welcome.