diff --git a/CHANGELOG.md b/CHANGELOG.md index 05cc55a01c28..30e246545874 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,7 +75,6 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Updated `Blobs` endpoint to return additional metadata fields. - Made QUIC the default method to connect with peers. - Check kzg commitments align with blobs and proofs for beacon api end point. -- Increase Max Payload Size in Gossip. - Revert "Proposer checks gas limit before accepting builder's bid". - Updated quic-go to v0.48.2 . diff --git a/beacon-chain/p2p/encoder/ssz.go b/beacon-chain/p2p/encoder/ssz.go index fc469969219e..820af846189f 100644 --- a/beacon-chain/p2p/encoder/ssz.go +++ b/beacon-chain/p2p/encoder/ssz.go @@ -18,7 +18,6 @@ var _ NetworkEncoding = (*SszNetworkEncoder)(nil) // MaxGossipSize allowed for gossip messages. var MaxGossipSize = params.BeaconConfig().GossipMaxSize // 10 Mib. var MaxChunkSize = params.BeaconConfig().MaxChunkSize // 10 Mib. -var MaxUncompressedPayloadSize = 2 * MaxGossipSize // 20 Mib. // This pool defines the sync pool for our buffered snappy writers, so that they // can be constantly reused. @@ -44,8 +43,8 @@ func (_ SszNetworkEncoder) EncodeGossip(w io.Writer, msg fastssz.Marshaler) (int if err != nil { return 0, err } - if uint64(len(b)) > MaxUncompressedPayloadSize { - return 0, errors.Errorf("gossip message exceeds max gossip size: %d bytes > %d bytes", len(b), MaxUncompressedPayloadSize) + if uint64(len(b)) > MaxGossipSize { + return 0, errors.Errorf("gossip message exceeds max gossip size: %d bytes > %d bytes", len(b), MaxGossipSize) } b = snappy.Encode(nil /*dst*/, b) return w.Write(b) @@ -82,7 +81,7 @@ func doDecode(b []byte, to fastssz.Unmarshaler) error { // DecodeGossip decodes the bytes to the protobuf gossip message provided. func (_ SszNetworkEncoder) DecodeGossip(b []byte, to fastssz.Unmarshaler) error { - b, err := DecodeSnappy(b, MaxUncompressedPayloadSize) + b, err := DecodeSnappy(b, MaxGossipSize) if err != nil { return err } diff --git a/beacon-chain/p2p/encoder/ssz_test.go b/beacon-chain/p2p/encoder/ssz_test.go index 8a7f05c82c48..6e12af4e7014 100644 --- a/beacon-chain/p2p/encoder/ssz_test.go +++ b/beacon-chain/p2p/encoder/ssz_test.go @@ -555,7 +555,7 @@ func TestSszNetworkEncoder_FailsSnappyLength(t *testing.T) { e := &encoder.SszNetworkEncoder{} att := ðpb.Fork{} data := make([]byte, 32) - binary.PutUvarint(data, encoder.MaxUncompressedPayloadSize+32) + binary.PutUvarint(data, encoder.MaxGossipSize+32) err := e.DecodeGossip(data, att) require.ErrorContains(t, "snappy message exceeds max size", err) }