-
Notifications
You must be signed in to change notification settings - Fork 1
SMIP-0011: GPU-POST LIB - PHASE II #45
Comments
The 64-bit position range was compliant with the max supported number of labels. To support 256-bit difficulty param, will even |
I think it will unless I'm missing something obvious here as uint64 = 8 bytes => uint64[4] = 32 bytes = 256 bits |
I was referring to the probabilistic nature of PoW, and that in the current API design there won't be a way to introduce hash preimage variants besides by incrementing the position. I don't think we'll have an issue with 256-bit range (or less), but I was still wondering about it. |
Doesn't the 32 bytes id input introduce a preimage variant? |
Yes but the user commits to a specific id when starting the PoST initialization so he cannot change that for the PoW part if he runs out of positions/indices. |
Right, he should keep using the same id for the PoW part - I think this is by design like that. So what's the issue about this? |
The smip has been numbered and this goes into development in few days. |
Phase III implementation is complete. https://github.com/spacemeshos/gpu-post/releases/tag/v0.1.19 |
@avive what is the reason to reopen this SMIP? is it in response to |
quoting Tal in slack. in the context of https://community.spacemesh.io/t/possible-dos-against-pops-vrf-beacon-and-mitigation/210
|
Motivation
Tortoise beacon VRF.
Algorithm Outline
Phase I: create the PoST initialization but tweak it so that for every scrypt output label before truncating the 256-bit output into ℓ ≤ 256 bits (and storing to disk these bits) we compare the full 256 bits against 256-bit constant parameter D and if this label is smaller than than D then we store the index of this label (if we already found label smaller than D and we already stored its index, then we simply overwrite it with the new index – I’m assuming that the index is 64-bit words and therefore the write operation is atomic, I don’t think that we need index whose size is more than 64-bit because even if we store 1 bit of the scrypt output per index the total storage would be more than 2 million terabytes).
Phase II: if we didn’t find any label smaller than D in phase1, then we continue with a “dry” run of the initialization that continue from the last index onwards but doesn’t write anything to disk (so there’s no need for it to truncate the scrypt outputs), and when it find a label smaller than D it stores its index and terminates.
API Design
scryptPositions()
params: 1. Compute leafs. 2. Compute PoW.One of these config options should be turned on by api client.
Motivation
API clients can just stop calling the method with the 2nd option set, after the POW was solved and in case the algorithm needs to progress to phase II (described above) then the api client will just call the method with the 2nd config option on as label computation is not needed.
out
param when only the POW option is set as leaves will not be written to it in this execution mode.API usage pattern
scryptPositions()
with both options set so both leaf computation and D comparison are made.scryptPositions()
.3.if all leaves computed and a solution was not found then continue calling with larger indexes with only POW option set until a solution is found.
Implementation Notes
Open Issues
The text was updated successfully, but these errors were encountered: