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

Add assumption about the max value of exponent #921

Closed
smol-ninja opened this issue May 14, 2024 · 1 comment
Closed

Add assumption about the max value of exponent #921

smol-ninja opened this issue May 14, 2024 · 1 comment
Labels
effort: low Easy or tiny task that takes less than a day. priority: 2 We will do our best to deal with this. type: docs Changes to documentation. work: clear Sense-categorize-respond. The relationship between cause and effect is clear.

Comments

@smol-ninja
Copy link
Member

A Codehawk auditor asked a really good question about the max value of UD2x18.

Since its max value is capped by type(uint64).max, the exponent cannot represent a value bigger than 18.446744073709551615. Thus, we should add this in the Assumptions section of SECURITY.md:

In Lockup dynamic, the fixed-point representation of a segment's exponent does not exceed 18.446744073709551615.

@smol-ninja smol-ninja added type: docs Changes to documentation. priority: 2 We will do our best to deal with this. effort: low Easy or tiny task that takes less than a day. work: clear Sense-categorize-respond. The relationship between cause and effect is clear. labels May 14, 2024
@smol-ninja smol-ninja changed the title Add assumption about the value of exponent Add assumption about the max value of exponent May 14, 2024
@smol-ninja smol-ninja added priority: 3 Nice-to-have. Willing to ship without this. priority: 2 We will do our best to deal with this. and removed priority: 2 We will do our best to deal with this. priority: 3 Nice-to-have. Willing to ship without this. labels May 14, 2024
@PaulRBerg
Copy link
Member

Agree that we should document this as an assumption, but there should be no need for exponents that large.

When you get that to double-digit ranges and above, the streaming function is so slow that it becomes effectively equivalent to a timelock (within that segment).

From the docs:

Warning

Because x is a percentage, the streaming rate is inversely proportional to the exponent. For example, if the exponent is 0.5, the rate is quadratically faster compared to the baseline when the exponent is 1. Conversely, if exponent is 2, the rate is quadratically slower compared to baseline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: low Easy or tiny task that takes less than a day. priority: 2 We will do our best to deal with this. type: docs Changes to documentation. work: clear Sense-categorize-respond. The relationship between cause and effect is clear.
Projects
None yet
Development

No branches or pull requests

2 participants