-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Remove the undocumented, unused array type from the portable storage specification #10138
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
base: master
Are you sure you want to change the base?
Remove the undocumented, unused array type from the portable storage specification #10138
Conversation
…specification This is currently unused, so it shouldn't be an issue to remove. It also likely isn't safe to adopt as it has unclear, potentially not actually implemented, behavior. Removing it now reduces the scope of the codec and prevents introducting usage. This not only promotes some ideal of safety (highly debatable if this is actually safer or just a nit) but makes it easier to safely reimplement the format (as seen in several PRs over the years due to the memory consumption of the original implementation). Pleasantly removes the of `make_recursive_variant`, which is documented to not be portable. While obviously, it's sufficiently portable that hasn't been an issue, it's nice to note. I removed all references to the constant and updated the code to compile. There may be some functions that are now unreachable and can also be removed. I did not personally run the full test suite and presume the CI will handle that.
|
This should prevent array of arrays, which is annoying but easy enough to workaround. Afaik, only ZeroMQ has The test suite for my serialization replacement actually tests for this case, and verifies that epee array of arrays does indeed write+read correctly. |
|
As a quick note - I may have to add this removed flag back in that serialization PR. The problem is that the interface (in my serialization PR) doesn't explicitly block array of arrays (because ZeroMQ already uses it), so we should need a way to indicate |
|
EPEE already doesn't support array of arrays:
I'd say this is just further justification for remove it so that it's not present as a potential. If your serialization PR does restore it, we'd also need it properly implemented, completely. As for Monero currently represents I'd also argue against the complexity of variably-typed arrays of arrays moving forward (as this definition would have assigned each sub-array its own type, right?). |
|
Yes,
The new serialization PR has tests for json and epee
It was a little tricky to implement, but not too bad. Certainly not worth banning permanently. I would just write the code for it in Rust (assuming thats what prompted this PR), and be done with it. Msgpack is loads easier in this situation as everything requires a tag regardless of situation. |
|
The alternative is just ban |
|
I'd hesitate to call it a reference implementation if reading isn't implemented 😅 Not re: Rust alone. If your upcoming PR has already put in all the work, and this will be used, I'm fine dropping this PR. I primarily wanted this out of its halfway state and didn't want to implement this myself. Distinct question of if this PR should be merged pending yours however. |
Agreed it's questionable - without a reader the whole scheme could've been broken in that situation. It appears they got it correct on the writer side.
Agreed, I'd prefer Msgpack or CBOR. Either would be easier on everyone, and fast enough. The goal of the new serialization was to eventually introduce Msgpack to ZeroMQ RPC+PUB and HTTP RPC. There's lots of internal type changes to make it all work seamless, but it's doable. The P2P layer would be converted/merged to the new system last, as I'm more hesitant to unleash the new epee reader on such critical traffic.
Yes, although given how that PR has stalled it might be worth moving forward with this one. The only problem is that I would have to drop it or re-introduce it, not sure which is better. |
|
This PR is ~10 lines. Seems easy enough to rebase your PR with the first added commit being "Revert removal of array type"? 😅 But I won't pressure you here. I trust and defer to your judgement :) Regarding another format, I now have sunk cost on EPEE. How dare you suggest the future be better for other people after my pain in the present? /s Would love to see a properly specified protocol used, with existing implementations, so long as it isn't rolled out too quickly and doesn't break current clients of course. But yeah, def a lot of issues with the status quo... We can also open the question of if EPEE should have this limitation and new RPC types (completely breaking) should migrate to msgpack (or whatever) with |
|
I definitely would like to support arrays of arrays as a method for off-chain serialization at some point in the future. Though I'm pretty sure @vtnerd's serialization suite wipes out all of this DOM code (the |
This is currently unused, so it shouldn't be an issue to remove. It also likely isn't safe to adopt as it has unclear, potentially not actually implemented, behavior. Removing it now reduces the scope of the codec and prevents introducing usage. This not only promotes some ideal of safety (highly debatable if this is actually safer or just a nit) but makes it easier to safely reimplement the format (as seen in several PRs over the years due to the memory consumption of the original implementation).
Pleasantly removes the of
make_recursive_variant, which is documented to not be portable. While obviously, it's sufficiently portable that hasn't been an issue, it's nice to note.I removed all references to the constant and updated the code to compile. There may be some functions that are now unreachable and can also be removed. I did not personally run the full test suite and presume the CI will handle that.
cc @jeffro256 as the person I primarily want to poke for review of this.