You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this PR I've changed U128 serialization such that it serializes to 2 fields and not 1. This then makes it possible to use as contract function arg as the resulting serialization format matches intrinsic serialization of Noir (U128 struct contains 2 limbs and that's what Noir assigns the values to when matching the witness with the function args).
But for whatever reason this has caused gas_estimation.test.ts to fail (specifically the second and third test case).
Palla helped me with debugging and he thinks this is an issue with the estimator. There is a workaround - if I set estimatedGasPadding to a larger value the tests passes.
The plan is that I will revisit this once I implement Packable trait because once that is done U128 will be once again stored as 1 field in storage. This will help us determine whether the issue is storage related as the storage costs should get to values before this PR was made.
Look for "TODO(#11324)" in the codebase to find where the workaround was placed.
Here are gas estimation values I obtained for different paddings in the estimates gas with public payment method test case and info whether the test passed (F - fail, P -pass):
F padding 0: Estimated gas limits for tx: DA=8192 L2=454967 teardownDA=2048 teardownL2=97792
F padding 0.0005859375: Estimated gas limits for tx: DA=8197 L2=455234 teardownDA=2050 teardownL2=97850
P padding 0.00068359375: Estimated gas limits for tx: DA=8198 L2=455279 teardownDA=2050 teardownL2=97859
Saving them here as they might be useful later on.
The text was updated successfully, but these errors were encountered:
benesjan
changed the title
GasEstimator issue triggered by changing U128 serializationGasEstimator issue triggered by changing U128 serialization
Jan 17, 2025
In this PR I've changed U128 serialization such that it serializes to 2 fields and not 1. This then makes it possible to use as contract function arg as the resulting serialization format matches intrinsic serialization of Noir (U128 struct contains 2 limbs and that's what Noir assigns the values to when matching the witness with the function args).
But for whatever reason this has caused
gas_estimation.test.ts
to fail (specifically the second and third test case).Palla helped me with debugging and he thinks this is an issue with the estimator. There is a workaround - if I set
estimatedGasPadding
to a larger value the tests passes.The plan is that I will revisit this once I implement
Packable
trait because once that is done U128 will be once again stored as 1 field in storage. This will help us determine whether the issue is storage related as the storage costs should get to values before this PR was made.Look for "TODO(#11324)" in the codebase to find where the workaround was placed.
Here are gas estimation values I obtained for different paddings in the
estimates gas with public payment method
test case and info whether the test passed (F - fail, P -pass):Saving them here as they might be useful later on.
The text was updated successfully, but these errors were encountered: