Exemplo n.º 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);
        }
        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);
        }
Exemplo n.º 3
0
 public SmartContractPoABlockDefinition(
     IBlockBufferGenerator blockBufferGenerator,
     ICoinView coinView,
     IConsensusManager consensusManager,
     IDateTimeProvider dateTimeProvider,
     IContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     ITxMempool mempool,
     MempoolSchedulerLock mempoolLock,
     Network network,
     ISenderRetriever senderRetriever,
     IStateRepositoryRoot stateRoot)
     : base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool, mempoolLock, new MinerSettings(NodeSettings.Default(network)), network, senderRetriever, stateRoot)
 {
     // TODO: Fix gross MinerSettings injection ^^
 }
 public TestFederatedPegBlockDefinition(
     IBlockBufferGenerator blockBufferGenerator,
     ICoinView coinView,
     IConsensusManager consensusManager,
     IDateTimeProvider dateTimeProvider,
     IContractExecutorFactory executorFactory,
     ILoggerFactory loggerFactory,
     ITxMempool mempool,
     MempoolSchedulerLock mempoolLock,
     Network network,
     ISenderRetriever senderRetriever,
     IStateRepositoryRoot stateRoot,
     MinerSettings minerSettings)
     : base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool, mempoolLock, network, senderRetriever, stateRoot, minerSettings)
 {
 }
 /// <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,
     IFederationGatewaySettings federationGatewaySettings)
     : base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool, mempoolLock, network, senderRetriever, stateRoot)
 {
     this.payToMultisigScript = federationGatewaySettings.MultiSigAddress.ScriptPubKey;
     this.payToMemberScript   = PayToPubkeyTemplate.Instance.GenerateScriptPubKey(new PubKey(federationGatewaySettings.PublicKey));
 }
Exemplo n.º 6
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,
     NodeDeployments nodeDeployments)
     : base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool, mempoolLock, network, senderRetriever, stateRoot, executionCache, callDataSerializer, minerSettings, nodeDeployments)
 {
 }
Exemplo n.º 7
0
 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)
     : base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool,
            mempoolLock, minerSettings, network, senderRetriever, stateRoot, executionCache, callDataSerializer)
 {
     // TODO: Fix gross MinerSettings injection ^^
 }
Exemplo n.º 8
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,
            MinerSettings minerSettings,
            FederatedPegSettings federatedPegSettings)
            : base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool, mempoolLock, network, senderRetriever, stateRoot, minerSettings)
        {
            this.payToMultisigScript = federatedPegSettings.MultiSigAddress.ScriptPubKey;

            this.premineSplitter = premineSplitter;
        }