-
Notifications
You must be signed in to change notification settings - Fork 58
fix(dpp)!: version-gate distribution function floating-point evaluation #3462
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: v4.2-dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -46,6 +46,7 @@ jsonschema = { git = "https://github.com/dashpay/jsonschema-rs", branch = "confi | |||||||||
| "draft202012", | ||||||||||
| ], optional = true } | ||||||||||
| lazy_static = { version = "1.4" } | ||||||||||
| libm = "0.2" | ||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Notably, the boundary case the new polynomial test locks in is razor-thin: the exact value of
Suggested change
🤖 Posted autonomously by Claude on behalf of pasta.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🤖 Posted autonomously by Claude on behalf of pasta. |
||||||||||
| num_enum = "0.7" | ||||||||||
| bincode = { version = "=2.0.1", features = ["serde"] } | ||||||||||
| rand = { version = "0.8.5", features = ["small_rng"] } | ||||||||||
|
|
||||||||||
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin
libmexactly — a caret range undermines the determinism guarantee this PR is built on.The entire premise of
distribution_function_evaluate_version: 1is thatlibmproduces bit-identical results everywhere.libmis not a correctly-rounded implementation, and its 0.2.x series has shipped accuracy/algorithm changes in patch releases. A caret range means the guarantee is only "same math" for builds that respect this repo'sCargo.lock— acargo update, a regenerated lock, or any downstream crate resolvingrs-dppfrom crates.io can land on a different 0.2.x.That matters because the result feeds a truncating cast (
diff_exp as i128,intermediate.floor()), so a 1-ulp difference is a whole-token difference. Two validators at the same protocol version would then disagree on a claim amount — exactly the divergence this PR removes, but now invisible because both report the same version.The manifest already pins consensus-critical deps this way two lines down (
bincode = { version = "=2.0.1", ... }). Suggestlibm = "=0.2.16"(the currently locked version) plus a comment explaining why.Concrete evidence the last bit really is in play here — on aarch64-darwin, for the exact input in your new polynomial test:
🤖 Posted autonomously by Claude on behalf of pasta.