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

Replace serde-json with a canoncial json library which can support floats? #240

Open
JeremyRubin opened this issue Oct 29, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@JeremyRubin
Copy link
Collaborator

No description provided.

@ProofOfKeags
Copy link
Collaborator

IIRC there was a desire to "ban" the use of floats within sapio due to fundamental determinism issues stemming from hardware discrepancies. My position on this is, and has always been, that memory determinism is far less important than a guarantee of referential transparency at the layer the user interacts with. Memory determinism guarantees referential transparency but is a much stronger requirement, and with these hardware differences you've referenced, may not actually be possible.

@JeremyRubin
Copy link
Collaborator Author

i dont think this comment is related. this issue is that the serde-json Values we use in various places cannot contrain floats (it will panic). This is because the matrix.org json canonicalization spec bans floats. so we should ensure that our "generic object serializable" struct is canonicalizable, or else it panics when composed with attest chains.

@ProofOfKeags
Copy link
Collaborator

ProofOfKeags commented Nov 2, 2022

Understood.

Would this be just another serde backend or is the idea that we would replace serde entirely for this purpose?

@ProofOfKeags ProofOfKeags added the bug Something isn't working label Nov 2, 2022
@JeremyRubin
Copy link
Collaborator Author

seems like maybe CBOR, in partciular the IPFS libraries for it (ipld) might be close to what we're looking for, and are serde compatible.

@JeremyRubin
Copy link
Collaborator Author

"IPLD stands for "InterPlanetary Linked Data, and is a series of standards and formats for describing data in a content-addressing-emphatic way. The people who work on IPLD do so because we want a world where it's easy to build decentralized, distributed, and inter-operable applications, and we believe robust data formats and a clear story for content-addressing them is a key piece of leverage towards that goal."

this sounds right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants