diff --git a/CHANGELOG.md b/CHANGELOG.md index abd4f911a89..465e8ca7c43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,4 +13,4 @@ ### Bug Fixes - Updated the gas change check for block building so that warnings only get raised if the change is off spec. - Fixed an issue with the `/eth/v1/config/spec` API not returning all previously included configuration parameters. - +- Increase the maximum size of a compressed message for libp2p to ensure uncompressed blocks can grow to max size. diff --git a/networking/p2p/src/main/java/tech/pegasys/teku/networking/p2p/libp2p/config/LibP2PParamsFactory.java b/networking/p2p/src/main/java/tech/pegasys/teku/networking/p2p/libp2p/config/LibP2PParamsFactory.java index ea3abca876e..278831b67c3 100644 --- a/networking/p2p/src/main/java/tech/pegasys/teku/networking/p2p/libp2p/config/LibP2PParamsFactory.java +++ b/networking/p2p/src/main/java/tech/pegasys/teku/networking/p2p/libp2p/config/LibP2PParamsFactory.java @@ -68,8 +68,10 @@ private static void addGossipParamsDValues( private static void addGossipParamsMaxValues( final NetworkingSpecConfig networkingSpecConfig, final GossipParamsBuilder builder) { + final int gossipMaxSize = networkingSpecConfig.getGossipMaxSize(); + final int compressedMaxGossipSize = 32 + gossipMaxSize + (gossipMaxSize / 6); builder - .maxGossipMessageSize(networkingSpecConfig.getGossipMaxSize()) + .maxGossipMessageSize(compressedMaxGossipSize) .maxPublishedMessages(1000) .maxTopicsPerPublishedMessage(1) .maxSubscriptions(MAX_SUBSCRIPTIONS_PER_MESSAGE) diff --git a/networking/p2p/src/test/java/tech/pegasys/teku/networking/p2p/libp2p/config/LibP2PParamsFactoryTest.java b/networking/p2p/src/test/java/tech/pegasys/teku/networking/p2p/libp2p/config/LibP2PParamsFactoryTest.java index 7d4003d6305..3dd82e4202e 100644 --- a/networking/p2p/src/test/java/tech/pegasys/teku/networking/p2p/libp2p/config/LibP2PParamsFactoryTest.java +++ b/networking/p2p/src/test/java/tech/pegasys/teku/networking/p2p/libp2p/config/LibP2PParamsFactoryTest.java @@ -43,7 +43,7 @@ void createGossipParams_checkZeroDsSucceed() { public void createGossipParams_setGossipMaxSizeFromNetworkSpecConfig() { final GossipConfig gossipConfig = GossipConfig.builder().build(); final NetworkingSpecConfig networkingSpecConfig = spy(spec.getNetworkingConfig()); - final int expectedGossipMaxSize = networkingSpecConfig.getGossipMaxSize(); + final int expectedGossipMaxSize = 12233418; reset(networkingSpecConfig); final GossipParams gossipParams =