Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable txpool if SequencerUrl is set #7513

Merged
merged 5 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/Nethermind/Nethermind.Init/Steps/InitializeBlockchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ protected virtual IHealthHintService CreateHealthHintService() =>
protected virtual IBlockProductionPolicy CreateBlockProductionPolicy() =>
new BlockProductionPolicy(_api.Config<IMiningConfig>());

protected virtual TxPool.TxPool CreateTxPool(CodeInfoRepository codeInfoRepository) =>
new(_api.EthereumEcdsa!,
protected virtual ITxPool CreateTxPool(CodeInfoRepository codeInfoRepository) =>
new TxPool.TxPool(_api.EthereumEcdsa!,
_api.BlobTxStorage ?? NullBlobTxStorage.Instance,
new ChainHeadInfoProvider(_api.SpecProvider!, _api.BlockTree!, _api.StateReader!, codeInfoRepository),
_api.Config<ITxPoolConfig>(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Nethermind.Evm.TransactionProcessing;
using Nethermind.Init.Steps;
using Nethermind.Merge.Plugin.InvalidChainTracker;
using Nethermind.TxPool;

namespace Nethermind.Optimism;

Expand Down Expand Up @@ -103,4 +104,7 @@ protected override IHealthHintService CreateHealthHintService() =>
new ManualHealthHintService(_blocksConfig.SecondsPerSlot * 6, HealthHintConstants.InfinityHint);

protected override IBlockProductionPolicy CreateBlockProductionPolicy() => AlwaysStartBlockProductionPolicy.Instance;

protected override ITxPool CreateTxPool(CodeInfoRepository codeInfoRepository) =>
api.Config<IOptimismConfig>().SequencerUrl is not null ? NullTxPool.Instance : base.CreateTxPool(codeInfoRepository);
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ protected override void RegisterEthRpcModule(IRpcModuleProvider rpcModuleProvide

if (_config.SequencerUrl is null && _logger.IsWarn)
{
_logger.Warn($"SequencerUrl is not set. Nethermind will behave as a Sequencer");
_logger.Warn("SequencerUrl is not set. Nethermind will behave as a Sequencer");
}

BasicJsonRpcClient? sequencerJsonRpcClient = _config.SequencerUrl is null
? null
: new(new Uri(_config.SequencerUrl), _api.EthereumJsonSerializer, _api.LogManager);
ModuleFactoryBase<IEthRpcModule> ethModuleFactory = CreateEthModuleFactory();
jmederosalvarado marked this conversation as resolved.
Show resolved Hide resolved
BasicJsonRpcClient? sequencerJsonRpcClient = _config.SequencerUrl is not null
? new(new Uri(_config.SequencerUrl), _api.EthereumJsonSerializer, _api.LogManager)
: null;

ITxSigner txSigner = new WalletTxSigner(_api.Wallet, _api.SpecProvider.ChainId);
TxSealer sealer = new(txSigner, _api.Timestamper);
Expand Down
Loading