public SmartContractBlockDefinition(
            IBlockBufferGenerator blockBufferGenerator,
            ICoinView coinView,
            IConsensusManager consensusManager,
            IDateTimeProvider dateTimeProvider,
            IContractExecutorFactory executorFactory,
            ILoggerFactory loggerFactory,
            ITxMempool mempool,
            MempoolSchedulerLock mempoolLock,
            MinerSettings minerSettings,
            Network network,
            ISenderRetriever senderRetriever,
            IStateRepositoryRoot stateRoot,
            IBlockExecutionResultCache executionCache,
            ICallDataSerializer callDataSerializer,
            NodeDeployments nodeDeployments)
            : base(consensusManager, dateTimeProvider, loggerFactory, mempool, mempoolLock, minerSettings, network, nodeDeployments)
        {
            this.coinView           = coinView;
            this.executorFactory    = executorFactory;
            this.logger             = loggerFactory.CreateLogger(this.GetType());
            this.senderRetriever    = senderRetriever;
            this.stateRoot          = stateRoot;
            this.callDataSerializer = callDataSerializer;
            this.executionCache     = executionCache;
            this.refundOutputs      = new List <TxOut>();
            this.receipts           = new List <Receipt>();

            // When building smart contract blocks, we will be generating and adding both transactions to the block and txouts to the coinbase.
            // At the moment, these generated objects aren't accounted for in the block size and weight accounting.
            // This means that if blocks started getting full, this miner could start generating blocks greater than the max consensus block size.
            // To avoid this without significantly overhauling the BlockDefinition, for now we just lower the block size by a percentage buffer.
            // If in the future blocks are being built over the size limit and you need an easy fix, just increase the size of this buffer.
            this.Options = blockBufferGenerator.GetOptionsWithBuffer(this.Options);
        }
Пример #2
0
 public TestFederatedPegBlockDefinition(
     IBlockBufferGenerator blockBufferGenerator,
     ICoinView coinView,
     IConsensusManager consensusManager,
     IDateTimeProvider dateTimeProvider,
     IContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     ITxMempool mempool,
     MempoolSchedulerLock mempoolLock,
     Network network,
     ISenderRetriever senderRetriever,
     IStateRepositoryRoot stateRoot,
     IBlockExecutionResultCache executionCache,
     ICallDataSerializer callDataSerializer,
     MinerSettings minerSettings)
     : base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool, mempoolLock, network, senderRetriever, stateRoot, executionCache, callDataSerializer, minerSettings)
 {
 }
Пример #3
0
 public SmartContractPoACoinviewRule(
     IStateRepositoryRoot stateRepositoryRoot,
     IContractExecutorFactory executorFactory,
     ICallDataSerializer callDataSerializer,
     ISenderRetriever senderRetriever,
     IReceiptRepository receiptRepository,
     ICoinView coinView,
     IBlockExecutionResultCache executionCache,
     ILoggerFactory loggerFactory)
 {
     this.stateRepositoryRoot = stateRepositoryRoot;
     this.executorFactory     = executorFactory;
     this.callDataSerializer  = callDataSerializer;
     this.senderRetriever     = senderRetriever;
     this.receiptRepository   = receiptRepository;
     this.coinView            = coinView;
     this.executionCache      = executionCache;
     this.loggerFactory       = loggerFactory;
 }
Пример #4
0
 public SmartContractCoinViewRuleLogic(IStateRepositoryRoot stateRepositoryRoot,
                                       IContractExecutorFactory executorFactory,
                                       ICallDataSerializer callDataSerializer,
                                       ISenderRetriever senderRetriever,
                                       IReceiptRepository receiptRepository,
                                       ICoinView coinView,
                                       IBlockExecutionResultCache executionCache,
                                       ILoggerFactory loggerFactory)
 {
     this.stateRepositoryRoot = stateRepositoryRoot;
     this.executorFactory     = executorFactory;
     this.callDataSerializer  = callDataSerializer;
     this.senderRetriever     = senderRetriever;
     this.receiptRepository   = receiptRepository;
     this.coinView            = coinView;
     this.executionCache      = executionCache;
     this.refundCounter       = 1;
     this.blockTxsProcessed   = new List <Transaction>();
     this.receipts            = new List <Receipt>();
     this.logger = loggerFactory.CreateLogger <SmartContractCoinViewRuleLogic>();
 }
 public SmartContractPoABlockDefinition(
     IBlockBufferGenerator blockBufferGenerator,
     ICoinView coinView,
     IConsensusManager consensusManager,
     IDateTimeProvider dateTimeProvider,
     IContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     ITxMempool mempool,
     MempoolSchedulerLock mempoolLock,
     Network network,
     ISenderRetriever senderRetriever,
     IStateRepositoryRoot stateRoot,
     IBlockExecutionResultCache executionCache,
     ICallDataSerializer callDataSerializer,
     MinerSettings minerSettings,
     NodeDeployments nodeDeployments)
     : base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool,
            mempoolLock, minerSettings, network, senderRetriever, stateRoot, executionCache, callDataSerializer, nodeDeployments)
 {
     // TODO: Fix gross MinerSettings injection ^^
 }
Пример #6
0
        /// <inheritdoc />
        public FederatedPegBlockDefinition(
            IBlockBufferGenerator blockBufferGenerator,
            ICoinView coinView,
            IConsensusManager consensusManager,
            IDateTimeProvider dateTimeProvider,
            IContractExecutorFactory executorFactory,
            ILoggerFactory loggerFactory,
            ITxMempool mempool,
            MempoolSchedulerLock mempoolLock,
            Network network,
            ISenderRetriever senderRetriever,
            IStateRepositoryRoot stateRoot,
            ICoinbaseSplitter premineSplitter,
            IBlockExecutionResultCache executionCache,
            ICallDataSerializer callDataSerializer,
            MinerSettings minerSettings,
            FederatedPegSettings federatedPegSettings)
            : base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool, mempoolLock, network, senderRetriever, stateRoot, executionCache, callDataSerializer, minerSettings)
        {
            this.payToMultisigScript = federatedPegSettings.MultiSigAddress.ScriptPubKey;

            this.premineSplitter = premineSplitter;
        }
 public SmartContractPowCoinviewRule(Network network, IStateRepositoryRoot stateRepositoryRoot,
                                     IContractExecutorFactory executorFactory, ICallDataSerializer callDataSerializer,
                                     ISenderRetriever senderRetriever, IReceiptRepository receiptRepository, ICoinView coinView, IBlockExecutionResultCache executionCache, ILoggerFactory loggerFactory)
     : base(network, stateRepositoryRoot, executorFactory, callDataSerializer, senderRetriever, receiptRepository, coinView, executionCache, loggerFactory)
 {
 }
 public SmartContractPosCoinviewRule(Network network, IStateRepositoryRoot stateRepositoryRoot,
                                     IContractExecutorFactory executorFactory, ICallDataSerializer callDataSerializer,
                                     ISenderRetriever senderRetriever, IReceiptRepository receiptRepository, ICoinView coinView,
                                     IStakeChain stakeChain, IStakeValidator stakeValidator, IBlockExecutionResultCache executionCache, ILoggerFactory loggerFactory)
     : base(network, stateRepositoryRoot, executorFactory, callDataSerializer, senderRetriever, receiptRepository, coinView, executionCache, loggerFactory)
 {
     this.consensus      = network.Consensus;
     this.stakeChain     = stakeChain;
     this.stakeValidator = stakeValidator;
 }