Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boost 接入 damocles 调研 #6214

Closed
simlecode opened this issue Nov 7, 2023 · 3 comments
Closed

boost 接入 damocles 调研 #6214

simlecode opened this issue Nov 7, 2023 · 3 comments
Assignees
Labels
C-enhancement Category: feature enhancement

Comments

@simlecode
Copy link
Collaborator

simlecode commented Nov 7, 2023

boost 接入 damocles 调研

  1. 目前 boost 存储(开发中)和检索都可以支持多矿工
  2. boost 主动给 miner 下发订单
  3. boost 没有 piecestore 的概念,piece 是通过 rpc 接口传给 miner
  4. boost 在线订单的 piece 存储在 repo/incoming 目录
  5. boost 用到的接口有部分在 damocles 可能不好实现

需要调整

  • boost 移除对节点 API 版本的验证
  • 检索需要
    • 检查 piece 是否 unseal
    • 能够 unseal piece
    • 能够获取到一个 piece 的 reader 流

存储订单用到的接口

  • ActorAddress // 获取矿工地址
  • SectorsStatus(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (api.SectorInfo, error)
  • ComputeDataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storiface.Data) (abi.PieceInfo, error)
  • SectorIndex
    • StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]storiface.SectorStorageInfo, error)
  • StorageAPI
    • StorageRedeclareLocal(context.Context, *storiface.ID, bool) error // Tell lotus to update it's storage list and remove any removed sectors
    • StorageList(context.Context) (map[storiface.ID][]storiface.Decl, error) // Get the current unsealed state of all sectors from lotus
  • API:给 web 端提供数据
    • WorkerJobs(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error)
    • SectorsList(context.Context) ([]abi.SectorNumber, error)
    • SectorsSummary(ctx context.Context) (map[api.SectorState]int, error)
    • SectorsListInStates(context.Context, []api.SectorState) ([]abi.SectorNumber, error)
  • SectorBuilder:add piece 使用
    • SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, r storiface.Data, d api.PieceDealInfo) (api.SectorOffset, error)

检索订单用到的接口

  • AcquireSector(ctx context.Context, s storiface.SectorRef, existing storiface.SectorFileType, allocate storiface.SectorFileType, sealing storiface.PathType, op storiface.AcquireMode) (paths storiface.SectorPaths, stores storiface.SectorPaths, err error)
  • SectorsUnsealPiece(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd *cid.Cid) error // SectorsUnsealPiece will Unseal a Sealed sector file for the given sector.

消息

boost 没有直接连接钱包,消息是 boost 构建好再推送到节点进行签名,这样就需要用户自己部署一个节点。孵化器给多个矿工发单也会有问题(签名)。

venus 没有该接口:MarketAddBalance(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error)

数据迁移

  • 迁移存储和检索订单,boost 用的是 sqlite
  • 迁移索引,需要把索引写入到 LevelDB
@simlecode simlecode added the C-enhancement Category: feature enhancement label Nov 7, 2023
@simlecode simlecode self-assigned this Nov 7, 2023
@Fatman13
Copy link
Collaborator

Fatman13 commented Nov 8, 2023

这个好。👍

@simlecode
Copy link
Collaborator Author

boost 接入 damocles 技术上可以实现,耗时两个人月,但优先级不高,不急着做

@Fatman13 Fatman13 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2024
@Fatman13 Fatman13 removed this from the Sophon v1.14.0 / 智子 v1.14.0 milestone Jan 29, 2024
@Fatman13
Copy link
Collaborator

Fatman13 commented Jan 29, 2024

确实。。听说 boost 可能不维护了。。😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: feature enhancement
Projects
Status: Done
Development

No branches or pull requests

2 participants