Esempio n. 1
0
 private ITxFilter CreateAuraTxFilterForProducer(IReadOnlyTxProcessorSource readOnlyTxProcessorSource, ISpecProvider specProvider) =>
 TxAuRaFilterBuilders.CreateAuRaTxFilterForProducer(
     NethermindApi.Config <IMiningConfig>(),
     _api,
     readOnlyTxProcessorSource,
     _minGasPricesContractDataStore,
     specProvider);
        protected override TxPool.TxPool CreateTxPool()
        {
            // This has to be different object than the _processingReadOnlyTransactionProcessorSource as this is in separate thread
            var txPoolReadOnlyTransactionProcessorSource = CreateReadOnlyTransactionProcessorSource();

            var(txPriorityContract, localDataSource) = TxAuRaFilterBuilders.CreateTxPrioritySources(_auraConfig, _api, txPoolReadOnlyTransactionProcessorSource !);

            ReportTxPriorityRules(txPriorityContract, localDataSource);

            var minGasPricesContractDataStore = TxAuRaFilterBuilders.CreateMinGasPricesDataStore(_api, txPriorityContract, localDataSource);

            ITxFilter txPoolFilter = TxAuRaFilterBuilders.CreateAuRaTxFilterForProducer(
                NethermindApi.Config <IMiningConfig>(),
                _api,
                txPoolReadOnlyTransactionProcessorSource,
                minGasPricesContractDataStore,
                _api.SpecProvider);

            return(new TxPool.TxPool(
                       _api.EthereumEcdsa,
                       new ChainHeadInfoProvider(_api.SpecProvider, _api.BlockTree, _api.StateReader),
                       NethermindApi.Config <ITxPoolConfig>(),
                       _api.TxValidator,
                       _api.LogManager,
                       CreateTxPoolTxComparer(txPriorityContract, localDataSource),
                       new TxFilterAdapter(_api.BlockTree, txPoolFilter, _api.LogManager)));
        }