public AuRaBlockProcessor(
     ISpecProvider specProvider,
     IBlockValidator blockValidator,
     IRewardCalculator rewardCalculator,
     IBlockProcessor.IBlockTransactionsExecutor blockTransactionsExecutor,
     IStateProvider stateProvider,
     IStorageProvider storageProvider,
     IReceiptStorage receiptStorage,
     ILogManager logManager,
     IBlockTree blockTree,
     ITxFilter?txFilter = null,
     AuRaContractGasLimitOverride?gasLimitOverride = null)
     : base(
         specProvider,
         blockValidator,
         rewardCalculator,
         blockTransactionsExecutor,
         stateProvider,
         storageProvider,
         receiptStorage,
         NullWitnessCollector.Instance,
         logManager)
 {
     _specProvider     = specProvider;
     _blockTree        = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
     _logger           = logManager?.GetClassLogger <AuRaBlockProcessor>() ?? throw new ArgumentNullException(nameof(logManager));
     _txFilter         = txFilter ?? NullTxFilter.Instance;
     _gasLimitOverride = gasLimitOverride;
     if (blockTransactionsExecutor is IBlockProductionTransactionsExecutor produceBlockTransactionsStrategy)
     {
         produceBlockTransactionsStrategy.AddingTransaction += OnAddingTransaction;
     }
 }
 public AuRaMergeBlockProcessor(
     IPoSSwitcher poSSwitcher,
     ISpecProvider specProvider,
     IBlockValidator blockValidator,
     IRewardCalculator rewardCalculator,
     IBlockProcessor.IBlockTransactionsExecutor blockTransactionsExecutor,
     IStateProvider stateProvider,
     IStorageProvider storageProvider,
     IReceiptStorage receiptStorage,
     ILogManager logManager,
     IBlockTree blockTree,
     ITxFilter?txFilter = null,
     AuRaContractGasLimitOverride?gasLimitOverride = null,
     ContractRewriter?contractRewriter             = null
     ) : base(
         specProvider,
         blockValidator,
         rewardCalculator,
         blockTransactionsExecutor,
         stateProvider,
         storageProvider,
         receiptStorage,
         logManager,
         blockTree,
         txFilter,
         gasLimitOverride,
         contractRewriter
         )
 {
     _poSSwitcher = poSSwitcher;
 }
        public ReadOnlyChainProcessingEnv(
            ReadOnlyTxProcessingEnv txEnv,
            IBlockValidator blockValidator,
            IBlockPreprocessorStep recoveryStep,
            IRewardCalculator rewardCalculator,
            IReceiptStorage receiptStorage,
            IReadOnlyDbProvider dbProvider,
            ISpecProvider specProvider,
            ILogManager logManager,
            IBlockProcessor.IBlockTransactionsExecutor?blockTransactionsExecutor = null)
        {
            _txEnv = txEnv;

            IBlockProcessor.IBlockTransactionsExecutor transactionsExecutor =
                blockTransactionsExecutor ?? new BlockProcessor.BlockValidationTransactionsExecutor(_txEnv.TransactionProcessor, StateProvider);

            BlockProcessor = new BlockProcessor(
                specProvider,
                blockValidator,
                rewardCalculator,
                transactionsExecutor,
                StateProvider,
                _txEnv.StorageProvider,
                receiptStorage,
                NullWitnessCollector.Instance,
                logManager);

            _blockProcessingQueue = new BlockchainProcessor(_txEnv.BlockTree, BlockProcessor, recoveryStep, logManager, BlockchainProcessor.Options.NoReceipts);
            BlockProcessingQueue  = _blockProcessingQueue;
            ChainProcessor        = new OneTimeChainProcessor(dbProvider, _blockProcessingQueue);
        }
示例#4
0
        public BlockProcessor(
            ISpecProvider?specProvider,
            IBlockValidator?blockValidator,
            IRewardCalculator?rewardCalculator,
            IBlockProcessor.IBlockTransactionsExecutor?blockTransactionsExecutor,
            IStateProvider?stateProvider,
            IStorageProvider?storageProvider,
            IReceiptStorage?receiptStorage,
            IWitnessCollector?witnessCollector,
            ILogManager?logManager)
        {
            _logger                    = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
            _specProvider              = specProvider ?? throw new ArgumentNullException(nameof(specProvider));
            _blockValidator            = blockValidator ?? throw new ArgumentNullException(nameof(blockValidator));
            _stateProvider             = stateProvider ?? throw new ArgumentNullException(nameof(stateProvider));
            _storageProvider           = storageProvider ?? throw new ArgumentNullException(nameof(storageProvider));
            _receiptStorage            = receiptStorage ?? throw new ArgumentNullException(nameof(receiptStorage));
            _witnessCollector          = witnessCollector ?? throw new ArgumentNullException(nameof(witnessCollector));
            _rewardCalculator          = rewardCalculator ?? throw new ArgumentNullException(nameof(rewardCalculator));
            _blockTransactionsExecutor = blockTransactionsExecutor ?? throw new ArgumentNullException(nameof(blockTransactionsExecutor));

            _receiptsTracer = new BlockReceiptsTracer();
        }