Skip to content

Commit

Permalink
cmd/devp2p/internal/ethtest: return request ID in BlockHeaders respon…
Browse files Browse the repository at this point in the history
…se (ethereum#22508)

This PR fixes an issue with the eth66 test suite where, during a readAndServe when
the test is manually responding to GetBlockHeader requests, it now responds
with a BlockHeaders eth66 packet that includes the inbound request ID.
  • Loading branch information
renaynay authored and atif-konasl committed Oct 15, 2021
1 parent 8d9e005 commit 2d01deb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/devp2p/internal/ethtest/eth66_suiteHelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ func (c *Conn) readAndServe66(chain *Chain, timeout time.Duration) (uint64, Mess
if err != nil {
return 0, errorf("could not get headers for inbound header request: %v", err)
}

if err := c.Write(headers); err != nil {
resp := &eth.BlockHeadersPacket66{
RequestId: reqID,
BlockHeadersPacket: eth.BlockHeadersPacket(headers),
}
if err := c.write66(resp, BlockHeaders{}.Code()); err != nil {
return 0, errorf("could not write to connection: %v", err)
}
default:
Expand Down

0 comments on commit 2d01deb

Please sign in to comment.