You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gnd: add mock IPFS client for file data source testing
Replaces the dummy IpfsRpcClient with a MockIpfsClient that serves
pre-loaded CID → bytes from a "files" array in test JSON files.
Missing CIDs are reported with a clear error instead of a 60-second
timeout. Also adds IpfsResponse::for_test() helper and documents the
unmocked eth_call timeout in the troubleshooting guide.
Copy file name to clipboardExpand all lines: gnd/docs/gnd-test.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -767,7 +767,7 @@ GraphQL queries → Assertions
767
767
-**Real WASM runtime:** Uses `EthereumRuntimeAdapterBuilder` with real `ethereum.call` host function
768
768
-**Pre-populated call cache:**`eth_call` responses are cached before indexing starts
769
769
-**No IPFS for manifest:** Uses `FileLinkResolver` to load manifest/WASM from build directory
770
-
-**Dummy RPC adapter:** Registered at `http://0.0.0.0:0`for capability lookup; never actually called
770
+
-**Dummy RPC adapter:** Registered at `http://0.0.0.0:0`— exists so the runtime can resolve an adapter with the required capabilities. If a mapping makes an `ethereum.call` that has no matching mock in `ethCalls`, the call misses the cache and falls through to this dummy adapter. The connection is refused immediately (port 0 is invalid), which graph-node treats as a possible reorg and restarts the block stream. The indexer then loops until the 60-second test timeout. See [Unmocked eth_call](#unmocked-eth_call-causes-60-second-timeout) in Troubleshooting.
771
771
772
772
## Troubleshooting
773
773
@@ -799,6 +799,28 @@ GraphQL queries → Assertions
799
799
2. Check function signature format: `"functionName(inputTypes)(returnTypes)"`
800
800
3. Ensure parameters are in correct order
801
801
802
+
### Unmocked eth_call Causes 60-Second Timeout
803
+
804
+
**Cause:** A mapping handler calls `ethereum.call` (directly or via a generated contract binding) for a call that has no matching entry in `ethCalls`. The call misses the pre-populated cache and is forwarded to the dummy RPC adapter at `http://0.0.0.0:0`. The connection is refused immediately, but graph-node interprets connection errors as a possible chain reorganisation and restarts the block stream instead of failing. The indexer loops indefinitely until the test runner's 60-second timeout expires.
805
+
806
+
**Symptom:** Test fails with `Sync timeout after 60s` with no indication of which call was missing.
807
+
808
+
**Fix:**
809
+
1. Add the missing call to `ethCalls` in your test block:
810
+
```json
811
+
"ethCalls": [
812
+
{
813
+
"address": "0xContractAddress",
814
+
"function": "myFunction(uint256):(address)",
815
+
"params": ["42"],
816
+
"returns": ["0xSomeAddress"]
817
+
}
818
+
]
819
+
```
820
+
2. If the call is not supposed to happen, check the mapping logic — a code path may be executing unexpectedly.
821
+
822
+
**Known limitation:** There is currently no fail-fast error for unmocked calls. The only signal is the timeout. A future improvement will make the dummy adapter panic immediately on a cache miss with a descriptive message.
823
+
802
824
### Block Handler Not Firing
803
825
804
826
**Cause:** Block handlers auto-fire, but might be outside data source's active range.
0 commit comments