@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
|
@@ -1335,6 +1335,7 @@ import { resolveTraitContractIds } from "@secondlayer/shared/db/queries/contract
|
|
|
1335
1335
|
import { advanceOperationCursor } from "@secondlayer/shared/db/queries/subgraph-operations";
|
|
1336
1336
|
import {
|
|
1337
1337
|
isByoSubgraph,
|
|
1338
|
+
recordLiveProgress,
|
|
1338
1339
|
recordSubgraphProcessed,
|
|
1339
1340
|
resolveSubgraphDb,
|
|
1340
1341
|
updateSubgraphStatus
|
|
@@ -2029,7 +2030,7 @@ async function processBlock(subgraph, subgraphName, blockHeight, opts) {
|
|
|
2029
2030
|
result.matched = matched.length;
|
|
2030
2031
|
if (matched.length === 0) {
|
|
2031
2032
|
if (!opts?.skipProgressUpdate) {
|
|
2032
|
-
await
|
|
2033
|
+
await recordLiveProgress(targetDb, subgraphName, blockHeight);
|
|
2033
2034
|
}
|
|
2034
2035
|
return result;
|
|
2035
2036
|
}
|
|
@@ -2052,8 +2053,11 @@ async function processBlock(subgraph, subgraphName, blockHeight, opts) {
|
|
|
2052
2053
|
const applyProgress = async (tx, rr) => {
|
|
2053
2054
|
if (opts?.skipProgressUpdate)
|
|
2054
2055
|
return;
|
|
2055
|
-
|
|
2056
|
-
|
|
2056
|
+
if (rr.errors > 0 && rr.processed === 0) {
|
|
2057
|
+
await updateSubgraphStatus(tx, subgraphName, "error", blockHeight);
|
|
2058
|
+
} else {
|
|
2059
|
+
await recordLiveProgress(tx, subgraphName, blockHeight);
|
|
2060
|
+
}
|
|
2057
2061
|
if (rr.processed > 0 || rr.errors > 0) {
|
|
2058
2062
|
const lastError = rr.errors > 0 ? `${rr.errors} error(s) at block ${blockHeight}` : undefined;
|
|
2059
2063
|
await recordSubgraphProcessed(tx, subgraphName, rr.processed, rr.errors, lastError);
|
|
@@ -2564,7 +2568,11 @@ async function reindexSubgraph(def, opts) {
|
|
|
2564
2568
|
for (const stmt of statements) {
|
|
2565
2569
|
await client.unsafe(stmt);
|
|
2566
2570
|
}
|
|
2567
|
-
|
|
2571
|
+
await updateSubgraphStatus2(targetDb, subgraphName, "reindexing", Math.max(0, fromBlock - 1));
|
|
2572
|
+
logger6.info("Schema recreated for reindex", {
|
|
2573
|
+
subgraph: subgraphName,
|
|
2574
|
+
cursorResetTo: Math.max(0, fromBlock - 1)
|
|
2575
|
+
});
|
|
2568
2576
|
await targetDb.updateTable("subgraphs").set({
|
|
2569
2577
|
last_processed_block: initialReindexProgressBlock(fromBlock),
|
|
2570
2578
|
reindex_from_block: fromBlock,
|
|
@@ -3485,5 +3493,5 @@ export {
|
|
|
3485
3493
|
startSubgraphOperationRunner
|
|
3486
3494
|
};
|
|
3487
3495
|
|
|
3488
|
-
//# debugId=
|
|
3496
|
+
//# debugId=91FB9399C4D211C364756E2164756E21
|
|
3489
3497
|
//# sourceMappingURL=processor.js.map
|