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 Jan 20, 2023
1 parent be53825 commit 4c84274
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,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 @@ -165,6 +166,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,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 @@ -108,14 +106,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 4c84274

Please sign in to comment.