-
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
feat: api: Make ClientCalcCommP multithreaded #8276
Conversation
@@ -1295,16 +1278,20 @@ func (a *API) ClientCalcCommP(ctx context.Context, inpath string) (*api.CommPRet | |||
return nil, xerrors.Errorf("seek to start: %w", err) | |||
} | |||
|
|||
pieceReader, pieceSize := padreader.New(rdr, uint64(stat.Size())) | |||
commP, err := ffiwrapper.GeneratePieceCIDFromFile(arbitraryProofType, pieceReader, pieceSize) |
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.
This kind of makes sense but I don't understand why this ffiwrapper thing exists and was called in the first place if the commp writer thing could just do a direct sum over the piece bytes in the first place.
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.
The writer thing is relatively recent, and this API existed for quite some time before.
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.
(the writer also calls FFI, it just does that from multiple threads for smaller chunks, then creates the top tree from them)
Codecov Report
@@ Coverage Diff @@
## master #8276 +/- ##
=======================================
Coverage 40.51% 40.51%
=======================================
Files 675 675
Lines 73527 73526 -1
=======================================
+ Hits 29788 29790 +2
+ Misses 38515 38510 -5
- Partials 5224 5226 +2
|
Related Issues
Proposed Changes
Make
ClientCalcCommP
a lot fasterAdditional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, testarea
: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps