Fix fast 1-weso parameter approximation, for massive speedup #205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The "fast" 1-Wesolowski prover inadvertently mixed up parameters in the call to ApproximateParameter.
ApproximateParameter's signature has L followed by K:
However, the 1-Weso calls used K followed by L:
While this typo does not affect the correctness of the created 1-Weso proof, this causes 1-Weso proving to be much slower than necessary. In isolated testing, the 1-Weso proof generation is up to 10x slower.
Funnily enough, the "slow" VDF impl (in
src/provers_slow.h
) uses a separate 1-Weso prover implementation which doesn't suffer from this bug, thus making the "slow" VDF impl faster than the "fast" overall.To be clear: the fixed bug only affects the performance (not the correctness!) of computing 1-Weso proofs (thus, blueboxing) using the "fast" implementation. Regular software timelords (N-Weso), hardware (ASIC) timelords, and the "slow" bluebox implementation are unaffected.
The speedup can be observed/tested by running
src/1weso_test.cpp
:1weso_test
also confirms that 1-Weso proof correctness is unaffected by this change. The prover still generates the exact same proofs, it just does so much faster.