Skip to content

[WIP] feat: market 2.0 #508

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

[WIP] feat: market 2.0 #508

wants to merge 6 commits into from

Conversation

LexLuthr
Copy link
Contributor

@LexLuthr LexLuthr commented May 14, 2025

  • Establish consensus on design
  • Aggregate Indexing
  • Aggregate IPNI
  • Test contract
  • PieceCID V2
    • Retrievals
    • Indexing
    • IPNI
    • UI - MK12 and MK20
    • MIgration to v2
    • Indexing Repair task
  • Write deal validation logic tests
  • MK2.0 UI
  • Notification pathway
  • Create mk20 test client
  • Write documentation for MK2.0 standard
  • Move PDP endpoints under market
  • Move any other market related endpoint
  • Testing
    • Devnet
    • Calibnet
    • Mainnet

Tests:

  1. Make mk20 deal with all data source types
  2. Force a mk12 and mk20 deal in a sector
  3. Deal status
  4. Test deal validation logic on each param
  5. Test any other endpoints
  6. Test UI
  7. Deal cancellation
  8. Test indexing and announcements
  9. Bombard system with mk12 and mk20 deals and see if anything breaks

pqBatchSize := 20000

for k, _ := range toDownload {
pqBatch.Queue(`SELECT id FROM parked_pieces WHERE piece_cid = $1 AND piece_padded_size = $2`, k.PieceCID.String(), int64(k.Size)).QueryRow(func(row pgx.Row) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a hack to make this 1 query total (no loop) with half the params:
SELECT id FROM parked_pieces WHERE CONCAT(piece_cid, STRING(piece_padded_size)) = ANY($1)

}
}

func insertPiecesInTransaction(ctx context.Context, tx *harmonydb.Tx, deal *mk20.Deal) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding batch-with-flush behavior, maybe keyed on the length of args list staying low (10,000)

if data.SourceHTTP != nil {
var pieceID int64
// Attempt to select the piece ID first
err = tx.QueryRow(`SELECT id FROM parked_pieces WHERE piece_cid = $1 AND piece_padded_size = $2`, data.PieceCID.String(), data.Size).Scan(&pieceID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider an UPSERT

Copy link
Collaborator

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reviewing types for now, didn't look at much beyond that, but generally things make sense.

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.

3 participants