-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 a command for compacting sector numbers bitfield #4640
Conversation
So, I think the right approach here would be to:
The compaction algorithm is actually pretty simple: be greedy.
This is optimal (mostly) because it (a) removes two runs for each step and (b) allocates the least sector numbers when doing this. This is mostly (optimal) because it doesn't account for the cost of encoding a run. Smaller runs are cheeper to encode than larger ones. However, I don't think this matters in practice. I'm happy to take this on, but I'm not sure what the target size should be. |
Signed-off-by: Jakub Sztandera <[email protected]>
For now, I wrote a manual version. The issue being that we need to know which sectors are still being commited, which are abandonned and so on. but the algorithm you are speaking of could be used as |
This may be a case for https://rachelbythebay.com/w/2020/10/26/num/. Where, ideally, the number you type in is the number of sector IDs remaining. |
I would say the number would be a number of sectors that will be marked as unavaliable by the operation. (the bigger the number, the more risk/harm there is). |
Also works. I just want miners to understand that there's a tradeoff. |
a4ffd1a
to
0656b62
Compare
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.
Looks landable, but probably should get another approval first
7ee0f01
to
15a6995
Compare
still in progress, would love it if someone could finish this up for me.