Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Update go-bitfield and specs-actors
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed Jul 30, 2020
1 parent add7f0b commit 91b2337
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 86 deletions.
7 changes: 6 additions & 1 deletion ffiwrapper/partialfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,15 @@ func openPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*partialFil
return xerrors.Errorf("getting trailer run iterator: %w", err)
}

lastSet, err := rlepluslazy.LastIndex(it, true)
f, err := rlepluslazy.Fill(it)
if err != nil {
return xerrors.Errorf("filling bitfield: %w", err)
}
lastSet, err := rlepluslazy.Count(f)
if err != nil {
return xerrors.Errorf("finding last set byte index: %w", err)
}

if lastSet > uint64(maxPieceSize) {
return xerrors.Errorf("last set byte at index higher than sector size: %d > %d", lastSet, maxPieceSize)
}
Expand Down
13 changes: 7 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,23 @@ require (
github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e
github.com/elastic/go-sysinfo v1.3.0
github.com/filecoin-project/filecoin-ffi v0.30.4-0.20200716204036-cddc56607e1d
github.com/filecoin-project/go-bitfield v0.0.4-0.20200703174658-f4a5758051a1
github.com/filecoin-project/go-bitfield v0.1.2
github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f
github.com/filecoin-project/go-paramfetch v0.0.2-0.20200218225740-47c639bab663
github.com/filecoin-project/specs-actors v0.6.1
github.com/filecoin-project/specs-actors v0.8.2
github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea
github.com/google/uuid v1.1.1
github.com/gorilla/mux v1.7.4
github.com/hashicorp/go-multierror v1.0.0
github.com/ipfs/go-cid v0.0.6
github.com/ipfs/go-ipfs-files v0.0.7
github.com/ipfs/go-ipld-cbor v0.0.5-0.20200204214505-252690b78669 // indirect
github.com/ipfs/go-log v1.0.3
github.com/ipfs/go-log/v2 v2.0.3
github.com/ipfs/go-log v1.0.4
github.com/ipfs/go-log/v2 v2.0.5
github.com/mattn/go-isatty v0.0.9 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/stretchr/testify v1.4.0
github.com/stretchr/testify v1.6.1
go.opencensus.io v0.22.3
go.uber.org/zap v1.14.1 // indirect
golang.org/x/crypto v0.0.0-20200317142112-1b76d66859c6 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/sys v0.0.0-20200317113312-5766fd39f98d // indirect
Expand All @@ -32,4 +31,6 @@ require (
honnef.co/go/tools v0.0.1-2020.1.3 // indirect
)

replace github.com/filecoin-project/specs-actors => ../specs-actors

replace github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi
Loading

0 comments on commit 91b2337

Please sign in to comment.