Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
support mock wdpost faulty sectors
Browse files Browse the repository at this point in the history
  • Loading branch information
zl03jsj committed Jan 17, 2022
1 parent f3afd92 commit 55d9db6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tag-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jobs:
export job_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
export oss_exists=0
export ftp_exists=0
if [[ "${{github.event_name}}" == "create" ]] && ([[ "$github_tag" =~ "v1." ]] || [[ "$github_tag" =~ "v2." ]]); then
export rx='^v([0-9]+\.){0,2}(\*|[0-9]+)(-rc[0-9]*){0,1}$'
if [[ "${{github.ref_type}}" == "tag" ]] && [[ "${{github.event_name}}" == "create" ]] && [[ "$github_tag" =~ $rx ]]; then
export pub_method=pushRelease
fi
if [[ "$branch" == "" ]]; then
Expand Down Expand Up @@ -101,8 +102,7 @@ jobs:
run: sudo apt-get install make ncftp mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y && sudo apt upgrade -y
- name: Build
run: |
sudo make deps
sudo make
make deps && make
mkdir ./release && mv ./venus-sealer ./venus-worker ./release
- name: Zip Release
uses: TheDoctor0/[email protected]
Expand Down
16 changes: 11 additions & 5 deletions app/venus-sealer/proving.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,11 @@ var provingMockWdPoStTaskCmd = &cli.Command{
Required: true,
Usage: "specify the partition which need mock",
},
&cli.BoolFlag{
Name: "include-faulty",
Value: false,
Usage: "whether include faulty sectors or not",
},
},
Action: func(cctx *cli.Context) error {

Expand Down Expand Up @@ -581,13 +586,14 @@ var provingMockWdPoStTaskCmd = &cli.Command{
return fmt.Errorf("partition-idx is range out of partitions array: %d <= %d", len(partitions), pidx)
}

toProve, err := bitfield.SubtractBitField(partitions[pidx].LiveSectors, partitions[pidx].FaultySectors)
if err != nil {
return err
toProve := partitions[pidx].LiveSectors
if !cctx.Bool("include-faulty") {
if toProve, err = bitfield.SubtractBitField(partitions[pidx].LiveSectors, partitions[pidx].FaultySectors); err != nil {
return err
}
}

toProve, err = bitfield.MergeBitFields(toProve, partitions[pidx].RecoveringSectors)
if err != nil {
if toProve, err = bitfield.MergeBitFields(toProve, partitions[pidx].RecoveringSectors); err != nil {
return err
}

Expand Down

0 comments on commit 55d9db6

Please sign in to comment.