3

I am trying to fetch blocks using P2P messages but at block 501500 I never received any block message.

Here how I do it : I am connecting to a node version/verack happens smoothly. I instantly answer any ping message. I have been able to do the getblocks/inv/block process up to to block 501500 where I am currently stuck. I don't have timeout so I am just waiting for my block messages. I also noticed I am not receiving ping message anymore. Could it be that the node disconnected from me ?

When I ask blocks from the start I have an answer. The node is supposed to be synced as I get its start height from the version message and it matches current block height.

Is there a reason why the node is disconnecting from me ? Any idea how I could debug or fix this ?

Note: I also tried with different nodes but I never get the blocks.

Update: I happen to have also a python script doing the same thing (fetching blocks) and I tried using it. It works! (most of the time). So indeed sometimes I am being ignored by the node. But I also believe in my rust implementation I have an issue when reading messages form the buffer.

I read first the 24 first bytes of a message so I get the command and the payload size. Then I block until I know I have all the payload. Unfortunately it looks like the payload is never fully available (but most probably sent by the other node). I never had this issue on other networks but I believe here it is because we have blocks at full capacity.

rllola
  • 151
  • 1
  • 7

0 Answers0