diff --git a/lib/spark.js b/lib/spark.js index af72878..ce0e30a 100644 --- a/lib/spark.js +++ b/lib/spark.js @@ -140,6 +140,9 @@ export default class Spark { statusCode: null } const searchParams = new URLSearchParams({ + // See https://github.com/filecoin-project/lassie/blob/main/docs/HTTP_SPEC.md#dag-scope-request-query-parameter + // Only the root block at the end of the path is returned after blocks required to verify the specified path segments. + 'dag-scope': 'block', protocols: retrieval.protocol, providers: retrieval.providerAddress }) diff --git a/test/spark.js b/test/spark.js index 8556ec0..2ff5224 100644 --- a/test/spark.js +++ b/test/spark.js @@ -3,7 +3,7 @@ import Spark from '../lib/spark.js' import { test } from 'zinnia:test' import { assertInstanceOf, assertEquals, assertArrayIncludes } from 'zinnia:assert' -import { SPARK_VERSION, MAX_CAR_SIZE } from '../lib/constants.js' +import { SPARK_VERSION } from '../lib/constants.js' test('getRetrieval', async () => { const round = { @@ -82,6 +82,7 @@ test('fetchCAR', async () => { assertEquals(requests, [{ url: URL }]) }) +/* Disabled as long as we are fetching the top-level block only test('fetchCAR exceeding MAX_CAR_SIZE', async () => { const URL = 'url' const fetch = async url => { @@ -110,6 +111,7 @@ test('fetchCAR exceeding MAX_CAR_SIZE', async () => { assertEquals(stats.carChecksum, null) assertEquals(stats.statusCode, 200) }) +*/ test('submitRetrieval', async () => { const requests = []