From e204bfc91d7fa1f53fcbe2c99e1a7f03ff430cb9 Mon Sep 17 00:00:00 2001 From: strykerin Date: Sat, 31 Dec 2022 20:08:55 -0300 Subject: [PATCH] cmd/devp2p: add pong validation on bond function --- cmd/devp2p/internal/v4test/discv4tests.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/devp2p/internal/v4test/discv4tests.go b/cmd/devp2p/internal/v4test/discv4tests.go index 7b818a52f9c..d799e4194b6 100644 --- a/cmd/devp2p/internal/v4test/discv4tests.go +++ b/cmd/devp2p/internal/v4test/discv4tests.go @@ -395,7 +395,7 @@ func FindnodePastExpiration(t *utesting.T) { // bond performs the endpoint proof with the remote node. func bond(t *utesting.T, te *testenv) { - te.send(te.l1, &v4wire.Ping{ + pingHash := te.send(te.l1, &v4wire.Ping{ Version: 4, From: te.localEndpoint(te.l1), To: te.remoteEndpoint(), @@ -417,7 +417,9 @@ func bond(t *utesting.T, te *testenv) { }) gotPing = true case *v4wire.Pong: - // TODO: maybe verify pong data here + if err := te.checkPong(req, pingHash); err != nil { + t.Fatal(err) + } gotPong = true } }