cmd/devp2p: fix getblockbodies request id error

Include the actual and expected request IDs in the GetBlockBodies response failure message. This also fixes the typo in the diagnostic so mismatched responses report a useful error.
This commit is contained in:
Weixie Cui 2026-06-09 20:00:00 +08:00
parent 1f87331fbc
commit 74b9c963d0

View file

@ -413,7 +413,7 @@ func (s *Suite) TestGetBlockBodies(t *utesting.T) {
t.Fatalf("error reading block bodies msg: %v", err)
}
if got, want := resp.RequestId, req.RequestId; got != want {
t.Fatalf("unexpected request id in respond", got, want)
t.Fatalf("unexpected request id in response: got %d, want %d", got, want)
}
if resp.List.Len() != len(req.GetBlockBodiesRequest) {
t.Fatalf("wrong bodies in response: expected %d bodies, got %d", len(req.GetBlockBodiesRequest), resp.List.Len())