-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Substrate drops gossamer nodes #2595
Comments
Are we sure that this is an "atomic" problem or is it possible that it's just a symptom of some larger problem (e.g. trie encoding)? |
Don't know yet. Will let you know after more inspection, when this issue is picked up. |
I think this is the interesting piece of code on the rust side |
substrate's block request
substrate's block response
So, substrate is asking for block number 2. Value of best in BlockRequest is 2 and I checked in the logs |
A block request contain start block, end block, direction and max size. It could be the case that block between start and end are less than max size. In such cases, so far we were pruning block from the end while preparing a block response. The correct way however would be to prune from the start, if the direction is descending and prune from the end if the direction is ascending. Since, we were pruning blocks the wrong way, we were preparing a response which substrate was not expecting. And that used to result in substrate dropping us. This commit fixes that issue. Fixes #2595
A block request contain start block, end block, direction and max size. It could be the case that block between start and end are less than max size. In such cases, so far we were pruning block from the end while preparing a block response. The correct way however would be to prune from the start, if the direction is descending and prune from the end if the direction is ascending. Since, we were pruning blocks the wrong way, we were preparing a response which substrate was not expecting. And that used to result in substrate dropping us. This commit fixes that issue. Fixes #2595
Describe the bug
Possible Solution
It looks like we are sending a block that was not requested. I believe that most likely is the reason, because right after that substrate drops gossamer.
To Reproduce
Steps I took to reproduce the behaviour:
./bin/gossamer --key bob --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWShRJhQnccFh7aRXPKnjAnUG4x3Lrwfw4wLgTFyDVfqh7 --port 7010 --basepath /tmp/bob --genesis ../substrate-node-template/genesis.json --log trace > bob.log
./bin/gossamer --key charlie --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWShRJhQnccFh7aRXPKnjAnUG4x3Lrwfw4wLgTFyDVfqh7 -port 7011 --basepath /tmp/charlie --genesis ../substrate-node-template/genesis.json --log trace > charlie.log
target/release/gssmr-test-node --alice --chain genesis.json --log=debug &> debug.log
(2 peers)
to(1 peers)
to(0 peers)
Log output
Logs of all three nodes in this gist https://gist.github.com/kishansagathiya/ec47bce650b926ff2a0c463d792080a6
The text was updated successfully, but these errors were encountered: