Skip to content

Commit

Permalink
Merge pull request #1082 from ipfs-force-community/cherry-pick-1081-t…
Browse files Browse the repository at this point in the history
…o-release-v0.10

Cherry pick #1081 to release v0.10
  • Loading branch information
simlecode authored Apr 23, 2024
2 parents 12567b4 + 0ebe009 commit 88767bc
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.10.2
- damocles-manager
- 兼容性修复 [#1081](https://github.com/ipfs-force-community/damocles/pull/1081)

## 0.10.0-rc1

- 支持 NV22 DDO [#1071](https://github.com/ipfs-force-community/damocles/pull/1071)
Expand Down
2 changes: 1 addition & 1 deletion damocles-manager/modules/impl/commitmgr/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (p PreCommitProcessor) preCommitInfo(
DealIDs: sector.DealIDs(), // DDO deal will be passed later in the Commit message
}

if len(sector.Pieces) > 0 {
if len(sector.Pieces) > 0 || len(sector.LegacyPieces) > 0 {
params.UnsealedCid = &sector.Pre.CommD
}

Expand Down
17 changes: 14 additions & 3 deletions damocles-manager/modules/sealer/sealer.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,15 @@ func (s *Sealer) ReportFinalized(ctx context.Context, sid abi.SectorID) (core.Me

func (s *Sealer) ReportAborted(ctx context.Context, sid abi.SectorID, reason string) (core.Meta, error) {
err := s.state.Finalize(ctx, sid, func(st *core.SectorState) (bool, error) {
if dealCount := len(st.LegacyPieces); dealCount > 0 {
err := s.deal.ReleaseLegacyDeal(ctx, sid, st.LegacyPieces)
if err != nil {
return false, fmt.Errorf("release legacy deals in sector: %w", err)
}

sectorLogger(sid).Infow("legacy deals released", "count", dealCount)
}

if dealCount := len(st.Pieces); dealCount > 0 {
err := s.deal.Release(ctx, sid, st.Pieces)
if err != nil {
Expand Down Expand Up @@ -616,15 +625,17 @@ func (s *Sealer) SubmitSnapUpProof(
return resp, sectorStateErr(err)
}

if len(state.Pieces) != len(snapupInfo.Pieces) {
desc = fmt.Sprintf("pieces count not match: %d != %d", len(state.Pieces), len(snapupInfo.Pieces))
pieceInfos := state.PieceInfos()

if len(pieceInfos) != len(snapupInfo.Pieces) {
desc = fmt.Sprintf("pieces count not match: %d != %d", len(pieceInfos), len(snapupInfo.Pieces))
resp.Res = core.SubmitRejected
resp.Desc = &desc
return resp, nil
}

for pi, pid := range snapupInfo.Pieces {
if localPID := state.Pieces[pi].Piece.PieceCID; !pid.Equals(state.Pieces[pi].Piece.PieceCID) {
if localPID := pieceInfos[pi].Cid; !pid.Equals(pieceInfos[pi].Cid) {
desc = fmt.Sprintf("#%d piece cid not match: %s != %s", pi, localPID, pid)
resp.Res = core.SubmitRejected
resp.Desc = &desc
Expand Down
2 changes: 1 addition & 1 deletion damocles-manager/modules/sealer/sealer_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *Sealer) RestoreSector(ctx context.Context, sid abi.SectorID, forced boo
var onRestore func(st *core.SectorState) (bool, error)
if !forced {
onRestore = func(st *core.SectorState) (bool, error) {
if len(st.Pieces) != 0 {
if len(st.PieceInfos()) != 0 {
return false, fmt.Errorf("sector with deals can not be normally restored")
}

Expand Down
7 changes: 4 additions & 3 deletions damocles-manager/modules/util/piece/piece.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ func ProcessPieces(
lookupID core.LookupID,
forceDDO bool,
) ([]miner13.PieceActivationManifest, []abi.DealID, error) {
pams := make([]miner13.PieceActivationManifest, 0, len(sector.Pieces))
dealIDs := make([]abi.DealID, 0, len(sector.Pieces))

sectorPieces := sector.SectorPiece()

pams := make([]miner13.PieceActivationManifest, 0, len(sectorPieces))
dealIDs := make([]abi.DealID, 0, len(sectorPieces))

hasDDO := forceDDO
if !forceDDO {
for _, piece := range sectorPieces {
Expand Down
2 changes: 1 addition & 1 deletion damocles-manager/ver/ver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ver

import "fmt"

const Version = "0.10.1"
const Version = "0.10.2"

var Commit string

Expand Down
2 changes: 1 addition & 1 deletion damocles-worker/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion damocles-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "damocles-worker"
version = "0.10.1"
version = "0.10.2"
authors = ["dtynn <[email protected]>"]
edition = "2021"
exclude = [".github"]
Expand Down

0 comments on commit 88767bc

Please sign in to comment.