Skip to content

Commit

Permalink
enable ddo, lock lotus deps, fix APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense committed Jan 12, 2024
1 parent 019b67d commit 9280986
Show file tree
Hide file tree
Showing 23 changed files with 520 additions and 84 deletions.
40 changes: 39 additions & 1 deletion api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,45 @@ type MarketBalance struct {

type MarketDeal struct {
Proposal market.DealProposal
State market.DealState
State MarketDealState
}

type MarketDealState struct {
SectorStartEpoch abi.ChainEpoch // -1 if not yet included in proven sector
LastUpdatedEpoch abi.ChainEpoch // -1 if deal state never updated
SlashEpoch abi.ChainEpoch // -1 if deal never slashed
}

func MakeDealState(mds market.DealState) MarketDealState {
return MarketDealState{
SectorStartEpoch: mds.SectorStartEpoch(),
LastUpdatedEpoch: mds.LastUpdatedEpoch(),
SlashEpoch: mds.SlashEpoch(),
}
}

type mstate struct {
s MarketDealState
}

func (m mstate) SectorStartEpoch() abi.ChainEpoch {
return m.s.SectorStartEpoch
}

func (m mstate) LastUpdatedEpoch() abi.ChainEpoch {
return m.s.LastUpdatedEpoch
}

func (m mstate) SlashEpoch() abi.ChainEpoch {
return m.s.SlashEpoch
}

func (m mstate) Equals(o market.DealState) bool {
return market.DealStatesEqual(m, o)
}

func (m MarketDealState) Iface() market.DealState {
return mstate{m}
}

type RetrievalOrder struct {
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions cmd/boost/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ func main() {
offlineDealCmd,
providerCmd,
walletCmd,
//TODO: enable when DDO ends up in a network upgrade
//directDealAllocate,
//directDealGetAllocations,
directDealAllocate,
directDealGetAllocations,
},
}
app.Setup()
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/boostd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func main() {
retrievalDealsCmd,
indexProvCmd,
importDataCmd,
//importDirectDataCmd,
importDirectDataCmd,
logCmd,
dagstoreCmd,
netCmd,
Expand Down
6 changes: 3 additions & 3 deletions cmd/lib/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,23 @@ func (a *MultiMinerAccessor) GetMinerAddresses() []address.Address {
func (a *MultiMinerAccessor) GetReader(ctx context.Context, minerAddr address.Address, id abi.SectorNumber, offset abi.PaddedPieceSize, length abi.PaddedPieceSize) (types.SectionReader, error) {
pr, ok := a.readers[minerAddr]
if !ok {
return nil, fmt.Errorf("get reader: no endpoint registered for miner %s", minerAddr)
return nil, fmt.Errorf("get reader: no endpoint registered for miner %s, len(readers)=%d", minerAddr, len(a.readers))
}
return pr.GetReader(ctx, minerAddr, id, offset, length)
}

func (a *MultiMinerAccessor) UnsealSectorAt(ctx context.Context, minerAddr address.Address, sectorID abi.SectorNumber, pieceOffset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (mount.Reader, error) {
sa, ok := a.sas[minerAddr]
if !ok {
return nil, fmt.Errorf("read sector: no endpoint registered for miner %s", minerAddr)
return nil, fmt.Errorf("read sector: no endpoint registered for miner %s, len(readers)=%d", minerAddr, len(a.readers))
}
return sa.UnsealSectorAt(ctx, sectorID, pieceOffset, length)
}

func (a *MultiMinerAccessor) IsUnsealed(ctx context.Context, minerAddr address.Address, sectorID abi.SectorNumber, offset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (bool, error) {
sa, ok := a.sas[minerAddr]
if !ok {
return false, fmt.Errorf("is unsealed: no endpoint registered for miner %s", minerAddr)
return false, fmt.Errorf("is unsealed: no endpoint registered for miner %s, len(readers)=%d", minerAddr, len(a.readers))
}
return sa.IsUnsealed(ctx, sectorID, offset, length)
}
Expand Down
1 change: 1 addition & 0 deletions docker/devnet/lotus-miner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ENV SECTOR_SIZE=8388608

VOLUME /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/genesis
VOLUME /var/lib/builtin-actors

WORKDIR /app
RUN mkdir -p /app
Expand Down
1 change: 1 addition & 0 deletions docker/devnet/lotus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ENV LOTUS_FEVM_ENABLEETHRPC=true

VOLUME /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/genesis
VOLUME /var/lib/builtin-actors

WORKDIR /app
RUN mkdir -p /app
Expand Down
2 changes: 1 addition & 1 deletion extern/filecoin-ffi
11 changes: 8 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/filecoin-project/go-jsonrpc v0.3.1
github.com/filecoin-project/go-padreader v0.0.1
github.com/filecoin-project/go-paramfetch v0.0.4
github.com/filecoin-project/go-state-types v0.12.8
github.com/filecoin-project/go-state-types v0.12.9-0.20240103231141-9941a911fb05
github.com/filecoin-project/go-statestore v0.2.0
github.com/filecoin-project/specs-actors v0.9.15 // indirect
github.com/gbrlsnchs/jwt/v3 v3.0.1
Expand Down Expand Up @@ -284,7 +284,7 @@ require (
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
github.com/twmb/murmur3 v1.1.6 // indirect
github.com/ugorji/go/codec v1.2.6 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba // indirect
Expand Down Expand Up @@ -323,7 +323,7 @@ require (
github.com/filecoin-project/boost/extern/boostd-data v0.0.0-20231124125934-3233c510357f
github.com/filecoin-project/go-data-segment v0.0.1
github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc7
github.com/filecoin-project/lotus v1.25.0
github.com/filecoin-project/lotus v1.25.1-rc1.0.20240108110627-c51ecb626f1b
github.com/ipfs/boxo v0.12.0
github.com/ipfs/go-ds-leveldb v0.5.0
github.com/ipfs/kubo v0.22.0
Expand All @@ -345,6 +345,7 @@ require (
github.com/filecoin-project/kubo-api-client v0.0.2-0.20230829103503-14448166d14d // indirect
github.com/gammazero/channelqueue v0.2.1 // indirect
github.com/gammazero/deque v0.2.1 // indirect
github.com/georgysavva/scany/v2 v2.0.0 // indirect
github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand All @@ -355,12 +356,15 @@ require (
github.com/ipfs/go-ipfs-blockstore v1.3.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.11.0 // indirect
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.2.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.10.0 // indirect
github.com/jackc/pgx/v5 v5.4.1 // indirect
github.com/jackc/puddle v1.2.1 // indirect
github.com/jackc/puddle/v2 v2.2.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/montanaflynn/stats v0.7.0 // indirect
github.com/onsi/ginkgo/v2 v2.11.0 // indirect
Expand All @@ -369,6 +373,7 @@ require (
github.com/quic-go/qtls-go1-20 v0.3.3 // indirect
github.com/quic-go/quic-go v0.38.1 // indirect
github.com/quic-go/webtransport-go v0.5.3 // indirect
github.com/triplewz/poseidon v0.0.0-20220525065023-a7cdb0e183e7 // indirect
github.com/warpfork/go-testmark v0.12.1 // indirect
github.com/yugabyte/gocql v0.0.0-20230831121436-1e2272bb6bb6 // indirect
github.com/yugabyte/pgx/v4 v4.14.5 // indirect
Expand Down
Loading

0 comments on commit 9280986

Please sign in to comment.