Skip to content

Commit

Permalink
LogFinder should be initialized befre UserOperationPools
Browse files Browse the repository at this point in the history
  • Loading branch information
flcl42 committed Dec 13, 2022
1 parent b021b8b commit 2e1fe41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Expand Up @@ -65,6 +65,7 @@ public IBlockFinder BlockFinder
set => _blockFinder = value;
}

public ILogFinder LogFinder { get; private set; } = null!;
public IJsonSerializer JsonSerializer { get; set; } = null!;
public IStateProvider State { get; set; } = null!;
public IReadOnlyStateProvider ReadOnlyState { get; private set; } = null!;
Expand Down Expand Up @@ -164,6 +165,10 @@ protected virtual async Task<TestBlockchain> Build(ISpecProvider? specProvider =
PoSSwitcher = NoPoS.Instance;
ISealer sealer = new NethDevSealEngine(TestItem.AddressD);
SealEngine = new SealEngine(sealer, Always.Valid);

BloomStorage bloomStorage = new(new BloomConfig(), new MemDb(), new InMemoryDictionaryFileStoreFactory());
ReceiptsRecovery receiptsRecovery = new(new EthereumEcdsa(SpecProvider.ChainId, LimboLogs.Instance), SpecProvider);
LogFinder = new LogFinder(BlockTree, ReceiptStorage, ReceiptStorage, bloomStorage, LimboLogs.Instance, receiptsRecovery);
BlockProcessor = CreateBlockProcessor();

BlockchainProcessor chainProcessor = new(BlockTree, BlockProcessor, BlockPreprocessorStep, StateReader, LogManager, Consensus.Processing.BlockchainProcessor.Options.Default);
Expand Down
Expand Up @@ -20,6 +20,7 @@
<ItemGroup>
<ProjectReference Include="..\Nethermind.Blockchain\Nethermind.Blockchain.csproj" />
<ProjectReference Include="..\Nethermind.Core\Nethermind.Core.csproj" />
<ProjectReference Include="..\Nethermind.Facade\Nethermind.Facade.csproj" />
<ProjectReference Include="..\Nethermind.Network\Nethermind.Network.csproj" />
<ProjectReference Include="..\Nethermind.Specs.Test\Nethermind.Specs.Test.csproj" />
</ItemGroup>
Expand Down
Expand Up @@ -39,8 +39,6 @@ public class TestRpcBlockchain : TestBlockchain
public IBlockchainBridge Bridge { get; private set; } = null!;
public ITxSealer TxSealer { get; private set; } = null!;
public ITxSender TxSender { get; private set; } = null!;
public ILogFinder LogFinder { get; private set; } = null!;

public IReceiptFinder ReceiptFinder { get; private set; } = null!;
public IGasPriceOracle GasPriceOracle { get; private set; } = null!;

Expand Down Expand Up @@ -107,14 +105,11 @@ public async Task<T> Build(ISpecProvider? specProvider = null, UInt256? initialV

protected override async Task<TestBlockchain> Build(ISpecProvider? specProvider = null, UInt256? initialValues = null)
{
BloomStorage bloomStorage = new(new BloomConfig(), new MemDb(), new InMemoryDictionaryFileStoreFactory());
specProvider ??= new TestSpecProvider(Berlin.Instance);
await base.Build(specProvider, initialValues);
IFilterStore filterStore = new FilterStore();
IFilterManager filterManager = new FilterManager(filterStore, BlockProcessor, TxPool, LimboLogs.Instance);

ReceiptsRecovery receiptsRecovery = new(new EthereumEcdsa(specProvider.ChainId, LimboLogs.Instance), specProvider);
LogFinder = new LogFinder(BlockTree, ReceiptStorage, ReceiptStorage, bloomStorage, LimboLogs.Instance, receiptsRecovery);

ReadOnlyTxProcessingEnv processingEnv = new(
new ReadOnlyDbProvider(DbProvider, false),
Expand Down

0 comments on commit 2e1fe41

Please sign in to comment.