Skip to content

Commit

Permalink
Revert "Change Max Payload Size (#14692)" (#14716)
Browse files Browse the repository at this point in the history
This reverts commit df81fa3.
  • Loading branch information
nisdas authored Dec 12, 2024
1 parent 6e6012b commit ac1717f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 .

Expand Down
7 changes: 3 additions & 4 deletions beacon-chain/p2p/encoder/ssz.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/p2p/encoder/ssz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ func TestSszNetworkEncoder_FailsSnappyLength(t *testing.T) {
e := &encoder.SszNetworkEncoder{}
att := &ethpb.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)
}
Expand Down

0 comments on commit ac1717f

Please sign in to comment.