Skip to content

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented May 3, 2022

Fixes #448

TODO:

  • Add test that verifies that the new values are being passed through to the storage deal filter query correctly

Note: This PR should not be merged until CID gravity has approved and deployed code that can handle this storage deal filter JSON format.

Adds more data to the storage deal filter JSON:

  • SealingPipelineState
  • FundsState
  • StorageState
{
  "DealUUID": "9c4ade22-7054-4b6c-8206-2059fc78ba3d",
  "IsOffline": false,
  "ClientDealProposal": {
    "Proposal": {
      "PieceCID": {
        "/": "baga6ea4seaqihx2pxanewwxvqwgeyrcmal7aomucelef52vhqy7qaarciamaqoq"
      },
      "PieceSize": 2048,
      "VerifiedDeal": false,
      "Client": "f3r3hr3xl27unpefvipve2f4hlfvdnq3forgr253z6dqahufvanatdandxm74zikheccvx74ys7by5vzafq2va",
      "Provider": "f01000",
      "Label": "bafk2bzacebiupsywspqnsvc5v7ing74i3u4y3r7wtgjioor7pqn3cxopq7lo4",
      "StartEpoch": 18171,
      "EndEpoch": 536571,
      "StoragePricePerEpoch": "1",
      "ProviderCollateral": "0",
      "ClientCollateral": "0"
    },
    "ClientSignature": {
      "Type": 2,
      "Data": "oEnUUL1WejrLawl3sP9o/TZYRZgPYA86xmF3RMQt5bPQJbrK/5x3UXYxeUKoIDMjE96fA1GSqfrE14tFl/nMyatPLUvzzZ0ulsPTQVwfb54Mgx0yBSMYTf/O8Bg09MNq"
    }
  },
  "DealDataRoot": {
    "/": "bafk2bzacebiupsywspqnsvc5v7ing74i3u4y3r7wtgjioor7pqn3cxopq7lo4"
  },
  "Transfer": {
    "Type": "http",
    "ClientID": "",
    "Params": "",
    "Size": 1101
  },
  "SealingPipelineState": {
    "SectorStates": {
      "Proving": 2,
      "WaitDeals": 1
    },
    "Workers": [{
      "ID": "9fdade22-7054-4b6c-8206-2059fc78ba4a",
      "Start": "2022-05-03T15:57:48.508Z",
      "Stage": "PC1",
      "Sector": 12345
    }]
  },
  "FundsState": {
    "Escrow": {
      "Tagged": "0",
      "Available": "5512",
      "Locked": "0"
    },
    "Collateral": {
      "Address": "f3ulwuppdq65qm2sxidb66terx7h7lcy34rsy3peqgaf34cs7475g5zqqxnlkbdejm4ug3dcrsvcmyyd2oymmq",
      "Balance": "3999998699790202783"
    },
    "PubMsg": {
      "Address": "f3u3xvmucqhngqo4wpqsxyba2veafl23va2qupkkinmhz5owphr5pxnrnjad6bnubttg2kpkgq3iohl45ybsga",
      "Balance": "9999976819311819602",
      "Tagged": "5000"
    }
  },
  "StorageState": {
    "TotalAvailable": 2000000000,
    "Tagged": 5505,
    "Staged": 5505,
    "Free": 1999994495
  },
  "DealType": "storage",
  "FormatVersion": "2.1.0",
  "Agent": "boost"
}

FundsState

type Status struct {
	// Funds in the Storage Market Actor
	Escrow SMAEscrow
	// Funds in the wallet used for deal collateral
	Collateral CollatWallet
	// Funds in the wallet used to pay for Publish Storage Deals messages
	PubMsg PubMsgWallet
}

type SMAEscrow struct {
	// Funds tagged for ongoing deals
	Tagged abi.TokenAmount
	// Funds in escrow available to be used for deal making
	Available abi.TokenAmount
	// Funds in escrow that are locked for ongoing deals
	Locked abi.TokenAmount
}

type CollatWallet struct {
	// The wallet address
	Address string
	// The wallet balance
	Balance abi.TokenAmount
}

type PubMsgWallet struct {
	// The wallet address
	Address string
	// The wallet balance
	Balance abi.TokenAmount
	// The funds that are tagged for ongoing deals
	Tagged abi.TokenAmount
}

StorageState

type Status struct {
	// The total number of bytes allocated for incoming data
	TotalAvailable uint64
	// The number of bytes reserved for accepted deals
	Tagged uint64
	// The number of bytes that have been downloaded and are waiting to be added to a piece
	Staged uint64
	// The number of bytes that are not tagged
	Free uint64
}

SealingPipelineState

type Status struct {
	// SectorState is a string, eg "WaitDeals"
	SectorStates map[api.SectorState]int
	Workers      []*worker
}

type worker struct {
	ID     string
	Start  time.Time
	// Stage is a string, eg "PC1"
	Stage  string
	Sector int32
}

@dirkmc dirkmc marked this pull request as draft May 3, 2022 15:53
@dirkmc dirkmc force-pushed the feat/more-filter-params branch 2 times, most recently from 88d253a to c1f6561 Compare May 4, 2022 07:40
@FlorianRuen
Copy link

@dirkmc Is it possible to send the struct for SealingPipelineState ?

@dirkmc
Copy link
Contributor Author

dirkmc commented Jun 21, 2022

It's in the description above:

"SealingPipelineState": {
    "SectorStates": {
      "Proving": 2,
      "WaitDeals": 1
    },
    "Workers": [{
      "ID": "9fdade22-7054-4b6c-8206-2059fc78ba4a",
      "Start": "2022-05-03T15:57:48.508Z",
      "Stage": "PC1",
      "Sector": 12345
    }]
  }

Is that what you were asking about?

@nicobao
Copy link
Contributor

nicobao commented Jun 21, 2022

@FlorianRuen

type SealingPipelineState struct {
	TaskJobsCount             map[string]int
	MaxWaitDealsSectors       uint64
	MaxSealingSectors         uint64
	MaxSealingSectorsForDeals uint64
}

@dirkmc
Copy link
Contributor Author

dirkmc commented Jun 21, 2022

I see what you mean now, I added a bit more to the description above:

SealingPipelineState

type Status struct {
	// SectorState is a string, eg "WaitDeals"
	SectorStates map[api.SectorState]int
	Workers      []*worker
}

type worker struct {
	ID     string
	Start  time.Time
	// Stage is a string, eg "PC1"
	Stage  string
	Sector int32
}

@jacobheun
Copy link
Contributor

Is anything still needed for this to move it forward or close it?

@s0nik42
Copy link

s0nik42 commented Nov 16, 2022

Implementation of this proposal is live in CIDgravity.

@s0nik42
Copy link

s0nik42 commented Jan 26, 2023

Hello @Fatman13,
Quick question, in Venus team stand point, can this PR be merged in boost or you see any impact on Venus ?

@Fatman13
Copy link

Hey, @s0nik42,

Just talked to the devs, it shouldn't be any immediate impact on Venus. Current Venus deal filter only supports deal related parameters. If popularity rises, we will see how we can support the proposed SealingPipelineState, FundsState, StorageState parameters.

@dirkmc dirkmc force-pushed the feat/more-filter-params branch 3 times, most recently from 51799f1 to 949f152 Compare February 1, 2023 08:51
@dirkmc dirkmc force-pushed the feat/more-filter-params branch from 949f152 to 27105e4 Compare February 1, 2023 08:53
@dirkmc dirkmc marked this pull request as ready for review February 1, 2023 08:57
@dirkmc dirkmc requested review from nonsense and jacobheun and removed request for nonsense February 1, 2023 08:57
@dirkmc
Copy link
Contributor Author

dirkmc commented Feb 1, 2023

TODO:

  • Add test that verifies that the new values are being passed through to the storage deal filter query correctly

@jacobheun jacobheun merged commit ce25b96 into main Feb 7, 2023
@jacobheun jacobheun deleted the feat/more-filter-params branch February 7, 2023 14:13
FlorianRuen pushed a commit to CIDgravity/boost that referenced this pull request Jul 7, 2023
* feat: add more storage deal filter parameters

* test: verify that deal filter is being called with correct params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add fields to Storage Deal filter JSON
6 participants