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

Impossible to create chain spec with large balance #2963

Closed
2 tasks done
nazar-pc opened this issue Jan 17, 2024 · 4 comments · Fixed by #2987
Closed
2 tasks done

Impossible to create chain spec with large balance #2963

nazar-pc opened this issue Jan 17, 2024 · 4 comments · Fixed by #2987
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@nazar-pc
Copy link
Contributor

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

After #1256 ChainSpec::from_genesis is deprectated, but both serializing manually constructed RuntimeGenesisConfig explicitly and using json! macro fails for large balances like u128:MAX / 2:

Error("number out of range", line: 0, column: 0)

Same balance still works great with ChainSpec::from_genesis, but the way it actually does that is extremely convoluted, I was not yet able to figure out why it succeeds.

Steps to reproduce

Try to set u128::MAX / 2 balance for one of the accounts at genesis

@nazar-pc nazar-pc added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Jan 17, 2024
@michalkucharczyk
Copy link
Contributor

arbitrary_precision feature on serde_json dep in runtime should fix the problem. Refer to: #1256 (comment)

@bkchr
Copy link
Member

bkchr commented Jan 18, 2024

@nazar-pc does this fixes your issue?

@nazar-pc
Copy link
Contributor Author

I have not tried, but I'm 99% positive it will from the test Michal did. But I do think it should be incorporated upstream in case you wanted to close this issue right away 🙂

@bkchr
Copy link
Member

bkchr commented Jan 18, 2024

Yeah fine, @michalkucharczyk you want to open a pr to enable it somewhere in our stack? Maybe somewhere near the GenesisConfig stuff?

github-merge-queue bot pushed a commit that referenced this issue Jan 18, 2024
…on` (#2987)

[`arbitrary_precision`](https://github.com/serde-rs/json/blob/6d44b9fac9269b4decf76acac5d68e8ec9d10c58/Cargo.toml#L69-L75)
feature allows to (de-)serialize big numbers w/o error.
For some details refer also to
#1256 (comment)

fixes: #2963
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this issue Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants