Skip to content
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
36a0f7e
PoC of delayed sending if requested
flcl42 Sep 8, 2025
d8294a2
Add retry cache
flcl42 Sep 9, 2025
bcc06a3
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 Sep 10, 2025
1d29ad5
Fix logs and multiple requests expiration
flcl42 Sep 29, 2025
2adbcbe
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 Sep 29, 2025
fb8e9e3
Add tests
flcl42 Oct 1, 2025
a474531
Rename
flcl42 Oct 1, 2025
b831531
Add more tests
flcl42 Oct 3, 2025
5cfaf85
Improve
flcl42 Oct 6, 2025
0825d2d
Simplify dependencies
flcl42 Oct 6, 2025
9414c22
Improve
flcl42 Oct 6, 2025
62b1ca8
Rename
flcl42 Oct 6, 2025
a49c3b7
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 Oct 6, 2025
d883a0a
no requestoor draft
flcl42 Oct 10, 2025
d5e60b2
Use messages
flcl42 Oct 15, 2025
34ec276
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 Oct 15, 2025
aab4e49
Remove the requestoor
flcl42 Oct 15, 2025
805f8df
Fix tests
flcl42 Oct 15, 2025
f2db9a6
Fix tests
flcl42 Oct 15, 2025
f615bd5
More fixes
flcl42 Oct 15, 2025
ca79d70
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 Oct 16, 2025
78e4de6
Substitute
flcl42 Oct 16, 2025
d41d386
Disconnect peers with invalid txs
flcl42 Oct 16, 2025
a197f6c
Update src/Nethermind/Nethermind.Network.Contract/Messages/IResourceR…
flcl42 Oct 16, 2025
1c8f173
Merge branch 'dont-cache-requested-txhashes' of github.com:Nethermind…
flcl42 Oct 16, 2025
eb2213e
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 Oct 16, 2025
dc8f823
Compress code
flcl42 Oct 20, 2025
3605567
Try pooled set
flcl42 Oct 21, 2025
f06ff7d
Handle as eth66
flcl42 Oct 21, 2025
0d8fdd3
Fix review
flcl42 Oct 21, 2025
83eee29
Fix tests
flcl42 Oct 21, 2025
ff5da9a
No need in syncing handling
flcl42 Oct 22, 2025
cad281d
Merge branch 'master' into dont-cache-requested-txhashes
benaadams Oct 22, 2025
1c2cca3
Remove redundant dispose
flcl42 Oct 22, 2025
765a3c5
Merge branch 'dont-cache-requested-txhashes' of github.com:Nethermind…
flcl42 Oct 22, 2025
b941945
Review
flcl42 Oct 22, 2025
75b8f92
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 Oct 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 Demerzel Solutions Limited
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using Nethermind.Consensus.Transactions;
Expand Down Expand Up @@ -36,7 +36,7 @@ public void GetTransactions_should_respect_customizable_blob_gas_limit(int[] blo
txPool.GetPendingLightBlobTransactionsBySender().Returns(transactionsWithBlobs);

ITxFilterPipeline txFilterPipeline = Substitute.For<ITxFilterPipeline>();
txFilterPipeline.Execute(Arg.Any<Transaction>(), Arg.Any<BlockHeader>(), Arg.Any<IReleaseSpec>()).Returns(AcceptTxResult.Accepted);
txFilterPipeline.Execute(Arg.Any<Transaction>(), Arg.Any<BlockHeader>(), Arg.Any<IReleaseSpec>()).Returns(true);

TxPoolTxSource transactionSelector = new(txPool, specProvider, transactionComparerProvider, LimboLogs.Instance, txFilterPipeline, new BlocksConfig { SecondsPerSlot = 12 });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Nethermind.Network;
using Nethermind.Network.Config;
using Nethermind.Network.Contract.P2P;
using Nethermind.Network.P2P.Subprotocols.Eth;
using Nethermind.State;
using Nethermind.State.SnapServer;
using Nethermind.Stats.Model;
Expand All @@ -31,7 +30,6 @@ protected override void Load(ContainerBuilder builder)
.AddSingleton<IPoSSwitcher>(NoPoS.Instance)

.AddSingleton<IProtocolValidator, ProtocolValidator>()
.AddSingleton<IPooledTxsRequestor, PooledTxsRequestor>()
.AddSingleton<IGossipPolicy>(Policy.FullGossip)
.AddComposite<ITxGossipPolicy, CompositeTxGossipPolicy>()

Expand Down
9 changes: 9 additions & 0 deletions src/Nethermind/Nethermind.Core/IMessageHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

namespace Nethermind.Core;

public interface IMessageHandler<TMessage>
{
void HandleMessage(TMessage message);
}
9 changes: 9 additions & 0 deletions src/Nethermind/Nethermind.Core/INew.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

namespace Nethermind.Core;

public interface INew<in TArg, out T>
{
public static abstract T New(TArg arg);
}
7 changes: 3 additions & 4 deletions src/Nethermind/Nethermind.Init/Steps/InitializeNetwork.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
Expand All @@ -16,7 +16,6 @@
using Nethermind.Network.Config;
using Nethermind.Network.Contract.P2P;
using Nethermind.Network.Discovery;
using Nethermind.Network.P2P.Subprotocols.Eth;
using Nethermind.Stats;
using Nethermind.Stats.Model;
using Nethermind.Synchronization;
Expand Down Expand Up @@ -275,14 +274,12 @@ private async Task InitPeer()
_api.PeerManager!,
_networkConfig,
_api.LogManager);
PooledTxsRequestor pooledTxsRequestor = new(_api.TxPool!, _api.Config<ITxPoolConfig>(), _api.SpecProvider);

_api.ProtocolsManager = new ProtocolsManager(
_api.SyncPeerPool!,
syncServer,
_api.BackgroundTaskScheduler,
_api.TxPool,
pooledTxsRequestor,
_discoveryApp,
_api.MessageSerializationService,
_api.RlpxPeer,
Expand All @@ -294,6 +291,8 @@ private async Task InitPeer()
_api.WorldStateManager!,
_api.BlockTree,
_api.LogManager,
_api.Config<ITxPoolConfig>(),
_api.SpecProvider,
_api.TxGossipPolicy);

if (_syncConfig.SnapServingEnabled == true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using System.IO;
using System.Threading.Tasks;
using Nethermind.Blockchain.Filters;
using Nethermind.Blockchain.Find;
using Nethermind.Blockchain.Receipts;
using Nethermind.Core.Specs;
Expand Down Expand Up @@ -39,7 +38,6 @@
using Nethermind.JsonRpc.Modules;
using Nethermind.JsonRpc.Modules.Trace;
using Nethermind.Network;
using Nethermind.Network.P2P.Subprotocols.Eth;
using Nethermind.Network.Rlpx;
using Nethermind.Stats;
using Nethermind.Synchronization.ParallelSync;
Expand Down Expand Up @@ -217,7 +215,6 @@ await base.Build(builder =>
Substitute.For<ISyncServer>(),
Substitute.For<IBackgroundTaskScheduler>(),
TxPool,
Substitute.For<IPooledTxsRequestor>(),
Substitute.For<IDiscoveryApp>(),
Substitute.For<IMessageSerializationService>(),
Substitute.For<IRlpxHost>(),
Expand All @@ -229,6 +226,8 @@ await base.Build(builder =>
WorldStateManager,
Substitute.For<IBlockFinder>(),
LimboLogs.Instance,
Substitute.For<ITxPoolConfig>(),
Substitute.For<ISpecProvider>(),
Substitute.For<ITxGossipPolicy>()
);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using Nethermind.Core;
using Nethermind.Core.Crypto;

namespace Nethermind.Network.Contract.Messages;

public readonly struct PooledTransactionRequestMessage : INew<ValueHash256, PooledTransactionRequestMessage>
{
public ValueHash256 TxHash { get; init; }

public static PooledTransactionRequestMessage New(ValueHash256 txHash) => new() { TxHash = txHash };
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
<ProjectReference Include="..\Nethermind.Core\Nethermind.Core.csproj" />
<ProjectReference Include="..\Nethermind.Network.Discovery\Nethermind.Network.Discovery.csproj" />
<ProjectReference Include="..\Nethermind.Network\Nethermind.Network.csproj" />
<ProjectReference Include="..\Nethermind.TxPool\Nethermind.TxPool.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using System.Collections.Generic;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using DotNetty.Buffers;
using FluentAssertions;
using Nethermind.Consensus;
using Nethermind.Core;
using Nethermind.Core.Collections;
using Nethermind.Core.Crypto;
using Nethermind.Core.Extensions;
using Nethermind.Core.Specs;
Expand All @@ -21,7 +19,6 @@
using Nethermind.Logging;
using Nethermind.Network.P2P;
using Nethermind.Network.P2P.Messages;
using Nethermind.Network.P2P.Subprotocols.Eth;
using Nethermind.Network.P2P.Subprotocols.Eth.V62.Messages;
using Nethermind.Network.P2P.Subprotocols.Eth.V65;
using Nethermind.Network.P2P.Subprotocols.Eth.V65.Messages;
Expand All @@ -43,7 +40,6 @@ public class Eth65ProtocolHandlerTests
private IMessageSerializationService _svc = null!;
private ISyncServer _syncManager = null!;
private ITxPool _transactionPool = null!;
private IPooledTxsRequestor _pooledTxsRequestor = null!;
private ISpecProvider _specProvider = null!;
private Block _genesisBlock = null!;
private Eth65ProtocolHandler _handler = null!;
Expand All @@ -64,7 +60,6 @@ public void Setup()
_session.When(s => s.DeliverMessage(Arg.Any<P2PMessage>())).Do(c => c.Arg<P2PMessage>().AddTo(_disposables));
_syncManager = Substitute.For<ISyncServer>();
_transactionPool = Substitute.For<ITxPool>();
_pooledTxsRequestor = Substitute.For<IPooledTxsRequestor>();
_specProvider = Substitute.For<ISpecProvider>();
_genesisBlock = Build.A.Block.Genesis.TestObject;
_syncManager.Head.Returns(_genesisBlock.Header);
Expand All @@ -80,7 +75,6 @@ public void Setup()
_syncManager,
RunImmediatelyScheduler.Instance,
_transactionPool,
_pooledTxsRequestor,
Policy.FullGossip,
new ForkInfo(_specProvider, _syncManager),
LimboLogs.Instance,
Expand Down Expand Up @@ -197,7 +191,7 @@ public void should_handle_NewPooledTransactionHashesMessage([Values(true, false)
HandleIncomingStatusMessage();
HandleZeroMessage(msg, Eth65MessageCode.NewPooledTransactionHashes);

_pooledTxsRequestor.Received(canGossipTransactions ? 1 : 0).RequestTransactions(Arg.Any<Action<GetPooledTransactionsMessage>>(), Arg.Any<IOwnedReadOnlyList<Hash256>>());
_session.Received(canGossipTransactions ? 1 : 0).DeliverMessage(Arg.Any<GetPooledTransactionsMessage>());
}

private void HandleZeroMessage<T>(T msg, int messageCode) where T : MessageBase
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System.Collections.Generic;
Expand All @@ -22,7 +22,6 @@
using Nethermind.Network.P2P;
using Nethermind.Network.P2P.Messages;
using Nethermind.Network.P2P.Subprotocols;
using Nethermind.Network.P2P.Subprotocols.Eth;
using Nethermind.Network.P2P.Subprotocols.Eth.V62.Messages;
using Nethermind.Network.P2P.Subprotocols.Eth.V65;
using Nethermind.Network.P2P.Subprotocols.Eth.V65.Messages;
Expand Down Expand Up @@ -56,7 +55,6 @@ public class Eth66ProtocolHandlerTests
private IMessageSerializationService _svc = null!;
private ISyncServer _syncManager = null!;
private ITxPool _transactionPool = null!;
private IPooledTxsRequestor _pooledTxsRequestor = null!;
private IGossipPolicy _gossipPolicy = null!;
private ITimerFactory _timerFactory = null!;
private ISpecProvider _specProvider = null!;
Expand All @@ -78,7 +76,6 @@ public void Setup()
_session.When(s => s.DeliverMessage(Arg.Any<P2PMessage>())).Do(c => c.Arg<P2PMessage>().AddTo(_disposables));
_syncManager = Substitute.For<ISyncServer>();
_transactionPool = Substitute.For<ITxPool>();
_pooledTxsRequestor = Substitute.For<IPooledTxsRequestor>();
_specProvider = Substitute.For<ISpecProvider>();
_gossipPolicy = Substitute.For<IGossipPolicy>();
_genesisBlock = Build.A.Block.Genesis.TestObject;
Expand All @@ -92,7 +89,6 @@ public void Setup()
_syncManager,
RunImmediatelyScheduler.Instance,
_transactionPool,
_pooledTxsRequestor,
_gossipPolicy,
new ForkInfo(_specProvider, _syncManager),
LimboLogs.Instance);
Expand Down Expand Up @@ -322,7 +318,6 @@ public void should_request_in_GetPooledTransactionsMessage_up_to_256_txs(int num
_syncManager,
RunImmediatelyScheduler.Instance,
_transactionPool,
new PooledTxsRequestor(_transactionPool, new TxPoolConfig(), _specProvider),
_gossipPolicy,
new ForkInfo(_specProvider, _syncManager),
LimboLogs.Instance);
Expand Down
Loading
Loading