-
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
decoupling post worker #7600
decoupling post worker #7600
Conversation
Hi,@jennijuju After this part is merged, I will modify it again |
|
||
var GenerateSingleVanillaProof = ffi.GenerateSingleVanillaProof | ||
|
||
var MergeWindowPoStPartitionProofs = ffi.MergeWindowPoStPartitionProofs |
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.
ffi types should not be used as part of the interface
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.
Ok, resubmitted
24ba063
to
a1bcd4a
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.
Sorry for taking so long on this, lets work on landing this soon.
(reviewing the ffiwrapper parts for now)
I'm not too sure if we need DeDuplicatePrivateSectorInfo
, it seems like it should be easy to avoid it
} | ||
body, err := ioutil.ReadAll(r.Body) | ||
if err != nil { | ||
failedRet(500, err) |
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.
Could use http.Error
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.
ok
TTGenerateWindowPoSt: "GWDP", | ||
TTGenerateWinningPoSt: "GWNP", |
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 tiny bit cleaner:
TTGenerateWindowPoSt: "GWDP", | |
TTGenerateWinningPoSt: "GWNP", | |
TTGenerateWindowPoSt: "WDP", | |
TTGenerateWinningPoSt: "WNP", |
api/api_worker.go
Outdated
GenerateWinningPoSt(ctx context.Context, mid abi.ActorID, privsectors ffiwrapper.SortedPrivateSectorInfo, randomness abi.PoStRandomness, sectorChallenges *ffiwrapper.FallbackChallenges) ([]proof.PoStProof, error) //perm:admin | ||
GenerateWindowPoSt(ctx context.Context, mid abi.ActorID, privsectors ffiwrapper.SortedPrivateSectorInfo, partitionIdx int, offset int, randomness abi.PoStRandomness, postChallenges *ffiwrapper.FallbackChallenges) (ffiwrapper.WindowPoStResult, error) //perm:admin |
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.
Nit: move above TaskDisable
, so that calls which do work are grouped together.
|
||
privsectors := ffi.NewSortedPrivateSectorInfo(out...) | ||
|
||
deDuplicationPrivsectors, err := ffi.DeDuplicatePrivateSectorInfo(ctx, &privsectors) |
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.
Could we, instead of adding this function, do the following:
- Add a
seen := map[abi.SectorNumber]struct{}
map above - Keep track of what sectors we've added to
out
in that map - Skip appending to
out
if we've seen the sector.
This way we should be able to avoid adding this function in filecoin-ffi
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.
Thank you, this is a good idea for deduplication, but after deduplication according to the underlying logic of ffi, the sector set must be sorted according to sectorNumber
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.
a1bcd4a
to
b387349
Compare
Hi @siriusmz how is this going? |
@jennijuju Others have been modified in accordance with the review comments |
b387349
to
9e4447b
Compare
95a787c
to
057efae
Compare
057efae
to
793b5c7
Compare
hi @siriusmz @jennijuju @magik6k,can this feature merge before march 4th? |
Thanks for the PR! Merged with #7971 |
based on:
#6943