-
Notifications
You must be signed in to change notification settings - Fork 317
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
Minor change for sector_bytes to use u64 type #608
Conversation
- add sectorbuilder implementation and interface links - fix verifier links - remove sectorbase interfaces since they are not needed at this moment.
sync from the original repo
sync the latest from original - 0416
There are some reasons here: 1) the original definition of sector size in sector-base\src\api\disk_backed_storage.rs is u64 type; 2) the usize type for a 32-bit system, could only support < 1<<32 sector size, in this case, it will make the system does not work for the seal function (overflow). 3) There are many place actually it will convert usize to u64, why do not use u64 at first?
Did you run into an actual issue with this, or what is the motivation behind this? |
Side Note: in general we should move all external visible number types to |
I think I mean the same thing as you mentioned. Here is some reasons simiar as what I put into the commit notes:
Currently, we do not see an issue since most of our system are 64-bit system, the usize is the same as u64, and the sector-size is defined as 256M (1<<28). No issues seen. However, there could be potential issue in the future, if (very low possibility) the sector size is getting much larger in some system, info might loss when convert u64 to usize and reconvert back (in a 32-bit system). I might think too much of it since this may never happen. The real motivation of this proposal is to keep the consistency, I would agree. |
No real issues found. You may ignore and close this PR since you are polishing the code as planned. |
@laser I believe you wrote this code, was there any intent here that we should know about? |
This code was written mostly by @porcuquine. That said, @steven004's rationale is sound and your recommendation to favor u64 over usize is a good one as well. I will approve this PR once the build turns green. Please ping me, @steven004, when you've resolved the build issue. |
I think the underlying issue is that we use |
It should be solved already, please check. thanks. |
We should definitely use
So, I agree with @porcuquine. We should fix this issue. @steven004 - are you up for the challenge? Places where we use
|
I've added an issue for this here. |
Sure, I could take care of this. I would suggest to merge this PR first, which is quite independent, and next, I will go through all other places related regarding this and do corresponding change, there would be more test done before submit. |
@steven004 thanks for the work, but this got pretty stale, so I am closing this. We are planning to add a compile time check for |
Understood. that is better option. |
No description provided.