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
Settle representation of voting power, truncation of native power #33
Comments
uint
or needs big.Int
uint
or needs big.Int
It does, but it probably doesn't need to if we're willing to lose some precision. |
Is there a benefit to losing precision? I do not see it currently |
Smaller power table updates. E.g., if I can truncate to the nearest 32GiB, I can save ~4 bytes per entry. I can save 5 bytes per entry if I can limit power increments to 1TiB. This will also let us limit the number of power table updates (as long as an update wouldn't cross over a 1TiB boundary). |
Truncating power is a good design question which has occurred to us, but not been investigated in depth. I'll retitle this issue to reflect that, and add to our meeting agenda. |
uint
or needs big.Int
I think changing the go-f3 representation to big int right now is the safest thing to do. Even if we truncate, we might still want a bigint to future-proof it. |
So, goals are are:
One interesting issue will be, e.g., if power shrinks appreciably. We'd need some way to "add back" precision and probably want some way to avoid constantly changing how we truncate. |
If we truncate the power by one byte (divide by 256) each time we reach some threshold, we can:
I'd like to avoid having any unstable points where it's possible to repeatedly trigger steps 1 & 2, but that's going to require some hysteresis. I guess that's fine? |
See also #5 , which will probably resolve this too |
For completeness, I looked into scaling power to the range 0x0-0xFFFF based on the total fraction of power. The idea was to avoid "cliffs" where we'd need to suddenly "add back" precision. Unfortunately:
So I'm going to discount scaling as a possible solution to reducing the size of the deltas, but it may still have a place... Additionally, given the low frequency of power changes, I'm inclined to discard truncation as well (for now). If necessary, we can smooth out power changes in the Filecoin protocol itself at some later point. |
So, current thoughts on scaling/truncation:
Specifically, I want to scale power for consensus decisions because it'll let us (eventually) commit to a scaled power table which:
|
Confirm if voting power can use uint or needs big.Int. Similar to the concern raised in #22.
Update: expanded scope to include design question about truncation
The text was updated successfully, but these errors were encountered: