예제 #1
0
        protected override TxPool.TxPool CreateTxPool(PersistentTxStorage txStorage)
        {
            // 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 FilteredTxPool(
                       txStorage,
                       _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)));
        }
예제 #2
0
 private ITxFilter CreateAuraTxFilterForProducer(IReadOnlyTxProcessorSource readOnlyTxProcessorSource, ISpecProvider specProvider) =>
 TxAuRaFilterBuilders.CreateAuRaTxFilterForProducer(
     NethermindApi.Config <IMiningConfig>(),
     _api,
     readOnlyTxProcessorSource,
     _minGasPricesContractDataStore,
     specProvider);