paritytech / substrate-api-sidecar

REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.
https://paritytech.github.io/substrate-api-sidecar/dist/
GNU General Public License v3.0
246 stars 151 forks source link

Block synchronization exception #1046

Open lynAzrael opened 2 years ago

lynAzrael commented 2 years ago

It returns some error info when I try to use api-sidecar to sync block 1790151 on astar blockchain.

startup log:

SAS:
  πŸ“¦ LOG:
     βœ… LEVEL: "info"
     βœ… JSON: false
     βœ… FILTER_RPC: false
     βœ… STRIP_ANSI: false
  πŸ“¦ SUBSTRATE:
     βœ… WS_URL: "wss://astar.public.blastapi.io"
     βœ… TYPES_BUNDLE: undefined
     βœ… TYPES_CHAIN: undefined
     βœ… TYPES_SPEC: undefined
     βœ… TYPES: undefined
  πŸ“¦ EXPRESS:
     βœ… BIND_HOST: "127.0.0.1"
     βœ… PORT: 9090
2022-09-05 15:46:15 info: Version: 12.4.2
2022-09-05 15:46:17 info: Connected to chain Astar on the astar client at wss://astar.public.blastapi.io
2022-09-05 15:46:17 info: Listening on http://127.0.0.1:9090/
2022-09-05 15:46:17 info: Check the root endpoint (http://127.0.0.1:9090/) to see the available endpoints for the current node
curl -XGET http://127.0.0.1:9090/blocks/1790151 | jq -r
{
    "code": 500,
    "message": "1: Unable to query dispatch info.: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\nWASM backtrace:\n\n    0: 0x365eb3 - <unknown>!rust_begin_unwind\n    1: 0x2d3ec6 - <unknown>!core::panicking::panic_fmt::h18b15be283411c65\n    2: 0x1d42a0 …",
    "stack": "RpcError: 1: Unable to query dispatch info.: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\nWASM backtrace:\n\n    0: 0x365eb3 - <unknown>!rust_begin_unwind\n    1: 0x2d3ec6 - <unknown>!core::panicking::panic_fmt::h18b15be283411c65\n    2: 0x1d42a0 …\n    at checkError (/Users/lilin/Desktop/work/src/blockchain-managers/astar-manager/libs/substrate-api-sidecar/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:34:11)\n    at RpcCoder.decodeResponse (/Users/lilin/Desktop/work/src/blockchain-managers/astar-manager/libs/substrate-api-sidecar/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:54:5)\n    at WsProvider.value (/Users/lilin/Desktop/work/src/blockchain-managers/astar-manager/libs/substrate-api-sidecar/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:297:90)\n    at W3CWebSocket.value [as onmessage] (/Users/lilin/Desktop/work/src/blockchain-managers/astar-manager/libs/substrate-api-sidecar/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:277:153)\n    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/lilin/Desktop/work/src/blockchain-managers/astar-manager/libs/substrate-api-sidecar/node_modules/yaeti/lib/EventTarget.js:107:17)\n    at W3CWebSocket.onMessage (/Users/lilin/Desktop/work/src/blockchain-managers/astar-manager/libs/substrate-api-sidecar/node_modules/websocket/lib/W3CWebSocket.js:234:14)\n    at WebSocketConnection.<anonymous> (/Users/lilin/Desktop/work/src/blockchain-managers/astar-manager/libs/substrate-api-sidecar/node_modules/websocket/lib/W3CWebSocket.js:205:19)\n    at WebSocketConnection.emit (node:events:513:28)\n    at WebSocketConnection.processFrame (/Users/lilin/Desktop/work/src/blockchain-managers/astar-manager/libs/substrate-api-sidecar/node_modules/websocket/lib/WebSocketConnection.js:554:26)\n    at /Users/lilin/Desktop/work/src/blockchain-managers/astar-manager/libs/substrate-api-sidecar/node_modules/websocket/lib/WebSocketConnection.js:323:40",
    "level": "error"
}

Update to the latest version: 13.0.0, it returns the same error.

SAS:
  πŸ“¦ LOG:
     βœ… LEVEL: "info"
     βœ… JSON: false
     βœ… FILTER_RPC: false
     βœ… STRIP_ANSI: false
  πŸ“¦ SUBSTRATE:
     βœ… URL: "wss://astar.public.blastapi.io"
     βœ… TYPES_BUNDLE: undefined
     βœ… TYPES_CHAIN: undefined
     βœ… TYPES_SPEC: undefined
     βœ… TYPES: undefined
  πŸ“¦ EXPRESS:
     βœ… BIND_HOST: "127.0.0.1"
     βœ… PORT: 8080
2022-09-05 16:03:46 info: Version: 13.0.0
2022-09-05 16:03:48 info: Connected to chain Astar on the astar client at wss://astar.public.blastapi.io
2022-09-05 16:03:48 info: Listening on http://127.0.0.1:8080/
2022-09-05 16:03:48 info: Check the root endpoint (http://127.0.0.1:8080/) to see the available endpoints for the current node
2022-09-05 16:04:01 error: RPC-CORE: queryInfo(extrinsic: Bytes, at?: BlockHash): RuntimeDispatchInfo:: 1: Unable to query dispatch info.: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:

    0: 0x365eb3 - <unknown>!rust_begin_unwind
    1: 0x2d3ec6 - <unknown>!core::panicking::panic_fmt::h18b15be283411c65
    2: 0x1d42a0 …
2022-09-05 16:04:01 error: 1: Unable to query dispatch info.: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:

    0: 0x365eb3 - <unknown>!rust_begin_unwind
    1: 0x2d3ec6 - <unknown>!core::panicking::panic_fmt::h18b15be283411c65
    2: 0x1d42a0 … 
 RpcError: 1: Unable to query dispatch info.: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:

    0: 0x365eb3 - <unknown>!rust_begin_unwind
    1: 0x2d3ec6 - <unknown>!core::panicking::panic_fmt::h18b15be283411c65
    2: 0x1d42a0 …
    at checkError (/Users/lilin/Desktop/work/pubChainProj/aca/sdk/substrate-api-sidecar/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:34:11)
    at RpcCoder.decodeResponse (/Users/lilin/Desktop/work/pubChainProj/aca/sdk/substrate-api-sidecar/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:54:5)
    at WsProvider.value (/Users/lilin/Desktop/work/pubChainProj/aca/sdk/substrate-api-sidecar/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:297:90)
    at W3CWebSocket.value [as onmessage] (/Users/lilin/Desktop/work/pubChainProj/aca/sdk/substrate-api-sidecar/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:277:153)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/lilin/Desktop/work/pubChainProj/aca/sdk/substrate-api-sidecar/node_modules/yaeti/lib/EventTarget.js:107:17)
    at W3CWebSocket.onMessage (/Users/lilin/Desktop/work/pubChainProj/aca/sdk/substrate-api-sidecar/node_modules/websocket/lib/W3CWebSocket.js:234:14)
    at WebSocketConnection.<anonymous> (/Users/lilin/Desktop/work/pubChainProj/aca/sdk/substrate-api-sidecar/node_modules/websocket/lib/W3CWebSocket.js:205:19)
    at WebSocketConnection.emit (node:events:513:28)
    at WebSocketConnection.processFrame (/Users/lilin/Desktop/work/pubChainProj/aca/sdk/substrate-api-sidecar/node_modules/websocket/lib/WebSocketConnection.js:554:26)
    at /Users/lilin/Desktop/work/pubChainProj/aca/sdk/substrate-api-sidecar/node_modules/websocket/lib/WebSocketConnection.js:323:40
2022-09-05 16:04:01 error: GET /blocks/1790151 500 3037ms
TarikGul commented 2 years ago

Hey @lynAzrael, so after some quick reproducing I am not totally sure what is happening. I was able to reproduce this both in Sidecar, as well as polkadot-js. I will keep looking into it and keep you updated.

lynAzrael commented 2 years ago

Hi @TarikGul ,Thank you for your reply. I tried the subsequent block synchronization and it is normal, there may be some special information in this block

TarikGul commented 2 years ago

From what we were chatting about, it could be a misalignment of of runtime api hashes to versions for the specific queryInfo call. I'll need to pull down the information from Astar to confirm, but like you said it could also be some special information in the block as well.