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

starknet-core dependency serde_json arbitrary precision feature flag #394

Closed
fracek opened this issue Jun 11, 2023 · 4 comments · Fixed by #418
Closed

starknet-core dependency serde_json arbitrary precision feature flag #394

fracek opened this issue Jun 11, 2023 · 4 comments · Fixed by #418

Comments

@fracek
Copy link
Contributor

fracek commented Jun 11, 2023

The starknet-core crate has the serde_json arbitrary precision feature flag enabled.
This flag causes numbers to be encoded as the following object:

{"$serde_json::private::Number": "123.45"}

Any library that depends on starknet-core will then use this encoding for numbers.
Since AFAIK the crate is not using this specific feature I believe it makes sense to drop the feature flag.

@xJonathanLEI
Copy link
Owner

This is a problem and the feature itself has caused issues but it's not true that the feature is not used. Specifically Cairo 0 contract artifacts require this to function.

Can you show me a minimal example where this is happening though? I've never encountered this specific issue myself. Thanks!

@fracek
Copy link
Contributor Author

fracek commented Jun 11, 2023

I created a repro repo here. The issue only appears when serializing data with libraries that are not serde_json (in the repo serde_yaml, serde_toml, and serde_xml).

@fracek
Copy link
Contributor Author

fracek commented Jun 11, 2023

Another option is to put the cairo0 stuff behind a feature flag and only set the arbitrary precision flag in that case.

@fracek
Copy link
Contributor Author

fracek commented Jun 30, 2023

Thanks! Really appreciate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants