@secondlayer/subgraphs 4.1.2 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.js +28 -19
- package/dist/src/index.js.map +5 -5
- package/dist/src/runtime/catchup.js +25 -19
- package/dist/src/runtime/catchup.js.map +4 -4
- package/dist/src/runtime/processor.js +28 -19
- package/dist/src/runtime/processor.js.map +5 -5
- package/dist/src/runtime/reindex.js +28 -19
- package/dist/src/runtime/reindex.js.map +5 -5
- package/dist/src/runtime/reorg.js +25 -19
- package/dist/src/runtime/reorg.js.map +4 -4
- package/dist/src/runtime/replay.js +4 -1
- package/dist/src/runtime/replay.js.map +3 -3
- package/dist/src/service.js +28 -19
- package/dist/src/service.js.map +5 -5
- package/package.json +1 -1
|
@@ -3206,6 +3206,9 @@ function decoderNamesForIndexEventTypes(eventTypes) {
|
|
|
3206
3206
|
function decoderNamesForSubgraph(subgraph) {
|
|
3207
3207
|
return decoderNamesForIndexEventTypes(referencedIndexEventTypes(subgraph));
|
|
3208
3208
|
}
|
|
3209
|
+
function usesDecodedIndexPlane(subgraph) {
|
|
3210
|
+
return process.env.SUBGRAPH_SOURCE === "streams-index" && isStreamsIndexEligible(subgraph);
|
|
3211
|
+
}
|
|
3209
3212
|
function committedHeight(cursor) {
|
|
3210
3213
|
if (!cursor)
|
|
3211
3214
|
return null;
|
|
@@ -3364,25 +3367,28 @@ async function catchUpSubgraph(subgraph, subgraphName) {
|
|
|
3364
3367
|
const rawTip = await source.getTip();
|
|
3365
3368
|
if (rawTip <= 0)
|
|
3366
3369
|
return 0;
|
|
3367
|
-
|
|
3368
|
-
if (
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3370
|
+
let chainTip = rawTip;
|
|
3371
|
+
if (usesDecodedIndexPlane(subgraph)) {
|
|
3372
|
+
const bound = await boundSourceTip(rawTip, decoderNamesForSubgraph(subgraph));
|
|
3373
|
+
if (!bound.ok) {
|
|
3374
|
+
logger8.warn("Subgraph catch-up stalled: missing decoder checkpoint", {
|
|
3375
|
+
event: "subgraph_catchup_decoder_stall",
|
|
3376
|
+
subgraph: subgraphName,
|
|
3377
|
+
missing: bound.missing
|
|
3378
|
+
});
|
|
3379
|
+
return 0;
|
|
3380
|
+
}
|
|
3381
|
+
if (bound.floor !== null && bound.floor < rawTip) {
|
|
3382
|
+
logger8.debug("Subgraph catch-up tip bounded by decoder progress", {
|
|
3383
|
+
event: "subgraph_catchup_decoder_floor",
|
|
3384
|
+
subgraph: subgraphName,
|
|
3385
|
+
rawTip,
|
|
3386
|
+
floor: bound.floor,
|
|
3387
|
+
tip: bound.tip
|
|
3388
|
+
});
|
|
3389
|
+
}
|
|
3390
|
+
chainTip = bound.tip;
|
|
3384
3391
|
}
|
|
3385
|
-
const chainTip = bound.tip;
|
|
3386
3392
|
if (chainTip <= 0 || lastProcessedBlock >= chainTip)
|
|
3387
3393
|
return 0;
|
|
3388
3394
|
const subgraphStart = Number(subgraphRow.start_block) || 1;
|
|
@@ -3846,6 +3852,9 @@ async function resolveBlockRange(source, def, opts) {
|
|
|
3846
3852
|
const definitionStart = def.startBlock ?? 1;
|
|
3847
3853
|
const fromBlock = opts?.startBlockFloor != null ? Math.max(definitionStart, opts.startBlockFloor) : definitionStart;
|
|
3848
3854
|
const rawTip = await source.getTip();
|
|
3855
|
+
if (!usesDecodedIndexPlane(def)) {
|
|
3856
|
+
return { fromBlock, toBlock: rawTip };
|
|
3857
|
+
}
|
|
3849
3858
|
const bound = await boundSourceTip(rawTip, decoderNamesForSubgraph(def));
|
|
3850
3859
|
if (!bound.ok) {
|
|
3851
3860
|
logger10.warn("Reindex stalled: missing decoder checkpoint", {
|
|
@@ -4091,5 +4100,5 @@ export {
|
|
|
4091
4100
|
backfillSubgraph
|
|
4092
4101
|
};
|
|
4093
4102
|
|
|
4094
|
-
//# debugId=
|
|
4103
|
+
//# debugId=6AE911849429761664756E2164756E21
|
|
4095
4104
|
//# sourceMappingURL=reindex.js.map
|