Open josepot opened 1 month ago
What happens is that the full nodes that we ask a Merkle proof from indicate that they're unable to answer the request (basically an error on their side). There's nothing indicating to smoldot what problem could have happened, so the way forward is to look at what the full node logs say.
To make smoldot connect to a specific full node, the easiest way is to modify the list of bootnodes to just that one full node.
You also need to modify this line like this:
next_discovery_when: self.platform.now() + Duration::from_secs(10000),
This gives you 10000 seconds between starting smoldot and the moment when it connects to nodes other than just the full node.
You can also not do this source code modification, but then whether the full node is actually queried by smoldot comes down to luck. By doing the modification, you guarantee that 100% of the time smoldot will chose that one full node. If it's very easy to you to search through the full node logs, it might be easier to not do the modification and just try multiple times, searching through the logs every time.
On the full node side, you have to pass the -l sub-libp2p=debug
flag (hopefully this hasn't changed since 2022). I guess that you should be able to search the string "DryRunApi_dry_run_call"
in the logs. I really don't remember enough about Substrate to precisely guide you from there, but we're looking for some kind of error message.
There are some things that can go wrong when connecting smoldot to your full node.
If the full node is on a separate machine, make sure obviously that ports are open. The address a full node is listening on by default is something like /ip4/0.0.0.0/tcp/30334/ws
, make sure you have the ws
.
The full node should also be fully synced, otherwise smoldot will simply ignore it.
If you're in touch with Parity devops, it might be easier to ask them to help you.
So, I finally managed to get a kusama snapshot and to have a full-node running locally. I have changed the bootnodes of the chainspec so that my local node is the only available bootnode, like this:
"bootNodes": [
"/ip4/127.0.0.1/tcp/1714/ws/p2p/12D3KooWGtoBv9Xb6VQ9YRWDejxNFxULzpuiR41pKLF9qV45UPnT"
],
Now, if I don't do this:
+ Duration::from_secs(10000)
I can reproduce the test, but it seems that it's not my node the peer responding to the smoldot requests, and if I make that change ^, then just nothing happens. I don't even get a response to the initial storage query. I see a message in the logs of the node that reads something like: 2024-11-21 14:52:52.369 DEBUG tokio-runtime-worker sub-libp2p: handshake doesn't contain peer role: []
... Could it be that for some reason my node is ignoring the light-client requests? is there a flag that I have to use to prevent that from happening or something?
NVM, I finally managed to reproduce it using my local node by delaying the next discovery as @tomaka suggested. Every time that I try to run the script I can see the following logs on my node:
2024-11-21 15:34:26.158 ERROR tokio-runtime-worker runtime: panicked at /home/builder/cargo/registry/src/index.crates.io-6f17d22bba15001f/polkadot-runtime-common-15.0.0/src/xcm_sender.rs:149:98:
called `Result::unwrap()` on an `Err` value: Error
I guess that you should report that to the Polkadot repo.
When trying to use smoldot against the Parallel parachain, it seems like all the operation requests "fail" with an
operationInaccessible
event, and after trying a bit later we get the same result over and over.These are the logs:
The chainSpec for this parachain is: