Skip to content

Commit 2d01deb

Browse files
renaynayatif-konasl
authored andcommitted
cmd/devp2p/internal/ethtest: return request ID in BlockHeaders response (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.
1 parent 8d9e005 commit 2d01deb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/devp2p/internal/ethtest/eth66_suiteHelpers.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,11 @@ func (c *Conn) readAndServe66(chain *Chain, timeout time.Duration) (uint64, Mess
141141
if err != nil {
142142
return 0, errorf("could not get headers for inbound header request: %v", err)
143143
}
144-
145-
if err := c.Write(headers); err != nil {
144+
resp := &eth.BlockHeadersPacket66{
145+
RequestId: reqID,
146+
BlockHeadersPacket: eth.BlockHeadersPacket(headers),
147+
}
148+
if err := c.write66(resp, BlockHeaders{}.Code()); err != nil {
146149
return 0, errorf("could not write to connection: %v", err)
147150
}
148151
default:

0 commit comments

Comments
 (0)