-
Notifications
You must be signed in to change notification settings - Fork 653
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
View call RPC is returning byte arrays instead of base64 #3179
Comments
Assigning to @khorolets , CC-ing @frol |
We should not break the existing API, so I see two ways to handle this:
UPD: I am re-assigning to myself to cast the decision first |
Check with Illia whether this is connected with old EVM implementation @artob |
@djsatok How exactly is this related to EVM? This is JSON RPC representation, and we cannot really change it in a backward-compatible way, so the only option is to return both old bytes array and a new base64 representation. We will also need to update the |
@frol OK, understood, and assigning this back to you. |
It's a general issue for sure. The EVM is affected by it because it uses
binary encoding to return values and the responses ending up huge due to
pure JSON encoding.
…On Mon, Dec 7, 2020 at 6:08 AM Arto Bendiken ***@***.***> wrote:
@frol <https://github.com/frol> OK, understood, and assigning this back
to you.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3179 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABK27QBJNU3KQUIW45R2CTSTTOWDANCNFSM4QAYDIPA>
.
--
Best regards,
Illia Polosukhin
|
@ilblackdragon can you elaborate more on the EVM use case? Do we need a v2 endpoint with base64 encoding instead? Should it be completely different? Should it be something that is not JSON in the first place? |
I mean it's not specific to EVM, just non consistent and takes more bytes
over the network.
Hm, the response from view calls is not JSON - it's arbitrary bytes.
EVM sends a byte array encoded with their RLP encoding.
But so does the bridge contracts for example, they are returning Borsh
encoded information for proofs.
…On Tue, Dec 8, 2020 at 12:00 PM Vlad Frolov ***@***.***> wrote:
@ilblackdragon <https://github.com/ilblackdragon> can you elaborate more
on the EVM use case? Do we need a v2 endpoint with base64 encoding instead?
Should it be completely different? Should it be something that is not JSON
in the first place?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3179 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABK27S6NJIL6HBZLAHO5GDST2AXDANCNFSM4QAYDIPA>
.
--
Best regards,
Illia Polosukhin
|
@ilblackdragon I meant that if the RPC response in JSON bytes encoding is too big, we may as well consider having the RPC responses in non-JSON format in the first place (instead of using base64 inside JSON RPC response). |
Well it's still needs to be encoded to something, so base64 is a reasonable
encoding.
I don't really understand what it would be instead of JSON RPC response
here in your suggestion.
Generally responses can be pretty big, like when fetching all accounts
staked to given pool. This is where indexing and alternative to RPC
querying comes in.
…On Wed, Dec 9, 2020, 6:09 PM Vlad Frolov ***@***.***> wrote:
@ilblackdragon <https://github.com/ilblackdragon> I meant that if the RPC
response in JSON bytes encoding is too big, we may as well consider having
the RPC responses in non-JSON format in the first place (instead of using
base64 inside JSON RPC response).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3179 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABK27WB26QAKR6OT2F424LST5EF3ANCNFSM4QAYDIPA>
.
|
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
@frol what is the status of this issue? |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
@frol ? |
We cannot handle it in a backward-compatible way and it is not important implementation detail if you deal with it through some near-api-* library |
Steps to reproduce:
query call/evm.test.near/view_call_contract
Expectation: result is base64 encoded.
The text was updated successfully, but these errors were encountered: