Skip to content

fix: don't U128::from_integer(u128)#10865

Merged
TomAFrench merged 1 commit intomasterfrom
ab/do-not-u128-from-u128
Dec 19, 2024
Merged

fix: don't U128::from_integer(u128)#10865
TomAFrench merged 1 commit intomasterfrom
ab/do-not-u128-from-u128

Conversation

@asterite
Copy link
Contributor

@asterite asterite commented Dec 18, 2024

In Noir we are removing the (private) built-ins as_field and from_field, which allowed casting any type to and from Field by truncating its bits. This uncovered two bugs where we were doing U128::from_integer(x) with x itself being a U128. That code won't compile anymore (and I think it was incorrect) so I'm doing those changes in this PR.

See noir-lang/noir#6845

@github-actions
Copy link
Contributor

Changes to public function bytecode sizes

Generated at commit: 80510e6ab96564eb54e7dea96e3dfef7835a69df, compared to commit: e867e87e4e5e4b140bf8ec3e5ee75abd24571bb1

🧾 Summary (100% most significant diffs)

Program Bytecode size in bytes (+/-) %
Lending::public_dispatch -47 ✅ -0.17%
Lending::get_position -66 ✅ -1.40%

Full diff report 👇
Program Bytecode size in bytes (+/-) %
Lending::public_dispatch 27,782 (-47) -0.17%
Lending::get_position 4,662 (-66) -1.40%

@asterite asterite requested a review from TomAFrench December 19, 2024 10:24
@TomAFrench TomAFrench merged commit 3d00d34 into master Dec 19, 2024
@TomAFrench TomAFrench deleted the ab/do-not-u128-from-u128 branch December 19, 2024 10:30
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 this pull request may close these issues.

2 participants