Skip to content

Commit b464556

Browse files
authored
chore: update lotus dependency to v1.27.1 (#1936)
* update lotus dependency to v1.27.1 * fix lint and mod tidy
1 parent 5dcdc1c commit b464556

File tree

37 files changed

+526
-1376
lines changed

37 files changed

+526
-1376
lines changed

api/api_full.go

Lines changed: 31 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
1717
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
1818
"github.com/filecoin-project/lotus/chain/types"
19-
"github.com/filecoin-project/lotus/node/repo/imports"
2019
)
2120

2221
//go:generate go run github.com/golang/mock/mockgen -destination=mocks/mock_full.go -package=mocks . FullNode
@@ -57,32 +56,6 @@ type MinerSectors struct {
5756
Faulty uint64
5857
}
5958

60-
type ImportRes struct {
61-
Root cid.Cid
62-
ImportID imports.ID
63-
}
64-
65-
type Import struct {
66-
Key imports.ID
67-
Err string
68-
69-
Root *cid.Cid
70-
71-
// Source is the provenance of the import, e.g. "import", "unknown", else.
72-
// Currently useless but may be used in the future.
73-
Source string
74-
75-
// FilePath is the path of the original file. It is important that the file
76-
// is retained at this path, because it will be referenced during
77-
// the transfer (when we do the UnixFS chunking, we don't duplicate the
78-
// leaves, but rather point to chunks of the original data through
79-
// positional references).
80-
FilePath string
81-
82-
// CARPath is the path of the CAR file containing the DAG for this import.
83-
CARPath string
84-
}
85-
8659
type MsgLookup struct {
8760
Message cid.Cid // Can be different than requested, in case it was replaced, but only gas values changed
8861
Receipt types.MessageReceipt
@@ -209,37 +182,37 @@ type MarketDealState struct {
209182
SlashEpoch abi.ChainEpoch // -1 if deal never slashed
210183
}
211184

212-
func MakeDealState(mds market.DealState) MarketDealState {
213-
return MarketDealState{
214-
SectorStartEpoch: mds.SectorStartEpoch(),
215-
LastUpdatedEpoch: mds.LastUpdatedEpoch(),
216-
SlashEpoch: mds.SlashEpoch(),
217-
}
218-
}
219-
220-
type mstate struct {
221-
s MarketDealState
222-
}
223-
224-
func (m mstate) SectorStartEpoch() abi.ChainEpoch {
225-
return m.s.SectorStartEpoch
226-
}
227-
228-
func (m mstate) LastUpdatedEpoch() abi.ChainEpoch {
229-
return m.s.LastUpdatedEpoch
230-
}
231-
232-
func (m mstate) SlashEpoch() abi.ChainEpoch {
233-
return m.s.SlashEpoch
234-
}
235-
236-
func (m mstate) Equals(o market.DealState) bool {
237-
return market.DealStatesEqual(m, o)
238-
}
239-
240-
func (m MarketDealState) Iface() market.DealState {
241-
return mstate{m}
242-
}
185+
//func MakeDealState(mds market.DealState) MarketDealState {
186+
// return MarketDealState{
187+
// SectorStartEpoch: mds.SectorStartEpoch(),
188+
// LastUpdatedEpoch: mds.LastUpdatedEpoch(),
189+
// SlashEpoch: mds.SlashEpoch(),
190+
// }
191+
//}
192+
//
193+
//type mstate struct {
194+
// s MarketDealState
195+
//}
196+
//
197+
//func (m mstate) SectorStartEpoch() abi.ChainEpoch {
198+
// return m.s.SectorStartEpoch
199+
//}
200+
//
201+
//func (m mstate) LastUpdatedEpoch() abi.ChainEpoch {
202+
// return m.s.LastUpdatedEpoch
203+
//}
204+
//
205+
//func (m mstate) SlashEpoch() abi.ChainEpoch {
206+
// return m.s.SlashEpoch
207+
//}
208+
//
209+
//func (m mstate) Equals(o market.DealState) bool {
210+
// return market.DealStatesEqual(m, o)
211+
//}
212+
//
213+
//func (m MarketDealState) Iface() market.DealState {
214+
// return mstate{m}
215+
//}
243216

244217
type InvocResult struct {
245218
MsgCid cid.Cid

api/docgen/docgen.go

Lines changed: 8 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package docgen
22

33
import (
4-
"encoding/json"
54
"fmt"
65
"go/ast"
76
"go/parser"
@@ -12,39 +11,22 @@ import (
1211
"time"
1312
"unicode"
1413

14+
"github.com/filecoin-project/boost/api"
1515
"github.com/filecoin-project/boost/datatransfer"
16-
"github.com/filecoin-project/boost/retrievalmarket/types/legacyretrievaltypes"
16+
types2 "github.com/filecoin-project/boost/storagemarket/types"
17+
"github.com/filecoin-project/boost/storagemarket/types/dealcheckpoints"
1718
"github.com/filecoin-project/boost/storagemarket/types/legacytypes/filestore"
18-
"github.com/filecoin-project/go-address"
19-
"github.com/filecoin-project/go-bitfield"
2019
"github.com/filecoin-project/go-jsonrpc/auth"
21-
"github.com/google/uuid"
22-
"github.com/ipfs/go-cid"
23-
"github.com/ipfs/go-graphsync"
24-
textselector "github.com/ipld/go-ipld-selector-text-lite"
20+
"github.com/filecoin-project/go-state-types/abi"
21+
"github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
22+
"github.com/filecoin-project/go-state-types/crypto"
23+
apitypes "github.com/filecoin-project/lotus/api/types"
2524
pubsub "github.com/libp2p/go-libp2p-pubsub"
2625
"github.com/libp2p/go-libp2p/core/metrics"
2726
"github.com/libp2p/go-libp2p/core/network"
2827
"github.com/libp2p/go-libp2p/core/peer"
2928
"github.com/libp2p/go-libp2p/core/protocol"
3029
"github.com/multiformats/go-multiaddr"
31-
32-
"github.com/filecoin-project/go-state-types/abi"
33-
"github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
34-
"github.com/filecoin-project/go-state-types/crypto"
35-
"github.com/filecoin-project/go-state-types/exitcode"
36-
37-
"github.com/filecoin-project/boost/api"
38-
types2 "github.com/filecoin-project/boost/storagemarket/types"
39-
"github.com/filecoin-project/boost/storagemarket/types/dealcheckpoints"
40-
lapi "github.com/filecoin-project/lotus/api"
41-
apitypes "github.com/filecoin-project/lotus/api/types"
42-
"github.com/filecoin-project/lotus/build"
43-
"github.com/filecoin-project/lotus/chain/types"
44-
"github.com/filecoin-project/lotus/node/modules/dtypes"
45-
"github.com/filecoin-project/lotus/node/repo/imports"
46-
"github.com/filecoin-project/lotus/storage/sealer/sealtasks"
47-
"github.com/filecoin-project/lotus/storage/sealer/storiface"
4830
"golang.org/x/text/cases"
4931
"golang.org/x/text/language"
5032
)
@@ -62,97 +44,32 @@ func addExample(v interface{}) {
6244
}
6345

6446
func init() {
65-
c, err := cid.Decode("bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4")
66-
if err != nil {
67-
panic(err)
68-
}
69-
70-
ExampleValues[reflect.TypeOf(c)] = c
71-
72-
c2, err := cid.Decode("bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve")
73-
if err != nil {
74-
panic(err)
75-
}
76-
77-
tsk := types.NewTipSetKey(c, c2)
78-
79-
ExampleValues[reflect.TypeOf(tsk)] = tsk
80-
81-
addr, err := address.NewIDAddress(1234)
82-
if err != nil {
83-
panic(err)
84-
}
85-
86-
ExampleValues[reflect.TypeOf(addr)] = addr
87-
8847
pid, err := peer.Decode("12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf")
8948
if err != nil {
9049
panic(err)
9150
}
9251
addExample(pid)
9352
addExample(&pid)
9453

95-
storeIDExample := imports.ID(50)
96-
textSelExample := textselector.Expression("Links/21/Hash/Links/42/Hash")
97-
clientEvent := legacyretrievaltypes.ClientEventDealAccepted
98-
99-
addExample(bitfield.NewFromSet([]uint64{5}))
100-
addExample(abi.RegisteredSealProof_StackedDrg32GiBV1_1)
101-
addExample(abi.RegisteredPoStProof_StackedDrgWindow32GiBV1)
10254
addExample(abi.ChainEpoch(10101))
10355
addExample(crypto.SigTypeBLS)
104-
addExample(types.KTBLS)
10556
addExample(int64(9))
10657
addExample(12.3)
10758
addExample(123)
108-
addExample(uintptr(0))
109-
addExample(abi.MethodNum(1))
110-
addExample(exitcode.ExitCode(0))
111-
addExample(crypto.DomainSeparationTag_ElectionProofProduction)
11259
addExample(true)
11360
addExample(abi.UnpaddedPieceSize(1024))
11461
addExample(abi.UnpaddedPieceSize(1024).Padded())
11562
addExample(abi.DealID(5432))
11663
addExample(abi.SectorNumber(9))
117-
addExample(abi.SectorSize(32 * 1024 * 1024 * 1024))
118-
addExample(api.MpoolChange(0))
11964
addExample(network.Connected)
120-
addExample(dtypes.NetworkName("lotus"))
121-
addExample(api.SyncStateStage(1))
122-
addExample(api.FullAPIVersion1)
123-
addExample(api.PCHInbound)
12465
addExample(time.Minute)
125-
addExample(graphsync.NewRequestID())
12666
addExample(datatransfer.TransferID(3))
127-
addExample(datatransfer.Ongoing)
128-
addExample(storeIDExample)
129-
addExample(&storeIDExample)
130-
addExample(clientEvent)
131-
addExample(&clientEvent)
132-
addExample(legacyretrievaltypes.ClientEventDealAccepted)
133-
addExample(legacyretrievaltypes.DealStatusNew)
134-
addExample(&textSelExample)
13567
addExample(network.ReachabilityPublic)
136-
addExample(build.TestNetworkVersion)
13768
allocationID := verifreg.AllocationId(0)
13869
addExample(allocationID)
139-
addExample(&allocationID)
14070
addExample(filestore.Path(""))
14171
addExample(map[string]int{"name": 42})
14272
addExample(map[string]time.Time{"name": time.Unix(1615243938, 0).UTC()})
143-
addExample(&types.ExecutionTrace{
144-
Msg: ExampleValue("init", reflect.TypeOf(types.MessageTrace{}), nil).(types.MessageTrace),
145-
MsgRct: ExampleValue("init", reflect.TypeOf(types.ReturnTrace{}), nil).(types.ReturnTrace),
146-
})
147-
addExample(map[string]types.Actor{
148-
"t01236": ExampleValue("init", reflect.TypeOf(types.Actor{}), nil).(types.Actor),
149-
})
150-
addExample(map[string]api.MarketDeal{
151-
"t026363": ExampleValue("init", reflect.TypeOf(api.MarketDeal{}), nil).(api.MarketDeal),
152-
})
153-
addExample(map[string]api.MarketBalance{
154-
"t026363": ExampleValue("init", reflect.TypeOf(api.MarketBalance{}), nil).(api.MarketBalance),
155-
})
15673
addExample(map[string]*pubsub.TopicScoreSnapshot{
15774
"/blocks": {
15875
TimeInMesh: time.Minute,
@@ -177,91 +94,14 @@ func init() {
17794
TotalOut: 12500,
17895
},
17996
})
180-
97+
//
18198
maddr, err := multiaddr.NewMultiaddr("/ip4/52.36.61.156/tcp/1347/p2p/12D3KooWFETiESTf1v4PGUvtnxMAcEFMzLZbJGg4tjWfGEimYior")
18299
if err != nil {
183100
panic(err)
184101
}
185102

186103
// because reflect.TypeOf(maddr) returns the concrete type...
187104
ExampleValues[reflect.TypeOf(struct{ A multiaddr.Multiaddr }{}).Field(0).Type] = maddr
188-
189-
// miner specific
190-
si := uint64(12)
191-
addExample(&si)
192-
addExample(legacyretrievaltypes.DealID(5))
193-
addExample(abi.ActorID(1000))
194-
addExample(storiface.ID("76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8"))
195-
addExample(storiface.FTUnsealed)
196-
addExample(storiface.PathSealing)
197-
addExample(map[storiface.ID][]storiface.Decl{
198-
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": {
199-
{
200-
SectorID: abi.SectorID{Miner: 1000, Number: 100},
201-
SectorFileType: storiface.FTSealed,
202-
},
203-
},
204-
})
205-
addExample(map[storiface.ID]string{
206-
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": "/data/path",
207-
})
208-
addExample(map[uuid.UUID][]storiface.WorkerJob{
209-
uuid.MustParse("ef8d99a2-6865-4189-8ffa-9fef0f806eee"): {
210-
{
211-
ID: storiface.CallID{
212-
Sector: abi.SectorID{Miner: 1000, Number: 100},
213-
ID: uuid.MustParse("76081ba0-61bd-45a5-bc08-af05f1c26e5d"),
214-
},
215-
Sector: abi.SectorID{Miner: 1000, Number: 100},
216-
Task: sealtasks.TTPreCommit2,
217-
RunWait: 0,
218-
Start: time.Unix(1605172927, 0).UTC(),
219-
Hostname: "host",
220-
},
221-
},
222-
})
223-
addExample(map[uuid.UUID]storiface.WorkerStats{
224-
uuid.MustParse("ef8d99a2-6865-4189-8ffa-9fef0f806eee"): {
225-
Info: storiface.WorkerInfo{
226-
Hostname: "host",
227-
Resources: storiface.WorkerResources{
228-
MemPhysical: 256 << 30,
229-
MemUsed: 2 << 30,
230-
MemSwap: 120 << 30,
231-
MemSwapUsed: 2 << 30,
232-
CPUs: 64,
233-
GPUs: []string{"aGPU 1337"},
234-
Resources: storiface.ResourceTable,
235-
},
236-
},
237-
Enabled: true,
238-
MemUsedMin: 0,
239-
MemUsedMax: 0,
240-
GpuUsed: 0,
241-
CpuUse: 0,
242-
},
243-
})
244-
addExample(storiface.ErrorCode(0))
245-
addExample(map[abi.SectorNumber]string{
246-
123: "can't acquire read lock",
247-
})
248-
addExample(json.RawMessage(`"json raw message"`))
249-
addExample([]abi.SectorNumber{123, 124})
250-
addExample([]storiface.SectorLock{
251-
{
252-
Sector: abi.SectorID{Number: 123, Miner: 1000},
253-
Write: [storiface.FileTypes]uint{0, 0, 1},
254-
Read: [storiface.FileTypes]uint{2, 3, 0},
255-
},
256-
})
257-
258-
// worker specific
259-
addExample(storiface.AcquireMove)
260-
addExample(storiface.UnpaddedByteIndex(abi.PaddedPieceSize(1 << 20).Unpadded()))
261-
addExample(map[sealtasks.TaskType]struct{}{
262-
sealtasks.TTPreCommit2: {},
263-
})
264-
addExample(sealtasks.TTCommit2)
265105
addExample(apitypes.OpenRPCDocument{
266106
"openrpc": "1.2.6",
267107
"info": map[string]interface{}{
@@ -270,18 +110,6 @@ func init() {
270110
},
271111
"methods": []interface{}{}},
272112
)
273-
274-
addExample(api.CheckStatusCode(0))
275-
addExample(map[string]interface{}{"abc": 123})
276-
addExample(storiface.ResourceTable)
277-
addExample(network.ScopeStat{
278-
Memory: 123,
279-
NumStreamsInbound: 1,
280-
NumStreamsOutbound: 2,
281-
NumConnsInbound: 3,
282-
NumConnsOutbound: 4,
283-
NumFD: 5,
284-
})
285113
addExample(map[string]network.ScopeStat{
286114
"abc": {
287115
Memory: 123,
@@ -292,17 +120,7 @@ func init() {
292120
NumFD: 5,
293121
}})
294122
addExample(dealcheckpoints.Transferred)
295-
addExample(lapi.SubsystemMarkets)
296123
addExample(types2.DealRetryAuto)
297-
addExample(map[string][]lapi.SealedRef{
298-
"98000": {
299-
lapi.SealedRef{
300-
SectorID: 100,
301-
Offset: 10 << 20,
302-
Size: 1 << 20,
303-
},
304-
},
305-
})
306124
}
307125

308126
func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {

build/openrpc/boost.json.gz

-79 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)