-
Notifications
You must be signed in to change notification settings - Fork 100
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
TokenId with Base64 #770
TokenId with Base64 #770
Conversation
Why do we need this incompatible change? |
I dont see why we need this change |
It's less amount of data to store, base64 is shorter than hex |
Indeed, but as @roman-khimov said, this change is minor but incompatible. Does it worth it to have an incompatible update to save a few bytes? |
Well, actually this pr dont have to change [RpcMethod], right? |
Storage-wise it's the same, we store raw id bytes, network-wise yes, there is some difference, but IDs are limited to 64 bytes, so we can save some tens (not even hundreds) of bytes, but we'll definitely break some applications. I'd rather leave it as is. |
I think the basic issue is all nep11 related RPC params in RpcServer return Base64 but TokensTracker still need hex input which is not uniform. For example: when someone tried to get |
Pretty similar to #609 situation. Base64 is better in some aspects, that's true. The problem is that this change will break some existing code interacting with RPC servers. If we want to switch, we can make an additional |
Then input is a problem. It doesn't accept base64 tokenId in |
Request:
Response:
Maybe using base64 encoded token id could avoid this kind of errors. |
@roman-khimov @Liaojinghui We find this error when emit hex, it's time to change to base64. |
How is it related to hex/base64 question?
P.S. BTW, the token just seems to be broken to me. "\ufffd\u0000" is not a proper UTF-8 string and C# node barfs at it for a reason (see neo-project/neo#2984 as well). |
Yes, you're right, it's a UTF-8 issue but not hex/base64 issue. |
I will close this pr if no further claims to support it. |
No description provided.