Missing RPC methods when using Chopsticks fork (getReadProof and others)
Description
When connecting to a live Kusama endpoint, all expected RPC methods are available through api.rpc.state. However, when using Chopsticks to fork the same network locally, several RPC methods are missing, including getReadProof which is required for my use case.
Steps to Reproduce
- Create a simple script to check available RPC methods:
import { ApiPromise, WsProvider } from "@polkadot/api";
try {
// Toggle between live endpoint and chopsticks
const kusamaProvider = new WsProvider("wss://kusama.dotters.network");
// const kusamaProvider = new WsProvider('ws://localhost:8000');
const kusamaApi = await ApiPromise.create({ provider: kusamaProvider });
const result = await kusamaApi.rpc.state;
console.log('result', result)
await kusamaApi.disconnect();
} catch (error) {
console.error("Remote proxy execution failed:", error.message);
}
- Run Chopsticks with Kusama fork:
LOG_LEVEL=trace chopsticks -c kusama
- Execute the script with both endpoints
Expected Behavior
When using wss://kusama.dotters.network, the following RPC methods are available:
result {
call: [Getter],
getChildReadProof: [Getter],
getKeys: [Getter],
getKeysPaged: [Getter],
getMetadata: [Getter],
getPairs: [Getter],
getReadProof: [Getter],
getRuntimeVersion: [Getter],
getStorage: [Getter],
getStorageHash: [Getter],
getStorageSize: [Getter],
queryStorage: [Getter],
queryStorageAt: [Getter],
subscribeRuntimeVersion: [Getter],
subscribeStorage: [Getter],
traceBlock: [Getter],
trieMigrationStatus: [Getter]
}
Actual Behavior
When using Chopsticks (ws://localhost:8000), several methods are missing:
result {
call: [Getter],
getKeysPaged: [Getter],
getMetadata: [Getter],
getRuntimeVersion: [Getter],
getStorage: [Getter],
queryStorageAt: [Getter],
subscribeRuntimeVersion: [Getter],
subscribeStorage: [Getter]
}
Missing Methods
The following RPC methods are missing in Chopsticks:
getChildReadProofgetKeysgetPairsgetReadProof⚠️ Required for my use casegetStorageHashgetStorageSizequeryStoragetraceBlocktrieMigrationStatus
Can you give bit more context on how you using this rpc? Because Chopsticks can arbitrarily modify storages so it is not always passible to generate a valid read proof. However, we can easily return some mock value or with more work, generate proof that works for most of the cases.
@xlc, thanks! Here's the context -> https://blog.kchr.de/polkadot/guides/remote-proxies-for-the-braves/#sending-a-remote-proxy-transaction-via-polkadot-js
I'm trying to replicate that script, but in a fork of Kusama Relay Chain and Kusama Asset Hub for testing with my own accounts.
ok that requires real proof and that will take some time to implement