-
Notifications
You must be signed in to change notification settings - Fork 79
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
Handle or migrate away from non-utf8 DealProposal Labels #69
Comments
(whether if this is a P0 for ntwk v16 is pending analysis. |
To be continued tmr. |
I would entirely discard this option. First, from a product perspective it makes adding binary metadata tricky. Given that Go accepts non-UTF-8 strings, and it's possible that those exist in state, we don't have an easy non-UTF-8 => UTF-8 migration path. We'd have to apply a transform which would manipulate the user-provided value, and that is definitely a no-go. I think I've read all the past discussion across all links. I have one basic question. A byte array is a looser type than a string. Any string should be representable as a byte array. I'm assuming the bulk of the migration is to re-encode this type from a CBOR string (tags 2 and 3) to a byte slice (different tag). What exactly makes this migration difficult, and what's the reason to consider stopping the market temporarily? |
@raulk |
@jennijuju Can someone please describe "the workable solution"? |
The migration is trivial. The issue is that naively changing the
The issue is that all of the de/serializaton steps fail if they were done on opposite sides of the switch from string to bytes. When should clients start using bytes instead of strings? When should SPs start expecting clients to be using bytes instead of strings? What happens to all messages in the mempool that signed strings instead of bytes after the network upgrades?
The solution proposed by @Stebalien is to use a Union type, something like
We'd assert that exactly one of Additionaly, we can start asserting that if This solves most of the problems described above. A large refactor may still be needed for client implementations if they don't abstract over possible |
Thanks for the detailed proposal. This would work if the union type is entirely transparent, that is, if it's not tagged in itself, and instead we use the CBOR tag in the encoded tuple position to discriminate which type is present. Is that what's intended? Does our DAG-CBOR library support such a serde pattern? Does Rust's serde (which we need to cooperate with)? |
@Stebalien would be the one to confirm, but I'm guessing it's supported in both places, since we have such types already in the HAMT used by Filecoin (see, for example, here). |
Closed by FIP 0027 |
See filecoin-project/FIPs#187 and https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0027.md.
At the moment, we reject non-utf8 labels. But we need to make a decision before we ship.
The text was updated successfully, but these errors were encountered: