Merge branch 'ethereum:master' into portal

This commit is contained in:
Chen Kai 2024-06-22 11:39:03 +08:00 committed by GitHub
commit 0f8632ed9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -135,7 +135,7 @@ func waitForRevalidationPing(t *testing.T, transport *pingRecorder, tab *Table,
simclock.Run(tab.cfg.PingInterval * slowRevalidationFactor)
p := transport.waitPing(2 * time.Second)
if p == nil {
t.Fatal("Table did not send revalidation ping")
continue
}
if id == (enode.ID{}) || p.ID() == id {
return p

View file

@ -604,6 +604,11 @@ func (h *handshakeState) readMsg(msg interface{}, prv *ecdsa.PrivateKey, r io.Re
}
size := binary.BigEndian.Uint16(prefix)
// baseProtocolMaxMsgSize = 2 * 1024
if size > 2048 {
return nil, errors.New("message too big")
}
// Read the handshake packet.
packet, err := h.rbuf.read(r, int(size))
if err != nil {