Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CanonicalSerde for Rc and Arc #649

Closed
alxiong opened this issue May 12, 2023 · 2 comments · Fixed by #811
Closed

CanonicalSerde for Rc and Arc #649

alxiong opened this issue May 12, 2023 · 2 comments · Fixed by #811

Comments

@alxiong
Copy link
Contributor

alxiong commented May 12, 2023

  1. Currently only CanonicalSerialize is implemented for Rc<T> here, but the deserialize counterpart is missing.
  2. Maybe consider relaxing the feature flag for CanonicalSerde for Arc<T> which is currently only available in feature="std", so I'm hoping:
    • (conditionally) re-export alloc::sync under #[cfg(target_has_atomic = "ptr")] in ark-std as alloc does it.
    • change the feature directive inside ark-serialize to reflect the change.
    • (these changes make it possible to use Arc on platforms that supports atomic ops and pointers, which include MIPS but unfortunately not WASM I believe)

The second request is optional, subject to maintainer's judgement on how relevant or useful will it be to add. But the first point is easy and nice to have.

@burdges
Copy link
Contributor

burdges commented May 12, 2023

ark-std lags std's alloc in a few ways, like arkworks-rs/std#44

If rust stabilizes error_in_core then ark-std could largely be deprecated. If someone wants something within the next few years then they should probably update parts of ark-std to a more recent alloc. It's unlikely to be contentious to make ark-std more like alloc.

@burdges
Copy link
Contributor

burdges commented May 18, 2023

We might've ark-serialize bugs similar to paritytech/parity-scale-codec#426 I suppose serde could've worse similar bugs.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
2 participants