diff --git a/package-lock.json b/package-lock.json index 6424487..b4383bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5579,9 +5579,9 @@ } }, "node_modules/@web3-storage/filecoin-api": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@web3-storage/filecoin-api/-/filecoin-api-4.3.1.tgz", - "integrity": "sha512-1hbIqOWxGPqf4Oh+FH696ru9pWd6LdA680V6K3BEieWvZ4U9bpwqsvzWdJwACPYR7neqtoqbQSNQRIXkONVveg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@web3-storage/filecoin-api/-/filecoin-api-4.4.0.tgz", + "integrity": "sha512-mT3QRC1Cbu0SDHMQjo1ZJFEH8dL4+8H6++wZOIm401bFSHXEamTkydQT3DfX9IHXAFSab/7kwkQ93yDwOgtXiA==", "dependencies": { "@ipld/dag-ucan": "^3.4.0", "@ucanto/client": "^9.0.0", @@ -5589,7 +5589,7 @@ "@ucanto/interface": "^9.0.0", "@ucanto/server": "^9.0.1", "@ucanto/transport": "^9.0.0", - "@web3-storage/capabilities": "^13.0.0", + "@web3-storage/capabilities": "^13.1.1", "@web3-storage/data-segment": "^4.0.0", "p-map": "^6.0.0" }, @@ -5609,9 +5609,9 @@ } }, "node_modules/@web3-storage/filecoin-api/node_modules/@web3-storage/capabilities": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-13.0.0.tgz", - "integrity": "sha512-SSviDXFweCu8FhaQ7BjsK1WDPBdwoduJhfD2DFRKkZT/V25vdBkqtW4qVc6tfO5IhTVxRpnn62PmbIbbcHzBRQ==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-13.1.1.tgz", + "integrity": "sha512-yQwrjhqwXGc1z8FCs7dCMsNp+G1LCrPq8RWCrflHA0rlISyMez6DQQpOJrCfao/MSk30nzPSzIm+FX/k3+8knw==", "dependencies": { "@ucanto/core": "^9.0.1", "@ucanto/interface": "^9.0.0", @@ -15206,7 +15206,7 @@ "@ucanto/transport": "^9.0.0", "@web3-storage/capabilities": "^12.0.3", "@web3-storage/data-segment": "^5.0.0", - "@web3-storage/filecoin-api": "^4.3.1", + "@web3-storage/filecoin-api": "^4.4.0", "@web3-storage/filecoin-client": "^3.1.3", "fzstd": "^0.1.0", "multiformats": "12.0.1", @@ -15382,7 +15382,8 @@ "@ucanto/server": "^9.0.1", "@ucanto/transport": "^9.0.0", "@w3filecoin/core": "*", - "@web3-storage/filecoin-api": "^4.3.1", + "@web3-storage/data-segment": "5.0.0", + "@web3-storage/filecoin-api": "^4.4.0", "@web3-storage/filecoin-client": "3.0.1", "uint8arrays": "^4.0.6" }, @@ -15484,6 +15485,16 @@ "@ucanto/validator": "^9.0.0" } }, + "packages/functions/node_modules/@web3-storage/data-segment": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-5.0.0.tgz", + "integrity": "sha512-5CbElsxec2DsKhEHEh3XRGISAyna+bCjKjjvFrLcYyXLCaiSt/nF3ypcllxwjpE4newMUArymGKGzzZnRWL2kg==", + "dependencies": { + "@ipld/dag-cbor": "^9.0.5", + "multiformats": "^11.0.2", + "sync-multihash-sha2": "^1.0.0" + } + }, "packages/functions/node_modules/tslib": { "version": "1.14.1", "dev": true, diff --git a/packages/core/package.json b/packages/core/package.json index 94697f6..24f8118 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -23,7 +23,7 @@ "@ucanto/transport": "^9.0.0", "@web3-storage/capabilities": "^12.0.3", "@web3-storage/data-segment": "^5.0.0", - "@web3-storage/filecoin-api": "^4.3.1", + "@web3-storage/filecoin-api": "^4.4.0", "@web3-storage/filecoin-client": "^3.1.3", "fzstd": "^0.1.0", "multiformats": "12.0.1", diff --git a/packages/functions/package.json b/packages/functions/package.json index 66655a3..3e9a489 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -11,7 +11,8 @@ "@ucanto/core": "^9.0.0", "@ucanto/server": "^9.0.1", "@ucanto/transport": "^9.0.0", - "@web3-storage/filecoin-api": "^4.3.1", + "@web3-storage/data-segment": "5.0.0", + "@web3-storage/filecoin-api": "^4.4.0", "@web3-storage/filecoin-client": "3.0.1", "@w3filecoin/core": "*" }, diff --git a/packages/functions/src/aggregator/handle-buffer-queue-message.js b/packages/functions/src/aggregator/handle-buffer-queue-message.js index cd8ac87..f42ef98 100644 --- a/packages/functions/src/aggregator/handle-buffer-queue-message.js +++ b/packages/functions/src/aggregator/handle-buffer-queue-message.js @@ -4,6 +4,7 @@ import { createClient as createBufferStoreClient } from '@w3filecoin/core/src/st import { createClient as createBufferQueueClient, decodeMessage } from '@w3filecoin/core/src/queue/buffer-queue.js' import { createClient as createAggregateOfferQueueClient } from '@w3filecoin/core/src/queue/aggregate-offer-queue.js' import * as aggregatorEvents from '@web3-storage/filecoin-api/aggregator/events' +import { Piece } from '@web3-storage/data-segment' import { mustGetEnv } from '../utils.js' @@ -93,7 +94,14 @@ function getContext () { config: { maxAggregateSize, minAggregateSize, - minUtilizationFactor + minUtilizationFactor, + prependBufferedPieces: [{ + // Small piece to prepend that is encoded as a CAR file + piece: Piece.fromString('bafkzcibciab3bwd67rgcoiejigar34jguwfasa5327hq3sjdcma3zz2ccupy4oi').link, + // will be prepended, so policy is irrelevant + policy: /** @type {import('@web3-storage/filecoin-api/src/aggregator/api').PiecePolicy} */ (0), + insertedAt: (new Date()).toISOString() + }] } } }