ipfs-force-community / droplet Goto Github PK
View Code? Open in Web Editor NEWmarket for storage and retrieval
market for storage and retrieval
If fastretrieval = false
, delete the piece file after sealing is completed. When the user retrieves it, it triggers the unsealing process. / 如果 fastretrieval = false
,密封完成后删除 piece 文件, 用户检索时,并触发 unseal 流程。
Drople 重启的时候 有一个查询花了比较长的时间
2023-07-04T09:48:55.254+0800 INFO modules rpc/rpc.go:99 start rpc listen /ip4/0.0.0.0/tcp/41240
2023/07/04 09:48:59 /root/droplet/models/mysql/storage_deal.go:405 SLOW SQL >= 200ms
[4098.379ms] [rows:34326] SELECT * FROM `storage_deals` WHERE cdp_provider='02002688' AND state in (7)
2023/07/04 09:52:06 /root/droplet/models/mysql/storage_deal.go:478 SLOW SQL >= 200ms
[191476.179ms] [rows:1527454] SELECT * FROM `storage_deals` LIMIT 2147483647
有时候可能只知道 deal id ,但是不知道 订单id ,这个时候能通过订单 id 获取订单就比较重要
列出订单时,应该默认看到最新的订单
计划包含以下功能:
目前 droplet dagstore 中 shard 和 topIndex 都保存在 badger 中,如果不同时间向有多个 droplet 检索同一个订单,
就可能会造成重复生成索引的问题,为了解决这个问题,打算把 shard 保存到 MySQL 数据库中,把 topIndex 存储到 MongoDB 中,这样多个 droplet 可以共享。
需要把存储在 badger 的 shard 迁移到 MySQL,droplet 提供了迁移工具:https://github.com/ipfs-force-community/droplet/tree/master/tools/index#%E8%BF%81%E7%A7%BB%E7%B4%A2%E5%BC%95
可能有部分 piece 没有生成索引,就需要为这部分 piece 重新生成索引,droplet 提供了生成索引的工具:https://github.com/ipfs-force-community/droplet/tree/master/tools/index#%E7%94%9F%E6%88%90%E7%B4%A2%E5%BC%95
不支持收boost的/fil/storage/mk/1.2.0协议向droplet发单。
droplet-client version v2.9.0+git.0a23f46
droplet-client query 网络不通会一直卡住,不会返回正确的错误信息
./droplet-client storage asks query t01504
2023-09-15T14:21:50.251+0800 DEBUG swarm2 swarm/limiter.go:201 [limiter] clearing all peer dials: 12D3KooWFviV912XCwYoB8BhhZWjooFUmTS1tBXa3aFXfeFNNZSU
2023-09-15T14:22:36.596+0800 WARN storagemarket_network network/libp2p_impl.go:92 open stream to 12D3KooWFviV912XCwYoB8BhhZWjooFUmTS1tBXa3aFXfeFNNZSU canceled by context
2023-09-15T14:22:36.596+0800 WARN rpc [email protected]/handler.go:456 error in RPC call to 'VENUS_MARKET_CLIENT.ClientQueryAsk': failed to open stream to miner:
github.com/filecoin-project/go-fil-markets/storagemarket/impl.(*Client).GetAsk
/root/go/pkg/mod/github.com/ipfs-force-community/[email protected]/storagemarket/impl/client.go:222
- open stream to 12D3KooWFviV912XCwYoB8BhhZWjooFUmTS1tBXa3aFXfeFNNZSU canceled by context:
github.com/filecoin-project/go-fil-markets/shared.(*RetryStream).OpenStream
/root/go/pkg/mod/github.com/ipfs-force-community/[email protected]/shared/retrystream.go:99
2023-09-15T14:22:36.596+0800 ERROR rpc [email protected]/websocket.go:127 handle me:websocket: close sent
droplet-client retrieval query-ask
没有提供检索询价的方法,而是直接检索数据
droplet-client version v2.8.0+git.dacf390
在设置了下单价格且钱包地址注册到gateway的前提下进行下单,报错:Error: failed to query ask: bls signature failed to verify
./droplet-client data import 9.png
Import 1692865190720248675, Root bafykbzacecnpkfnjutdjthm2yveylbg3xw3exkilzi6w5uuuiearjfrdvobu4
root@calib-venus-132:~/droplet# ./droplet-client storage deals init
Data CID (from droplet-client data import): bafykbzacecnpkfnjutdjthm2yveylbg3xw3exkilzi6w5uuuiearjfrdvobu4
.. calculating data size
PieceCid: baga6ea4seaqfwtemwtlpiil73z3fnrelflmldtjwumd7uq52ydoobokt7b2hgaa PayLoadSize: 40162647 PieceSize: 67108864
Deal duration (days): 380
Miner Addresses (f0.. f0..), none to find: f023456
.. querying miner asks
Error: failed to query ask: bls signature failed to verify
./droplet-client data import xxx
./droplet-client storage deals init
Data CID (from droplet-client data import): xxx
PieceCid: baga6ea4seaqfwtemwtlpiil73z3fnrelflmldtjwumd7uq52ydoobokt7b2hgaa PayLoadSize: 40162647 PieceSize: 67108864
Deal duration (days): 380
Miner Addresses (f0.. f0..), none to find: f023456
.. querying miner asks
Error: failed to query ask: bls signature failed to verify
需要把依赖的 Venus 升级到最新版本
目前来看导入已经发布的订单速度较慢,会逐个检查订单是否已经存在,可以考虑按 provider 拿到已有订单,然后再过滤。active 订单的导入后,status 的值不对。
v1.12.0
内存持续增长,通过火焰图可以看到 context.WithCancel 占用内存较多,也是通过 http 请求调用节点接口。
pprof.droplet-pprof.alloc_objects.alloc_space.inuse_objects.inuse_space.001.pb.gz
。
No response
允许 PieceReader 平行读取优化,不知道能不能适用于水滴这边?
需要显示出deal_id对应的sector_id、是否为DC订单及将订单生命周期由高度改为天数。
droplet storage deal list
ProposalCid DealId State PieceState Client Provider Size Price Duration
...rtvij444 89836 StorageDealActive Proving t15eda5pnz7q3ycwbbpp5xl43nrzmed3am4gyiedi t01037 32GiB 0 FIL 864000
droplet storage deal list
ProposalCid Piece State DealId Sector IsVerified PieceState Client Provider Size Price days
...rtvij444 baga6e...vb7ba3apsdoba StorageDealActive 89836 100 true Proving ....am4giedi t01037 32GiB 0 FIL 210
增加 issue 模板
v1.13.0
统一链服务入口之后, node, messager , auth 的配置项应通过函数获取
这个时候,auth 的 token 不应该再 被 cs-token 直接覆盖
略
No response
为了更好的监控,运维,添加如下metrics:
组件名称 | 指标 | label | value | name |
---|---|---|---|---|
droplet | api接口启动状态 | \ | 0或1来表示是否正常启动 | api/state |
droplet | 检索计数 | 检索计数 (0:fail,1:succeed) | retrieval/transfer_event | |
droplet | dagstore list-shards中不同状态piece数量 | \ | piece数量 | shard/num |
v2.8.1
订单上链之后,如果失败了,修复错误之后,重置订单状态就可以继续进行
但是缺乏一个重新让订单启动的 命令
略
No response
PL 的 xinan xu 最近在负责 retrieval bot 这一块。retrieval bot 主要用于 f+ 的检索检索检查。如果检查效果不好,有可能被拒绝 ldn 的申请。水滴这边主要以满足 http 检索功能为主。Spec 虽然没有写进 filecoin 的 spec,现阶段可能也没有办法。
Spec
讨论
xinan xu 说有问题的话可以问他。
droplet 自动删除临时的 car 文件
droplet 支持http是一个非常好的idea,但发现这个功能共用了rpc端口,rpc服务功能比较多,而且可以操作钱包签名,一般是内部人员使用,不会把端口直接爆漏在公网, 虽然有鉴权机制,但从安全性角度来说,检索应该独立一个服务实现,检索毕竟属于公开的服务,不需要鉴权,不应该跟内部功能性的rpc共用端口,所以建议把检索服务独立一个http单独去实现。
1、提供离线的droplet-client data commP计算功能;
2、提供离线droplet-client上car文件与piece文件相互转换功能。
缺少RemoveExpiredAllocations方法,用于回收过期的订单的DC配额;
lotus filplus
NAME:
lotus filplus - Interact with the verified registry actor used by Filplus
USAGE:
lotus filplus command [command options] [arguments...]
COMMANDS:
grant-datacap give allowance to the specified verified client address
list-notaries list all notaries
list-clients list all verified clients
check-client-datacap check verified client remaining bytes
check-notary-datacap check a notary's remaining bytes
sign-remove-data-cap-proposal allows a notary to sign a Remove Data Cap Proposal
list-allocations List allocations made by client
remove-expired-allocations remove expired allocations (if no allocations are specified all eligible allocations are removed)
help, h Shows a list of commands or help for one command
OPTIONS:
--help, -h show help (default: false)
droplet-client version v2.8.0-rc2+git.8f9a887
eg: ./droplet-client storage asks query t023456
2023-06-26T15:30:43.319+0800 FATAL main droplet-client/main.go:147 RPC error (-32601): (error code -32601) method 'VENUS_MARKET_CLIENT.ClientQueryAsk' not found
droplet version v2.8.1+git.8fb315f
droplet piece-storage add-fs --name test-file --path /opt/test-fil
添加完存储路径,再尝试使用HTTP方式检索无法获取到数据。
curl http://127.0.0.1:41235/piece/baga6ea4seaqxxxxxxf33gkeq --output /tmp/test
Error: unable to find piece baga6ea4seaqxxxxxxf33gkeq: not found for read
No response
先看看当前是啥?需不需要改成 droplet,还是就算了?(CIDgravity的人在问) 不过我看好像没有 agent 这个参数?
目前有部分用户的 piece 文件名格式是 piececid.car
,但 piecestorage 只能识别以 piececid
作为文件名的,考虑兼容
目前有的用户只有piece文件,但批量发单需要一个 manifest,所以需要新增一个命令把 piece 文件的信息转换后存储到 manifest。
manifest 需要四个值:payload_cid,piece_cid,payload_size,piece_size。
当多个 droplet 使用同一个 MySQL 时,每个 droplet 都会追踪订单的状态,但只需要一个 droplet 能追踪订单状态就行,考虑增加一个开关来控制是否追踪订单状态,相关代码:https://github.com/ipfs-force-community/droplet/blob/master/storageprovider/deal_tracker.go#L53
When the market client places an order, there is no limit on the number of days to place an order; The default real order is stored for a minimum of 180 days and a maximum of 540 days.
market-client deal
/root/.marketclient
Data CID (from lotus client import): bafykbzaceciyctgphnwj6sxashn55puodo62bk4n4kkqhgw4fwkchbvq2qlw
.. calculating data size
PieceCid: baga6ea4seaqhcwxs566wheq7yn5evm22xtpiv6usnqtou44vbz2zsfdmeyiaeq PayLoadSize: 13959883139 PieceSize: 17179869184
Deal duration (days): 999999999999999999
Miner Addresses (f0.. f0..), none to find: f01111
.. querying miner asks
Proposing from f3v5shsytrnz7ycr7ou4yxq2nf2xm34idnvfgnm6wyru7lrmu2ykuvtte2hq6rk2v3qttrsysvssr42cxt6a
Balance: 13762.152500344563313485 FIL
Piece size: 16GiB (Payload size: 13GiB)
Duration: 1942802h0m29.571268608s
Total price: ~1.86508992 FIL (0.000000008 FIL per epoch)
Verified: false
Accept (yes/no): yes
.. executing
Deal (f019411) CID: bafyreihxyph3pqm47teqtzqkdbs6nmpjkuu74jjcb2esidklrmzesw6le
droplet 发布 v2.10.0-rc1,对应 nv21 calibnet 升级
droplet version v2.8.1+git.8fb315f
线下模式中,damocles-manager直连droplet日志一直报错
2023-08-05T19:17:12.996+0800 ERROR rpc [email protected]/server.go:99 RPC Error: (error code 0) fatal error calling 'VENUS_MARKET.ListenMarketEvent': panic in rpc method 'VENUS_MARKET.ListenMarketEvent': runtime error: invalid memory address or nil pointer dereference: error code 0
2023-08-05T19:17:12.996+0800 WARN rpc [email protected]/server.go:105 rpc error: (error code 0) fatal error calling 'VENUS_MARKET.ListenMarketEvent': panic in rpc method 'VENUS_MARKET.ListenMarketEvent': runtime error: invalid memory address or nil pointer dereference: error code 0
2023-08-05T19:17:13.394+0800 ERROR rpc [email protected]/handler.go:306 panic in rpc method 'VENUS_MARKET.ListenMarketEvent': runtime error: invalid memory address or nil pointer dereference
github.com/filecoin-project/go-jsonrpc.doCall.func1
/root/go/pkg/mod/github.com/ipfs-force-community/[email protected]/handler.go:306
runtime.gopanic
/usr/local/go/src/runtime/panic.go:890
runtime.panicmem
/usr/local/go/src/runtime/panic.go:260
runtime.sigpanic
/usr/local/go/src/runtime/signal_unix.go:839
github.com/ipfs-force-community/sophon-auth/jwtclient.(*AuthClient).MinerExistInUser
/root/go/pkg/mod/github.com/ipfs-force-community/[email protected]/jwtclient/auth_client.go:377
github.com/ipfs-force-community/sophon-gateway/validator.(*AuthMinerValidator).Validate
/root/go/pkg/mod/github.com/ipfs-force-community/[email protected]/validator/miner_validator.go:29
github.com/ipfs-force-community/sophon-gateway/marketevent.(*MarketEventStream).ListenMarketEvent
/root/go/pkg/mod/github.com/ipfs-force-community/[email protected]/marketevent/market_event.go:59
github.com/ipfs-force-community/droplet/v2/api/impl.(*MarketNodeImpl).ListenMarketEvent
/opt/venus-market/api/impl/venus_market.go:122
reflect.Value.call
/usr/local/go/src/reflect/value.go:584
reflect.Value.Call
/usr/local/go/src/reflect/value.go:368
github.com/filecoin-project/venus/venus-shared/api/permission.PermissionProxy.func1
/root/go/pkg/mod/github.com/filecoin-project/[email protected]/venus-shared/api/permission/permission.go:51
github.com/filecoin-project/venus/venus-shared/api/market/v1.(*IMarketStruct).ListenMarketEvent
/root/go/pkg/mod/github.com/filecoin-project/[email protected]/venus-shared/api/market/v1/proxy_gen.go:262
reflect.Value.call
/usr/local/go/src/reflect/value.go:584
reflect.Value.Call
/usr/local/go/src/reflect/value.go:368
github.com/filecoin-project/go-jsonrpc.doCall
/root/go/pkg/mod/github.com/ipfs-force-community/[email protected]/handler.go:310
github.com/filecoin-project/go-jsonrpc.(*handler).handle
/root/go/pkg/mod/github.com/ipfs-force-community/[email protected]/handler.go:435
2023-08-05T19:17:13.395+0800 ERROR rpc [email protected]/server.go:99 RPC Error: (error code 0) fatal error calling 'VENUS_MARKET.ListenMarketEvent': panic in rpc method 'VENUS_MARKET.ListenMarketEvent': runtime error: invalid memory address or nil pointer dereference: error code 0
No response
ci 测试偶尔过不了
https://github.com/ipfs-force-community/droplet/actions/runs/5471080445/jobs/9965625931?pr=369
topIndex 主要是在查某一段数据的时候会用到,使用 MongoDB 存储,方便所有 droplet 共享
对于上面的问题 2,shard 支持存储到 MySQL
调整 dagstore 库 管理 shard 的接口
After the wrong miner number for the first time, enter the correct check failure again
./market-client deal
/root/.marketclient
Data CID (from lotus client import): 540
Error: parsing cid string: selected encoding not supported
Data CID (from lotus client import): bafykbzacebfy3lbvxvgfnzc3fd5wpugtqf4gyb67hywifks3zdtczemzsbfg
.. calculating data size
PieceCid: baga6ea4seaqmobo7ajlhdrwozyrb7fhx6ey7j22yfj5t4uzlbivbz5a5yufiygy PayLoadSize: 13495574905 PieceSize: 17179869184
Deal duration (days): 530
Miner Addresses (f0.. f0..), none to find: f01941
.. querying miner asks
Error: failed to get peerID for miner: failed to load miner actor state: unknown actor code bafkqadlgnfwc6nrpmfrwg33vnz2a
Miner Addresses (f0.. f0..), none to find: f019111
https://github.com/ipfs-force-community/droplet/actions/runs/5960286640/job/16169094728
Direct data onboarding 一种新的 deal 模式。
cs-token
和singer-token
含义基本一样,可以都用signer-token
替代。
signer-type
来决定token的类型是什么。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.