Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Msgpack encoded Bytes instead of JSON to transfer data #78

Open
Niraj-Kamdar opened this issue Apr 20, 2023 · 4 comments
Open

Use Msgpack encoded Bytes instead of JSON to transfer data #78

Niraj-Kamdar opened this issue Apr 20, 2023 · 4 comments

Comments

@Niraj-Kamdar
Copy link
Contributor

Niraj-Kamdar commented Apr 20, 2023

If RPC call give bytes as response, it may not be JSON serializable in some languages.
So, we should use msgpack instead of JSON.

Current schema

request(method: String!, params: JSON, connection: Connection): JSON!

Proposed Schema

request(method: String!, params: Bytes!, connection: Connection): Bytes!
@cbrzn
Copy link
Contributor

cbrzn commented Apr 24, 2023

hey @Niraj-Kamdar I think that since the request method is just an JSON-RPC call to an Ethereum node, it makes sense to return JSON. If a method's response is in bytes, those bytes will be received as string

@Niraj-Kamdar
Copy link
Contributor Author

That's not true for every implementation. Checkout web3.py

@cbrzn
Copy link
Contributor

cbrzn commented Apr 24, 2023

That's not true for every implementation. Checkout web3.py

can you be more specific about what should I check? I've seen & used the library but I am not sure what you mean exactly

@Niraj-Kamdar
Copy link
Contributor Author

call eth_getTransactionReceipt RPC method and try to stringify the result. You can do this by invoking request method which will fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants