@secondlayer/subgraphs 3.14.0 → 3.14.2
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 +13 -5
- package/dist/src/index.js.map +4 -4
- package/dist/src/runtime/block-processor.js +8 -4
- package/dist/src/runtime/block-processor.js.map +3 -3
- package/dist/src/runtime/catchup.js +8 -4
- package/dist/src/runtime/catchup.js.map +3 -3
- package/dist/src/runtime/processor.js +13 -5
- package/dist/src/runtime/processor.js.map +4 -4
- package/dist/src/runtime/reindex.js +13 -5
- package/dist/src/runtime/reindex.js.map +4 -4
- package/dist/src/runtime/reorg.js +8 -4
- package/dist/src/runtime/reorg.js.map +3 -3
- package/dist/src/service.js +13 -5
- package/dist/src/service.js.map +4 -4
- package/package.json +2 -2
package/dist/src/index.js
CHANGED
|
@@ -1413,6 +1413,7 @@ import { resolveTraitContractIds } from "@secondlayer/shared/db/queries/contract
|
|
|
1413
1413
|
import { advanceOperationCursor } from "@secondlayer/shared/db/queries/subgraph-operations";
|
|
1414
1414
|
import {
|
|
1415
1415
|
isByoSubgraph,
|
|
1416
|
+
recordLiveProgress,
|
|
1416
1417
|
recordSubgraphProcessed,
|
|
1417
1418
|
resolveSubgraphDb,
|
|
1418
1419
|
updateSubgraphStatus
|
|
@@ -2107,7 +2108,7 @@ async function processBlock(subgraph, subgraphName, blockHeight, opts) {
|
|
|
2107
2108
|
result.matched = matched.length;
|
|
2108
2109
|
if (matched.length === 0) {
|
|
2109
2110
|
if (!opts?.skipProgressUpdate) {
|
|
2110
|
-
await
|
|
2111
|
+
await recordLiveProgress(targetDb, subgraphName, blockHeight);
|
|
2111
2112
|
}
|
|
2112
2113
|
return result;
|
|
2113
2114
|
}
|
|
@@ -2130,8 +2131,11 @@ async function processBlock(subgraph, subgraphName, blockHeight, opts) {
|
|
|
2130
2131
|
const applyProgress = async (tx, rr) => {
|
|
2131
2132
|
if (opts?.skipProgressUpdate)
|
|
2132
2133
|
return;
|
|
2133
|
-
|
|
2134
|
-
|
|
2134
|
+
if (rr.errors > 0 && rr.processed === 0) {
|
|
2135
|
+
await updateSubgraphStatus(tx, subgraphName, "error", blockHeight);
|
|
2136
|
+
} else {
|
|
2137
|
+
await recordLiveProgress(tx, subgraphName, blockHeight);
|
|
2138
|
+
}
|
|
2135
2139
|
if (rr.processed > 0 || rr.errors > 0) {
|
|
2136
2140
|
const lastError = rr.errors > 0 ? `${rr.errors} error(s) at block ${blockHeight}` : undefined;
|
|
2137
2141
|
await recordSubgraphProcessed(tx, subgraphName, rr.processed, rr.errors, lastError);
|
|
@@ -2642,7 +2646,11 @@ async function reindexSubgraph(def, opts) {
|
|
|
2642
2646
|
for (const stmt of statements) {
|
|
2643
2647
|
await client.unsafe(stmt);
|
|
2644
2648
|
}
|
|
2645
|
-
|
|
2649
|
+
await updateSubgraphStatus2(targetDb, subgraphName, "reindexing", Math.max(0, fromBlock - 1));
|
|
2650
|
+
logger6.info("Schema recreated for reindex", {
|
|
2651
|
+
subgraph: subgraphName,
|
|
2652
|
+
cursorResetTo: Math.max(0, fromBlock - 1)
|
|
2653
|
+
});
|
|
2646
2654
|
await targetDb.updateTable("subgraphs").set({
|
|
2647
2655
|
last_processed_block: initialReindexProgressBlock(fromBlock),
|
|
2648
2656
|
reindex_from_block: fromBlock,
|
|
@@ -4019,5 +4027,5 @@ export {
|
|
|
4019
4027
|
ByoBreakingChangeError
|
|
4020
4028
|
};
|
|
4021
4029
|
|
|
4022
|
-
//# debugId=
|
|
4030
|
+
//# debugId=8B1D7AE53DBBA74F64756E2164756E21
|
|
4023
4031
|
//# sourceMappingURL=index.js.map
|