示例#1
0
        public SmartContractPosPowBlockDefinition(
            IBlockBufferGenerator blockBufferGenerator,
            ICoinView coinView,
            IConsensusLoop consensusLoop,
            IDateTimeProvider dateTimeProvider,
            ISmartContractExecutorFactory executorFactory,
            ILoggerFactory loggerFactory,
            ITxMempool mempool,
            MempoolSchedulerLock mempoolLock,
            MinerSettings minerSettings,
            Network network,
            ISenderRetriever senderRetriever,
            IStakeChain stakeChain,
            IStakeValidator stakeValidator,
            IContractStateRoot stateRoot)
            : base(consensusLoop, dateTimeProvider, loggerFactory, mempool, mempoolLock, minerSettings, network)
        {
            this.coinView        = coinView;
            this.executorFactory = executorFactory;
            this.logger          = loggerFactory.CreateLogger(this.GetType().FullName);
            this.senderRetriever = senderRetriever;
            this.stakeChain      = stakeChain;
            this.stakeValidator  = stakeValidator;
            this.stateRoot       = stateRoot;

            // 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 SmartContractBlockDefinition(
     CoinView coinView,
     IConsensusLoop consensusLoop,
     IDateTimeProvider dateTimeProvider,
     ISmartContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     ITxMempool mempool,
     MempoolSchedulerLock mempoolLock,
     Network network,
     ContractStateRepositoryRoot stateRoot)
     : base(consensusLoop, dateTimeProvider, loggerFactory, mempool, mempoolLock, network)
 {
     this.coinView        = coinView;
     this.executorFactory = executorFactory;
     this.logger          = loggerFactory.CreateLogger(this.GetType());
     this.stateRoot       = stateRoot;
 }
 public SmartContractConsensusRules(
     ConcurrentChain chain,
     ICheckpoints checkpoints,
     ConsensusSettings consensusSettings,
     IDateTimeProvider dateTimeProvider,
     ISmartContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     Network network,
     NodeDeployments nodeDeployments,
     ContractStateRepositoryRoot originalStateRoot,
     ILookaheadBlockPuller puller,
     ICoinView utxoSet,
     ISmartContractReceiptStorage receiptStorage)
     : base(network, loggerFactory, dateTimeProvider, chain, nodeDeployments, consensusSettings, checkpoints, utxoSet, puller)
 {
     this.ExecutorFactory   = executorFactory;
     this.OriginalStateRoot = originalStateRoot;
     this.ReceiptStorage    = receiptStorage;
 }
示例#4
0
 public SmartContractBlockDefinition(
     ICoinView coinView,
     IConsensusLoop consensusLoop,
     IDateTimeProvider dateTimeProvider,
     ISmartContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     ITxMempool mempool,
     MempoolSchedulerLock mempoolLock,
     MinerSettings minerSettings,
     Network network,
     ContractStateRepositoryRoot stateRoot)
     : base(consensusLoop, dateTimeProvider, loggerFactory, mempool, mempoolLock, minerSettings, network)
 {
     this.coinView        = coinView;
     this.executorFactory = executorFactory;
     this.logger          = loggerFactory.CreateLogger(this.GetType());
     this.stateRoot       = stateRoot;
     this.refundOutputs   = new List <TxOut>();
     this.receipts        = new List <Receipt>();
 }
示例#5
0
 public SmartContractPowConsensusRuleEngine(
     ConcurrentChain chain,
     ICheckpoints checkpoints,
     ConsensusSettings consensusSettings,
     IDateTimeProvider dateTimeProvider,
     ISmartContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     Network network,
     NodeDeployments nodeDeployments,
     IContractStateRoot originalStateRoot,
     IReceiptRepository receiptRepository,
     ISenderRetriever senderRetriever,
     ICoinView utxoSet,
     IChainState chainState,
     IInvalidBlockHashStore invalidBlockHashStore)
     : base(network, loggerFactory, dateTimeProvider, chain, nodeDeployments, consensusSettings, checkpoints, utxoSet, chainState, invalidBlockHashStore)
 {
     this.ExecutorFactory   = executorFactory;
     this.OriginalStateRoot = originalStateRoot;
     this.ReceiptRepository = receiptRepository;
     this.SenderRetriever   = senderRetriever;
 }
 public SmartContractPosPowBlockDefinition(
     ICoinView coinView,
     IConsensusLoop consensusLoop,
     IDateTimeProvider dateTimeProvider,
     ISmartContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     ITxMempool mempool,
     MempoolSchedulerLock mempoolLock,
     MinerSettings minerSettings,
     Network network,
     IStakeChain stakeChain,
     IStakeValidator stakeValidator,
     ContractStateRepositoryRoot stateRoot)
     : base(consensusLoop, dateTimeProvider, loggerFactory, mempool, mempoolLock, minerSettings, network)
 {
     this.coinView        = coinView;
     this.executorFactory = executorFactory;
     this.logger          = loggerFactory.CreateLogger(this.GetType().FullName);
     this.stakeChain      = stakeChain;
     this.stakeValidator  = stakeValidator;
     this.stateRoot       = stateRoot;
 }
示例#7
0
 public SmartContractPosConsensusRuleEngine(
     ConcurrentChain chain,
     ICheckpoints checkpoints,
     ConsensusSettings consensusSettings,
     IDateTimeProvider dateTimeProvider,
     ISmartContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     Network network,
     NodeDeployments nodeDeployments,
     IContractStateRoot originalStateRoot,
     ILookaheadBlockPuller puller,
     IReceiptRepository receiptRepository,
     ISenderRetriever senderRetriever,
     IStakeChain stakeChain,
     IStakeValidator stakeValidator,
     ICoinView utxoSet)
     : base(network, loggerFactory, dateTimeProvider, chain, nodeDeployments, consensusSettings, checkpoints, utxoSet, puller, stakeChain, stakeValidator)
 {
     this.ExecutorFactory   = executorFactory;
     this.OriginalStateRoot = originalStateRoot;
     this.ReceiptRepository = receiptRepository;
     this.SenderRetriever   = senderRetriever;
 }