mirror of
https://github.com/pezkuwichain/pezkuwi-subquery.git
synced 2026-04-22 04:17:59 +00:00
fix: handle pruned RPC state in SubQuery node
Substrate nodes prune historical state by default (~256 blocks). When SubQuery restarts and tries to fetch runtime version for old blocks, it crashes with "State already discarded". This patch adds a fallback to current runtime version when historical state is unavailable, preventing crash loops on pruned RPC endpoints. Also removes --pull from deploy workflow to avoid unnecessary full rebuilds on every push.
This commit is contained in:
@@ -41,4 +41,9 @@ RUN node -e " \
|
||||
fs.writeFileSync(p, JSON.stringify(pkg, null, 2)); \
|
||||
"
|
||||
|
||||
# Patch: handle pruned blockchain state gracefully.
|
||||
# Without this, SubQuery crashes when RPC nodes have pruned old block state.
|
||||
COPY docker/patches/pruned-state-fallback.js /tmp/pruned-state-fallback.js
|
||||
RUN node /tmp/pruned-state-fallback.js && rm /tmp/pruned-state-fallback.js
|
||||
|
||||
ENTRYPOINT ["/app/node_modules/.bin/subql-node"]
|
||||
|
||||
Reference in New Issue
Block a user