onflow / flow-go-sdk

Tools for building Go applications on Flow :ocean:
https://onflow.org
Apache License 2.0
211 stars 86 forks source link

RLP Implementation #221

Open sideninja opened 3 years ago

sideninja commented 3 years ago

Currently, the SDK uses RLP implementation from go-ethereum package which is huge!. I believe we would benefit from implementing RLP ourselves since that big dependency would be removed. Also RLP is something that wouldn't change.

sideninja commented 2 years ago

There has been some work done for RLP integration in flow-go https://github.com/onflow/flow-go/pull/2011 Keep an 👁️ on it

jwinkler2083233 commented 2 years ago

I agree with you 100%, from a performance perspective. RLP only requires about 8 code files, plus tests.

In addition to the heap thrashing addressed in https://github.com/onflow/flow-go/pull/2011, the use of reflection and heap for walking the object graph is worth avoiding. Other forums online have suggested creating a kind of IDL -- a parser that will generate the appropriate code for generating struct and data object graph serialization. It's actually not hard to do, so it's on the radar. It would be much better if RLP code were forked (or appropriated somehow) to make this happen.

sideninja commented 2 years ago

Is there any plan in the flow-go to do that? The forking/our implementation?