Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/pdptool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ var streamingPieceUploadCmd = &cli.Command{

client := &http.Client{}

req, err := http.NewRequest("GET", serviceURL+"/pdp/piece/uploads", nil)
req, err := http.NewRequest("POST", serviceURL+"/pdp/piece/uploads", nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice find

if err != nil {
return fmt.Errorf("failed to create upload request: %v", err)
}
Expand Down
3 changes: 2 additions & 1 deletion pdp/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ func (p *PDPService) handleDeleteDataSet(w http.ResponseWriter, r *http.Request)
// ### DEL /data-sets/{set id}
// Remove the specified data set entirely

http.Error(w, "todo", http.StatusBadRequest)
http.Error(w, "dataset deletion not yet implemented", http.StatusNotImplemented)
}

// handleGetPieceAdditionStatus handles GET /pdp/data-sets/{dataSetId}/pieces/added/{txHash}
Expand Down Expand Up @@ -906,6 +906,7 @@ func (p *PDPService) handleDeleteDataSetPiece(w http.ResponseWriter, r *http.Req
}
if !found {
http.Error(w, "Piece not found", http.StatusNotFound)
return
}

// Get the ABI and pack the transaction data
Expand Down
4 changes: 2 additions & 2 deletions pdp/handlers_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ func (p *PDPService) transformAddPiecesRequest(ctx context.Context, serviceLabel
}
// sanity check that the rawSize in the CommPv2 matches the totalSize of the subPieces
if rawSize != totalSize {
return nil, nil, nil, fmt.Errorf("raw size miss-match: expected %d, got %d", totalSize, rawSize)
return nil, nil, nil, fmt.Errorf("raw size mismatch: expected %d, got %d", totalSize, rawSize)
}

/* TODO: this doesn't work, do we need it?
// sanity check that height and totalSize match
computedHeight := bits.LeadingZeros64(totalSize-1) - 5
if computedHeight != int(height) {
http.Error(w, fmt.Sprintf("Height miss-match: expected %d, got %d for total size %d", computedHeight, height, totalSize), http.StatusBadRequest)
http.Error(w, fmt.Sprintf("Height mismatch: expected %d, got %d for total size %d", computedHeight, height, totalSize), http.StatusBadRequest)
}
*/

Expand Down
2 changes: 1 addition & 1 deletion tasks/indexing/task_pdp_ipni.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func PDPInitProvider(tx *harmonydb.Tx) (peer.ID, error) {

n, err := tx.Exec(`INSERT INTO ipni_peerid (priv_key, peer_id, sp_id) VALUES ($1, $2, $3)`, privKey, peerID, PDP_SP_ID)
if err != nil {
return "", xerrors.Errorf("failed to to insert the key into DB: %w", err)
return "", xerrors.Errorf("failed to insert the key into DB: %w", err)
}

if n == 0 {
Expand Down