venus
venus copied to clipboard
[venus-market] 重构venus-market中地址和账号关系及相关组件
Discussed in https://github.com/filecoin-project/venus/discussions/4947
Originally posted by hunjixin June 20, 2022
Checklist
- [X] This is not a security-related bug/issue. If it is, please follow please follow the security policy.
- [X] This is not a question or a support request. If you have any lotus related questions, please ask in the venus forum.
- [X] This is not a new feature request. If it is, please file a feature request instead.
- [X] This is not an enhancement request. If it is, please file a improvement suggestion instead.
- [X] I have searched on the issue tracker and the venus forum, and there is no existing related issue or discussion.
- [X] I am running the
latest release
, or the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these. - [X] I did not make any code changes to venus.
Venus component
- [ ] venus daemon - chain sync
- [ ] venus auth - authentication
- [ ] venus gateway - chain service gateway
- [ ] venus miner - mining and block production
- [ ] venus sealer/worker - sealing
- [ ] venus sealer - proving(WindowPoSt)
- [X] venus market - storage deal
- [X] venus market - retrieval deal
- [ ] venus market - data transfer
- [ ] venus light-weight client
- [ ] venus JSON-RPC API
- [ ] venus messager - message management (mpool)
- [ ] Other
Venus Version
latest
Describe the Bug
venus-market中存在两个问题
-
现在会从venus-auth拿出账号矿工, 建立一个addr-account的表,当需要签名是通过from查询地址属于哪个account,在通过gateway去找用户签名。 但是如果这个矿工被移除,在这个cache表中移除对应的地址将会十分困难。另外一个问题是,如果两个account使用相同的地址,这里会存在后来的addr-account覆盖前面的情况,签名转发会不正确。
-
在目前market的部分功能,例如publish订单,paychannel会进行对相同地址的一些信息进行聚合,在进行签名的时候就无法区分是否是数据是来源于哪个account。签名转发自然也就不正确了。
解决办法:在account级别上隔离market里面的各种信息,在account级别上进行资产的聚合支付,这样在寻求消息签名时自然可以知道该到哪个account上去寻求签名。这样也就不需要addr-account缓存的存在了。 影响部分:
1. minermgr 删除。
2. paychannel支持按account/addr级别进行资金聚合和支付,而不是通过addr。
3. 签名客户端需要换一种抽象方法来兼容lotus节点直接签名。
Logging Information
--
Repo Steps
No response
publish订单聚合方式, fundmgr资产聚合方式 聚合方式使用地址和账号
文档: https://github.com/filecoin-project/venus-market/blob/feat/lt/refactor_addr_manager/docs/zh/account-sign.md 涉及组件: https://github.com/filecoin-project/venus/pull/5433 https://github.com/filecoin-project/venus-auth/pull/113 https://github.com/ipfs-force-community/venus-gateway/pull/95 https://github.com/filecoin-project/venus-messager/pull/271 https://github.com/filecoin-project/venus-market/pull/231 https://github.com/filecoin-project/venus-miner/pull/150