@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.
@@ -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
- const bound = await boundSourceTip(rawTip, decoderNamesForSubgraph(subgraph));
3368
- if (!bound.ok) {
3369
- logger8.warn("Subgraph catch-up stalled: missing decoder checkpoint", {
3370
- event: "subgraph_catchup_decoder_stall",
3371
- subgraph: subgraphName,
3372
- missing: bound.missing
3373
- });
3374
- return 0;
3375
- }
3376
- if (bound.floor !== null && bound.floor < rawTip) {
3377
- logger8.debug("Subgraph catch-up tip bounded by decoder progress", {
3378
- event: "subgraph_catchup_decoder_floor",
3379
- subgraph: subgraphName,
3380
- rawTip,
3381
- floor: bound.floor,
3382
- tip: bound.tip
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;
@@ -3646,5 +3652,5 @@ export {
3646
3652
  handleSubgraphReorg
3647
3653
  };
3648
3654
 
3649
- //# debugId=EC9E2B7AA2A2AEEC64756E2164756E21
3655
+ //# debugId=33B13FDE84A36A1564756E2164756E21
3650
3656
  //# sourceMappingURL=reorg.js.map