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

Impossible to carry non-utf8 market labels over API boundaries #179

Open
ribasushi opened this issue Mar 24, 2023 · 6 comments
Open

Impossible to carry non-utf8 market labels over API boundaries #179

ribasushi opened this issue Mar 24, 2023 · 6 comments
Labels
good first issue Good for newcomers

Comments

@ribasushi
Copy link
Contributor

Because the JSON marshaller ignores the Bytes datamodel type, whenever one uses a non-utf8 ([]byte) label it is stripped off during RPC (JSON) transport

https://github.com/filecoin-project/go-state-types/blob/v0.10.0/builtin/v10/market/deal.go#L166-L168
+
https://github.com/filecoin-project/go-state-types/blob/v0.10.0/builtin/v10/market/deal.go#L184-L187

@arajasek @magik6k Is this intentional? If not any objections I fix it?

@arajasek
Copy link
Contributor

@ribasushi Definitely not intentional, please fix.

@ribasushi
Copy link
Contributor Author

@arajasek actually seems intentional... can you double-confirm? #43

@ZenGround0
Copy link
Contributor

FIP 0027 is relevant.

@rjan90 rjan90 added the good first issue Good for newcomers label Jun 11, 2024
@rjan90
Copy link
Contributor

rjan90 commented Jun 11, 2024

Its a bit unclear if this is still impacting Lotus anymore as we have removed the legacy markets, but it might be impacting Boost. So worth checking in with Curio on this.

We are not actively going to fix this, unless we find out if this has a larger impact for DX.

@rvagg
Copy link
Member

rvagg commented Jun 12, 2024

Really easy fix here would be to break in to dag-json in this field when it's bytes, "label": "a string label", vs "label": {"/":{"bytes":"AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAjA"}}.

The alternative is to go with the standard Go route of base64 encoding this, but then you lose the signal about whether it's bytes or string.

@ribasushi what did you have in mind for a fix for this?

@ribasushi
Copy link
Contributor Author

I do not have interest in this bugreport anymore: DDO made the entire label construct obsolete. It is definitely a bug with the JSON serialization of the struct, but yeah: feel free to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: No status
Development

No branches or pull requests

5 participants